/* =========================================================================
   DVF Côtes-d'Armor — système de design
   Palette de séries validée (contrastes et séparation daltonienne) pour les
   deux modes ; les rôles ci-dessous sont les seules couleurs employées.
   ========================================================================= */

:root {
  color-scheme: light;
  --plane:        #f3f6fa;
  --surface:      #ffffff;
  --surface-2:    #eaf0f7;
  --ink:          #14243c;
  --ink-2:        #42546b;
  --muted:        #596a80;
  --grid:         #e1e0d9;
  --axis:         #c3c2b7;
  --border:       rgba(11, 11, 11, .10);
  --shadow:       0 2px 8px rgba(20, 36, 60, .035);

  --s1: #2a78d6;  --s2: #eb6834;  --s3: #1baf7a;  --s4: #eda100;
  --s5: #e87ba4;  --s6: #008300;  --s7: #4a3aa7;  --s8: #e34948;

  /* Rampe séquentielle bleue, du clair au foncé (magnitude continue) */
  --r1: #cde2fb; --r2: #9ec5f4; --r3: #6da7ec; --r4: #3987e5;
  --r5: #256abf; --r6: #184f95; --r7: #0d366b;

  --good: #006300;  --bad: #d03b3b;  --warn: #fab219;
  --accent: #245bbb;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --plane: #0d0d0d;  --surface: #1a1a19;  --surface-2: #232322;
    --ink: #ffffff;    --ink-2: #c3c2b7;    --muted: #a5b3c6;
    --accent: #8bbcff;
    --grid: #2c2c2a;   --axis: #383835;
    --border: rgba(255, 255, 255, .10);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    --s1: #3987e5;  --s2: #d95926;  --s3: #199e70;  --s4: #c98500;
    --s5: #d55181;  --s6: #008300;  --s7: #9085e9;  --s8: #e66767;
    --r1: #0d366b; --r2: #184f95; --r3: #256abf; --r4: #3987e5;
    --r5: #6da7ec; --r6: #9ec5f4; --r7: #cde2fb;
    --good: #0ca30c;  --bad: #d03b3b;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --plane: #0d0d0d;  --surface: #1a1a19;  --surface-2: #232322;
  --ink: #ffffff;    --ink-2: #c3c2b7;    --muted: #a5b3c6;
  --accent: #8bbcff;
  --grid: #2c2c2a;   --axis: #383835;
  --border: rgba(255, 255, 255, .10);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  --s1: #3987e5;  --s2: #d95926;  --s3: #199e70;  --s4: #c98500;
  --s5: #d55181;  --s6: #008300;  --s7: #9085e9;  --s8: #e66767;
  --r1: #0d366b; --r2: #184f95; --r3: #256abf; --r4: #3987e5;
  --r5: #6da7ec; --r6: #9ec5f4; --r7: #cde2fb;
  --good: #0ca30c;  --bad: #d03b3b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--plane);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- entête */
header {
  position: sticky; top: 0; z-index: 900;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.marque { display: flex; align-items: baseline; gap: 10px; }
.marque h1 { font-size: 16px; font-weight: 650; margin: 0; letter-spacing: -.01em; }
.marque span { font-size: 12px; color: var(--muted); }
.entete-droite { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* --------------------------------------------------------------- onglets */
nav.onglets {
  position: sticky; top: 53px; z-index: 890;
  display: flex; gap: 2px; padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
nav.onglets::-webkit-scrollbar { display: none; }
nav.onglets button {
  flex: 0 0 auto;
  padding: 10px 14px 9px;
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: color .12s, border-color .12s;
}
nav.onglets button:hover { color: var(--ink); }
nav.onglets button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ------------------------------------------------------- barre de filtres */
.filtres {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px;
  padding: 12px 22px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.champ { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.champ > label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.champ-inline { display: flex; align-items: center; gap: 5px; }

input, select, button.btn {
  font: inherit; font-size: 13px;
  padding: 6px 9px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: 7px;
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input.mini { width: 74px; }
select { cursor: pointer; }

button.btn { cursor: pointer; font-weight: 500; }
button.btn:hover { border-color: var(--accent); color: var(--accent); }
button.btn.primaire { background: var(--accent); border-color: var(--accent); color: #fff; }
button.btn.primaire:hover { filter: brightness(1.08); color: #fff; }
button.icone { padding: 6px 8px; line-height: 1; }

.bascule { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.bascule input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }

/* -------------------------------------------------- sélecteur de communes */
.jetons {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  min-height: 32px; min-width: 240px; max-width: 460px;
  padding: 3px 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 7px;
}
.jeton {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 4px 2px 8px; border-radius: 20px;
  background: var(--surface-2); font-size: 12px;
}
.jeton b { font-weight: 500; }
.jeton button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 14px; line-height: 1; padding: 0 2px; }
.jeton button:hover { color: var(--bad); }
.jetons input { border: 0; padding: 3px; min-width: 110px; flex: 1; background: none; }
.jetons input:focus { box-shadow: none; }
.suggestions {
  position: absolute; z-index: 950; max-height: 280px; overflow-y: auto;
  min-width: 240px; margin-top: 2px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow);
}
.suggestions div { padding: 6px 11px; cursor: pointer; font-size: 13px; display: flex; justify-content: space-between; gap: 14px; }
.suggestions div:hover, .suggestions div.actif { background: var(--surface-2); }
.suggestions em { color: var(--muted); font-style: normal; font-size: 11px; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- pages */
main { padding: 18px 22px 60px; }
.page { display: none; }
.page.actif { display: block; animation: apparait .18s ease-out; }
@keyframes apparait { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.grille { display: grid; gap: 14px; grid-template-columns: repeat(12, 1fr); }
.carte {
  grid-column: span 12;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  min-width: 0;
}
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; }
.c6 { grid-column: span 6; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
@media (max-width: 1100px) { .c3 { grid-column: span 6; } .c4, .c6, .c8 { grid-column: span 12; } }
@media (max-width: 640px)  { .c3 { grid-column: span 12; } }

.carte h2 { margin: 0 0 2px; font-size: 13px; font-weight: 650; letter-spacing: -.005em; }
.carte .sous { margin: 0 0 14px; font-size: 12px; color: var(--muted); }
.entete-carte { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.entete-carte > div:first-child { flex: 1; min-width: 160px; }
.entete-carte .sous { margin: 0; }
.outils { display: flex; gap: 6px; flex-wrap: wrap; }
.outils select, .outils button.btn { padding: 4px 8px; font-size: 12px; }

/* ------------------------------------------------------- tuiles de chiffres */
.tuile .valeur {
  font-size: 30px; font-weight: 620; letter-spacing: -.02em;
  line-height: 1.15; margin: 4px 0 2px;
}
.tuile .etiquette { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.tuile .detail { font-size: 12px; color: var(--ink-2); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; }
.delta.hausse { color: var(--good); }
.delta.baisse { color: var(--bad); }

/* Évolutions ventilées par département, dans une tuile de chiffres */
.lignes-dep { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.lignes-dep div {
  display: flex; align-items: baseline; gap: 7px;
  font-size: 12px; color: var(--ink-2);
}
.lignes-dep .nom { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lignes-dep .delta { font-size: 13px; }

/* --------------------------------------------------------------- tableaux */
.enveloppe-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 7px 10px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th {
  position: sticky; top: 0;
  font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em;
  background: var(--surface); border-bottom: 1px solid var(--axis);
  cursor: pointer; user-select: none;
}
th.nontri { cursor: default; }
th:hover:not(.nontri) { color: var(--ink); }
th .fleche { color: var(--accent); }
td { border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: var(--surface-2); }
td.texte { font-variant-numeric: normal; white-space: normal; }

/* Cellules du tableau croisé : rampe séquentielle à 7 classes.
   La couleur du texte est fixée par classe et non héritée : sur les pas foncés
   de la rampe, l'encre par défaut tomberait à 1,65:1 de contraste. Les valeurs
   retenues donnent au minimum 5,4:1 dans les deux modes (le sens de la rampe
   s'inverse en mode sombre, donc les seuils aussi). Les couleurs de texte sont
   écrites en dur : elles doivent suivre le fond, pas le thème. */
td.cel { font-weight: 500; text-align: center; }
td.cel-0 { background: var(--r1); } td.cel-1 { background: var(--r2); }
td.cel-2 { background: var(--r3); } td.cel-3 { background: var(--r4); }
td.cel-4 { background: var(--r5); } td.cel-5 { background: var(--r6); }
td.cel-6 { background: var(--r7); }

td.cel-0, td.cel-1, td.cel-2, td.cel-3 { color: #0b0b0b; }
td.cel-4, td.cel-5, td.cel-6 { color: #ffffff; }

:root[data-theme="dark"] td.cel-0,
:root[data-theme="dark"] td.cel-1,
:root[data-theme="dark"] td.cel-2 { color: #ffffff; }
:root[data-theme="dark"] td.cel-3,
:root[data-theme="dark"] td.cel-4,
:root[data-theme="dark"] td.cel-5,
:root[data-theme="dark"] td.cel-6 { color: #0b0b0b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) td.cel-0,
  :root:not([data-theme="light"]) td.cel-1,
  :root:not([data-theme="light"]) td.cel-2 { color: #ffffff; }
  :root:not([data-theme="light"]) td.cel-3,
  :root:not([data-theme="light"]) td.cel-4,
  :root:not([data-theme="light"]) td.cel-5,
  :root:not([data-theme="light"]) td.cel-6 { color: #0b0b0b; }
}

/* ------------------------------------------------------------- graphiques */
.zone-graph { position: relative; height: 300px; }
.zone-graph.haute { height: 380px; }
.zone-graph.basse { height: 210px; }

.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; }
.legende span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.pastille { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }

/* Barres horizontales (classement) : une seule série, marque fine */
.barres { display: flex; flex-direction: column; gap: 9px; }
.barre-ligne { display: grid; grid-template-columns: 150px 1fr 84px; align-items: center; gap: 10px; font-size: 13px; }
.barre-ligne .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
/* display:block est indispensable : ces éléments sont des <span>, dont la
   largeur serait ignorée tant qu'ils restent en rendu inline. */
.barre-piste { display: block; height: 9px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.barre-jauge { display: block; height: 100%; background: var(--s1); border-radius: 4px; transition: width .35s cubic-bezier(.4,0,.2,1); }
.barre-ligne .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 550; }

/* Boîtes à moustaches, tracées en SVG */
.boites svg { width: 100%; display: block; }

/* ------------------------------------------------------------------ carte */
#carte-leaflet { height: 620px; border-radius: var(--radius); z-index: 1; }
.leaflet-container { background: var(--surface-2); font: inherit; }
.echelle-carte { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.echelle-bandes { display: flex; height: 10px; border-radius: 3px; overflow: hidden; width: 220px; }
.echelle-bandes i { flex: 1; }
/* Pastilles de regroupement : encre neutre, elles comptent sans qualifier. */
.grappe-dvf {
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  color: var(--surface); border: 2px solid var(--surface);
  border-radius: 50%; font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums; box-shadow: 0 1px 4px rgba(0, 0, 0, .28);
}
.grappe-dvf span { line-height: 1; }

.popup-dvf { font-family: var(--font); font-size: 13px; min-width: 190px; }
.popup-dvf b { display: block; font-size: 14px; margin-bottom: 3px; }
.popup-dvf table { font-size: 12px; }
.popup-dvf td { border: 0; padding: 1px 0; }
.popup-dvf td:first-child { color: var(--muted); padding-right: 12px; }

/* ------------------------------------------------------------- estimation */
.resultat-estim { text-align: center; padding: 8px 0 4px; }
.resultat-estim .principal { font-size: 40px; font-weight: 640; letter-spacing: -.025em; line-height: 1.1; }
.resultat-estim .fourchette { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.jauge-estim { margin: 18px 0 6px; }
.jauge-estim .piste { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--r2), var(--r4), var(--r2)); }
.jauge-estim .curseur { position: absolute; top: -5px; width: 3px; height: 18px; border-radius: 2px; background: var(--ink); transform: translateX(-50%); }
.jauge-estim .bornes { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 7px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------- avertissement légal */
.voile-avertissement {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, #0b0b0b 62%, transparent);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}
.voile-avertissement[hidden] { display: none; }

.boite-avertissement {
  max-width: 620px; width: 100%; margin: auto;
  padding: 26px 30px 24px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-top: 4px solid var(--warn);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.boite-avertissement h2 { margin: 0 0 12px; font-size: 18px; font-weight: 650; }
.boite-avertissement .chapeau {
  margin: 0 0 14px; font-size: 14px; line-height: 1.6;
  padding: 10px 13px; border-radius: 8px;
  background: color-mix(in srgb, var(--warn) 15%, var(--surface));
}
.boite-avertissement ul { margin: 0 0 14px; padding-left: 20px; }
.boite-avertissement li { margin-bottom: 9px; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.boite-avertissement li b, .boite-avertissement p b { color: var(--ink); }
.boite-avertissement p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.boite-avertissement .mention { font-size: 12px; color: var(--muted); }
.boite-avertissement button { width: 100%; padding: 10px; font-size: 14px; }

/* Bandeau permanent : l'avertissement reste visible après acceptation. */
.pied {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 26px 22px 0; padding: 13px 16px 15px;
  border-top: 2px solid var(--warn);
  background: var(--surface);
  font-size: 12.5px; line-height: 1.6; color: var(--ink-2);
}
.etiquette-pied {
  flex: 0 0 auto; padding: 2px 8px; border-radius: 4px;
  background: color-mix(in srgb, var(--warn) 26%, var(--surface));
  color: var(--ink); font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
}
.pied b { color: var(--ink); }
.lien-pied {
  border: 0; background: none; padding: 0; margin-left: 4px;
  color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer;
}

/* ------------------------------------------------------- états et divers */
.vide, .chargement { padding: 34px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.note {
  display: flex; gap: 9px; padding: 10px 13px; border-radius: 8px;
  background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); line-height: 1.55;
}
.note b { color: var(--ink); font-weight: 600; }
.note.attention { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); }
.pastille-compte {
  display: inline-block; padding: 1px 7px; border-radius: 20px;
  background: var(--surface-2); font-size: 11px; font-weight: 600;
  color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.pagination button { padding: 4px 11px; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination button:disabled:hover { border-color: var(--border); color: var(--ink); }

.tourniquet {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 999;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 40% 100%; background-repeat: no-repeat;
  animation: glisse 1s linear infinite; display: none;
}
.tourniquet.actif { display: block; }
@keyframes glisse { from { background-position: -40% 0; } to { background-position: 140% 0; } }

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

/* Parcours de recherche : territoire, sélection, puis résultats. */
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.evitement { position: fixed; left: 16px; top: -100px; z-index: 1100; background: var(--surface); padding: 12px; color: var(--ink); }
.evitement:focus { top: 12px; }
header { min-height: 76px; padding: 16px 28px; }
.marque { flex-direction: column; gap: 1px; }
.marque h1 { font-size: 19px; letter-spacing: -.04em; }
.marque span { font-size: 12px; }
.pastille-compte { padding: 5px 12px; font-size: 13px; }
nav.onglets { top: 76px; }
nav.onglets button { font-size: 14px; min-height: 46px; }
.filtres { gap: 16px; padding: 24px 28px; }
.filtres > .champ:nth-child(2) { flex: 1; min-width: 220px; }
.filtres .jetons { min-width: 0; max-width: none; min-height: 42px; }
.champ > label { font-size: 14px; color: var(--ink-2); font-weight: 500; letter-spacing: 0; }
input, select, button.btn { font-size: 14px; min-height: 42px; padding: 9px 12px; }
input.mini { width: 95px; }
input[type="checkbox"] { min-height: 0; }
button.btn.primaire { background: #245bbb; border-color: #245bbb; }
.filtres-avances { flex-basis: calc(100% - 145px); }
.filtres-avances summary { width: fit-content; padding: 9px 0; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.filtres-avances[open] { flex-basis: 100%; }
.filtres-secondaires { display: flex; flex-wrap: wrap; align-items: end; gap: 16px 24px; padding: 18px 0 4px; }
#nombre-filtres:not(:empty) { background: var(--surface-2); padding: 2px 7px; border-radius: 5px; }
main { padding: 26px 28px 40px; }
.contexte-marche { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.surtitre { color: var(--accent); font-size: 12px; letter-spacing: .1em; font-weight: 700; margin: 0 0 5px; }
#contexte-territoire { font-size: clamp(24px, 2.6vw, 36px); letter-spacing: -.035em; line-height: 1.2; margin: 0 0 8px; overflow-wrap: anywhere; }
.contexte-selection { color: var(--ink-2); font-size: 14px; margin: 0; }
.conseil-territoire { color: var(--ink-2); border-left: 3px solid var(--accent); padding: 8px 14px; margin: -2px 0 24px; font-size: 14px; }
.grille { gap: 18px; }
.carte { padding: 22px; border-radius: 12px; }
.carte h2 { font-size: 16px; }
.carte .sous { font-size: 13px; }
.tuile { border-top: 3px solid var(--grid); }
.tuile:has(#k-pm2) { border-top-color: var(--accent); }
.tuile .etiquette { font-size: 12px; letter-spacing: .035em; }
.tuile .valeur { font-size: clamp(26px, 2.5vw, 38px); margin: 12px 0 9px; font-variant-numeric: tabular-nums; }
.tuile .detail { font-size: 13px; }
.barre-ligne { grid-template-columns: minmax(85px, 1.3fr) minmax(30px, 1fr) 90px; font-size: 14px; }
.outils select, .outils button.btn { font-size: 14px; }
table { font-size: 14px; }
th { font-size: 12px; }
.note { font-size: 14px; }
.suggestions { max-width: calc(100vw - 32px); }
.suggestions div { font-size: 14px; }
.suggestions em { font-size: 12px; }
.pied { margin: 0 28px 20px; }
@media (min-width: 1200px) {
  nav.onglets { position: fixed; left: 0; bottom: 0; width: 206px; padding: 28px 14px; flex-direction: column; gap: 6px; background: #14243c; border: none; overflow-y: auto; }
  nav.onglets button { text-align: left; padding: 13px 16px; color: #becce0; border: 0; border-radius: 7px; }
  nav.onglets button:hover { background: #203550; color: #fff; }
  nav.onglets button[aria-selected="true"] { background: #2b466c; color: #fff; box-shadow: inset 3px 0 #8bbcff; }
  .filtres, main { margin-left: 206px; }
  .pied { margin-left: 234px; }
}
@media (max-width: 760px) {
  header { position: relative; padding: 14px 16px; }
  .marque h1 { font-size: 17px; }
  .pastille-compte { display: none; }
  nav.onglets { top: 0; padding: 0 6px; }
  .filtres { padding: 18px 16px; gap: 14px; }
  .filtres > .champ { flex: 1 1 calc(50% - 14px); }
  .filtres > .champ:nth-child(2) { min-width: 0; }
  .filtres select { width: 100%; min-width: 0; }
  .filtres .jetons { width: 100%; }
  .filtres .jetons input { width: 100%; min-width: 0; }
  main { padding: 22px 16px; }
  .contexte-marche { flex-wrap: wrap; }
  .contexte-marche button { width: 100%; }
  .carte { padding: 18px; }
  .pied { margin: 0 16px 20px; flex-wrap: wrap; }
  .champ-inline { min-width: 0; }
  #carte-leaflet { height: 440px; }
  .boite-avertissement { padding: 20px; }
}

/* Même sélection pour les points cartographiques et leur liste. */
.exploration-carte { display: grid; grid-template-columns: minmax(0, 1fr) 300px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.exploration-carte #carte-leaflet { height: 610px; border-radius: 0; }
.liste-carte { min-width: 0; height: 610px; display: flex; flex-direction: column; border-left: 1px solid var(--border); background: var(--surface); }
.entete-liste-carte { padding: 18px; border-bottom: 1px solid var(--border); }
.entete-liste-carte h3 { font-size: 16px; margin: 0 0 4px; }
.entete-liste-carte p { margin: 0; font-size: 12px; color: var(--muted); }
#ventes-carte { flex: 1; overflow-y: auto; }
.vente-carte { display: flex; flex-direction: column; gap: 5px; width: 100%; padding: 18px; background: var(--surface); color: var(--ink); font: inherit; border: 0; border-bottom: 1px solid var(--border); text-align: left; cursor: pointer; }
.vente-carte:hover, .vente-carte:focus-visible { background: var(--surface-2); }
.vente-carte:focus-visible { outline-offset: -3px; }
.vente-carte strong { font-size: 23px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.vente-metadata { font-size: 12px; color: var(--muted); }
.vente-adresse { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
#voir-transactions { margin: 12px; flex-shrink: 0; }
@media (max-width: 900px) {
  .exploration-carte { grid-template-columns: 1fr; }
  .exploration-carte #carte-leaflet { height: 420px; }
  .liste-carte { height: 410px; border-left: 0; border-top: 1px solid var(--border); }
}

/* Identité The Tall Guy et filtre de types à sélection multiple. */
.logo-site { display: block; flex: 0 0 44px; line-height: 0; }
.logo-site img { display: block; width: 44px; height: 44px; border-radius: 7px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.champ-types { width: 240px; }
.choix-types { position: relative; min-width: 0; }
.choix-types[open] { z-index: 850; }
.choix-types > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; font-size: 14px; cursor: pointer; list-style: none; }
.choix-types > summary::-webkit-details-marker { display: none; }
.choix-types > summary::after { content: ''; flex: 0 0 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: -3px 2px 0 0; }
.choix-types[open] > summary { border-color: var(--accent); }
#resume-types { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panneau-types { position: absolute; right: 0; top: calc(100% + 8px); width: 310px; max-width: calc(100vw - 32px); max-height: min(70vh, 510px); overflow-y: auto; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(20, 36, 60, .2); }
.panneau-types fieldset { margin: 10px 0; padding: 0; border: 0; min-width: 0; }
.panneau-types fieldset label { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px; font-size: 14px; border-radius: 6px; cursor: pointer; }
.panneau-types fieldset label:hover { background: var(--surface-2); }
.panneau-types input { width: 17px; height: 17px; flex-shrink: 0; margin: 0; padding: 0; accent-color: var(--accent); }
.panneau-types input:disabled { cursor: default; }
#aide-types { font-size: 12px; line-height: 1.45; color: var(--muted); margin: 10px 8px; }
#types-tous, #types-fermer { width: 100%; }
@media (max-width: 760px) {
  .champ-types { width: auto; }
  .panneau-types { left: 0; right: auto; }
}

.couverture-courte { color: var(--muted); font-size: 12px; }
#page-donnees .enveloppe-table { max-height: 580px; }
.filtres > .champ:first-child { position: relative; }
.couverture-courte { position: absolute; top: calc(100% + 3px); left: 0; white-space: nowrap; }
.filtres { row-gap: 24px; }
