/* Cartographie IMPA : fond blanc vivant, encre ardoise, et quatre couleurs qui portent le sens (A, B, C, D). */
:root {
  --surface: #ffffff;
  --fond: #ffffff;
  --encre: #1b2330;
  --sur-encre: #ffffff;
  --texte-2: #586377;
  --texte-3: #8b94a4;
  --trait: #e5e8ee;
  --trait-fort: #cfd5df;
  --voile: rgba(255, 255, 255, 0.82);
  --voile-fort: rgba(255, 255, 255, 0.94);
  --survol: #f3f5f9;
  --a: #12a150;
  --a-pale: #e3f6ea;
  --b: #e8b100;
  --b-encre: #3d2e00;
  --b-pale: #fdf4d6;
  --c: #f2780c;
  --c-pale: #fdebdc;
  --d: #de2f2f;
  --d-pale: #fbe3e3;
  --rouge-pin: #e03131;
  --vert-pin: #15a34a;
  --ombre-douce: 0 1px 2px rgba(27, 35, 48, 0.05), 0 6px 18px rgba(27, 35, 48, 0.06);
  --ombre-haute: 0 2px 6px rgba(27, 35, 48, 0.06), 0 24px 60px rgba(27, 35, 48, 0.16);
  --titre: "Bricolage Grotesque", "Atkinson Hyperlegible", system-ui, sans-serif;
  --texte: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rayon-s: 8px;
  --rayon-m: 12px;
  --rayon-l: 18px;
  --tete: 64px;
  --fiche: min(540px, 100vw);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--fond);
  color: var(--encre);
  font: 15px/1.5 var(--texte);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: inherit; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--encre); outline-offset: 2px; border-radius: 6px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Défilement doux, barres fines */
* { scrollbar-width: thin; scrollbar-color: var(--trait-fort) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--trait-fort); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background-color: var(--texte-3); }

