/* Radar Marchés : feuille de style unique, sans police ni ressource externe (CSP style-src 'self'). */
:root {
  --fond: #f4f6f9;
  --surface: #ffffff;
  --texte: #101b26;
  --texte-2: #4a5a6a;
  --bord: #dfe5ec;
  --marque: #0a2f4e;
  --marque-vif: #1563a0;
  --marque-pale: #e9f2fa;
  --accent: #c2410c;
  --accent-pale: #fff1e8;
  --succes: #137a4a;
  --echeance-fond: #e7f0f8;
  --echeance-texte: #0a2f4e;
  --urgent-fond: #fdeee3;
  --urgent-texte: #9a3412;
  --discret-fond: #eef1f4;
  --rayon: 14px;
  --rayon-petit: 10px;
  --ombre: 0 1px 2px rgba(16, 27, 38, 0.04), 0 4px 14px rgba(16, 27, 38, 0.05);
  --ombre-forte: 0 2px 4px rgba(16, 27, 38, 0.05), 0 12px 32px rgba(16, 27, 38, 0.08);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0b1117;
    --surface: #121a22;
    --texte: #e7edf3;
    --texte-2: #9aabbb;
    --bord: #243140;
    --marque: #e6f2fc;
    --marque-vif: #8cc8f2;
    --marque-pale: #14263a;
    --accent: #f59e5c;
    --accent-pale: #2b1c12;
    --succes: #5fd39a;
    --echeance-fond: #132a3d;
    --echeance-texte: #b7dcf7;
    --urgent-fond: #3b2212;
    --urgent-texte: #ffbe8a;
    --discret-fond: #1b252e;
    --ombre: none;
    --ombre-forte: none;
  }
}
:root[data-theme="dark"] {
  --fond: #0b1117;
  --surface: #121a22;
  --texte: #e7edf3;
  --texte-2: #9aabbb;
  --bord: #243140;
  --marque: #e6f2fc;
  --marque-vif: #8cc8f2;
  --marque-pale: #14263a;
  --accent: #f59e5c;
  --accent-pale: #2b1c12;
  --succes: #5fd39a;
  --echeance-fond: #132a3d;
  --echeance-texte: #b7dcf7;
  --urgent-fond: #3b2212;
  --urgent-texte: #ffbe8a;
  --discret-fond: #1b252e;
  --ombre: none;
  --ombre-forte: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; width: 100%; }
a { color: var(--marque-vif); text-underline-offset: 3px; }
a:hover { color: var(--marque); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.22; color: var(--texte); }
h1 { font-size: clamp(1.75rem, 4.6vw, 2.75rem); margin: 0.4rem 0 0.8rem; letter-spacing: -0.02em; font-weight: 800; }
h2 { font-size: 1.35rem; margin: 2.6rem 0 1rem; letter-spacing: -0.01em; font-weight: 700; }
h3 { font-size: 1.05rem; margin: 0; font-weight: 650; }
p { margin: 0 0 1em; }

