/* BâtIA, habillage inspiré du système de design de l'État : blanc, gris clair, bleu France pour la structure. */
:root {
  --bleu: #000091; --bleu-vif: #1212FF; --bleu-pale: #E3E3FD; --bleu-clair: #CACAFB; --info: #0063CB;
  --encre: #161616; --encre-2: #3A3A3A; --encre-3: #666666;
  --papier: #FFFFFF; --papier-2: #F6F6F6; --mortier: #EEEEEE; --sable: #C9C9C9; --trait: #DDDDDD;
  --brique: var(--bleu); --brique-cuite: var(--bleu); --brique-claire: var(--bleu-pale); --brique-fond: var(--bleu); --brique-nuit: var(--bleu-vif);
  --ardoise: var(--bleu); --ardoise-claire: var(--bleu-clair); --froid: var(--info);
  --sans: 'Inter', 'Source Sans 3', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --serif: var(--sans);
  --ombre: 0 1px 2px rgba(22, 22, 22, .08), 0 8px 24px -12px rgba(22, 22, 22, .25);
  --rayon: 12px; --rayon-ctrl: 8px; --rayon-pastille: 999px;
  --haut: 14px; --bord: 14px; --barre: 56px; --larg-file: 404px; --larg-fiche: 424px;
  --assise: none;
  --grain: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font-family: var(--sans); color: var(--encre); background: var(--papier-2); font-size: 14px; line-height: 1.35; font-feature-settings: "tnum" 1, "lnum" 1; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
[hidden] { display: none !important; }

#carte { position: fixed; inset: 0; }

/* ── La marque : un bloc de brique posé sur le mortier ── */
.marque {
  position: fixed; z-index: 20; top: var(--haut); left: var(--bord); width: var(--larg-file); height: var(--barre);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 8px 0 16px;
  background: var(--brique-fond); color: #fff; border-radius: var(--rayon); box-shadow: var(--ombre);
}
.marque-nom { text-decoration: none; display: flex; flex-direction: column; line-height: 1; }
.marque-nom span { font-weight: 700; font-size: 23px; letter-spacing: 0; }
.marque-nom small { font-size: 11px; letter-spacing: .03em; opacity: .78; margin-top: 4px; }
.marque-nom small span { font: inherit; letter-spacing: inherit; }
.energie-seule { }
.lentilles { display: flex; background: rgba(255, 255, 255, .12); border-radius: 4px; padding: 3px; gap: 2px; }
.lentilles button { border: 0; background: none; color: rgba(255, 255, 255, .85); font-weight: 600; font-size: 14px; padding: 7px 9px; border-radius: 2px; transition: background .15s, color .15s; }
.lentilles button:hover { color: #fff; }
.lentilles button[aria-selected="true"] { background: var(--papier); color: var(--brique-cuite); }
body.renovations .lentilles button[aria-selected="true"] { color: var(--lancer); }

/* ── Les outils : recherche, relevé, pages ── */
.outils {
  position: fixed; z-index: 20; top: var(--haut); right: var(--bord); height: var(--barre); width: var(--larg-fiche);
  display: flex; align-items: center; gap: 4px; padding: 0 6px 0 6px;
  background: var(--papier); border-radius: var(--rayon); box-shadow: var(--ombre); border: 1px solid var(--trait);
}
.recherche { position: relative; flex: 1; display: flex; align-items: center; min-width: 0; }
.recherche svg { position: absolute; left: 10px; color: var(--encre-3); pointer-events: none; }
.recherche input { width: 100%; height: 40px; border: 1.5px solid transparent; background: var(--papier-2); border-radius: 3px; padding: 0 30px 0 34px; font-size: 14.5px; }
.recherche input:focus { outline: none; border-color: var(--bleu); background: #fff; }
.recherche input::placeholder { color: var(--encre-3); }
.recherche kbd { position: absolute; right: 9px; font: 600 11px var(--sans); color: var(--encre-3); border: 1px solid var(--trait); border-radius: 3px; padding: 1px 5px; pointer-events: none; }
.recherche input:focus + kbd { display: none; }
#suggestions { position: absolute; top: 46px; left: 0; width: max(100%, 404px); margin: 0; padding: 4px; list-style: none; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); max-height: 60vh; overflow: auto; }
#suggestions li { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-radius: 3px; cursor: pointer; white-space: nowrap; }
#suggestions li > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; }
#suggestions li[aria-selected="true"], #suggestions li:hover { background: var(--mortier); }
#suggestions .sug-type { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-3); width: 78px; flex: none; }
#suggestions .sug-sous { color: var(--encre-3); font-size: 13px; margin-left: auto; white-space: nowrap; }
.releve { font-size: 12.5px; color: var(--encre-3); white-space: nowrap; padding: 0 6px; }
.outil { text-decoration: none; font-weight: 600; font-size: 14px; padding: 9px 8px; border-radius: 3px; color: var(--bleu); }
.outil:hover { background: var(--bleu-pale); color: var(--bleu); }

/* ── Les panneaux : des plaques de mortier fin posées sur la carte ── */
.panneau {
  position: fixed; z-index: 15; top: calc(var(--haut) + var(--barre) + 10px); bottom: var(--bord);
  background: var(--papier); border-radius: var(--rayon); box-shadow: var(--ombre); border: 1px solid var(--trait);
  display: flex; flex-direction: column; overflow: hidden;
}
.file { left: var(--bord); width: var(--larg-file); transform: translateX(calc(-100% - 40px)); transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.file.arrive { transform: none; }
.fiche { right: var(--bord); width: var(--larg-fiche); animation: glisse-droite .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes glisse-droite { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.tete { position: relative; padding: 16px 18px 0; flex: none; }
.fiche .tete { padding-bottom: 12px; box-shadow: 0 1px 0 var(--trait); z-index: 1; }
body.energie .file .tete { padding-bottom: 8px; box-shadow: 0 1px 0 var(--trait); z-index: 1; }
.bloc .lignes { padding: 0 0 6px; margin: 0 -10px; }
/* sur ordinateur, la file filtrée montre déjà ces lignes ; au téléphone, la fiche les porte */
@media (min-width: 761px) { .bloc-visiter { display: none; } }
.marque-nom small { white-space: nowrap; }
.marque-nom small .vieux { font-weight: 700; color: var(--bleu); background: var(--brique-claire); padding: 0 5px; border-radius: 2px; }
.niveau[data-decide] { color: var(--encre-2); }
.niveau[data-decide]::before { background: none; box-shadow: inset 0 0 0 1.5px var(--brique-cuite); }
.defile { position: relative; flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--sable) transparent; }

/* le grand nombre de la file */
.compte { display: flex; align-items: baseline; gap: 10px; }
.compte b { font-weight: 700; font-size: 44px; line-height: 1; color: var(--brique-cuite); letter-spacing: -.01em; }
.compte span { font-size: 19px; font-weight: 600; color: var(--encre); white-space: nowrap; }
.compte small { margin-left: auto; font-size: 12.5px; color: var(--encre-3); text-align: right; line-height: 1.25; }
body.energie .compte b { color: var(--urgent); }
body.energie .compte span { font-size: 19px; }

.onglets { display: flex; gap: 2px; margin: 14px -18px 0; padding: 0 12px; border-bottom: 1px solid var(--trait); }
.onglets button { border: 0; background: none; padding: 10px 8px 9px; font-weight: 600; font-size: 14.5px; color: var(--encre-3); border-bottom: 3px solid transparent; margin-bottom: -1px; display: flex; gap: 6px; align-items: baseline; }
.onglets button span { font-weight: 500; font-size: 13px; color: var(--encre-3); }
.onglets button:hover { color: var(--encre); }
.onglets button[aria-selected="true"] { color: var(--encre); border-bottom-color: var(--brique-cuite); }
.onglets button[aria-selected="true"] span { color: var(--brique-cuite); }

.filtres { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 18px 2px; min-height: 8px; }
.pastille { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--bleu); background: var(--bleu); color: var(--papier); border-radius: 3px; padding: 3px 4px 3px 9px; font-weight: 600; font-size: 13.5px; }
.pastille button { border: 0; background: rgba(255, 255, 255, .14); color: inherit; width: 22px; height: 22px; border-radius: 2px; display: grid; place-items: center; font-size: 15px; line-height: 1; padding: 0; }
.pastille button:hover { background: rgba(255, 255, 255, .3); }
.filtre-famille { border: 1.5px solid var(--trait); background: var(--papier); border-radius: 3px; padding: 4px 8px; font-size: 13.5px; color: var(--encre-2); max-width: 100%; }
.exporter { margin-left: auto; font-size: 13.5px; font-weight: 600; color: var(--bleu); padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
.exporter::after { content: ' ↓'; }

/* ── Une ligne de la file : rang sur brique, appareil, lieu, raison ── */
.lignes { list-style: none; margin: 0; padding: 6px 8px 18px; }
.ligne { position: relative; display: grid; grid-template-columns: 46px 1fr auto; gap: 2px 10px; padding: 11px 10px 11px 8px; border-radius: 3px; cursor: pointer; transition: background .12s; }
.ligne + .ligne::before { content: ''; position: absolute; top: 0; left: 64px; right: 10px; border-top: 1px solid var(--trait); }
.ligne:hover { background: var(--papier-2); }
.ligne[aria-current="true"] { background: var(--mortier); }
.ligne.meme-residence { background: var(--papier-2); }
.ligne.meme-residence .rang { outline: 2px solid var(--encre); outline-offset: 1px; }
.ligne[aria-current="true"]::after { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; background: var(--brique-cuite); border-radius: 2px; }
.ligne + .ligne[aria-current="true"]::before, .ligne[aria-current="true"] + .ligne::before { border-color: transparent; }
.ligne-titre { font-weight: 650; font-size: 15px; line-height: 1.25; }
.ligne-lieu { font-size: 13px; color: var(--encre-3); grid-column: 2 / 4; }
.ligne-raison { font-size: 13.5px; color: var(--encre-2); grid-column: 2 / 4; margin-top: 3px; line-height: 1.3; }
.ligne-raison em { font-style: normal; color: var(--encre-3); }
.ligne-indice { grid-row: 1; grid-column: 3; font-size: 12px; color: var(--encre-3); text-align: right; white-space: nowrap; padding-top: 2px; }
.ligne-indice b { font-size: 15px; color: var(--encre); font-weight: 650; }
.ligne-decision { grid-column: 2 / 4; font-size: 13px; font-weight: 600; color: var(--encre-2); margin-top: 4px; display: flex; gap: 6px; align-items: center; }

/* la brique de rang : longue et plate comme une foraine */
.rang { grid-row: 1 / 4; align-self: start; margin-top: 1px; width: 44px; height: 20px; border-radius: 2px; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; letter-spacing: .02em;
  background: var(--mortier); color: var(--encre-2); }
[data-niveau="visiter"] > .rang { background: var(--brique-cuite); color: #fff; }
[data-niveau="surveiller"] > .rang { background: var(--brique-claire); color: var(--bleu); }
[data-decide] > .rang { background: transparent; color: var(--encre-3); box-shadow: inset 0 0 0 1.5px var(--sable); }
.vide { padding: 28px 22px; color: var(--encre-3); font-size: 14.5px; }
.vide b { display: block; font-size: 19px; color: var(--encre-2); margin-bottom: 4px; font-weight: 600; }
.plus { display: block; width: calc(100% - 36px); margin: 0 18px 18px; border: 1.5px solid var(--trait); background: none; border-radius: 3px; padding: 9px; font-weight: 600; color: var(--encre-2); }
.plus:hover { background: var(--papier-2); }

/* ── La fiche ── */
.fermer { position: absolute; top: 10px; right: 10px; z-index: 2; width: 36px; height: 36px; border: 0; background: var(--papier-2); border-radius: 3px; display: grid; place-items: center; color: var(--encre-2); }
.fermer:hover { background: var(--mortier); color: var(--encre); }
.retour { border: 0; background: none; padding: 4px 0; font-weight: 600; font-size: 13.5px; color: var(--encre-3); display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.retour:hover { color: var(--encre); }
.fiche h2 { font-weight: 700; font-size: 24px; line-height: 1.15; margin: 0 44px 6px 0; letter-spacing: -.005em; }
.fil { font-size: 14px; color: var(--encre-2); display: flex; flex-wrap: wrap; gap: 0 6px; }
.fil a, .fil button { color: var(--bleu); font-weight: 600; text-decoration: underline; text-decoration-color: var(--bleu-clair); text-decoration-thickness: 1.5px; text-underline-offset: 3px; background: none; border: 0; padding: 0; font-size: inherit; }
.fil a:hover, .fil button:hover { text-decoration-color: var(--bleu); }
.fil .sep { color: var(--sable); }
.etat { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; font-size: 14px; color: var(--encre-2); }
.niveau { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.niveau::before { content: ''; width: 30px; height: 13px; border-radius: 2px; background: var(--mortier); box-shadow: inset 0 0 0 1.5px var(--sable); }
.niveau[data-niveau="visiter"] { color: var(--brique-cuite); }
.niveau[data-niveau="visiter"]::before { background: var(--brique-cuite); box-shadow: none; }
.niveau[data-niveau="surveiller"] { color: var(--encre-2); }
.niveau[data-niveau="surveiller"]::before { background: var(--brique-claire); box-shadow: none; }

/* les trois décisions */
.decisions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 16px 0 4px; }
.decisions button { border: 1.5px solid var(--bleu); color: var(--bleu); background: var(--papier); border-radius: 3px; padding: 10px 6px 9px; font-weight: 700; font-size: 14.5px; display: flex; flex-direction: column; align-items: center; gap: 1px; transition: background .12s, color .12s; }
.decisions button small { font-weight: 500; font-size: 11.5px; color: var(--encre-3); }
.decisions button:hover { background: var(--bleu); color: var(--papier); }
.decisions button:hover small { color: rgba(255, 255, 255, .75); }
.decisions button kbd { font: 600 10.5px var(--sans); opacity: .55; }
.decide { margin: 16px 0 4px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 3px; background: var(--bleu); color: var(--papier); }
.decide b { font-size: 15.5px; }
.decide span { font-size: 13px; opacity: .75; }
.decide button { margin-left: auto; border: 1.5px solid rgba(255, 255, 255, .35); background: none; color: inherit; border-radius: 3px; padding: 6px 10px; font-weight: 600; font-size: 13.5px; }
.decide button:hover { background: rgba(255, 255, 255, .12); }
.note { width: 100%; border: 1.5px solid var(--trait); background: var(--papier-2); border-radius: 3px; padding: 8px 10px; font-size: 14px; margin-top: 6px; }
.note:focus { outline: none; border-color: var(--bleu); background: #fff; }

.bloc { padding: 16px 18px 4px; }
.bloc + .bloc { border-top: 1px solid var(--trait); }
.bloc h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .11em; color: var(--encre-3); margin: 0 0 10px; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; }
.bloc h3 span { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12.5px; }

.raisons { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 9px; }
.raisons li { display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: baseline; font-size: 14.5px; line-height: 1.32; }
.poids { height: 7px; border-radius: 1px; background: var(--mortier); position: relative; top: -1px; overflow: hidden; }
.poids i { position: absolute; inset: 0 auto 0 0; background: var(--brique); }

.faits { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 12px; font-size: 14px; }
.faits dt { color: var(--encre-3); }
.faits dd { margin: 0; }

.histoire { list-style: none; margin: 0 0 8px; padding: 0 0 0 14px; position: relative; }
.histoire::before { content: ''; position: absolute; left: 3px; top: 6px; bottom: 6px; border-left: 2px dotted var(--sable); }
.histoire li { position: relative; padding: 0 0 12px 12px; font-size: 14px; }
.histoire li::before { content: ''; position: absolute; left: -15px; top: 5px; width: 10px; height: 10px; border-radius: 1px; background: var(--papier); box-shadow: inset 0 0 0 2px var(--sable); }
.histoire li[data-sorte="arret"]::before { background: var(--brique-cuite); box-shadow: none; }
.histoire li[data-sorte="depannage"]::before { background: var(--brique-claire); box-shadow: none; }
.histoire li[data-sorte="remplacement"]::before { background: var(--encre-2); box-shadow: none; }
.histoire li[data-sorte="demande"]::before { border-radius: 50%; box-shadow: inset 0 0 0 2px var(--froid); }
.histoire .quand { font-size: 12.5px; color: var(--encre-3); display: block; }
.histoire .quoi { font-weight: 600; }
.histoire .quoi.arret { color: var(--brique-cuite); }
.histoire q { display: block; color: var(--encre-2); font-style: italic; quotes: "« " " »"; margin-top: 1px; }
.histoire .detail { color: var(--encre-2); }

.equip { list-style: none; margin: 0 0 10px; padding: 0; }
.equip li { display: grid; grid-template-columns: 46px 1fr auto; gap: 0 10px; align-items: center; padding: 7px 4px; border-radius: 3px; cursor: pointer; }
.equip li:hover { background: var(--papier-2); }
.equip li .rang { grid-row: 1 / 3; margin: 0; }
.equip li small { color: var(--encre-3); font-size: 12.5px; grid-column: 2; }
.equip li .ligne-indice { grid-row: 1 / 3; }
.equip li.inerte { cursor: default; }
.equip li.inerte:hover { background: none; }

.chiffres { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 14px 0 2px; }
.chiffres div { display: flex; align-items: baseline; gap: 6px; }
.chiffres b { font-size: 26px; font-weight: 700; line-height: 1; }
.chiffres span { font-size: 13.5px; color: var(--encre-2); }
.chiffres .c-visiter b { color: var(--brique-cuite); }
.chiffres .c-surveiller b { color: var(--encre-2); }
.chiffres .c-energie b { color: var(--urgent); }

/* ── Énergie : l'échelle A–G, choisie d'un geste ── */
.echelle-dpe { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin: 12px 0 0; }
.echelle-dpe button { border: 0; height: 34px; border-radius: 2px; font-weight: 700; font-size: 15px; background: var(--papier-2); color: var(--encre-3); box-shadow: inset 0 0 0 1.5px var(--trait); position: relative; }
/* les étiquettes qui comptent portent leur couleur officielle ; les autres restent en retrait */
.echelle-dpe button.au-dela { background: var(--fond-dpe); color: var(--sur-dpe); box-shadow: none; }
.echelle-dpe button.seuil::after { content: ''; position: absolute; left: -3px; top: -5px; bottom: -5px; border-left: 2.5px solid var(--encre); }
.echelle-dpe button:hover { filter: brightness(1.06); }
.legende-dpe { display: flex; justify-content: space-between; font-size: 12px; color: var(--encre-3); margin-top: 6px; }
.dpe-barre { display: flex; height: 12px; border-radius: 2px; overflow: hidden; margin: 8px 0 4px; background: var(--mortier); }
.dpe-barre i { display: block; height: 100%; }
.res-energie { list-style: none; margin: 0; padding: 6px 8px 18px; }
.res-energie li { position: relative; display: grid; grid-template-columns: 34px 1fr auto; gap: 2px 12px; padding: 12px 10px 12px 8px; border-radius: 3px; cursor: pointer; }
.res-energie li + li::before { content: ''; position: absolute; top: 0; left: 54px; right: 10px; border-top: 1px solid var(--trait); }
.res-energie li:hover { background: var(--papier-2); }
.res-energie li[aria-current="true"] { background: var(--mortier); }
.lettre-res { grid-row: 1 / 4; width: 32px; height: 32px; border: 1.5px solid var(--encre); border-radius: 2px; display: grid; place-items: center; font-weight: 700; font-size: 17px; background: var(--papier); }
.res-energie .compte-dpe { grid-row: 1; grid-column: 3; text-align: right; font-size: 12.5px; color: var(--encre-3); }
.res-energie .compte-dpe b { font-size: 17px; color: var(--encre); font-weight: 700; display: block; line-height: 1.1; }
.res-energie .ops { grid-column: 2 / 4; font-size: 13px; color: var(--encre-2); margin-top: 3px; }
.etiquette { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 2px; font-weight: 700; font-size: 13px; color: #fff; }
.op { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; padding: 9px 0; border-top: 1px solid var(--trait); font-size: 14px; }
.op:first-child { border-top: 0; }
.op small { color: var(--encre-3); font-size: 12.5px; grid-column: 1 / 3; }
.op b { font-weight: 650; }
.alerte-dpe { display: inline-flex; gap: 6px; align-items: center; background: var(--urgent); color: var(--sur-urgent); font-weight: 700; font-size: 12.5px; border-radius: 2px; padding: 3px 8px; }

/* ── Le territoire : la première assise du mur ── */
.territoire { position: fixed; z-index: 12; right: var(--bord); bottom: var(--bord); width: var(--larg-fiche); background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 14px 16px 14px; transition: opacity .35s, transform .35s; }
.territoire.cache { opacity: 0; transform: translateY(12px); pointer-events: none; }
.territoire h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .11em; color: var(--encre-3); display: flex; justify-content: space-between; }
.territoire h3 span { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--encre-2); font-size: 13px; }
.mur { display: grid; grid-template-columns: repeat(21, 1fr); gap: 3px 3px; margin: 2px 0 10px; }
.mur i { height: 9px; border-radius: 1px; box-shadow: inset 0 0 0 1.2px var(--sable); }
.mur i.pose { background: var(--brique); box-shadow: none; }
.mur i:nth-child(42n + 22), .mur i:nth-child(42n + 22) ~ i { }
.dpts { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 14px; }
.dpts li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.dpts li span { color: var(--encre-3); }
.dpts li b { font-weight: 650; }
.dpts .raccorde span { color: var(--brique-cuite); font-weight: 600; }
.dpts a { color: var(--bleu); font-weight: 600; text-underline-offset: 3px; }

/* ── Les échelles ── */
.echelles { position: fixed; z-index: 12; bottom: var(--bord); left: calc(var(--bord) + var(--larg-file) + 12px); display: flex; gap: 2px; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 3px; box-shadow: var(--ombre); }
.echelles button { border: 0; background: none; padding: 7px 11px; font-weight: 600; font-size: 13.5px; color: var(--encre-2); border-radius: 2px; }
.echelles button:hover { background: var(--papier-2); }
.echelles button[aria-pressed="true"] { background: var(--bleu); color: var(--papier); }

/* contrôles de la carte : sous les échelles, à gauche de l'espace libre */
#carte .maplibregl-ctrl-top-left { top: auto; bottom: calc(var(--bord) + 52px); left: calc(var(--bord) + var(--larg-file) + 2px); }
#carte .maplibregl-ctrl-bottom-right { right: calc(var(--bord) + var(--larg-fiche) + 8px); bottom: 6px; }
body.sans-fiche.sans-territoire #carte .maplibregl-ctrl-bottom-right { right: 0; bottom: 0; }

/* ── Les pages à part (Méthode, Données) ── */
.page { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; }
.page-fond { position: absolute; inset: 0; background: rgba(22, 22, 22, .32); backdrop-filter: blur(1.5px); }
.page-corps { position: relative; width: min(760px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; background: var(--papier); border-radius: var(--rayon); box-shadow: 0 30px 80px -30px rgba(22, 22, 22, .6); padding: 30px 38px 34px; animation: monte .3s cubic-bezier(.2, .8, .2, 1); }
.page-corps:focus { outline: none; }
@keyframes monte { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.page-corps h1 { font-weight: 700; font-size: 30px; margin: 0 0 4px; }
.page-corps h2 { font-weight: 700; font-size: 20px; margin: 26px 0 8px; }
.page-corps p, .page-corps li { font-size: 15.5px; line-height: 1.55; color: var(--encre-2); max-width: 64ch; }
.page-corps .chapeau { font-size: 17px; color: var(--encre); }
.page-corps table { border-collapse: collapse; margin: 8px 0 6px; font-size: 14.5px; }
.page-corps th, .page-corps td { text-align: left; padding: 7px 18px 7px 0; border-bottom: 1px solid var(--trait); }
.page-corps th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-3); font-weight: 700; }
.page-corps td.n { text-align: right; font-weight: 650; }
.page-corps .fermer { position: sticky; float: right; top: 0; margin: -12px -20px 0 0; }
.page-corps table { width: calc(100% - 30px); }
.alerte-page { border-left: 4px solid var(--bleu); background: var(--bleu-pale); padding: 10px 14px; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.bouton { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--bleu); color: var(--bleu); background: var(--papier); border-radius: 3px; padding: 9px 14px; font-weight: 700; font-size: 14.5px; text-decoration: none; }
.bouton:hover { background: var(--bleu-pale); }
.bouton.plein { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.bouton.plein:hover { background: var(--bleu-vif); border-color: var(--bleu-vif); color: #fff; }
.retour-import { font-size: 14.5px; font-weight: 600; margin: 6px 0; }

.annonce { position: fixed; z-index: 50; left: 50%; top: 86px; max-width: min(560px, calc(100vw - 20px)); transform: translate(-50%, -12px); background: var(--encre); color: var(--papier); padding: 10px 14px 10px 16px; border-radius: 4px; font-weight: 600; font-size: 14.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; display: flex; gap: 14px; align-items: center; box-shadow: var(--ombre); }
.annonce.visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.annonce > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.annonce button { border: 0; background: rgba(255, 255, 255, .14); color: inherit; border-radius: 2px; padding: 5px 10px; font-weight: 700; }

/* ── Épuré : des catégories en mots courts, en couleur vive seulement pour ce qui demande une action ── */
/* le centre de l'en-tête : l'entrée du rejeu */
.place-bascule { position: fixed; z-index: 20; top: var(--haut); left: 50%; width: 560px; height: var(--barre); margin-left: -280px; pointer-events: none;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.place-bascule > * { pointer-events: auto; }
.bascule { grid-column: 2; display: flex; gap: 2px; padding: 3px; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); }
.bascule button { border: 0; background: none; padding: 9px 14px; font-weight: 700; font-size: 14.5px; color: var(--encre-2); border-radius: 2px; white-space: nowrap; transition: background .2s, color .2s; }
.bascule button:hover { background: var(--papier-2); color: var(--encre); }
.bascule button[aria-checked="true"] { background: var(--bleu); color: var(--papier); }
.rejeu-entree, .capot-entree { display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 14px; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--papier); color: var(--bleu); box-shadow: var(--ombre);
  font-weight: 700; font-size: 14.5px; white-space: nowrap; text-decoration: none; cursor: pointer; }
.rejeu-entree:hover, .capot-entree:hover { background: var(--papier-2); }
.rejeu-entree { grid-column: 1; justify-self: end; }
.rejeu-entree svg { color: var(--bleu); }
.capot-entree { grid-column: 3; justify-self: start; visibility: hidden; }
body.monde-reel .capot-entree { visibility: visible; }
body.monde-reel .rejeu-entree, body:not(.bascule-prete) .bascule { visibility: hidden; }
.cat { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 2px; font-weight: 700; font-size: 12.5px; letter-spacing: .01em; white-space: nowrap; border: 0;
  background: var(--mortier); color: var(--encre-2); }
.cat b { font-weight: 800; }
.cat[data-vive][data-cat="urgence"] { background: var(--urgent-fond); color: var(--urgent); }
.cat[data-vive][data-cat="alerte"] { background: var(--alerte-fond); color: var(--alerte-texte); }
.cat[data-vive][data-cat="vigilance"] { background: var(--vigilance-fond); color: var(--vigilance-texte); }
.cat[data-vive][data-cat="lancer"] { background: var(--lancer-fond); color: var(--lancer); }
.cat[data-cat="surveiller"], .cat[data-cat="vigilance"]:not([data-vive]) { background: var(--mortier); color: var(--encre-2); box-shadow: inset 0 0 0 1px var(--sable); }
.cat[data-cat="calme"], .cat[data-cat="ras"] { background: none; color: var(--encre-3); box-shadow: inset 0 0 0 1.5px var(--trait); font-weight: 600; }
.cat[data-cat="decide"] { background: none; color: var(--bleu); box-shadow: inset 0 0 0 1.5px var(--bleu); }
.cat[data-cat="prevu"] { background: none; color: var(--encre); box-shadow: inset 0 0 0 1.5px var(--encre-2); }
.cat.grand { height: 32px; padding: 0 14px; font-size: 16px; }

/* la file : les comptes sont les onglets */
.file .tete { padding-top: 12px; }
.file .onglets { margin: 0 -18px; padding: 0 10px; }
.file .onglets button { font-size: 15px; font-weight: 600; padding: 8px 8px 10px; color: var(--encre-3); }
.file .onglets button b { font-size: 24px; font-weight: 700; color: var(--encre-2); margin-right: 2px; }
.file .onglets button[aria-selected="true"] { color: var(--encre); }
.file .onglets button[aria-selected="true"] b { color: var(--encre); }
body:not(.energie) .file .onglets button[data-onglet="visiter"] b { color: var(--urgent); }
.bandes { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 0 2px; }
.bandes .cat { height: 30px; padding: 0 11px; font-size: 14px; cursor: pointer; }
.bandes button.cat[aria-pressed="true"] { outline: 2.5px solid var(--bleu); outline-offset: 2px; }
.bandes button.cat:hover { filter: brightness(1.05); }
.fiche .bandes { padding-top: 10px; }
.filtres { padding: 8px 18px 0; }
.filtre-famille { border: 0; background: none; padding: 4px 2px; font-size: 13.5px; color: var(--encre-3); font-weight: 600; cursor: pointer; }
.filtre-famille:hover, .filtre-famille:focus { color: var(--encre); }
.ligne { grid-template-columns: 96px 1fr; gap: 1px 12px; padding: 10px 10px 10px 8px; align-items: center; }
.ligne + .ligne::before { left: 116px; }
.ligne > .cat { grid-row: 1 / 3; width: 96px; }
.ligne-titre { font-size: 15.5px; }
.ligne-lieu { grid-column: 2; font-size: 13.5px; }
.ligne[data-decide] .ligne-titre { color: var(--encre-2); }

/* la fiche */
.fiche .etat { margin-top: 12px; flex-wrap: wrap; }
.decisions { margin-top: 14px; }
.decisions button { padding: 11px 6px; font-size: 15px; }
.ajout-note, .plus-infos { margin: 0; }
.ajout-note summary { font-size: 13.5px; color: var(--encre-3); font-weight: 600; padding: 8px 0 0; cursor: pointer; list-style: none; }
.ajout-note summary::-webkit-details-marker, .plus-infos summary::-webkit-details-marker { display: none; }
.ajout-note summary:hover { color: var(--encre); }
.plus-infos { border-top: 1px solid var(--trait); padding: 0 18px 8px; }
.plus-infos summary { list-style: none; cursor: pointer; font-weight: 700; font-size: 14px; color: var(--encre-2); padding: 14px 0; display: flex; align-items: center; gap: 8px; }
.plus-infos summary::before { content: '+'; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 2px; box-shadow: inset 0 0 0 1.5px var(--sable); font-weight: 700; }
.plus-infos[open] summary::before { content: '−'; }
.plus-infos summary:hover { color: var(--encre); }
.sous-bloc { font-size: 12px; text-transform: uppercase; letter-spacing: .11em; color: var(--encre-3); margin: 14px 0 10px; font-weight: 700; }
.raisons { gap: 10px; margin-bottom: 14px; }
.raisons li { display: block; position: relative; padding-left: 16px; font-size: 15px; }
.raisons li::before { content: ''; position: absolute; left: 0; top: .5em; width: 7px; height: 7px; border-radius: 50%; background: var(--bleu); }
.raisons li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.raisons .pts { flex: none; min-width: 38px; text-align: right; font-weight: 700; color: var(--bleu); font-feature-settings: "tnum" 1; }
.raisons .pts.moins { color: var(--lancer); }
.total { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 4px; padding-top: 8px; border-top: 1px solid var(--trait); font-size: 14.5px; color: var(--encre-2); }
.total b { font-size: 18px; color: var(--encre); }
.seuil { margin: 0 0 8px; font-size: 12.5px; color: var(--encre-3); }
.score { font-size: 14px; color: var(--encre-2); }
.score b { font-size: 16px; color: var(--encre); }
.observe { margin: 8px 0 0; font-size: 13.5px; color: var(--encre-2); }
.equip li { grid-template-columns: auto 1fr auto; gap: 0 10px; padding: 8px 4px; }
.equip li > .cat { min-width: 64px; }
.equip li .lettre-res { width: 40px; height: 26px; font-size: 14px; grid-row: auto; }
.equip .calme { color: var(--encre-3); }
.suivant { margin: 8px 0 2px; width: 100%; }

/* énergie : un compte par résidence, la barre des étiquettes */
.res-energie li { grid-template-columns: 34px 1fr auto; }
.res-energie .compte-dpe b { font-size: 20px; }
.res-energie .compte-dpe b.zero { color: var(--encre-3); font-weight: 600; }

/* rénovations : ce qu'on lance cette année, l'effet du plan, les années */
.compte em { margin-left: auto; font-style: normal; font-weight: 700; font-size: 15px; color: var(--encre-2); }
body.renovations .compte b { color: var(--lancer); }
.effet { width: 100%; border-collapse: collapse; margin: 12px 0 12px; font-size: 13.5px; }
.effet th, .effet td { padding: 4px 0; text-align: right; font-weight: 600; color: var(--encre-3); }
.effet thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; padding-bottom: 6px; }
.effet tbody th { text-align: left; color: var(--encre-2); font-weight: 600; }
.effet td { width: 96px; font-size: 15px; white-space: nowrap; }
.effet .ce-plan { color: var(--lancer); font-weight: 800; }
.effet thead .ce-plan { color: var(--lancer); }
body.renovations .file .tete { box-shadow: 0 1px 0 var(--trait); z-index: 1; }
.annees { list-style: none; margin: 0; padding: 4px 8px 12px; }
.annee { border-radius: 3px; margin-bottom: 4px; }
.annee[aria-current="true"] { background: var(--papier-2); }
.annee-tete { width: 100%; display: grid; grid-template-columns: 46px auto 1fr auto; gap: 10px; align-items: center; border: 0; background: none; padding: 10px 10px 6px; text-align: left; }
.annee-tete b { font-size: 20px; font-weight: 700; grid-column: 1; }
.annee-tete .cat { grid-column: 2; }
.annee-tete .budget { grid-column: 3; height: 8px; border-radius: 1px; background: var(--mortier); position: relative; overflow: hidden; }
.annee-tete .budget i { position: absolute; inset: 0 auto 0 0; background: var(--encre-3); }
.annee[data-maintenant] .budget i { background: var(--lancer); }
.annee-tete:not(:has(.cat)) .budget { grid-column: 2 / 4; }
.montant { font-weight: 700; font-size: 13.5px; color: var(--encre-2); white-space: nowrap; text-align: right; }
.ops { list-style: none; margin: 0; padding: 0 0 8px; }
.op-ligne { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 3px; cursor: pointer; }
.op-ligne:hover { background: var(--mortier); }
.op-ligne[aria-current="true"] { background: var(--mortier); box-shadow: inset 3px 0 0 var(--lancer); }
.op-ligne .lettre-res { width: 28px; height: 24px; font-size: 14px; grid-row: auto; }
.op-ligne .ligne-titre { font-size: 14.5px; font-weight: 600; }
.op-ligne small { font-weight: 500; color: var(--encre-3); font-size: 12.5px; }
.annee[data-maintenant] .op-ligne .ligne-titre { font-weight: 700; }
.pied-plan { padding: 4px 18px 18px; font-size: 13.5px; font-weight: 600; }
.pied-plan a { color: var(--bleu); }
.decalage { font-size: 13px; font-weight: 600; color: var(--encre-2); box-shadow: inset 0 0 0 1.5px var(--sable); padding: 4px 8px; border-radius: 2px; }
.criteres { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.criteres li { display: flex; justify-content: space-between; align-items: center; font-size: 14.5px; }
.force { font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 2px; }
.force[data-force="fort"] { background: var(--bleu); color: var(--papier); }
.force[data-force="moyen"] { box-shadow: inset 0 0 0 1.5px var(--bleu); color: var(--bleu); }
.force[data-force="faible"] { color: var(--encre-3); }

/* sur la carte : la catégorie écrite dans sa couleur, pas de sous-titre */
.rv-cat { display: inline-block; padding: 1px 6px; border-radius: 2px; font-weight: 700; font-size: 12px; text-shadow: none; margin-right: 3px; background: var(--mortier); color: var(--encre); }
.rv-cat[data-cat="urgence"] { background: var(--urgent); color: #fff; }
.rv-cat[data-cat="alerte"] { background: var(--alerte); color: var(--sur-alerte); }
.rv-cat[data-cat="vigilance"] { background: var(--vigilance); color: var(--sur-vigilance); box-shadow: inset 0 0 0 1px rgba(22, 22, 22, .2); }
.rv-cat[data-cat="lancer"] { background: var(--lancer); color: #fff; }
.rv-cat[data-cat="prevu"] { background: var(--bleu); color: var(--papier); }
.carte-assise .rv-visiter { color: var(--encre); font-weight: 700; }
.carte-assise .rv-sous { display: none; }
.carte-assise .rv-alerte { font-size: 13px; }

/* ── Écrans moyens : la fiche passe devant la file ── */
@media (max-width: 1180px) {
  :root { --larg-file: 372px; --larg-fiche: 390px; }
  .lentilles button { font-size: 13px; padding: 7px 7px; }
  .releve { display: none; }
}
@media (max-width: 960px) and (min-width: 761px) {
  .outils { width: auto; left: calc(var(--bord) + var(--larg-file) + 10px); }
  .fiche { width: min(var(--larg-fiche), calc(100vw - var(--larg-file) - 3 * var(--bord))); }
  .territoire { display: none; }
}

/* ── Téléphone : la carte en haut, une feuille qu'on tire du pouce ── */
.poignee, .pied-tel { display: none; }
@media (max-width: 760px) {
  #suggestions { width: 100%; }
  #suggestions .sug-sous { display: none; }
  :root { --haut: 10px; --bord: 10px; --barre: 50px; }
  body { font-size: 15px; }
  .marque { width: auto; right: calc(var(--bord) + 58px); padding-left: 12px; }
  .marque-nom span { font-size: 22px; }
  .marque-nom small { display: none; }
  /* au téléphone, seul l'âge d'un relevé ancien reste */
  .marque-nom small:has(.vieux) { display: block; font-size: 10.5px; margin-top: 1px; }
  .marque-nom small .date-releve { display: none; }
  .marque-nom small .vieux::before { content: 'relevé '; }
  .outils { width: 50px; padding: 0; justify-content: center; cursor: pointer; }
  body.cherche .outils { cursor: auto; }
  .outils .releve, .outils .outil { display: none; }
  .recherche { flex: none; }
  .recherche svg { position: static; width: 20px; height: 20px; color: var(--encre); }
  .recherche input, .recherche kbd { display: none; }
  body.cherche .outils { left: var(--bord); width: auto; z-index: 30; padding: 0 6px; }
  body.cherche .recherche { flex: 1; }
  body.cherche .recherche svg { position: absolute; width: 17px; height: 17px; color: var(--encre-3); }
  body.cherche .recherche input { display: block; }
  .file, .fiche {
    left: 0; right: 0; width: auto; top: auto; bottom: 0; height: var(--feuille, 46vh); border-radius: 14px 14px 0 0;
    transform: none; transition: height .35s cubic-bezier(.2, .8, .2, 1); animation: none;
    box-shadow: 0 -12px 34px -18px rgba(22, 22, 22, .45);
  }
  .file:not(.arrive) { transform: translateY(100%); }
  .fiche { z-index: 16; }
  .glisse .file, .glisse .fiche { transition: none; }
  .poignee { display: block; flex: none; height: 26px; position: relative; touch-action: none; cursor: grab; border: 0; background: none; width: 100%; }
  .panneau .tete { touch-action: none; }
  .pied-tel { display: flex; gap: 10px; padding: 8px 18px 22px; }
  .pied-tel a { flex: 1; text-align: center; padding: 12px; border: 1.5px solid var(--trait); border-radius: 3px; font-weight: 600; color: var(--encre-2); }
  .poignee::before { content: ''; position: absolute; left: 50%; top: 8px; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: var(--sable); }
  .tete { padding-top: 0; }
  .compte b { font-size: 36px; }
  .fiche h2 { font-size: 22px; }
  .fermer { top: 18px; }
  .ligne { padding: 12px 8px 12px 6px; }
  .territoire, .echelles { display: none; }
  #carte .maplibregl-ctrl-top-left { display: none; }
  #carte .maplibregl-ctrl-bottom-right { display: none; }
  .page { padding: 0; }
  .page-corps { max-height: 100vh; height: 100%; border-radius: 0; padding: 22px 20px 30px; }
  .decisions button { padding: 12px 4px 11px; }
  .annonce { bottom: calc(var(--feuille, 46vh) + 12px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Téléphone, version épurée : trois lentilles dans la barre, la mention sous la barre ── */
@media (max-width: 760px) {
  .marque { padding: 0 4px; }
  .marque-nom { position: absolute; top: calc(100% + 6px); left: 0; flex-direction: row; align-items: baseline; gap: 6px; background: rgba(255, 255, 255, .94); color: var(--encre-2); padding: 3px 8px; border-radius: 3px; box-shadow: 0 2px 6px -3px rgba(22, 22, 22, .35); }
  .marque-nom span { font-size: 13px; color: var(--encre); }
  .marque-nom small, .marque-nom small:has(.vieux) { display: block; font-size: 11px; margin: 0; opacity: 1; }
  .lentilles { flex: 1; }
  .lentilles button { flex: 1; font-size: 14px; padding: 8px 2px; }
  .ligne { grid-template-columns: 88px 1fr; }
  .ligne > .cat { width: 88px; }
  .ligne + .ligne::before { left: 106px; }
  .file .onglets button { padding: 6px 6px 9px; font-size: 14px; }
  .file .onglets button b { font-size: 21px; }
  .effet td { width: auto; padding-left: 12px; }
}

/* rénovations : la décision de l'année */
.decisions.deux { grid-template-columns: 1fr 1fr; }
.op-ligne[data-choix] .ligne-titre { color: var(--encre-3); font-weight: 600; }
.fiche .decide + .chiffres, .fiche .decisions + .chiffres { margin-top: 14px; }

/* ── Le centre de l'en-tête sur un écran moyen : sous la barre, à droite de la file ── */
@media (max-width: 1300px) and (min-width: 761px) {
  .place-bascule { top: calc(var(--haut) + var(--barre) + 10px); left: calc(var(--bord) + var(--larg-file) + 12px); margin-left: 0; width: auto; height: auto; display: flex; gap: 8px; }
  .rejeu-entree, .capot-entree { height: 42px; }
  body.monde-reel .rejeu-entree, .capot-entree { display: none; }
  body.monde-reel .capot-entree { display: inline-flex; }
}

/* ── Téléphone ── */
@media (max-width: 760px) {
  .marque-nom { flex-direction: column; align-items: flex-start; gap: 1px; }
  .place-bascule { top: calc(var(--haut) + var(--barre) + 6px); left: auto; right: var(--bord); margin: 0; width: auto; height: auto; display: flex; }
  .bascule { padding: 2px; }
  .bascule button { padding: 7px 10px; font-size: 13.5px; }
  .rejeu-entree { display: none; }
  .capot-entree { position: fixed; top: calc(var(--haut) + 5px); right: calc(var(--bord) + 5px); height: calc(var(--barre) - 10px); padding: 0 12px; font-size: 14px; display: none; }
  body.monde-reel .capot-entree { display: inline-flex; }
  body.monde-reel .marque { right: var(--bord); }
  body.monde-reel .capot-entree { left: calc(var(--bord) + 5px); justify-self: stretch; justify-content: center; gap: 8px; font-size: 15px; color: var(--bleu); }
  .pied-tel button { flex: 1.3; text-align: center; padding: 12px 6px; border: 1.5px solid var(--trait); border-radius: 3px; font-weight: 600; color: var(--encre-2); background: none; white-space: nowrap; }
  .pied-tel a { padding: 12px 6px; }
}

/* ── Arrondis : plus l'élément est court, plus il est rond ── */
.cat, .rang, .rv-cat, .alerte-dpe, .pastille, .pastille button, .decalage, .annonce button { border-radius: var(--rayon-pastille); }
.bascule, .echelles, .lentilles { border-radius: var(--rayon-pastille); padding: 3px; }
.bascule button, .echelles button { border-radius: var(--rayon-pastille); padding-inline: 16px; }
.lentilles button { border-radius: var(--rayon-pastille); padding-inline: 11px; }
.decisions button, .bouton, .plus, .fermer, .note, .recherche input, .filtre-famille, .rejeu-entree, .capot-entree, .ligne, .op-ligne, .res-energie li, .equip li, .decide, .decide button, #suggestions li, .outil, .annee { border-radius: var(--rayon-ctrl); }
.decisions button, .bouton, .plus, .note, .filtre-famille, .pastille { border-width: 1px; }
.etiquette, .echelle-dpe button { border-radius: 4px; }

/* ── La file : un point de couleur par catégorie, la pastille pleine reste aux filtres ── */
.ligne { grid-template-columns: 88px 1fr; }
.ligne + .ligne::before { left: 108px; }
.ligne > .cat[data-cat], .ligne > .cat[data-vive][data-cat], .equip li > .cat[data-cat], .equip li > .cat[data-vive][data-cat] { width: auto; background: none; box-shadow: none; color: var(--encre-2); justify-content: flex-start; padding: 0; gap: 7px; }
.ligne > .cat::before, .equip li > .cat::before { content: ''; width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--mortier); box-shadow: inset 0 0 0 1.5px var(--sable); }
.ligne > .cat[data-cat="urgence"]::before, .equip li > .cat[data-cat="urgence"]::before { background: var(--urgent); box-shadow: none; }
.ligne > .cat[data-cat="alerte"]::before, .equip li > .cat[data-cat="alerte"]::before { background: var(--alerte); box-shadow: none; }
.ligne > .cat[data-cat="vigilance"][data-vive]::before, .equip li > .cat[data-cat="vigilance"][data-vive]::before { background: var(--vigilance); box-shadow: none; }
.ligne > .cat[data-cat="calme"]::before, .ligne > .cat[data-cat="ras"]::before, .equip li > .cat[data-cat="calme"]::before, .equip li > .cat[data-cat="ras"]::before { background: none; box-shadow: inset 0 0 0 1.5px var(--trait); }
.equip li > .cat[data-cat="lancer"]::before { background: var(--lancer); box-shadow: none; }
.equip li > .cat[data-cat="prevu"]::before { background: var(--bleu); box-shadow: none; }

/* ── La fiche : une action principale ── */
.decisions button:first-child { background: var(--bleu); color: #fff; }
.decisions button:first-child small { color: rgba(255, 255, 255, .75); }
.decisions button:first-child:hover { background: var(--bleu-vif); border-color: var(--bleu-vif); }
.decisions button:last-child { border-color: transparent; color: var(--encre-3); background: none; }
.decisions button:last-child:hover { background: var(--papier-2); color: var(--encre); }
.fil button:not(:first-child) { color: var(--encre-2); text-decoration: none; font-weight: 500; }

/* ── La lettre de résidence : un disque, pas une étiquette DPE ── */
.lettre-res { border-radius: 50%; border: 1px solid var(--sable); background: var(--papier); color: var(--encre); font-size: 16px; }
.op-ligne .lettre-res, .equip li .lettre-res { width: 26px; height: 26px; font-size: 13px; }
[aria-current="true"] .lettre-res { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.dpe-barre { height: 10px; border-radius: 999px; gap: 1px; }

/* ── Les raisons repliées et l'aide des décisions ── */
.raisons .autres { display: block; }
.raisons .autres details summary { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; cursor: pointer; list-style: none; }
.raisons .autres details summary::-webkit-details-marker { display: none; }
.raisons .autres details summary small { display: block; font-size: 12.5px; color: var(--bleu); text-decoration: underline; text-underline-offset: 3px; }
.raisons .autres details[open] summary small { text-decoration: none; }
.raisons .autres ul { list-style: none; margin: 8px 0 0; padding: 8px 0 0 10px; border-left: 2px solid var(--trait); display: grid; gap: 6px; }
.raisons .autres ul li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-size: 13.5px; color: var(--encre-2); }
.raisons .autres ul li .pts { font-size: 13px; }
.decisions button small { font-weight: 500; font-size: 11.5px; color: var(--encre-3); }
.aide-decision { margin: 6px 0 0; font-size: 12.5px; color: var(--encre-3); }

/* ── Le haut de la fiche, deux versions comparées : ?tete=h2 ou ?tete=h3 ── */
.tete-h3 { display: none; }
body.fiche-h3 .tete-h2 { display: none; }
body.fiche-h3 .tete-h3 { display: block; }
.encadre { margin: 10px 0 0; padding: 10px 14px; border-left: 4px solid var(--bande, var(--bleu)); background: var(--bande-fond, var(--papier-2)); font-size: 15px; font-weight: 600; border-radius: 0 8px 8px 0; }
.encadre small { display: block; font-weight: 500; color: var(--encre-2); font-size: 13px; margin-top: 2px; }
.score-pilule { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 14px; border-radius: 999px; font-weight: 800; font-size: 17px; background: var(--bande-fond, var(--mortier)); color: var(--bande, var(--encre)); }
.score-pilule small { font-weight: 600; font-size: 12px; }
.stat-pannes { margin: 12px 0 0; padding: 12px 14px 12px 16px; background: var(--papier-2); border-left: 4px solid var(--encre-3); border-radius: 0 8px 8px 0; }
.stat-ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.stat-pannes b { font-size: 34px; font-weight: 600; line-height: 1; white-space: nowrap; letter-spacing: -.01em; }
.stat-pannes b span { font-size: 18px; color: var(--encre-3); font-weight: 600; }
.stat-part { font-size: 15px; font-weight: 600; color: var(--encre-2); }
.stat-pannes p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.35; color: var(--encre-2); }
.jauge { height: 6px; margin-top: 10px; border-radius: 999px; background: var(--trait); overflow: hidden; }
.jauge i { display: block; height: 100%; border-radius: 999px; background: var(--encre-2); }
.cat.grand[data-cat="urgence"], .score-pilule[data-cat="urgence"], .encadre[data-cat="urgence"] { --bande: var(--urgent); --bande-fond: var(--urgent-fond); }
.cat.grand[data-cat="alerte"], .score-pilule[data-cat="alerte"], .encadre[data-cat="alerte"] { --bande: var(--alerte-texte); --bande-fond: var(--alerte-fond); }
.cat.grand[data-cat="vigilance"], .score-pilule[data-cat="vigilance"], .encadre[data-cat="vigilance"] { --bande: var(--vigilance-texte); --bande-fond: var(--vigilance-fond); }

/* ── Le menu des actions secondaires ── */
.menu { position: relative; flex: none; }
.menu-bouton { width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--bleu); display: grid; place-items: center; }
.menu-bouton:hover, .menu-bouton[aria-expanded="true"] { background: var(--bleu-pale); }
.menu-liste { position: absolute; top: 46px; right: 0; min-width: 260px; padding: 6px; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon-ctrl); box-shadow: var(--ombre); z-index: 30; display: grid; gap: 2px; }
.menu-liste hr { border: 0; border-top: 1px solid var(--trait); margin: 4px 6px; }
.menu-liste > a, .menu-liste > button { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--encre); font-weight: 600; font-size: 14.5px; text-decoration: none; text-align: left; box-shadow: none; white-space: nowrap; }
.menu-liste > a:hover, .menu-liste > button:hover { background: var(--papier-2); color: var(--bleu); }
.menu-liste .rejeu-entree { display: flex; height: 40px; visibility: visible; grid-column: auto; justify-self: auto; }
.menu-liste .rejeu-entree svg { color: var(--bleu); }
.menu-liste kbd { margin-left: auto; font: 600 11px var(--sans); color: var(--encre-3); border: 1px solid var(--trait); border-radius: 4px; padding: 1px 5px; }
body.monde-reel .menu-liste .rejeu-entree { display: none; }
.lignes { padding: 6px 8px 22px; }
.ligne { padding: 12px 10px 12px 8px; }
.file .tete { padding-top: 14px; }
.bandes { padding: 14px 0 4px; }
.filtres { padding: 10px 18px 2px; }
@media (max-width: 760px) {
  .outils { width: 50px; }
  .outils .menu { display: none; }
  body.cherche .outils .menu { display: block; }
  .menu-liste { right: -4px; }
}

/* ── Pannes : un seul grand compte, les autres niveaux en pilules ── */
.compte b.compte-visiter { color: var(--urgent); }
.compte b.compte-surveiller, .compte b.compte-decide { color: var(--encre); }
.bandes .cat.onglet-pilule { background: none; box-shadow: inset 0 0 0 1px var(--trait); color: var(--encre-2); font-weight: 600; }
.bandes .cat.onglet-pilule b { color: var(--encre); font-weight: 700; }
.bandes .cat.onglet-pilule:hover { background: var(--papier-2); }
.file .tete { box-shadow: 0 1px 0 var(--trait); z-index: 1; padding-bottom: 10px; }
.ligne { grid-template-columns: 88px 1fr auto; }
.ligne-indice { grid-row: 1; grid-column: 3; font-size: 12.5px; color: var(--encre-3); padding-top: 2px; }
.ligne-indice b { font-size: 14.5px; color: var(--encre-2); font-weight: 700; }
.ligne-lieu { grid-column: 2 / 4; }
.res-zero { margin: 4px 8px 12px; }
.res-zero summary { list-style: none; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--bleu); padding: 8px 10px; text-decoration: underline; text-underline-offset: 3px; }
.res-zero summary::-webkit-details-marker { display: none; }
.res-zero[open] summary { text-decoration: none; color: var(--encre-3); }
.res-zero .res-energie { padding-top: 0; }
.tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 0; }
.tuile { padding: 10px 12px 10px 14px; background: var(--papier-2); border-left: 4px solid var(--lancer); border-radius: 0 8px 8px 0; display: flex; flex-direction: column; gap: 2px; }
.tuile b { font-size: 26px; font-weight: 700; line-height: 1; color: var(--lancer); }
.tuile span { font-size: 13.5px; font-weight: 600; color: var(--encre); }
.tuile small { font-size: 12px; color: var(--encre-3); line-height: 1.3; }
.effet-energie { margin: 10px 0 2px; font-size: 13.5px; color: var(--encre-2); }
.effet-energie b { color: var(--lancer); }
@media (max-width: 760px) {
  .bascule button { padding-inline: 10px; font-size: 13px; }
  .marque-nom { max-width: 46vw; }
  .marque-nom small, .marque-nom span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .ligne { grid-template-columns: 88px 1fr auto; }
}

/* ── Carte d'abord : une barre de recherche blanche, des pastilles de lentille, la liste à la demande ── */
.marque { background: var(--papier); color: var(--encre); border: 1px solid var(--trait); border-radius: 999px; padding: 0 6px 0 16px; gap: 8px; height: 48px; justify-content: flex-start; }
.marque-nom { flex: none; padding-right: 10px; border-right: 1px solid var(--trait); }
.marque-nom span { font-size: 17px; font-weight: 700; color: var(--bleu); }
.marque-nom small { display: none; }
.marque .outils { position: static; width: auto; height: auto; flex: 1; min-width: 0; background: none; border: 0; box-shadow: none; padding: 0; gap: 2px; }
.marque .recherche input { height: 36px; background: none; padding-left: 30px; font-size: 14px; }
.marque .recherche svg { left: 6px; }
.marque .recherche input:focus { background: var(--papier-2); }
.marque #suggestions { top: 46px; left: -16px; width: calc(100% + 60px); }
.menu-bouton { width: 36px; height: 36px; }
.lentilles { position: fixed; z-index: 20; top: var(--haut); left: calc(var(--bord) + var(--larg-file) + 12px); display: flex; gap: 8px; background: none; padding: 0; }
.lentilles button { height: 40px; padding: 0 16px; border-radius: 999px; background: var(--papier); color: var(--encre); border: 1px solid var(--trait); box-shadow: var(--ombre); font-weight: 600; font-size: 14px; }
.lentilles button:hover { background: var(--papier-2); color: var(--encre); }
.lentilles button[aria-selected="true"] { background: var(--bleu-pale); color: var(--bleu); border-color: var(--bleu-clair); }
body.renovations .lentilles button[aria-selected="true"] { color: var(--lancer); background: var(--lancer-fond); border-color: transparent; }
.place-bascule { left: auto; right: var(--bord); width: auto; margin: 0; display: flex; justify-content: flex-end; gap: 8px; }
.place-bascule .bascule { grid-column: auto; }
.rejeu-entree, .capot-entree { height: 40px; }
.panneau { top: calc(var(--haut) + 48px + 10px); }
body.liste-fermee .file { transform: translateX(calc(-100% - 40px)); }
.fermer-file { top: 8px; right: 8px; width: 32px; height: 32px; }
.file .tete, .file .compte { padding-right: 44px; }
.compte b { font-size: 30px; }
.compte span { font-size: 16px; }
.bandes .cat { height: 28px; font-size: 13px; padding: 0 10px; }
.ligne { grid-template-columns: 84px 1fr; padding: 10px 10px 10px 8px; }
.ligne-indice { display: none; }
.ligne-titre { font-size: 14px; }
.ligne-lieu { font-size: 12.5px; }
.ligne > .cat[data-cat], .ligne > .cat[data-vive][data-cat], .equip li > .cat[data-cat], .equip li > .cat[data-vive][data-cat] { font-size: 12px; }
.fiche h2 { font-size: 20px; }
.fil { font-size: 13px; }
.cat.grand, .score-pilule { height: 28px; font-size: 14px; padding: 0 12px; }
.score-pilule { font-size: 15px; }
.stat-pannes b { font-size: 28px; }
.raisons li { font-size: 14px; }
.decisions button { font-size: 14px; padding: 9px 6px; }
.tuile b { font-size: 22px; }
.echelles button { font-size: 13px; padding: 6px 12px; }
.page-corps p, .page-corps li { font-size: 14.5px; }
@media (max-width: 1300px) and (min-width: 761px) {
  .lentilles { top: calc(var(--haut) + 48px + 10px); left: calc(var(--bord) + var(--larg-file) + 12px); }
  .place-bascule { top: var(--haut); left: auto; }
}
@media (max-width: 760px) {
  .marque { width: auto; right: var(--bord); padding: 0 4px 0 12px; }
  .marque-nom { position: static; background: none; box-shadow: none; padding: 0 8px 0 0; }
  .marque-nom span { font-size: 15px; }
  .outils, .marque .outils { display: flex; width: auto; left: auto; justify-content: flex-start; }
  .marque .outils .menu { display: block; }
  .lentilles { top: calc(var(--haut) + 48px + 8px); left: var(--bord); right: var(--bord); overflow-x: auto; scrollbar-width: none; }
  .lentilles button { flex: none; height: 36px; padding: 0 12px; font-size: 13px; }
  .place-bascule { top: calc(var(--haut) + 48px + 8px + 44px); right: var(--bord); }
  .capot-entree { position: static; height: 36px; }
  .file, .fiche { top: auto; }
  body.liste-fermee .file.arrive { transform: translateY(100%); }
  .file .tete { padding-top: 0; }
}

/* ── Les commandes de la carte : en bas à droite, comme un plan en ligne ── */
#carte .maplibregl-ctrl-top-left { top: auto; left: auto; bottom: 36px; right: var(--bord); }
body:not(.sans-fiche) #carte .maplibregl-ctrl-top-left { right: calc(var(--bord) + var(--larg-fiche) + 8px); }
#carte .maplibregl-ctrl-group { border-radius: 8px; border: 1px solid var(--trait); box-shadow: var(--ombre); background: var(--papier); }
#carte .maplibregl-ctrl-group button { width: 36px; height: 36px; border-radius: 0; padding: 0; }
#carte .maplibregl-ctrl-group button:hover { background: var(--papier-2); }
body.liste-fermee .echelles { left: var(--bord); }
.echelles { transition: left .6s cubic-bezier(.2, .8, .2, 1); }
@media (max-width: 1300px) and (min-width: 761px) {
  .fiche, .territoire { top: calc(var(--haut) + 48px + 10px + 40px + 8px); }
  .lentilles button { height: 36px; padding: 0 13px; font-size: 13.5px; }
}
@media (max-width: 1180px) and (min-width: 761px) {
  .echelles button { font-size: 12.5px; padding: 5px 9px; }
}

/* ── Le compte, les rôles, les animations ── */
.compte-util { position: relative; flex: none; }
.avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--papier); background: var(--bleu); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; box-shadow: var(--ombre); letter-spacing: .02em; }
.avatar:hover, .avatar[aria-expanded="true"] { background: var(--bleu-vif); }
.avatar.grand { width: 44px; height: 44px; font-size: 15px; box-shadow: none; border: 0; }
.compte-popover { position: absolute; top: 48px; right: 0; width: 320px; padding: 14px; background: var(--papier); border: 1px solid var(--trait); border-radius: 12px; box-shadow: var(--ombre); z-index: 30; display: grid; gap: 10px; text-align: left; }
.compte-tete { display: flex; gap: 10px; align-items: center; }
.compte-tete b { display: block; font-size: 15px; }
.compte-tete small { display: block; font-size: 12px; color: var(--encre-3); }
.compte-roles { display: grid; gap: 6px; border-top: 1px solid var(--trait); padding-top: 10px; }
.compte-roles button { display: grid; gap: 2px; padding: 8px 12px 8px 34px; border: 1px solid var(--trait); border-radius: 8px; background: var(--papier); text-align: left; position: relative; }
.compte-roles button::before { content: ''; position: absolute; left: 11px; top: 12px; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--sable); background: var(--papier); }
.compte-roles button[aria-checked="true"] { border-color: var(--bleu); background: var(--bleu-pale); }
.compte-roles button[aria-checked="true"]::before { border-color: var(--bleu); background: radial-gradient(circle, var(--bleu) 45%, var(--papier) 50%); }
.compte-roles b { font-size: 13.5px; }
.compte-roles small { font-size: 12px; color: var(--encre-2); line-height: 1.3; }
.compte-action { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: var(--bleu); font-weight: 600; font-size: 13.5px; text-decoration: none; text-align: left; }
.compte-action:hover { background: var(--papier-2); }
.compte-action[aria-pressed]::after { content: 'non'; font-size: 12px; color: var(--encre-3); border: 1px solid var(--trait); border-radius: 999px; padding: 1px 8px; }
.compte-action[aria-pressed="true"]::after { content: 'oui'; color: #fff; background: var(--bleu); border-color: var(--bleu); }
.compte-sortie { color: var(--encre-3); border-top: 1px solid var(--trait); border-radius: 0; margin-top: 2px; padding-top: 12px; }
body.role-direction .decisions, body.role-direction .aide-decision, body.role-direction .ajout-note, body.role-direction [data-semaine] { display: none; }
body.role-direction .compte-roles ~ [data-semaine] { display: none; }
body.sans-animation *, body.sans-animation *::before, body.sans-animation *::after { animation: none !important; transition: none !important; }
.semaine-fin { margin-left: auto; border: 0; background: none; color: var(--bleu); font-weight: 600; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.ligne-raison { grid-column: 2 / 4; font-size: 12.5px; color: var(--encre-2); margin-top: 2px; line-height: 1.3; }
.ligne-raison em { font-style: normal; color: var(--encre-3); }
.retour-terrain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: 13px; color: var(--encre-2); }
.retour-terrain button { border: 1px solid var(--bleu); color: var(--bleu); background: var(--papier); border-radius: 999px; padding: 5px 12px; font-weight: 600; font-size: 13px; }
.retour-terrain button:hover { background: var(--bleu-pale); }
.retour-terrain small { font-size: 12px; color: var(--encre-3); }
.reparer-remplacer { margin: 10px 18px 0; padding: 10px 14px; border-left: 4px solid var(--alerte-texte); background: var(--alerte-fond); border-radius: 0 8px 8px 0; font-size: 13.5px; display: grid; gap: 2px; }
.reparer-remplacer b { color: var(--alerte-texte); }
@media (max-width: 760px) { .compte-popover { width: min(320px, calc(100vw - 20px)); } }

.compte .semaine-fin { white-space: nowrap; }
body.semaine .bandes { display: none; }
.retour-terrain > span { flex-basis: 100%; }

/* ── Pannes : chaque équipement est une carte ── */
.lignes { padding: 8px 12px 22px; display: grid; gap: 10px; }
.lignes .ligne { display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 4px; padding: 14px 14px 12px; border: 1.5px solid var(--trait); border-radius: var(--rayon); background: var(--papier); }
.lignes .ligne + .ligne::before, .lignes .ligne[aria-current="true"]::after { content: none; }
.lignes .ligne:hover { background: var(--papier-2); border-color: var(--sable); }
.lignes .ligne.meme-residence { border-color: var(--sable); }
.lignes .ligne[aria-current="true"] { background: var(--bleu-pale); border-color: var(--bleu); box-shadow: inset 0 0 0 .5px var(--bleu); }
.lignes .ligne:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }
.ligne-haut { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.lignes .ligne > .ligne-haut > .cat { height: 28px; padding: 0 12px 0 10px; gap: 6px; border-radius: var(--rayon-pastille); font-size: 13px; font-weight: 600; box-shadow: none; }
.lignes .ligne > .ligne-haut > .cat[data-vive][data-cat="urgence"] { background: var(--urgent-fond); color: var(--urgent); border: 1px solid color-mix(in srgb, var(--urgent) 40%, white); }
.lignes .ligne > .ligne-haut > .cat[data-vive][data-cat="alerte"] { background: var(--alerte-fond); color: var(--alerte-texte); border: 1px solid color-mix(in srgb, var(--alerte-texte) 40%, white); }
.lignes .ligne > .ligne-haut > .cat[data-vive][data-cat="vigilance"] { background: var(--vigilance-fond); color: var(--vigilance-texte); border: 1px solid color-mix(in srgb, var(--vigilance-texte) 40%, white); }
.lignes .ligne > .ligne-haut > .cat:not([data-vive]) { background: var(--mortier); color: var(--encre-2); border: 1px solid var(--sable); }
.lignes .ligne > .ligne-haut > .cat[data-cat="decide"] { background: none; color: var(--bleu); border: 1.5px solid var(--bleu); }
.lignes .ligne > .ligne-haut > .cat svg { flex: none; }
.ligne-score { font-size: 14px; color: var(--encre-2); white-space: nowrap; }
.ligne-score b { font-weight: 700; color: var(--encre); font-size: 15px; }
.lignes .ligne-lieu { font-size: 13.5px; color: var(--encre-3); }
.lignes .ligne-titre { font-size: 15.5px; font-weight: 600; line-height: 1.3; color: var(--encre); margin: 2px 0 4px; }
.lignes .ligne[data-decide] .ligne-titre { color: var(--encre-2); }
.lignes .ligne-raison { margin: 0 0 2px; }
.ligne-bas { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 2px; }
.ligne-date { font-size: 14px; font-weight: 600; color: var(--encre); line-height: 1.3; }
.ligne-date small { display: block; font-size: 12.5px; font-weight: 400; color: var(--encre-3); }
.voir { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--bleu); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; white-space: nowrap; }
.lignes .ligne:hover .voir { color: var(--bleu-vif); }

/* ── Pannes : la tête de filtres collante (sticky) et le sélecteur de résidence ── */
.file .filtres {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--papier);
  box-shadow: 0 1px 0 var(--trait);
  padding: 10px 48px 8px 18px;
  gap: 8px 10px;
}
.file > .fermer-file {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
}
.file .defile {
  scroll-padding-top: 68px;
}
.filtres { gap: 8px 10px; padding: 10px 18px 4px; }
.filtre-residence-bloc { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 10px; border: 1.5px solid var(--trait); border-radius: var(--rayon-pastille); background: var(--papier); color: var(--encre-2); max-width: 100%; }
.filtre-residence-bloc.actif { border-color: var(--bleu); background: var(--bleu); color: var(--papier); }
.filtre-residence-bloc svg { flex: none; }
.filtre-residence { appearance: none; -webkit-appearance: none; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; font-size: 13.5px; padding: 0 18px 0 0; cursor: pointer; max-width: 100%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right center; background-size: 14px; }
.filtre-residence-bloc.actif .filtre-residence { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.filtre-residence:focus-visible { outline: none; }
.filtre-residence-bloc:focus-within { outline: 2px solid var(--bleu); outline-offset: 2px; }
.filtre-residence option { color: var(--encre); background: var(--papier); }


.portee { font-size: 12.5px; color: var(--encre-3); }
.filtres .filtre-famille { flex-basis: 100%; text-align: left; padding-left: 0; }
@media (max-width: 760px) {
  .lignes { padding: 6px 10px 22px; gap: 8px; }
  .lignes .ligne { padding: 12px 12px 10px; }
  .lignes .ligne-titre { font-size: 14.5px; }
  .ligne-date, .voir { font-size: 13px; }
  .portee { display: none; }
}

/* ── Données : la zone de dépôt et le rapport d'import ── */
.zone-depot { display: grid; justify-items: center; gap: 4px; padding: 26px 18px; margin: 12px 0 10px; border: 2px dashed var(--sable); border-radius: var(--rayon); background: var(--papier-2); color: var(--encre-2); text-align: center; cursor: pointer; transition: border-color .12s, background .12s; }
.zone-depot svg { color: var(--bleu); margin-bottom: 4px; }
.zone-depot b { font-size: 15px; color: var(--encre); }
.zone-depot span { font-size: 13px; color: var(--encre-3); }
.zone-depot:hover, .zone-depot.survol, .zone-depot:focus-within { border-color: var(--bleu); background: var(--bleu-pale); }
.retour-import { font-weight: 400; }
.rapport-titre { font-weight: 600; margin: 8px 0 4px; }
.rapport-titre.erreur { color: var(--urgent); }
.rapport { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.rapport li { padding: 6px 10px 6px 12px; border-left: 3px solid var(--sable); background: var(--papier-2); border-radius: 0 6px 6px 0; font-size: 13.5px; }
.rapport li.ok { border-left-color: var(--lancer); }
.rapport li.ignore { border-left-color: var(--alerte); color: var(--encre-2); }