/* ---------- Fond blanc vivant : trois halos très pâles qui dérivent lentement ---------- */
.fond { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: var(--fond); }
.fond i { position: absolute; width: 62vmax; height: 62vmax; border-radius: 50%; filter: blur(70px); opacity: 0.75; will-change: transform; }
.fond i:nth-child(1) { background: radial-gradient(circle at 50% 50%, #e7eef8 0%, rgba(231, 238, 248, 0) 68%); top: -22vmax; left: -14vmax; animation: derive-1 78s ease-in-out infinite alternate; }
.fond i:nth-child(2) { background: radial-gradient(circle at 50% 50%, #e9f5ee 0%, rgba(233, 245, 238, 0) 66%); bottom: -26vmax; right: -18vmax; animation: derive-2 96s ease-in-out infinite alternate; }
.fond i:nth-child(3) { background: radial-gradient(circle at 50% 50%, #f3eff8 0%, rgba(243, 239, 248, 0) 64%); top: 30%; left: 38%; width: 46vmax; height: 46vmax; animation: derive-3 112s ease-in-out infinite alternate; }
@keyframes derive-1 { to { transform: translate(18vmax, 14vmax) scale(1.12); } }
@keyframes derive-2 { to { transform: translate(-16vmax, -12vmax) scale(1.08); } }
@keyframes derive-3 { 0% { transform: translate(0, 0); } 50% { transform: translate(-14vmax, 8vmax) scale(0.92); } 100% { transform: translate(10vmax, -10vmax) scale(1.06); } }

/* ---------- Marque ---------- */
.marque { display: flex; align-items: center; gap: 10px; font-family: var(--titre); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }
.marque-pin { width: 26px; height: 26px; border-radius: 8px; background: var(--encre); position: relative; flex: none; }
.marque-pin::before { content: ""; position: absolute; left: 7px; top: 4px; width: 12px; height: 12px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--a); }
.marque-pin::after { content: ""; position: absolute; left: 11px; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--surface); }
.marque-grande { font-size: 22px; }

/* ---------- Boutons ---------- */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--trait-fort); background: var(--voile-fort); font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s, transform 0.1s; }
.bouton:hover { background: var(--survol); border-color: var(--texte-3); }
.bouton:active { transform: translateY(1px); }
.bouton[disabled], .bouton[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.bouton-plein { background: var(--encre); border-color: var(--encre); color: var(--sur-encre); }
.bouton-plein:hover { background: #2b3546; border-color: #2b3546; }
.bouton-vert { background: var(--a); border-color: var(--a); color: #fff; }
.bouton-vert:hover { background: #0e8a44; border-color: #0e8a44; }
.bouton-danger { color: var(--d); border-color: #f1b9b9; }
.bouton-danger:hover { background: var(--d-pale); border-color: var(--d); }
.bouton-large { width: 100%; min-height: 46px; font-size: 15px; }
.bouton-texte { border: 0; background: none; padding: 6px 8px; color: var(--texte-2); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.bouton-icone { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--texte-2); }
.bouton-icone:hover { background: var(--survol); color: var(--encre); }
.compteur { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--encre); color: var(--sur-encre); font-size: 12px; font-weight: 700; }

.segment { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(27, 35, 48, 0.06); gap: 2px; }
.segment button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: 13.5px; color: var(--texte-2); }
.segment button[aria-checked="true"] { background: var(--surface); color: var(--encre); box-shadow: 0 1px 3px rgba(27, 35, 48, 0.12); }
.segment-petit button { padding: 5px 10px; font-size: 13px; }

/* ---------- Entrée ---------- */
.entree { position: relative; z-index: 1; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.entree-carte { width: min(400px, 100%); display: grid; gap: 18px; padding: 32px 28px; border-radius: var(--rayon-l); background: var(--voile); backdrop-filter: blur(14px); border: 1px solid var(--trait); box-shadow: var(--ombre-haute); }
.entree-texte { margin: 0; color: var(--texte-2); }
.entree-erreur { margin: 0; color: var(--d); font-weight: 700; }
.champ { display: grid; gap: 6px; }
.champ-titre { font-size: 13px; font-weight: 700; color: var(--texte-2); }
.champ input, .champ textarea, .champ select, input.saisie, textarea.saisie { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--trait-fort); background: var(--surface); }
.champ input:focus, .champ textarea:focus, textarea.saisie:focus, input.saisie:focus { outline: none; border-color: var(--encre); box-shadow: 0 0 0 3px rgba(27, 35, 48, 0.08); }

/* ---------- Application ---------- */
.appli { position: relative; z-index: 1; height: 100dvh; display: grid; grid-template-rows: var(--tete) auto 1fr; }
.tete { display: flex; align-items: center; gap: 18px; padding: 0 20px; border-bottom: 1px solid var(--trait); background: var(--voile); backdrop-filter: blur(16px); position: relative; z-index: 30; }
.cherche { flex: 1; display: flex; align-items: center; gap: 8px; max-width: 760px; }
.combo { position: relative; flex: 1; display: flex; align-items: center; }
.combo-icone { position: absolute; left: 12px; color: var(--texte-3); pointer-events: none; }
.combo input { width: 100%; height: 40px; padding: 0 12px 0 38px; border-radius: 11px; border: 1px solid var(--trait-fort); background: var(--surface); }
.combo input:focus { outline: none; border-color: var(--encre); box-shadow: 0 0 0 3px rgba(27, 35, 48, 0.08); }
.combo-petit input { padding-left: 12px; height: 38px; }
.combo-liste { position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; box-shadow: var(--ombre-haute); z-index: 60; max-height: 320px; overflow: auto; }
.combo-liste li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.combo-liste li[aria-selected="true"], .combo-liste li:hover { background: var(--survol); }
.combo-liste small { color: var(--texte-3); white-space: nowrap; }
.bouton-cibler .chevron { transition: transform 0.2s; }
.bouton-cibler[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.tete-droite { display: flex; align-items: center; gap: 10px; margin-left: auto; position: relative; }
.conso { display: grid; gap: 4px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--trait); background: var(--surface); min-width: 92px; text-align: left; }
.conso-valeur { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.conso-jauge { display: block; height: 3px; border-radius: 3px; background: var(--trait); overflow: hidden; }
.conso-jauge i { display: block; height: 100%; width: 0; background: var(--a); transition: width 0.4s; }
.pop { position: absolute; top: calc(100% + 10px); right: 0; width: 320px; padding: 16px; border-radius: var(--rayon-m); background: var(--surface); border: 1px solid var(--trait); box-shadow: var(--ombre-haute); z-index: 70; font-size: 14px; }
.pop h4 { margin: 0 0 8px; font-family: var(--titre); font-size: 15px; }
.pop table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pop td { padding: 4px 0; border-bottom: 1px solid var(--trait); }
.pop td:last-child { text-align: right; }
.pop p { margin: 8px 0 0; color: var(--texte-2); font-size: 13px; }

/* ---------- Cibler (menu déroulant) ---------- */
.cibler { position: fixed; top: calc(var(--tete) + 8px); left: 50%; transform: translateX(-50%); width: min(1040px, calc(100vw - 32px)); max-height: calc(100dvh - var(--tete) - 24px); display: grid; grid-template-rows: 1fr auto; border-radius: var(--rayon-l); background: var(--voile-fort); backdrop-filter: blur(18px); border: 1px solid var(--trait); box-shadow: var(--ombre-haute); z-index: 50; overflow: hidden; animation: deroule 0.22s ease-out; }
@keyframes deroule { from { opacity: 0; transform: translate(-50%, -8px); } }
.cibler-cadre { display: grid; grid-template-columns: 200px 1fr; min-height: 0; }
.cibler-nav { display: grid; align-content: start; gap: 2px; padding: 14px 10px; border-right: 1px solid var(--trait); }
.cibler-nav button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 9px; font-weight: 700; color: var(--texte-2); display: flex; justify-content: space-between; align-items: center; }
.cibler-nav button:hover { background: var(--survol); }
.cibler-nav button[aria-current="true"] { background: var(--encre); color: var(--sur-encre); }
.cibler-nav .compteur { background: var(--a); }
.cibler-corps { overflow: auto; padding: 18px 24px 24px; min-height: 0; overscroll-behavior: contain; }
.rubrique h3 { margin: 18px 0 8px; font-family: var(--titre); font-size: 16px; font-weight: 700; }
.rubrique h3:first-child { margin-top: 0; }
.rubrique h4 { margin: 14px 0 6px; font-size: 13px; color: var(--texte-2); }
.aide { margin: 0 0 10px; color: var(--texte-2); font-size: 13.5px; max-width: 70ch; }
.grille-cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.grille-serree { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); margin-top: 10px; }
.grille-large { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.case { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--trait); background: var(--surface); cursor: pointer; font-size: 14px; user-select: none; transition: border-color 0.12s, background 0.12s; }
.case:hover { border-color: var(--trait-fort); }
.case input { appearance: none; width: 18px; height: 18px; margin: 0; border-radius: 5px; border: 1.6px solid var(--trait-fort); display: grid; place-items: center; flex: none; background: var(--surface); }
.case input::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--sur-encre); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.case input:checked { background: var(--encre); border-color: var(--encre); }
.case input:checked::after { opacity: 1; }
.case:has(input:checked) { border-color: var(--encre); background: #f7f8fb; }
.case small { margin-left: auto; color: var(--texte-3); font-size: 12px; }
.pilier-bloc { border: 1px solid var(--trait); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: var(--surface); }
.pilier-bloc .case { border: 0; padding: 4px 0; background: none; font-weight: 700; }
.pilier-paliers { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px 27px; }
.pilier-paliers .case { border: 1px solid var(--trait); padding: 5px 9px; font-weight: 400; font-size: 13px; background: var(--surface); }
.page-titre { margin: 16px 0 8px; font-size: 12.5px; color: var(--texte-3); font-weight: 700; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.puce { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 20px; background: var(--encre); color: var(--sur-encre); font-size: 13px; font-weight: 700; }
.puce button { border: 0; background: rgba(255, 255, 255, 0.18); color: var(--sur-encre); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.puce button svg { width: 12px; height: 12px; }
.rayon-point { display: grid; gap: 8px; margin-top: 10px; max-width: 520px; }
.point-choisi { margin: 0; font-size: 13.5px; color: var(--texte-2); }
.point-choisi strong { color: var(--encre); }
.cibler-pied { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--trait); background: var(--surface); }
.cibler-resume { margin: 0 auto 0 0; color: var(--texte-2); font-size: 13.5px; }

/* ---------- Onglets ---------- */
.onglets { display: flex; align-items: center; gap: 4px; padding: 8px 20px 0; position: relative; z-index: 5; }
.onglets button { border: 0; background: none; padding: 8px 12px; border-radius: 9px; font-weight: 700; color: var(--texte-2); display: inline-flex; gap: 8px; align-items: center; }
.onglets button:hover { background: var(--survol); color: var(--encre); }
.onglets button[aria-current="page"] { color: var(--encre); background: rgba(27, 35, 48, 0.06); }
.onglets-info { margin-left: auto; font-size: 13px; color: var(--texte-2); }

/* ---------- Vue Prospection ---------- */
.vue { min-height: 0; display: grid; grid-template-rows: auto 1fr; position: relative; z-index: 2; }
.barre { display: grid; gap: 10px; padding: 10px 20px 12px; }
.spectre { display: flex; height: 40px; border-radius: 12px; overflow: hidden; background: rgba(27, 35, 48, 0.05); gap: 2px; padding: 2px; }
.spectre button { position: relative; border: 0; min-width: 72px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 10px; color: #fff; font-weight: 700; transition: flex-grow 0.5s cubic-bezier(.2, .8, .2, 1), opacity 0.15s, filter 0.15s; overflow: hidden; }
.spectre button .lettre-g { font-family: var(--titre); font-size: 20px; font-weight: 800; line-height: 1; }
.spectre button .n { font-size: 13px; font-variant-numeric: tabular-nums; opacity: 0.92; }
.spectre button[data-lettre="A"] { background: var(--a); }
.spectre button[data-lettre="B"] { background: var(--b); color: var(--b-encre); }
.spectre button[data-lettre="C"] { background: var(--c); }
.spectre button[data-lettre="D"] { background: var(--d); }
.spectre.filtre button[aria-pressed="false"] { opacity: 0.28; filter: saturate(0.4); }
.spectre button:hover { filter: brightness(1.05); }
.spectre-vide { flex: 1; display: flex; align-items: center; padding: 0 14px; color: var(--texte-2); font-size: 14px; }
.barre-outils { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filtre-texte { flex: 1; min-width: 200px; position: relative; display: flex; align-items: center; }
.filtre-texte svg { position: absolute; left: 11px; color: var(--texte-3); }
.filtre-texte input { width: 100%; height: 36px; padding: 0 12px 0 34px; border-radius: 10px; border: 1px solid var(--trait); background: var(--voile-fort); }
.filtre-texte input:focus { outline: none; border-color: var(--encre); }
.tri { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--texte-2); font-weight: 700; }
.tri select { height: 36px; border-radius: 10px; border: 1px solid var(--trait); background: var(--surface); padding: 0 28px 0 10px; color: var(--encre); font-weight: 700; }

.plan { min-height: 0; display: grid; grid-template-columns: minmax(380px, 460px) 1fr; gap: 0; border-top: 1px solid var(--trait); }
.plan[data-vue="liste"] { grid-template-columns: 1fr; }
.plan[data-vue="liste"] .carte-zone { display: none; }
.plan[data-vue="liste"] .liste { max-width: 920px; margin: 0 auto; width: 100%; }
.plan[data-vue="carte"] { grid-template-columns: 1fr; }
.plan[data-vue="carte"] .liste-zone { display: none; }
.liste-zone { position: relative; min-height: 0; overflow: auto; border-right: 1px solid var(--trait); scroll-behavior: smooth; overscroll-behavior: contain; }
.liste-tete { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--voile-fort); backdrop-filter: blur(10px); border-bottom: 1px solid var(--trait); font-size: 13px; color: var(--texte-2); }
.liste-tete .case { border: 0; padding: 0; background: none; font-weight: 700; color: var(--encre); }
.liste-tete .message { margin-left: auto; text-align: right; }
.liste { display: grid; gap: 8px; padding: 10px 12px 120px; }
.liste-pied { padding: 0 16px 140px; text-align: center; color: var(--texte-2); }
.vide { padding: 48px 24px; text-align: center; color: var(--texte-2); max-width: 46ch; margin: 0 auto; }
.vide h3 { font-family: var(--titre); color: var(--encre); font-size: 20px; margin: 0 0 8px; }
.remonter { position: sticky; bottom: 92px; margin-left: auto; margin-right: 14px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--trait-fort); background: var(--surface); box-shadow: var(--ombre-douce); float: right; z-index: 4; }

/* Carte de structure */
.st { position: relative; display: grid; grid-template-columns: 44px 1fr auto; gap: 4px 12px; padding: 12px 12px 12px 12px; border-radius: var(--rayon-m); background: var(--voile-fort); border: 1px solid var(--trait); cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; content-visibility: auto; contain-intrinsic-size: 0 118px; }
.st:hover { border-color: var(--trait-fort); box-shadow: var(--ombre-douce); }
.st[aria-current="true"] { border-color: var(--encre); box-shadow: 0 0 0 1px var(--encre), var(--ombre-douce); }
.st.fait { background: linear-gradient(90deg, rgba(21, 163, 74, 0.06), rgba(255, 255, 255, 0.94) 40%); }
.st-lettre { grid-row: span 3; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-family: var(--titre); font-weight: 800; font-size: 24px; color: #fff; }
.l-A { background: var(--a); }
.l-B { background: var(--b); color: var(--b-encre) !important; }
.l-C { background: var(--c); }
.l-D { background: var(--d); }
.st-nom { margin: 0; font-family: var(--titre); font-size: 16px; font-weight: 700; line-height: 1.25; letter-spacing: -0.005em; overflow-wrap: anywhere; }
.st-meta { margin: 0; color: var(--texte-2); font-size: 13.5px; }
.st-mail { margin: 2px 0 0; font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; }
.st-mail.absent { font-weight: 400; color: var(--texte-3); font-size: 13.5px; }
.st-infos { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--texte-2); font-size: 13px; }
.st-actions { grid-row: 1 / 3; grid-column: 3; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.st-select { width: 22px; height: 22px; accent-color: var(--encre); margin: 2px; cursor: pointer; }
.fait-bouton { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 6px; border-radius: 20px; border: 1px solid var(--trait-fort); background: var(--surface); font-size: 12.5px; font-weight: 700; color: var(--texte-2); white-space: nowrap; }
.fait-bouton svg { width: 14px; height: 14px; }
.fait-bouton[aria-pressed="true"] { background: var(--vert-pin); border-color: var(--vert-pin); color: #fff; }
.palier-tag { display: inline-flex; gap: 6px; align-items: baseline; font-size: 12.5px; color: var(--encre); font-weight: 700; }
.palier-tag span { color: var(--texte-2); font-weight: 400; }

/* Carte géographique */
.carte-zone { position: relative; min-height: 0; }
#carte { position: absolute; inset: 0; background: #f4f6f9; }
.legende { position: absolute; left: 12px; bottom: 14px; z-index: 500; display: flex; gap: 12px; padding: 7px 12px; border-radius: 20px; background: var(--voile-fort); border: 1px solid var(--trait); font-size: 12.5px; color: var(--texte-2); box-shadow: var(--ombre-douce); }
.legende span { display: inline-flex; gap: 6px; align-items: center; }
.pt { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pt-rouge { background: var(--rouge-pin); }
.pt-vert { background: var(--vert-pin); }
.pt-encre { background: var(--encre); }
.carte-absente { position: absolute; inset: auto 16px 60px; z-index: 501; padding: 12px 14px; background: var(--surface); border-radius: 10px; border: 1px solid var(--trait); }
.epingle { background: none; border: 0; }
.epingle svg { width: 26px; height: 34px; stroke: none; filter: drop-shadow(0 2px 2px rgba(27, 35, 48, 0.25)); transition: transform 0.15s; transform-origin: 50% 100%; }
.epingle:hover svg { transform: scale(1.15); }
.epingle.ouverte svg { transform: scale(1.3); }
.grappe { background: none; }
.grappe div { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--encre); box-shadow: 0 2px 8px rgba(27, 35, 48, 0.25); }
.grappe span { display: grid; place-items: center; width: calc(100% - 8px); height: calc(100% - 8px); border-radius: 50%; background: var(--surface); }
.leaflet-container { font: 13px/1.4 var(--texte); }
.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-control-attribution { font-size: 10.5px; }

/* Barre de sélection */
.lot { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; border-radius: 16px; background: var(--encre); color: var(--sur-encre); box-shadow: var(--ombre-haute); max-width: calc(100vw - 24px); animation: monte 0.2s ease-out; }
@keyframes monte { from { opacity: 0; transform: translate(-50%, 10px); } }
.lot-texte { margin: 0; white-space: nowrap; }
.lot-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lot .bouton { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); color: var(--sur-encre); min-height: 34px; }
.lot .bouton:hover { background: rgba(255, 255, 255, 0.18); }
.lot .bouton-plein { background: var(--surface); color: var(--encre); border-color: var(--sur-encre); }
.lot .bouton-texte { color: rgba(255, 255, 255, 0.75); }

/* ---------- Fiche ---------- */
.fiche { position: fixed; top: 0; right: 0; bottom: 0; width: var(--fiche); z-index: 45; background: var(--voile-fort); backdrop-filter: blur(22px); border-left: 1px solid var(--trait); box-shadow: var(--ombre-haute); transform: translateX(104%); transition: transform 0.32s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; }
.fiche.ouverte { transform: translateX(0); }
.fiche-defile { overflow: auto; flex: 1; scroll-behavior: smooth; overscroll-behavior: contain; padding-bottom: 60px; }
.fiche-tete { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: 64px 1fr auto; gap: 6px 14px; padding: 18px 20px 14px; background: var(--voile-fort); backdrop-filter: blur(16px); border-bottom: 1px solid var(--trait); }
.fiche-lettre { grid-row: span 2; width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-family: var(--titre); font-size: 38px; font-weight: 800; color: #fff; }
.fiche-nom { margin: 0; font-family: var(--titre); font-size: 21px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.fiche-sous { margin: 2px 0 0; color: var(--texte-2); font-size: 14px; }
.fiche-fermer { grid-row: 1; grid-column: 3; }
.fiche-boutons { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 20px 14px; border-bottom: 1px solid var(--trait); }
.fiche-boutons .bouton { min-height: 34px; font-size: 13.5px; }
.statut-pastille { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 20px; font-size: 12.5px; font-weight: 700; background: var(--survol); color: var(--texte-2); }
.statut-pastille.fait { background: var(--a-pale); color: #0b7a3a; }
.statut-pastille.bloque { background: var(--d-pale); color: #a61d1d; }
.bloc { padding: 18px 20px; border-bottom: 1px solid var(--trait); }
.bloc > h3 { margin: 0 0 12px; font-family: var(--titre); font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.bloc > h3 small { font-family: var(--texte); font-weight: 400; font-size: 12.5px; color: var(--texte-3); }
.contact-mail { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--trait); }
.contact-mail a { font-weight: 700; font-size: 16.5px; text-decoration: none; overflow-wrap: anywhere; }
.contact-mail.absent { color: var(--texte-2); font-size: 14px; background: var(--survol); border-style: dashed; }
.source { margin: 6px 2px 0; font-size: 12.5px; color: var(--texte-3); overflow-wrap: anywhere; }
.lignes { display: grid; gap: 8px; margin-top: 12px; font-size: 14px; }
.ligne { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.ligne dt { color: var(--texte-3); }
.ligne dd { margin: 0; overflow-wrap: anywhere; }
.ligne a { text-underline-offset: 3px; }
.palier-carte { display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--trait); }
.palier-carte .code { font-family: var(--titre); font-size: 13px; font-weight: 700; color: var(--texte-2); }
.palier-carte .nom { font-family: var(--titre); font-size: 19px; font-weight: 700; margin: 0; }
.palier-carte .livre { margin: 4px 0 0; color: var(--texte-2); font-size: 14px; }
.palier-carte .prix { display: flex; gap: 14px; font-size: 13.5px; font-weight: 700; margin-top: 6px; }
.palier-alt { margin: 10px 2px 0; font-size: 13.5px; color: var(--texte-2); }
.pourquoi { margin: 12px 2px 0; font-size: 14px; }
.source-analyse { display: inline-flex; padding: 2px 8px; border-radius: 20px; background: var(--survol); font-size: 12px; font-weight: 700; color: var(--texte-2); }
.source-analyse.claude { background: #eef1ff; color: #3341a8; }
.arguments { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.arguments li { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: baseline; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--trait); font-weight: 700; }
.arguments li em { font-style: normal; font-weight: 700; font-size: 12.5px; }
.arguments li[data-force="fort"] { border-left: 4px solid var(--a); }
.arguments li[data-force="fort"] em { color: #0b7a3a; }
.arguments li[data-force="moyen"] { border-left: 4px solid var(--b); }
.arguments li[data-force="moyen"] em { color: #8a6a00; }
.arguments li[data-force="faible"] { border-left: 4px solid var(--c); }
.arguments li[data-force="faible"] em { color: #b35500; }
.trame { margin: 0; padding: 0; list-style: none; counter-reset: etape; display: grid; gap: 0; }
.trame li { counter-increment: etape; display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 7px 0; position: relative; font-size: 14px; }
.trame li::before { content: counter(etape); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--encre); font-size: 12px; font-weight: 700; background: var(--surface); position: relative; z-index: 1; }
.trame li:not(:last-child)::after { content: ""; position: absolute; left: 11.5px; top: 31px; bottom: -7px; width: 1.5px; background: var(--trait-fort); }
.imperatifs { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
details.objections { margin-top: 12px; font-size: 14px; }
details.objections summary { cursor: pointer; font-weight: 700; color: var(--texte-2); }
details.objections dl { margin: 10px 0 0; display: grid; gap: 10px; }
details.objections dt { font-weight: 700; }
details.objections dd { margin: 2px 0 0; color: var(--texte-2); }

/* Mail */
.mail-types { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.mail-types button { border: 1px solid var(--trait); background: var(--surface); border-radius: 9px; padding: 6px 11px; font-weight: 700; font-size: 13px; color: var(--texte-2); }
.mail-types button[aria-pressed="true"] { background: var(--encre); color: var(--sur-encre); border-color: var(--encre); }
.mail-types button .pt { width: 7px; height: 7px; margin-left: 6px; vertical-align: middle; }
.mail-reglages { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.mail-reglages textarea { min-height: 54px; resize: vertical; }
.modele-choix { display: grid; gap: 4px; font-size: 13px; color: var(--texte-2); font-weight: 700; }
.modele-choix select { height: 38px; border-radius: 10px; border: 1px solid var(--trait-fort); padding: 0 8px; background: var(--surface); color: var(--encre); font-weight: 700; }
.apercu { margin-top: 12px; border-radius: 14px; border: 1px solid var(--trait); background: var(--surface); overflow: hidden; }
.apercu-tete { padding: 10px 14px; border-bottom: 1px solid var(--trait); font-size: 13.5px; display: grid; gap: 2px; }
.apercu-tete span { color: var(--texte-3); }
.apercu-tete strong { font-size: 15px; }
.apercu iframe { display: block; width: 100%; border: 0; min-height: 300px; background: var(--surface); }
.apercu-vide { padding: 28px 18px; text-align: center; color: var(--texte-2); font-size: 14px; }
.edition { display: grid; gap: 8px; margin-top: 12px; }
.edition textarea { min-height: 240px; resize: vertical; font-size: 14px; line-height: 1.55; }
.controles { margin: 12px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 13px; }
.controles li { display: flex; gap: 6px; align-items: baseline; }
.controles li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--a); flex: none; transform: translateY(-1px); }
.controles li.ko { color: #a61d1d; font-weight: 700; }
.controles li.ko::before { background: var(--d); }
.mail-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.mail-etat { margin: 10px 0 0; font-size: 13.5px; color: var(--texte-2); }
.mail-etat.ok { color: #0b7a3a; font-weight: 700; }
.mail-etat.ko { color: #a61d1d; font-weight: 700; }
.cout { font-size: 12.5px; color: var(--texte-3); font-weight: 400; }

/* Suivi */
.suivi-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.suivi-grille select { height: 38px; }
.chaleurs { display: flex; gap: 6px; }
.chaleurs button { flex: 1; border: 1px solid var(--trait); background: var(--surface); border-radius: 9px; padding: 7px 4px; font-weight: 700; font-size: 13px; color: var(--texte-2); }
.chaleurs button[aria-pressed="true"][data-chaleur="fort"] { background: var(--a); border-color: var(--a); color: #fff; }
.chaleurs button[aria-pressed="true"][data-chaleur="moyen"] { background: var(--b); border-color: var(--b); color: var(--b-encre); }
.chaleurs button[aria-pressed="true"][data-chaleur="faible"] { background: var(--c); border-color: var(--c); color: #fff; }
.ajout-contact { display: grid; grid-template-columns: 130px 1fr auto; gap: 8px; margin-top: 12px; }
.ajout-contact select, .ajout-contact input { height: 38px; border-radius: 10px; border: 1px solid var(--trait-fort); padding: 0 10px; background: var(--surface); }
.chrono { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.chrono li { display: grid; grid-template-columns: 90px 1fr; gap: 10px; font-size: 13.5px; }
.chrono time { color: var(--texte-3); font-variant-numeric: tabular-nums; }
.chrono strong { display: block; }
.detail-note { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.detail-note td { padding: 5px 0; border-bottom: 1px solid var(--trait); vertical-align: top; }
.detail-note td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; padding-left: 10px; }
.ajout-email { display: grid; gap: 8px; margin-top: 10px; }
.ajout-email summary { cursor: pointer; font-size: 13.5px; color: var(--texte-2); font-weight: 700; }
.ajout-email-champs { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 8px; }
.ajout-email-champs input { height: 38px; border-radius: 10px; border: 1px solid var(--trait-fort); padding: 0 10px; }

/* ---------- Pages Historique et File ---------- */
.vue-page { grid-template-rows: auto 1fr; overflow: auto; padding: 0 20px 40px; }
.page-tete { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; padding: 16px 0; }
.page-tete h2 { margin: 0; font-family: var(--titre); font-size: 24px; letter-spacing: -0.01em; }
.page-filtres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-filtres .filtre-texte input { padding-left: 12px; }
.histo, .file-liste { display: grid; gap: 6px; align-content: start; }
.histo-ligne, .file-ligne { display: grid; grid-template-columns: 40px minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--voile-fort); border: 1px solid var(--trait); text-align: left; width: 100%; }
.histo-ligne:hover { border-color: var(--trait-fort); box-shadow: var(--ombre-douce); }
.histo-ligne .st-lettre { grid-row: auto; width: 36px; height: 36px; font-size: 19px; border-radius: 10px; }
.histo-ligne .l-vide { background: var(--trait); color: var(--texte-2); }
.histo-ligne small, .file-ligne small { display: block; color: var(--texte-2); font-size: 12.5px; }
.file-resume { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.file-resume div { padding: 12px 16px; border-radius: 12px; background: var(--voile-fort); border: 1px solid var(--trait); min-width: 160px; }
.file-resume strong { display: block; font-family: var(--titre); font-size: 22px; }
.file-resume span { color: var(--texte-2); font-size: 13px; }
.file-message { width: 100%; margin: 0; padding: 10px 14px; border-radius: 10px; background: #fff7e0; border: 1px solid #f3dc97; font-size: 14px; }
.file-ligne { grid-template-columns: 110px minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr); }
.etiquette { display: inline-flex; padding: 2px 9px; border-radius: 20px; font-size: 12.5px; font-weight: 700; background: var(--survol); color: var(--texte-2); }
.etiquette.envoye { background: var(--a-pale); color: #0b7a3a; }
.etiquette.erreur, .etiquette.annule { background: var(--d-pale); color: #a61d1d; }
.etiquette.en_attente, .etiquette.envoi_en_cours { background: var(--b-pale); color: #6b5200; }

/* ---------- Messages ---------- */
.toasts { position: fixed; left: 16px; bottom: 16px; z-index: 90; display: grid; gap: 8px; max-width: min(440px, calc(100vw - 32px)); }
.toast { padding: 12px 14px; border-radius: 12px; background: var(--encre); color: var(--sur-encre); box-shadow: var(--ombre-haute); font-size: 14px; animation: monte-t 0.2s ease-out; }
.toast.erreur { background: #8f1d1d; color: #fff; }
.toast.ok { background: #0b7a3a; color: #fff; }
@keyframes monte-t { from { opacity: 0; transform: translateY(8px); } }
.chargement { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: tourne 0.7s linear infinite; vertical-align: -2px; }
@keyframes tourne { to { transform: rotate(360deg); } }
.squelette { height: 104px; border-radius: var(--rayon-m); background: linear-gradient(90deg, #f1f3f7 0%, #f8f9fb 50%, #f1f3f7 100%); background-size: 200% 100%; animation: luit 1.4s ease-in-out infinite; }
@keyframes luit { to { background-position: -200% 0; } }

/* ---------- Écrans moyens ---------- */
@media (max-width: 1180px) {
  .plan { grid-template-columns: minmax(340px, 400px) 1fr; }
  .tete { gap: 12px; padding: 0 14px; }
  .marque-nom { display: none; }
}

/* ---------- Téléphone ---------- */
@media (max-width: 820px) {
  :root { --tete: auto; }
  body { overflow: auto; }
  .appli { height: auto; min-height: 100dvh; grid-template-rows: auto auto 1fr; }
  .tete { flex-wrap: wrap; padding: 10px 16px; gap: 10px; position: sticky; top: 0; }
  .marque-nom { display: inline; }
  .cherche { order: 3; flex-basis: 100%; max-width: none; flex-wrap: wrap; }
  .cherche .combo { flex-basis: 100%; }
  .cherche .bouton { flex: 1; }
  .tete-droite { gap: 6px; }
  .tete-droite .segment button { padding: 5px 8px; }
  .conso { min-width: 0; }
  .onglets { padding: 8px 16px 0; overflow-x: auto; }
  .onglets-info { display: none; }
  .barre { padding: 10px 16px; }
  .spectre button { min-width: 52px; padding: 0 8px; }
  .plan, .plan[data-vue="deux"] { grid-template-columns: 1fr; grid-template-rows: auto; }
  .plan[data-vue="deux"] .carte-zone { display: none; }
  .plan[data-vue="carte"] .carte-zone { display: block; height: 70dvh; }
  .liste-zone { overflow: visible; border-right: 0; }
  .liste { padding: 10px 16px 140px; }
  .st { grid-template-columns: 40px 1fr auto; }
  .st-lettre { width: 40px; height: 40px; font-size: 22px; }
  .cibler { top: 8px; width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .cibler-cadre { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .cibler-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--trait); padding: 8px; }
  .cibler-nav button { white-space: nowrap; }
  .cibler-corps { padding: 14px 16px 20px; }
  .cibler-pied { flex-wrap: wrap; }
  .cibler-resume { flex-basis: 100%; }
  .lot { left: 8px; right: 8px; transform: none; bottom: 8px; flex-direction: column; align-items: stretch; gap: 8px; animation: none; }
  .lot-actions .bouton { flex: 1; }
  .fiche { width: 100vw; }
  .fiche-tete { grid-template-columns: 52px 1fr auto; padding: 14px 16px 12px; }
  .fiche-lettre { width: 52px; height: 52px; font-size: 30px; }
  .bloc { padding: 16px; }
  .ligne { grid-template-columns: 100px 1fr; }
  .controles { grid-template-columns: 1fr; }
  .mail-reglages { grid-template-columns: 1fr; }
  .ajout-contact, .ajout-email-champs { grid-template-columns: 1fr; }
  .suivi-grille { grid-template-columns: 1fr; }
  .histo-ligne { grid-template-columns: 36px 1fr; }
  .histo-ligne > :nth-child(n + 3) { grid-column: 2; }
  .file-ligne { grid-template-columns: 1fr; }
  .vue-page { padding: 0 16px 40px; overflow: visible; }
  .remonter { bottom: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  html, .liste-zone, .fiche-defile { scroll-behavior: auto; }
  .fond i, .squelette, .chargement { animation: none !important; }
  .fiche, .spectre button, .cibler, .lot, .toast { transition: none !important; animation: none !important; }
}

/* Ajustements : bandeau vide du spectre, onglets sur une ligne, pied du menu Cibler sur téléphone */
.spectre:has(.spectre-vide) { height: auto; min-height: 40px; padding: 8px 4px; }
.onglets button { white-space: nowrap; }
@media (max-width: 820px) {
  .cibler-pied .bouton { flex: 1; }
  .tri { flex: 1; }
  .tri select { flex: 1; }
}
/* La barre de sélection passe au-dessus de la carte (Leaflet monte jusqu'à 1000). */
.lot { z-index: 1100; width: max-content; }
.lot-actions { flex-wrap: nowrap; }
@media (max-width: 1180px) { .lot-actions { flex-wrap: wrap; } .lot { width: auto; } }
@media (max-width: 820px) { .lot { width: auto; } }

/* Leads chauds du site (/combien) */
.etiquette.lead { background: var(--a-pale); color: #0b7a3a; margin-left: 6px; }
.bloc-lead { border-left: 4px solid #16A34A; }
.lead-resume { white-space: pre-wrap; font: inherit; font-size: 13px; color: var(--texte-2); margin: 8px 0 0; }
/* Parrain de métier (16/10) */
.parrainage { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
@media (max-width: 720px) { .parrainage { grid-template-columns: 1fr; } }
.etiquette.parrain { background: var(--b-pale); color: #6b5200; margin-left: 6px; }
ul.filleuls { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
ul.filleuls .lien { background: none; border: 0; padding: 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }


/* Encadré de chaque structure à la couleur de sa lettre : A vert, B jaune, C orange, D rouge. */
.st.t-A { border: 2px solid var(--a); border-left-width: 6px; }
.st.t-B { border: 2px solid var(--b); border-left-width: 6px; }
.st.t-C { border: 2px solid var(--c); border-left-width: 6px; }
.st.t-D { border: 2px solid var(--d); border-left-width: 6px; }
.epingle.faite svg { opacity: 0.9; }

/* Thème sombre : automatique selon l'appareil, ou choisi avec le bouton. */
:root[data-theme="sombre"] { --surface: #1a2230; --fond: #0f141c; --encre: #e8edf5; --sur-encre: #0f141c; --trait: #2a3342; --trait-fort: #3a4558; --voile: rgba(15, 20, 28, 0.82); --voile-fort: rgba(20, 26, 36, 0.96); --survol: #1a2230; --texte-2: #b3bdcc; --texte-3: #8794a8; --a-pale: #0f2a1b; --b-pale: #2e2608; --c-pale: #301c0a; --d-pale: #321212; color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) { --surface: #1a2230; --fond: #0f141c; --encre: #e8edf5; --sur-encre: #0f141c; --trait: #2a3342; --trait-fort: #3a4558; --voile: rgba(15, 20, 28, 0.82); --voile-fort: rgba(20, 26, 36, 0.96); --survol: #1a2230; --texte-2: #b3bdcc; --texte-3: #8794a8; --a-pale: #0f2a1b; --b-pale: #2e2608; --c-pale: #301c0a; --d-pale: #321212; color-scheme: dark; }
  :root:not([data-theme="clair"]) .leaflet-tile-pane > .leaflet-layer:first-child { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9); }
}
:root[data-theme="sombre"] body { background: var(--fond); color: var(--encre); }
:root[data-theme="sombre"] .leaflet-tile-pane > .leaflet-layer:first-child { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9); }

.tete-outils { display: inline-flex; gap: 12px; margin-left: auto; flex-wrap: wrap; }


/* Thème sombre : contrastes corrigés (boutons, champs, menus, barre du bas). */
:root[data-theme="sombre"] .bouton-plein, :root[data-theme="sombre"] .compteur, :root[data-theme="sombre"] .puce, :root[data-theme="sombre"] .cibler-nav button[aria-current="true"], :root[data-theme="sombre"] .marque-pin { background: #e8edf5; border-color: #e8edf5; color: #0f141c; }
:root[data-theme="sombre"] .marque-pin::after { background: #0f141c; }
:root[data-theme="sombre"] .case input:checked { background: #e8edf5; border-color: #e8edf5; }
:root[data-theme="sombre"] .segment button[aria-checked="true"] { background: #e8edf5; color: #0f141c; box-shadow: none; }
:root[data-theme="sombre"] .champ input, :root[data-theme="sombre"] .champ textarea, :root[data-theme="sombre"] .champ select, :root[data-theme="sombre"] input.saisie, :root[data-theme="sombre"] textarea.saisie, :root[data-theme="sombre"] .combo input, :root[data-theme="sombre"] .combo-liste, :root[data-theme="sombre"] .conso, :root[data-theme="sombre"] .pop, :root[data-theme="sombre"] .case, :root[data-theme="sombre"] .case input, :root[data-theme="sombre"] .pilier-bloc, :root[data-theme="sombre"] .pilier-paliers .case, :root[data-theme="sombre"] .cibler-pied, :root[data-theme="sombre"] .tri select, :root[data-theme="sombre"] .remonter, :root[data-theme="sombre"] .fait-bouton, :root[data-theme="sombre"] .carte-absente, :root[data-theme="sombre"] .grappe span { background: #1a2230; color: #e8edf5; border-color: #3a4558; }
:root[data-theme="sombre"] input::placeholder, :root[data-theme="sombre"] textarea::placeholder { color: #8794a8; }
:root[data-theme="sombre"] .lot { background: #e8edf5; color: #0f141c; }
:root[data-theme="sombre"] .lot .bouton-plein { background: #0f141c; color: #e8edf5; border-color: #0f141c; }
:root[data-theme="sombre"] .st.fait { background: linear-gradient(90deg, rgba(21, 163, 74, 0.14), rgba(20, 26, 36, 0.96) 40%); }
:root[data-theme="sombre"] .fond i { opacity: 0.06; }
:root[data-theme="sombre"] .bouton:disabled, :root[data-theme="sombre"] button:disabled { opacity: 0.45; }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="clair"]) .bouton-plein, :root:not([data-theme="clair"]) .compteur, :root:not([data-theme="clair"]) .puce, :root:not([data-theme="clair"]) .cibler-nav button[aria-current="true"], :root:not([data-theme="clair"]) .marque-pin { background: #e8edf5; border-color: #e8edf5; color: #0f141c; }
:root:not([data-theme="clair"]) .marque-pin::after { background: #0f141c; }
:root:not([data-theme="clair"]) .case input:checked { background: #e8edf5; border-color: #e8edf5; }
:root:not([data-theme="clair"]) .segment button[aria-checked="true"] { background: #e8edf5; color: #0f141c; box-shadow: none; }
:root:not([data-theme="clair"]) .champ input, :root:not([data-theme="clair"]) .champ textarea, :root:not([data-theme="clair"]) .champ select, :root:not([data-theme="clair"]) input.saisie, :root:not([data-theme="clair"]) textarea.saisie, :root:not([data-theme="clair"]) .combo input, :root:not([data-theme="clair"]) .combo-liste, :root:not([data-theme="clair"]) .conso, :root:not([data-theme="clair"]) .pop, :root:not([data-theme="clair"]) .case, :root:not([data-theme="clair"]) .case input, :root:not([data-theme="clair"]) .pilier-bloc, :root:not([data-theme="clair"]) .pilier-paliers .case, :root:not([data-theme="clair"]) .cibler-pied, :root:not([data-theme="clair"]) .tri select, :root:not([data-theme="clair"]) .remonter, :root:not([data-theme="clair"]) .fait-bouton, :root:not([data-theme="clair"]) .carte-absente, :root:not([data-theme="clair"]) .grappe span { background: #1a2230; color: #e8edf5; border-color: #3a4558; }
:root:not([data-theme="clair"]) input::placeholder, :root:not([data-theme="clair"]) textarea::placeholder { color: #8794a8; }
:root:not([data-theme="clair"]) .lot { background: #e8edf5; color: #0f141c; }
:root:not([data-theme="clair"]) .lot .bouton-plein { background: #0f141c; color: #e8edf5; border-color: #0f141c; }
:root:not([data-theme="clair"]) .st.fait { background: linear-gradient(90deg, rgba(21, 163, 74, 0.14), rgba(20, 26, 36, 0.96) 40%); }
:root:not([data-theme="clair"]) .fond i { opacity: 0.06; }
:root:not([data-theme="clair"]) .bouton:disabled, :root:not([data-theme="clair"]) button:disabled { opacity: 0.45; }
}


/* Thème sombre : dernières zones claires. */
:root[data-theme="sombre"] .case:has(input:checked) { background: #232c3b; }
:root[data-theme="sombre"] #carte { background: #0f141c; }
:root[data-theme="sombre"] .source-analyse.claude { background: #1d2347; color: #b9c2ff; }
:root[data-theme="sombre"] .file-message { background: #2e2608; border-color: #6b5512; color: #f5e6b0; }
:root[data-theme="sombre"] .lot .bouton { background: rgba(15, 20, 28, 0.08); border-color: rgba(15, 20, 28, 0.25); color: #0f141c; }
:root[data-theme="sombre"] .lot .bouton:hover { background: rgba(15, 20, 28, 0.16); }
:root[data-theme="sombre"] .puce button { background: rgba(15, 20, 28, 0.15); color: #0f141c; }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="clair"]) .case:has(input:checked) { background: #232c3b; }
:root:not([data-theme="clair"]) #carte { background: #0f141c; }
:root:not([data-theme="clair"]) .source-analyse.claude { background: #1d2347; color: #b9c2ff; }
:root:not([data-theme="clair"]) .file-message { background: #2e2608; border-color: #6b5512; color: #f5e6b0; }
:root:not([data-theme="clair"]) .lot .bouton { background: rgba(15, 20, 28, 0.08); border-color: rgba(15, 20, 28, 0.25); color: #0f141c; }
:root:not([data-theme="clair"]) .lot .bouton:hover { background: rgba(15, 20, 28, 0.16); }
:root:not([data-theme="clair"]) .puce button { background: rgba(15, 20, 28, 0.15); color: #0f141c; }
}

/* 18/10 : texte sur fond « encre » toujours contrasté (variable --sur-encre), popups de carte lisibles en sombre. */
:root[data-theme="sombre"] .leaflet-popup-content-wrapper, :root[data-theme="sombre"] .leaflet-popup-tip, :root[data-theme="sombre"] .leaflet-tooltip { background: #1a2230; color: #e8edf5; border-color: #3a4558; }
:root[data-theme="sombre"] .leaflet-bar a { background: #1a2230; color: #e8edf5; border-color: #3a4558; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) .leaflet-popup-content-wrapper, :root:not([data-theme="clair"]) .leaflet-popup-tip, :root:not([data-theme="clair"]) .leaflet-tooltip { background: #1a2230; color: #e8edf5; border-color: #3a4558; }
  :root:not([data-theme="clair"]) .leaflet-bar a { background: #1a2230; color: #e8edf5; border-color: #3a4558; }
}