.cadre { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.evitement { position: absolute; left: -9999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 10; }
.evitement:focus { left: 16px; top: 8px; }
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* En-tête */
.entete {
  background: var(--surface);
  border-bottom: 1px solid var(--bord);
  position: sticky; top: 0; z-index: 5;
  backdrop-filter: saturate(1.4) blur(8px);
}
.entete-cadre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-top: 14px; padding-bottom: 14px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--marque); font-weight: 800; font-size: 1.12rem; text-decoration: none; letter-spacing: -0.01em; }
.logo svg { color: var(--marque-vif); }
.navigation { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.navigation a {
  color: var(--texte-2); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  padding: 7px 12px; border-radius: 8px;
}
.navigation a:hover { color: var(--marque); background: var(--marque-pale); }
.navigation a[aria-current="page"] { color: var(--marque); background: var(--marque-pale); }
.navigation a.navigation-action {
  margin-left: 6px; background: var(--marque); color: #fff; padding: 8px 14px;
}
.navigation a.navigation-action:hover { background: var(--marque-vif); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .navigation a.navigation-action { color: #0b1117; } }
:root[data-theme="dark"] .navigation a.navigation-action { color: #0b1117; }

/* Accueil */
.hero {
  position: relative;
  margin: 0 -20px;
  padding: 56px 20px 48px;
  background:
    radial-gradient(900px 380px at 85% -10%, rgba(21, 99, 160, 0.22), transparent 60%),
    linear-gradient(160deg, var(--marque) 0%, #0d3f66 100%);
  color: #f2f7fb;
}
.hero-interieur { max-width: 1120px; margin: 0 auto; padding: 0 0; }
.hero h1 { color: #ffffff; max-width: 820px; }
.hero .chapeau { color: #c9dbea; max-width: 700px; font-size: 1.12rem; }
.hero .surtitre { color: #ffb27a; }
.hero .bouton { background: #ffffff; color: var(--marque); border-color: #ffffff; }
.hero .bouton:hover { background: #e9f2fa; border-color: #e9f2fa; color: var(--marque); }
.hero .bouton-second { background: transparent; color: #ffffff; border-color: rgba(255,255,255,0.45); }
.hero .bouton-second:hover { background: rgba(255,255,255,0.1); border-color: #ffffff; color: #ffffff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero .bouton { color: var(--marque); } }
:root[data-theme="dark"] .hero .bouton { color: var(--marque); }

.surtitre {
  display: inline-block; color: var(--accent); font-weight: 700; text-transform: uppercase;
  font-size: 0.76rem; letter-spacing: 0.1em; margin: 0 0 6px; padding: 5px 10px; border-radius: 999px;
  background: var(--accent-pale);
}
.chapeau { font-size: 1.08rem; color: var(--texte-2); max-width: 720px; margin-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 0; }
.bouton {
  display: inline-flex; align-items: center; gap: 8px; background: var(--marque); color: #fff; text-decoration: none; font-weight: 650;
  padding: 12px 20px; border-radius: var(--rayon-petit); border: 2px solid var(--marque); font-size: 0.98rem;
  box-shadow: 0 1px 2px rgba(10, 47, 78, 0.2);
}
.bouton:hover { background: var(--marque-vif); border-color: var(--marque-vif); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bouton, :root:not([data-theme="light"]) .bouton:hover { color: #0b1117; } }
:root[data-theme="dark"] .bouton, :root[data-theme="dark"] .bouton:hover { color: #0b1117; }
.bouton-second { background: transparent; color: var(--marque); border-color: var(--marque); box-shadow: none; }
.bouton-second:hover { color: #fff; background: var(--marque); border-color: var(--marque); }
.lien-fort { font-weight: 650; }

/* Bandeau de confiance */
.confiance {
  list-style: none; margin: -22px 0 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr)); position: relative;
}
.confiance li {
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  box-shadow: var(--ombre-forte); padding: 18px 20px;
}
.confiance strong { display: block; font-size: clamp(1.45rem, 4.4vw, 2rem); color: var(--marque); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.confiance span { display: block; color: var(--texte-2); font-size: 0.9rem; line-height: 1.35; margin-top: 6px; }
.chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.chiffres p { margin: 0; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 18px 20px; box-shadow: var(--ombre); }
.chiffres strong { display: block; font-size: clamp(1.45rem, 4.4vw, 2rem); color: var(--marque); line-height: 1.1; font-weight: 800; }
.chiffres span { display: block; color: var(--texte-2); font-size: 0.9rem; line-height: 1.35; margin-top: 6px; }

/* Départements */
.grille-deps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.grille-deps li {
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon-petit);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.grille-deps li:hover { border-color: var(--marque-vif); box-shadow: var(--ombre); transform: translateY(-1px); }
.grille-deps a { font-weight: 650; text-decoration: none; color: var(--texte); }
.grille-deps a::before { content: ""; position: absolute; inset: 0; }
.grille-deps li { position: relative; }
.grille-deps a:hover { color: var(--marque-vif); }
.dep-code {
  display: inline-block; min-width: 2.4em; color: var(--marque-vif); font-weight: 800; margin-right: 6px;
}
.dep-compte { color: var(--texte-2); font-size: 0.85rem; }

.liste-liens { list-style: none; padding: 0; margin: 0; columns: 2 280px; column-gap: 28px; }
.liste-liens li { break-inside: avoid; display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--bord); }
.liste-liens span { color: var(--texte-2); white-space: nowrap; font-size: 0.9rem; }

/* Encarts */
.explication, .encart {
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 8px 26px 22px; margin-top: 40px; box-shadow: var(--ombre);
}
.explication { border-left: 4px solid var(--marque-vif); }
.encart { border-left: 4px solid var(--accent); background: linear-gradient(90deg, var(--accent-pale), var(--surface) 60%); }
.encart h2, .explication h2 { margin-top: 14px; }

/* Listes d'avis et de marchés */
.fil { font-size: 0.9rem; color: var(--texte-2); margin-top: 18px; }
.liens-annexes { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.fiche-avis { display: grid; grid-template-columns: minmax(150px, 0.35fr) 1fr; gap: 0; margin: 8px 0 0; border: 1px solid var(--bordure, #d8dee6); border-radius: 10px; overflow: hidden; background: var(--surface); }
.fiche-avis dt, .fiche-avis dd { margin: 0; padding: 10px 14px; border-top: 1px solid var(--bordure, #d8dee6); }
.fiche-avis dt { font-weight: 600; color: var(--texte-2); background: var(--surface-2, transparent); }
.fiche-avis dt:first-child, .fiche-avis dt:first-child + dd { border-top: 0; }
.fiche-avis dd { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .fiche-avis { grid-template-columns: 1fr; }
  .fiche-avis dt { border-top: 1px solid var(--bordure, #d8dee6); padding-bottom: 2px; }
  .fiche-avis dd { border-top: 0; padding-top: 2px; }
  .fiche-avis dt:first-child { border-top: 0; }
}.filtre {
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 16px 18px; margin: 18px 0; box-shadow: var(--ombre);
}
.filtre label { display: block; font-weight: 650; margin-bottom: 8px; font-size: 0.95rem; }
.filtre input {
  width: 100%; font: inherit; padding: 11px 14px; border: 1px solid var(--bord); border-radius: var(--rayon-petit);
  background: var(--fond); color: var(--texte);
}
.filtre input:focus { border-color: var(--marque-vif); outline: none; box-shadow: 0 0 0 3px var(--marque-pale); }
.filtre-compte { margin: 10px 0 0; color: var(--texte-2); font-size: 0.9rem; }
.cartes { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.carte {
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 18px 20px; box-shadow: var(--ombre); transition: border-color 0.15s, box-shadow 0.15s;
}
.carte:hover { border-color: var(--marque-vif); }
.carte-titre a { text-decoration: none; color: var(--texte); }
.carte-titre a:hover { color: var(--marque-vif); text-decoration: underline; }
.carte-meta { margin: 6px 0 10px; color: var(--texte-2); font-size: 0.92rem; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 650; padding: 4px 10px; border-radius: 999px; background: var(--discret-fond); color: var(--texte-2); }
.badge-echeance { background: var(--echeance-fond); color: var(--echeance-texte); }
.badge-urgent { background: var(--urgent-fond); color: var(--urgent-texte); }
.badge-discret { font-weight: 500; }
.vide { color: var(--texte-2); background: var(--surface); border: 1px dashed var(--bord); border-radius: var(--rayon); padding: 22px; }
.note { color: var(--texte-2); font-size: 0.92rem; border-left: 3px solid var(--marque-vif); padding: 4px 0 4px 14px; margin-top: 24px; }
.attribution { font-size: 0.85rem; color: var(--texte-2); margin-top: 32px; }

.tableau { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; }
.tableau th, .tableau td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--bord); }
.tableau th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--texte-2); background: var(--fond); }
.tableau .nombre { text-align: right; white-space: nowrap; }
.tableau-defilant { overflow-x: auto; margin: 0 0 8px; border-radius: var(--rayon); }
.tableau-defilant .tableau { font-size: 0.92rem; min-width: 640px; }

/* Pages de texte */
.texte { max-width: 780px; padding: 8px 0 24px; }
.texte h1 { margin-top: 1.2rem; }
.texte h2 { font-size: 1.18rem; }
.faq details { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon-petit); padding: 12px 18px; margin-bottom: 10px; box-shadow: var(--ombre); }
.faq summary { cursor: pointer; font-weight: 650; }
.formules { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0; }
.formule { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 8px 22px 22px; box-shadow: var(--ombre); }
.formule-phare { border: 2px solid var(--marque-vif); position: relative; }
.formule h2 { margin-top: 14px; }
.prix { font-size: 1.9rem; font-weight: 800; color: var(--marque); margin: 0; letter-spacing: -0.02em; }
.prix span, .prix-annuel { font-size: 0.9rem; font-weight: 400; color: var(--texte-2); }
.prix-annuel { margin: 2px 0 0; }
.bientot { font-weight: 650; color: var(--accent); }

/* Pied de page */
.pied {
  margin-top: 64px; background: var(--marque); color: #c9dbea; padding: 40px 0 32px; font-size: 0.92rem;
}
.pied p { color: #c9dbea; max-width: 760px; }
.pied-liens { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.14); }
.pied-liens a { color: #ffffff; text-decoration: none; opacity: 0.85; }
.pied-liens a:hover { opacity: 1; text-decoration: underline; }
.pied a:focus-visible { outline-color: #ffb27a; }

@media (max-width: 640px) {
  .cadre { padding: 0 16px; }
  .hero { margin: 0 -16px; padding: 36px 16px 40px; }
  .confiance, .chiffres { grid-template-columns: 1fr; margin-top: 0; }
  .confiance { margin-top: -16px; }
  .actions .bouton { flex: 1 1 100%; justify-content: center; }
  .navigation a { padding: 6px 9px; font-size: 0.9rem; }
  .explication, .encart { padding: 6px 18px 18px; }
  .carte { padding: 16px; }
}

@media (prefers-reduced-motion: no-preference) {
  a, .bouton, .grille-deps li { transition: color 0.15s, background-color 0.15s, border-color 0.15s; }
}

/* ---------- Chiffres : cartes d'indicateurs, barres et animations ---------- */
.bandeau-chiffres {
  margin: 22px 0 8px; padding: 26px 26px 22px; border-radius: var(--rayon);
  background: linear-gradient(135deg, var(--marque) 0%, var(--marque-vif) 100%); color: #fff;
  box-shadow: var(--ombre-forte); position: relative; overflow: hidden;
}
.bandeau-chiffres::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.08); pointer-events: none;
}
.bandeau-chiffres h1 { color: #fff; margin: 0 0 6px; }
.bandeau-chiffres .chapeau { color: rgba(255, 255, 255, 0.88); margin: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bandeau-chiffres { background: linear-gradient(135deg, #14263a 0%, #1d4f7a 100%); } }
:root[data-theme="dark"] .bandeau-chiffres { background: linear-gradient(135deg, #14263a 0%, #1d4f7a 100%); }

.indicateurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 22px 0; }
.indicateur {
  position: relative; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 20px 20px 18px; box-shadow: var(--ombre); overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.indicateur::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--marque-vif));
}
.indicateur:hover { transform: translateY(-3px); box-shadow: var(--ombre-forte); border-color: var(--marque-vif); }
.indicateur-label { display: block; font-size: 0.84rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texte-2); font-weight: 600; }
.indicateur-valeur {
  display: block; margin: 8px 0 4px; font-size: clamp(1.7rem, 3.2vw, 2.3rem); font-weight: 800; line-height: 1.05; white-space: nowrap;
  color: var(--marque); font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.indicateur-note { display: block; font-size: 0.9rem; color: var(--texte-2); }
.indicateur--vedette { background: linear-gradient(135deg, var(--marque) 0%, var(--marque-vif) 100%); border-color: transparent; }
.indicateur--vedette::before { background: var(--accent); }
.indicateur--vedette .indicateur-label, .indicateur--vedette .indicateur-note { color: rgba(255, 255, 255, 0.85); }
.indicateur--vedette .indicateur-valeur { color: #fff; }

.section-chiffres { margin: 30px 0; }
.section-chiffres h2 { margin-bottom: 10px; }
.repartition { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--discret-fond); box-shadow: inset 0 0 0 1px var(--bord); }
.repartition > span { display: block; width: 0; height: 100%; transition: width 1.1s cubic-bezier(.2,.7,.2,1); }
.repartition .r-urgent { background: var(--accent); }
.repartition .r-mois { background: var(--marque-vif); }
.repartition .r-loin { background: var(--marque); opacity: 0.55; }
.legende { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 0.92rem; color: var(--texte-2); }
.legende li { display: flex; align-items: center; gap: 8px; }
.legende i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.legende .r-urgent { background: var(--accent); }
.legende .r-mois { background: var(--marque-vif); }
.legende .r-loin { background: var(--marque); opacity: 0.55; }

.classement { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.classement li { display: grid; grid-template-columns: minmax(150px, 1.2fr) 3fr minmax(92px, auto); gap: 14px; align-items: center; }
.classement a { color: var(--texte); text-decoration: none; font-weight: 600; }
.classement a:hover { color: var(--marque-vif); text-decoration: underline; }
.barre-piste { height: 12px; background: var(--discret-fond); border-radius: 999px; overflow: hidden; }
.barre-remplie {
  height: 100%; width: 0; border-radius: 999px; transition: width 1s cubic-bezier(.2,.7,.2,1);
  background: linear-gradient(90deg, var(--marque-vif), var(--marque));
}
.classement .valeur { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--marque); white-space: nowrap; }
.classement .valeur small { display: block; font-weight: 400; color: var(--texte-2); font-size: 0.8rem; }

.montant-carte {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 16px 0 6px; padding: 16px 20px;
  border-radius: var(--rayon); background: var(--marque-pale); border: 1px solid var(--bord);
}
.montant-carte .montant-valeur { font-size: clamp(1.6rem, 3.5vw, 2.1rem); font-weight: 800; color: var(--marque); font-variant-numeric: tabular-nums; }
.montant-carte .montant-note { color: var(--texte-2); font-size: 0.92rem; }

.retenir { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 6px 22px 16px; box-shadow: var(--ombre); }
.retenir ul { padding-left: 0; list-style: none; margin: 0; }
.retenir li { padding: 9px 0 9px 28px; position: relative; border-top: 1px solid var(--bord); }
.retenir li:first-child { border-top: 0; }
.retenir li::before {
  content: ""; position: absolute; left: 4px; top: 16px; width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--marque-vif));
}

.js-anime .reveler { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js-anime .reveler.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveler { opacity: 1; transform: none; transition: none; }
  .indicateur, .repartition > span, .barre-remplie { transition: none; }
  .indicateur:hover { transform: none; }
}
@media (max-width: 600px) {
  .classement li { grid-template-columns: 1fr auto; }
  .classement li .barre-piste { grid-column: 1 / -1; grid-row: 2; }
  .bandeau-chiffres { padding: 20px 18px; }
}

/* ---------- Carte de France et recherche par ville ---------- */
:root { --carte-0: #e5ebf2; --carte-1: #bcd6ee; --carte-2: #7fb3de; --carte-3: #3f86c4; --carte-4: #1d5f97; --carte-5: #0a2f4e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --carte-0: #1b2733; --carte-1: #22466a; --carte-2: #2f6496; --carte-3: #4a8fcc; --carte-4: #7cbbea; --carte-5: #cfe8fb; } }
:root[data-theme="dark"] { --carte-0: #1b2733; --carte-1: #22466a; --carte-2: #2f6496; --carte-3: #4a8fcc; --carte-4: #7cbbea; --carte-5: #cfe8fb; }

.carte-bloc { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px; box-shadow: var(--ombre); }
.carte-france { display: block; width: 100%; height: auto; max-width: 640px; margin: 0 auto; }
.carte-france .dep { stroke: var(--surface); stroke-width: 0.9; transition: fill 0.2s ease, opacity 0.2s ease; }
.carte-france .dep.q0 { fill: var(--carte-0); }
.carte-france .dep.q1 { fill: var(--carte-1); }
.carte-france .dep.q2 { fill: var(--carte-2); }
.carte-france .dep.q3 { fill: var(--carte-3); }
.carte-france .dep.q4 { fill: var(--carte-4); }
.carte-france .dep.q5 { fill: var(--carte-5); }
.carte-france .dep-lien:hover .dep, .carte-france .dep-lien:focus .dep { fill: var(--accent); cursor: pointer; }
.carte-france .dep-lien:focus { outline: none; }
.carte-legende i.q0 { background: var(--carte-0); }
.carte-legende i.q1 { background: var(--carte-1); }
.carte-legende i.q3 { background: var(--carte-3); }
.carte-legende i.q5 { background: var(--carte-5); }

.recherche-ville { display: grid; grid-template-columns: minmax(200px, 2fr) minmax(120px, 1fr) auto; gap: 12px; align-items: end; margin: 14px 0 6px; }
.recherche-ville .champ { position: relative; display: grid; gap: 6px; }
.recherche-ville label { font-weight: 600; font-size: 0.92rem; color: var(--texte-2); }
.recherche-ville input, .recherche-ville select {
  font: inherit; padding: 11px 13px; border-radius: var(--rayon-petit); border: 1px solid var(--bord);
  background: var(--surface); color: var(--texte); min-height: 44px;
}
.recherche-ville input:focus-visible, .recherche-ville select:focus-visible, .recherche-ville button:focus-visible { outline: 3px solid var(--marque-vif); outline-offset: 2px; }
.suggestions {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 5; list-style: none; margin: 4px 0 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon-petit); box-shadow: var(--ombre-forte);
}
.suggestions:empty { display: none; }
.suggestion { padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.suggestion:hover, .suggestion:focus { background: var(--marque-pale); outline: none; }
.champ-bouton .bouton { min-height: 44px; }
.resume-recherche { font-weight: 600; color: var(--marque); margin: 12px 0; }
.couverture { font-size: 0.92rem; margin-top: 18px; }
@media (max-width: 640px) {
  .recherche-ville { grid-template-columns: 1fr; }
}

/* ---------- Recherche ---------- */
.filtres { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 18px; box-shadow: var(--ombre); margin: 18px 0 8px; }
.filtres-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 16px; }
.filtres .champ { position: relative; display: grid; gap: 6px; align-content: start; }
.filtres label { font-weight: 600; font-size: 0.9rem; color: var(--texte-2); }
.filtres input[type="search"], .filtres select {
  font: inherit; padding: 10px 12px; min-height: 44px; border-radius: var(--rayon-petit);
  border: 1px solid var(--bord); background: var(--surface); color: var(--texte); width: 100%; box-sizing: border-box;
}
.filtres input:focus-visible, .filtres select:focus-visible, .filtres button:focus-visible, .filtres .case input:focus-visible {
  outline: 3px solid var(--marque-vif); outline-offset: 2px;
}
.filtres-bas { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--bord); }
.filtres .case { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--texte); cursor: pointer; }
.filtres .case input { width: 18px; height: 18px; accent-color: var(--marque-vif); }
.bouton-texte { background: none; border: 0; color: var(--marque-vif); font: inherit; font-weight: 600; cursor: pointer; padding: 8px 4px; text-decoration: underline; }
.chiffres-recherche { color: var(--texte-2); font-size: 0.95rem; margin: 0 0 14px; }
.recherche-ville .suggestions, .filtres .suggestions { position: absolute; left: 0; right: 0; top: 100%; }

/* ---------- Carte détaillée d'un département ---------- */
.carte-dep-bloc { max-width: 560px; margin: 0 auto; }
.carte-departement { display: block; width: 100%; height: auto; }
.carte-departement .dep-contour { fill: var(--carte-2); stroke: var(--surface); stroke-width: 1.2; }
.carte-departement .ville { fill: var(--accent); fill-opacity: 0.78; stroke: var(--surface); stroke-width: 1; }
.carte-departement .ville:hover { fill-opacity: 1; }
.carte-departement .ville-nom { font-size: 11px; font-weight: 600; fill: var(--texte); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.carte-france .dep-code { font-size: 8px; font-weight: 600; fill: var(--texte); pointer-events: none; text-anchor: middle; dominant-baseline: middle; }
.carte-france .dep-lien:hover .dep-code { fill: #fff; }

/* ---------- Accueil : accès rapides ---------- */
.acces { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 22px 0 8px; }
.acces-carte {
  display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--rayon); text-decoration: none;
  background: var(--surface); border: 1px solid var(--bord); box-shadow: var(--ombre); color: var(--texte);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; position: relative; overflow: hidden;
}
.acces-carte::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--accent), var(--marque-vif)); }
.acces-carte:hover { transform: translateY(-3px); box-shadow: var(--ombre-forte); border-color: var(--marque-vif); }
.acces-titre { font-size: 1.12rem; font-weight: 800; color: var(--marque); }
.acces-texte { color: var(--texte-2); font-size: 0.95rem; line-height: 1.45; }

/* ---------- Carte interactive ---------- */
.carte-commandes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin: 0 0 10px; }
.carte-bouton {
  font: inherit; font-weight: 700; min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: var(--rayon-petit);
  border: 1px solid var(--bord); background: var(--surface); color: var(--marque); cursor: pointer; box-shadow: var(--ombre);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.carte-bouton:hover { border-color: var(--marque-vif); color: var(--marque-vif); }
.carte-bouton:focus-visible { outline: 3px solid var(--marque-vif); outline-offset: 2px; }
.carte-bouton[aria-pressed="true"] { background: var(--marque); color: #fff; border-color: var(--marque); }
.carte-panneau {
  margin-top: 12px; padding: 14px 18px; min-height: 64px; border-radius: var(--rayon); background: var(--surface);
  border: 1px solid var(--bord); border-left: 4px solid var(--accent); box-shadow: var(--ombre); color: var(--texte);
}
.carte-panneau strong { color: var(--marque); font-size: 1.05rem; }
.carte-panneau-chiffres { display: block; margin: 4px 0 6px; color: var(--texte-2); font-variant-numeric: tabular-nums; }
.carte-panneau-villes { margin: 4px 0 8px; padding-left: 18px; color: var(--texte-2); font-size: 0.92rem; }
.carte-france { cursor: grab; touch-action: none; }
.carte-france:active { cursor: grabbing; }
.carte-france .couche-villes .ville-point { fill: var(--accent); fill-opacity: 0.85; stroke: var(--surface); stroke-width: 0.8; pointer-events: none; }
.carte-france .dep-code { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }

.carte-bulle {
  position: absolute; z-index: 10; pointer-events: none; padding: 8px 12px; border-radius: 10px; font-weight: 600;
  background: var(--marque); color: #fff; box-shadow: var(--ombre-forte); font-size: 0.92rem; white-space: nowrap;
}
.carte-bloc { position: relative; }
.carte-france .couche-villes .ville-point { pointer-events: auto; cursor: pointer; }
.carte-france .couche-villes .ville-point:hover { fill: var(--marque); }

/* ---------- Tableau de bord (accueil) ---------- */
.tableau-bord { margin: 18px 0 8px; }
.entete-bord { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 20px; }
.entete-bord h1 { margin: 4px 0 6px; }
.maj-bord { margin: 0; color: var(--texte-2); font-size: 0.9rem; }
.indicateurs-bord { margin-top: 16px; }
.barre-recherche {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 12px 12px 12px 20px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--bord); box-shadow: var(--ombre); color: var(--texte-2); text-decoration: none;
}
.barre-recherche:hover { border-color: var(--marque-vif); color: var(--texte); }
.barre-recherche-bouton { flex: 0 0 auto; padding: 10px 18px; border-radius: 999px; background: var(--marque); color: #fff; font-weight: 700; }
@media (max-width: 600px) { .barre-recherche span:first-child { font-size: 0.92rem; } }

/* ---------- Refonte du tableau de bord (accueil) ---------- */
.tb { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 8px; }
.tb-menu { position: sticky; top: 16px; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px; box-shadow: var(--ombre); display: grid; gap: 2px; }
.tb-menu-titre { margin: 12px 8px 4px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--texte-2); font-weight: 700; }
.tb-menu-titre:first-child { margin-top: 2px; }
.tb-menu a { display: block; padding: 9px 10px; border-radius: var(--rayon-petit); color: var(--texte); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.tb-menu a:hover { background: var(--marque-pale); color: var(--marque-vif); }
.tb-menu a[aria-current="page"] { background: var(--marque); color: #fff; }
.tb-menu-bientot { display: block; padding: 9px 10px; color: var(--texte-2); font-size: 0.92rem; }
.tb-principal { min-width: 0; display: grid; gap: 18px; }
.tb-entete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px 16px; }
.tb-entete h1 { margin: 0 0 4px; }
.tb-entete .chapeau { margin: 0; }
.tb-maj { margin: 0; color: var(--texte-2); font-size: 0.88rem; }
.tb-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.tb-kpi { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 18px 18px 16px; box-shadow: var(--ombre); display: grid; gap: 4px; }
.tb-kpi-label { font-size: 0.82rem; color: var(--texte-2); font-weight: 600; }
.tb-kpi-valeur { font-size: clamp(1.6rem, 3.2vw, 2.2rem); font-weight: 800; color: var(--marque); font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; }
.tb-kpi-note { font-size: 0.85rem; color: var(--texte-2); }
.tb-kpi--vedette { background: linear-gradient(135deg, var(--marque), var(--marque-vif)); border-color: transparent; }
.tb-kpi--vedette .tb-kpi-label, .tb-kpi--vedette .tb-kpi-note { color: rgba(255,255,255,0.85); }
.tb-kpi--vedette .tb-kpi-valeur { color: #fff; }
.tb-recherche { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 10px 10px 20px; border-radius: 999px; background: var(--surface); border: 1px solid var(--bord); box-shadow: var(--ombre); color: var(--texte-2); text-decoration: none; }
.tb-recherche:hover { border-color: var(--marque-vif); }
.tb-recherche-bouton { flex: 0 0 auto; padding: 10px 18px; border-radius: 999px; background: var(--marque); color: #fff; font-weight: 700; }
.tb-grille { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.tb-grille--bas { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.tb-carte, .tb-liste, .tb-alerte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 18px; box-shadow: var(--ombre); min-width: 0; }
.tb-carte h2, .tb-liste h2, .tb-alerte h2 { margin: 0 0 6px; font-size: 1.1rem; }
.tb-carte-entete .chapeau { margin: 0 0 12px; font-size: 0.92rem; }
.tb-liste-entete { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.tb-liste-entete h2 { margin: 0; }
.tb-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tb-item { border: 1px solid var(--bord); border-left: 4px solid var(--accent); border-radius: var(--rayon-petit); padding: 12px 14px; display: grid; gap: 4px; }
.tb-item-date { justify-self: start; }
.tb-item-titre { font-weight: 700; color: var(--texte); text-decoration: none; line-height: 1.35; }
.tb-item-titre:hover { color: var(--marque-vif); text-decoration: underline; }
.tb-item-meta { font-size: 0.88rem; color: var(--texte-2); }
.tb-alerte { border-left: 4px solid var(--marque-vif); }
.tb-alerte p { margin: 6px 0; }
.tb-alerte-note { font-size: 0.88rem; color: var(--texte-2); }
.tb-accesbas { text-align: center; font-size: 0.92rem; color: var(--texte-2); margin: 4px 0 0; }
@media (max-width: 960px) {
  .tb { grid-template-columns: minmax(0, 1fr); }
  .tb-menu { position: static; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; padding: 10px; }
  .tb-menu-titre { width: 100%; margin: 6px 4px 0; }
  .tb-menu a, .tb-menu-bientot { padding: 7px 10px; font-size: 0.9rem; }
  .tb-grille, .tb-grille--bas { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .tb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-kpi { padding: 14px; }
  .tb-recherche span:first-child { font-size: 0.9rem; }
  .carte-bloc { padding: 8px; }
}
