/* ============================================================
   SAT-ellites — Dashboard CSS commun
   Base partagée par tous les dashboards :
   DPE public/privé, vulnérabilités public/privé, portrait social
   ============================================================ */

:root {
  --db-bg: #eef5f3;
  --db-surface: #fff;
  --db-soft: #f7fbfa;
  --db-tint: #edf7f5;
  --db-ink: #172126;
  --db-muted: #63757a;
  --db-line: #dce9e5;
  --db-teal: #39c1bc;
  --db-teal2: #1fa7a2;
  --db-shadow: 0 14px 34px rgba(22,34,38,.08);
  --db-green: #78b66b;
  --db-yellow: #eecf75;
  --db-orange: #dc8540;
  --db-red: #bd4a3f;
  --db-purple: #6c4fa2;
  --db-grey: #a6b0b4;
}

/* --- App shell --- */
.app { padding: 18px 22px 26px; display: grid; gap: 14px }

/* --- Dashboard hero --- */
.app .hero {
  position: relative;
  min-height: auto;
  margin: 0;
  background: var(--db-surface);
  border: 1px solid var(--db-line);
  border-radius: 28px;
  box-shadow: var(--db-shadow);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 18px;
  align-items: center;
}
.app .hero::after { display: none }
.app .hero h1 { font-size: 30px; letter-spacing: -.04em; line-height: 1.05; margin-bottom: 6px }
.app .hero p { max-width: 1050px; font-size: 13px; line-height: 1.48 }
.hero-copy { display: grid; grid-template-columns: minmax(0,1fr); gap: 18px; align-items: center }
.hero-logo { width: 150px; height: auto; display: block }
.hero-text { min-width: 0 }
.topline { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 9px }
.pill { border: 1px solid #d5ebe8; background: #f4faf8; color: #25524f; border-radius: 999px; padding: 7px 10px; font-weight: 850; font-size: 11px }
.kpis { display: grid; grid-template-columns: 112px 126px 112px 112px; gap: 8px }
.kpi { border: 1px solid #d8e9e5; background: #f4faf8; border-radius: 18px; padding: 11px }
.kpi strong { display: block; font-size: 24px; letter-spacing: -.04em; line-height: 1; white-space: nowrap }
.kpi span { display: block; font-size: 11px; color: var(--db-muted); line-height: 1.18; margin-top: 4px }

/* --- Bailleur strip / SAT grid --- */
.bailleur-strip,
.sat-grid {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--db-line);
  border-radius: 24px;
  box-shadow: var(--db-shadow);
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0,1fr));
  gap: 10px;
  position: sticky;
  top: 8px;
  z-index: 900;
  backdrop-filter: blur(8px);
}
.sat-card {
  border: 1px solid #dbe8e4;
  background: linear-gradient(180deg, #fff, #f6faf8);
  border-radius: 18px;
  padding: 9px;
  min-height: 120px;
  transition: .18s;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: none;
  cursor: default;
}
.sat-card:hover { transform: none; box-shadow: none }
.sat-card.is-muted { filter: grayscale(1); opacity: .48 }
.sat-card.collectif { filter: none; opacity: 1; background: linear-gradient(180deg, #eaf8f6, #fff); border-color: #8edbd7 }
.sat-card.collectif .sat-logo-wrap { font-size: 20px; font-weight: 950; color: #1f6f6b; letter-spacing: -.05em }
.sat-card.collectif .sat-name { font-size: 12px; color: #163d3a }
.sat-card.collectif .sat-stat strong { font-size: 24px }
.sat-card.is-empty { opacity: .42 }
.btile {
  border: 1px solid #dbe8e4;
  background: linear-gradient(180deg, #fff, #f6faf8);
  border-radius: 18px;
  padding: 9px;
  cursor: default;
  min-height: 120px;
  transition: .18s;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: none;
}
.btile:hover { transform: none; box-shadow: none }
.btile.active, .btile.collectif { background: linear-gradient(180deg, #eaf8f6, #fff); border-color: #8edbd7; box-shadow: none }
.btile.dim, .btile.muted { filter: grayscale(1); opacity: .48 }
.sat-logo-wrap, .blogo {
  height: 52px;
  border-radius: 12px;
  border: 1px solid #e2eeeb;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  overflow: hidden;
}
.sat-logo-wrap img, .blogo img { max-width: 100%; max-height: 100%; object-fit: contain }
.fallback-logo { font-weight: 900; color: #24524f; font-size: 15px }
.sat-name, .bname { font-size: 11px; font-weight: 900; line-height: 1.15; color: #27383c; min-height: 24px; letter-spacing: 0 }
.sat-name .ghost { visibility: hidden }
.sat-stat, .bstat {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  border-top: 1px solid #e5efec;
  padding-top: 6px;
  margin-top: auto;
  align-items: flex-end;
}
.sat-stat strong, .bstat strong { font-size: 20px; line-height: 1; letter-spacing: -.04em; margin: 0 }
.sat-stat span, .bstat span { font-size: 10px; color: var(--db-muted); text-align: right; line-height: 1.1 }

/* --- Main grid (map + side) --- */
.main-grid { display: grid; grid-template-columns: minmax(0,2fr) minmax(360px,1fr); gap: 14px; align-items: stretch }
.map-card, .side-card {
  background: var(--db-surface);
  border: 1px solid var(--db-line);
  border-radius: 26px;
  box-shadow: var(--db-shadow);
  overflow: hidden;
}
.map-card { position: relative; min-height: 675px; height: 100%; display: flex; flex-direction: column }
#map { flex: 1 1 auto; min-height: 675px; height: 100%; width: 100%; background: #e9f0ee }

/* --- Map filters --- */
.map-filters, .map-filter-card {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 650;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--db-line);
  border-radius: 22px;
  box-shadow: 0 14px 32px rgba(22,34,38,.15);
  padding: 11px;
  width: min(292px, calc(100% - 28px));
  backdrop-filter: blur(7px);
  display: grid;
  gap: 6px;
}
.filter-title { font-weight: 900; font-size: 12px; display: flex; justify-content: space-between; gap: 8px; align-items: center }
.filter-title .reset, .filter-title button, #reset {
  border: 0; background: #eaf4f1; color: #285653;
  border-radius: 999px; padding: 7px 9px; font-weight: 900; font-size: 12px; cursor: pointer;
}
.filter-line { display: grid; grid-template-columns: 1fr; gap: 4px; align-items: stretch }
.filter-label { font-size: 10.5px; font-weight: 900; color: #285653; line-height: 1 }
.search-line { position: relative }
.search-line input { width: 100%; padding-left: 34px }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); z-index: 1; color: #557176; font-weight: 900 }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 7px }

/* --- Form controls --- */
.app select, .app input {
  border: 1px solid #d7e8e4;
  border-radius: 999px;
  padding: 8px 10px;
  background: #fff;
  color: #244b48;
  font-weight: 750;
  font-size: 12px;
  min-width: 0;
}
.app button, .app input, .app select { font: inherit }

/* --- Chips --- */
.checks { display: flex; gap: 6px; flex-wrap: wrap }
.geo-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px }
.chip {
  border: 1px solid #d6e8e4;
  border-radius: 999px;
  background: #fff;
  color: #285653;
  font-weight: 850;
  padding: 7px 8px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.08;
  text-align: center;
}
.chip.active { background: linear-gradient(180deg, var(--db-teal), var(--db-teal2)); color: white; border-color: transparent }
.reset { border: 0; background: #eaf4f1; color: #285653; border-radius: 999px; padding: 7px 9px; font-weight: 900; font-size: 12px; cursor: pointer }

/* --- Multi-select --- */
.multi { position: relative; min-width: 0 }
.multi-btn {
  width: 100%;
  border: 1px solid #d7e8e4;
  border-radius: 999px;
  padding: 8px 28px 8px 10px;
  background: #fff;
  color: #244b48;
  font-weight: 850;
  font-size: 12px;
  min-width: 0;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}
.multi-btn::after { content: "\2304"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #557176; font-weight: 900 }
.multi.open .multi-btn { border-color: #64cfc8; box-shadow: 0 0 0 3px rgba(57,193,188,.13) }
.multi-menu {
  display: none;
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 5px);
  background: #fff;
  border: 1px solid #d7e8e4;
  border-radius: 16px;
  box-shadow: 0 16px 34px rgba(22,34,38,.18);
  padding: 8px;
  z-index: 900;
  max-height: 260px;
  overflow: auto;
}
.multi.open .multi-menu { display: grid; gap: 4px }
.multi-options { display: grid; gap: 4px; max-height: 190px; overflow: auto; padding-right: 2px }
.multi-actions {
  position: sticky; bottom: -8px;
  background: #fff;
  border-top: 1px solid #e1efec;
  margin: 4px -8px -8px;
  padding: 8px;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  border-radius: 0 0 16px 16px;
}
.multi-action { border: 1px solid #d7e8e4; border-radius: 999px; background: #fff; color: #285653; font-size: 11px; font-weight: 900; padding: 7px 9px; cursor: pointer }
.multi-action.primary { background: linear-gradient(180deg, var(--db-teal), var(--db-teal2)); color: #fff; border-color: transparent }
.multi-option { display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 6px; align-items: center; border-radius: 10px; padding: 5px 6px; font-size: 12px; font-weight: 750; color: #244b48; cursor: pointer }
.multi-option:hover { background: #eef8f6 }
.multi-option input { width: 14px; height: 14px; accent-color: var(--db-teal); padding: 0 }
.multi-empty { font-size: 12px; color: var(--db-muted); padding: 7px }
.map-note { font-size: 10.5px; color: #557176; line-height: 1.28; background: #eef8f6; border: 1px solid #d5ebe8; border-radius: 14px; padding: 7px }

/* --- Side card --- */
.side-card { padding: 16px; display: flex; flex-direction: column; gap: 14px }
.side-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px }
.side-head h2 { font-size: 21px; letter-spacing: -.03em }
.side-head p { font-size: 12px; margin-top: 4px }

/* --- Control blocks --- */
.control-block { border: 1px solid #e0ece8; background: #f8fbfa; border-radius: 20px; padding: 12px; display: grid; gap: 10px }
.control-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 900; color: #5b6f75 }
.control-toggle {
  width: 100%;
  border: 1px solid transparent;
  background: linear-gradient(180deg, var(--db-teal), var(--db-teal2));
  color: #fff;
  border-radius: 999px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 950;
  text-align: center;
  box-shadow: 0 10px 22px rgba(57,193,188,.18);
}
.control-toggle.off { background: linear-gradient(180deg, #fff, #f5faf8); border-color: #d9e7e2; color: #244b48; box-shadow: none }
.control-content { display: grid; gap: 10px }
.control-block.collapsed .control-content { display: none }
.control-select { width: 100%; border: 1px solid #d7e8e4; border-radius: 999px; padding: 10px 12px; background: #fff; color: #244b48; font-weight: 850; font-size: 12px }
.control-note { font-size: 11.5px; line-height: 1.35; color: #436469; background: #eef8f6; border: 1px solid #d6ebe7; border-radius: 14px; padding: 8px }

/* --- Metric buttons --- */
.metric-buttons { display: grid; grid-template-columns: 1fr; gap: 8px }
.metric-btn, .soft-btn {
  border: 1px solid #d9e7e2;
  background: linear-gradient(180deg, #fff, #f5faf8);
  color: #244b48;
  border-radius: 999px;
  padding: 9px 10px;
  cursor: pointer;
  font-weight: 900;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}
.metric-btn.active, .soft-btn.active {
  background: linear-gradient(180deg, var(--db-teal), var(--db-teal2));
  border-color: transparent;
  color: white;
  box-shadow: 0 10px 22px rgba(57,193,188,.18);
}

/* --- Metric KPIs --- */
.metric-kpis, .profile-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px }
.metric-kpi, .small-stat { border: 1px solid #d7e8e4; background: #f5fbf9; border-radius: 16px; padding: 10px }
.metric-kpi strong, .small-stat strong { display: block; font-size: 21px; letter-spacing: -.04em; line-height: 1 }
.metric-kpi span, .small-stat span { display: block; color: var(--db-muted); font-size: 10px; line-height: 1.18; margin-top: 5px }

/* --- Layer toggles --- */
.layer-list { display: flex; flex-wrap: wrap; gap: 8px }
.layer-toggle { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #dbe8e4; background: #fff; border-radius: 999px; padding: 9px 12px; font-size: 12px; font-weight: 800; color: #2d5a57 }
.layer-toggle input { accent-color: #1fa7a2 }

/* --- Info boxes --- */
.map-help, .load, .warn, .tagline { background: #f3faf8; border: 1px solid #d9ebe7; border-radius: 18px; padding: 11px; font-size: 12px; color: #345d5b; line-height: 1.4 }
.warn { background: #fff8e8; border-color: #edd9a8; color: #725420 }
.load { background: #eff9f7; border-color: #cfeceb; color: #245c58 }

/* --- Mini chips & sublegend --- */
.map-sublegend { display: flex; flex-wrap: wrap; gap: 8px }
.mini-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d9e7e2; background: #f4faf8; color: #2d5a57; border-radius: 999px; padding: 7px 10px; font-size: 11px; font-weight: 800 }
.mini-chip .dot { width: 10px; height: 10px; border-radius: 50% }
.mini-chip .dot.color { background: #cf5a4d }
.mini-chip .dot.bubble { background: #47b8bd; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(28,94,98,.45) }

/* --- Legend --- */
.legend { position: absolute; right: 18px; bottom: 22px; z-index: 650; background: rgba(255,255,255,.94); border: 1px solid var(--db-line); box-shadow: 0 14px 34px rgba(22,34,38,.14); border-radius: 18px; padding: 12px; min-width: 230px }
.legend h3 { font-size: 13px; margin-bottom: 8px }
.legend-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; font-size: 12px; margin: 6px 0 }
.swatch { width: 18px; height: 12px; border-radius: 4px; border: 1px solid rgba(0,0,0,.08) }
.basemap-note { position: absolute; left: 18px; bottom: 22px; z-index: 649; background: rgba(255,255,255,.88); border: 1px solid var(--db-line); border-radius: 999px; padding: 8px 11px; font-size: 11px; font-weight: 800; color: #365b58; box-shadow: 0 10px 24px rgba(22,34,38,.10) }
.note { font-size: 12px; color: var(--db-muted); line-height: 1.45 }

/* --- Popups --- */
.leaflet-popup-content { font-family: Inter, Arial, sans-serif; font-size: 12px }
.popup-title { font-size: 15px; font-weight: 900; margin-bottom: 4px }
.popup-grid { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; min-width: 220px }
.popup-grid strong { text-align: right }
.pop-title { font-size: 15px; font-weight: 900; margin-bottom: 4px }
.pop-meta { color: #65777d; margin-bottom: 8px; line-height: 1.35 }
.pop-grid { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; min-width: 240px }
.pop-grid strong { text-align: right }

/* --- Below cards --- */
.below { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start }
.app .card, .social-card { background: var(--db-surface); border: 1px solid var(--db-line); border-radius: 24px; box-shadow: var(--db-shadow); padding: 15px }
.app .card h3, .app .card h2, .social-card h2 { font-size: 17px; letter-spacing: -.03em; margin-bottom: 10px }
.section-title { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 12px }
.section-title h2 { font-size: 17px; letter-spacing: -.03em }
.section-title p { font-size: 12px }

/* --- Bar lists --- */
.bar-list { display: grid; gap: 8px }
.bar-tools { display: flex; justify-content: flex-end }
.bar-all { border: 1px solid #d6e8e4; border-radius: 999px; background: #fff; color: #285653; font-size: 11px; font-weight: 900; padding: 7px 10px; cursor: pointer }
.bar-all:hover { border-color: #64cfc8 }
.bar-row { display: grid; grid-template-columns: 92px 1fr 64px; gap: 8px; align-items: center; font-size: 12px }
.bar-label { display: flex; align-items: center; gap: 7px }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block }
.bar-track, .compare-track, .track { height: 10px; background: #eaf1ef; border-radius: 999px; overflow: hidden }
.bar-fill, .compare-fill, .fill { height: 100%; background: linear-gradient(90deg, var(--db-teal2), var(--db-teal)); border-radius: 999px }
.bar-value { font-weight: 900; text-align: right }
.commune-list { display: grid; gap: 8px }
.commune-chip { border: 1px solid #dbe8e4; background: #fff; border-radius: 16px; padding: 10px; cursor: pointer; text-align: left }
.commune-chip:hover { border-color: #8fd3cc }
.commune-chip strong { display: block; font-size: 13px }
.commune-chip span { font-size: 11px; color: var(--db-muted) }

/* --- Social compare --- */
.social-compare { display: block }
.social-card { border-radius: 26px; padding: 18px }
.social-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 14px }
.social-head h2 { font-size: 22px; letter-spacing: -.03em }
.social-head p { max-width: 920px; font-size: 12px }
.social-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px }
.compare-tile { min-height: 282px; display: flex; flex-direction: column; gap: 10px; border: 1px solid #dce9e5; background: linear-gradient(180deg, #fff, #f7fbfa); border-radius: 22px; padding: 14px }
.compare-tile:before { content: 'SAT'; align-self: flex-end; margin: -2px 0 -28px 0; background: #fceceb; border: 1px solid #f2d3d0; color: #9c4038; border-radius: 999px; padding: 5px 8px; font-size: 10px; font-weight: 900 }
.compare-tile:nth-child(5):before { content: 'vigilance'; background: #fff5e8; border-color: #ecd5aa; color: #8c5b12 }
.compare-main { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 10px }
.compare-main strong { font-size: 34px; line-height: 1; letter-spacing: -.04em }
.compare-main span { font-size: 12px; color: var(--db-muted); font-weight: 800 }
.compare-caption { font-size: 12px; color: var(--db-muted); line-height: 1.35; min-height: 36px }
.compare-bars { display: grid; gap: 8px; margin-top: 8px }
.compare-row { display: grid; grid-template-columns: 76px 1fr 58px; gap: 10px; align-items: center; font-size: 12px; color: #466065 }
.compare-row:first-child { background: #fff4f2; border: 1px solid #f1d5d1; border-radius: 14px; padding: 8px 9px }
.compare-fill { background: linear-gradient(90deg, #d65b52, #bd4a3f) }
.compare-fill.ref { background: #91aaa7 }
.compare-fill.fr { background: #cfd8d7 }
.compare-delta { display: inline-flex; align-self: flex-start; border-radius: 999px; padding: 5px 8px; font-size: 11px; font-weight: 900; background: #eefafa; color: #1f6764; margin-top: auto }
.compare-delta.warn { background: #fff4e8; color: #8a4b19 }
.compare-delta.bad { background: #fbeeed; color: #9a3b35 }
.compare-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px }
.legend-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #dde9e5; background: #f6fbfa; border-radius: 999px; padding: 7px 10px; font-size: 11px; font-weight: 800; color: #466065 }
.legend-dot { width: 10px; height: 10px; border-radius: 999px; background: #cfd8d7 }
.legend-dot.sat { background: #cf5147 }
.legend-dot.ref { background: #91aaa7 }
.legend-dot.fr { background: #cfd8d7 }

/* --- Source cards --- */
.source-card { grid-column: auto; grid-row: auto }
.source-card .source-list { grid-template-columns: repeat(2, minmax(0,1fr)) }
.source-list { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px }
.source-item { border: 1px solid #dce9e5; background: #f7fbfa; border-radius: 16px; padding: 12px }
.source-item strong { display: block; font-size: 13px; margin-bottom: 4px }
.source-item span { font-size: 12px; color: var(--db-muted); line-height: 1.45 }
.source-item a { color: #1f6764; font-weight: 900; text-decoration: none }
.source-item a:hover { text-decoration: underline }

/* --- Bubble markers --- */
.bubble-marker { background: transparent; border: none !important }
.lls-bubble { display: flex; align-items: center; justify-content: center; border-radius: 999px; border: 0; box-shadow: 0 8px 20px rgba(22,34,38,.24), 0 0 0 1px rgba(22,34,38,.18); font-weight: 950; letter-spacing: -.035em; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.28) }
.lls-bubble.small { font-size: 0 !important; color: transparent; text-shadow: none }
.legend-subtitle { font-size: 11px; color: #6a7a7f; margin: 10px 0 4px; font-weight: 800 }
.bubble-legend { display: grid; gap: 7px }
.bubble-legend-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; font-size: 12px }
.bubble-swatch { border-radius: 999px; border: 0; box-shadow: 0 2px 7px rgba(22,34,38,.20), 0 0 0 1px rgba(22,34,38,.16); justify-self: center }
.lls-color-scale { display: grid; gap: 6px; margin-top: 7px }
.lls-color-row { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: center; font-size: 12px; color: #4d6468 }
.lls-color-dot { width: 18px; height: 12px; border-radius: 999px; box-shadow: 0 0 0 1px rgba(22,34,38,.12) }

/* --- DPE scales --- */
.dpe-card { display: flex; flex-direction: column; gap: 7px }
.dpe-caption { font-size: 12px; font-weight: 900; color: #172126 }
.dpe-caption.bottom { margin-top: 2px }
.dpe-unit { font-size: 10px; color: var(--db-muted); margin-top: auto }
.dpe-scale { display: grid; gap: 6px; min-height: 210px }
.dpe-row { display: grid; grid-template-columns: minmax(0,1fr) 60px; gap: 8px; align-items: center }
.dpe-track { width: 100%; display: flex; align-items: center }
.dpe-bar { height: 26px; min-width: 128px; background: var(--c); clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%); display: flex; align-items: center; justify-content: space-between; padding: 0 18px 0 10px; font-weight: 950; box-shadow: inset 0 0 0 1px rgba(255,255,255,.55) }
.dpe-bar .range { font-size: 11px; white-space: nowrap }
.dpe-bar .letter { font-size: 17px; line-height: 1; margin-left: 10px }
.dpe-count { text-align: right; font-weight: 900; font-size: 12px; color: #243638 }
.dpe-missing { font-size: 11px; color: var(--db-muted); border-top: 1px solid #e5efec; padding-top: 5px }
.dpe-source-note { font-size: 10px; color: var(--db-muted); line-height: 1.25 }

/* --- Donut charts --- */
.donut-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px }
.donut-card { border: 1px solid #e0ece8; background: #fff; border-radius: 18px; padding: 12px; display: grid; grid-template-columns: 94px 1fr; gap: 12px; align-items: start }
.donut-plot { display: grid; place-items: center; gap: 4px }
.donut-title { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: #5b6f75 }
.donut { width: 84px; height: 84px; border-radius: 50%; position: relative; box-shadow: inset 0 0 0 1px rgba(0,0,0,.04) }
.donut::after { content: ""; position: absolute; inset: 16px; background: #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.04) }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; z-index: 2; line-height: 1 }
.donut-center strong { font-size: 28px; letter-spacing: -.04em; color: #243638 }
.donut-center span { font-size: 10px; color: var(--db-muted) }
.donut-meta { display: grid; gap: 5px }
.donut-legend { display: grid; gap: 3px }
.donut-leg-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 6px; align-items: center; font-size: 11px }
.donut-leg-row .dot { width: 10px; height: 10px }
.donut-dominant { font-size: 11px; color: #345d5b; border-top: 1px solid #e5efec; padding-top: 6px; margin-top: 4px; line-height: 1.3 }
.subtle { font-size: 11px; color: var(--db-muted); line-height: 1.3 }

/* --- Risk matrix --- */
.risk-matrix-section { background: var(--db-surface); border: 1px solid var(--db-line); border-radius: 26px; box-shadow: var(--db-shadow); padding: 18px; display: grid; gap: 14px }
.risk-matrix-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap }
.risk-matrix-title h2 { font-size: 24px; letter-spacing: -.035em; margin-bottom: 5px }
.risk-matrix-title p { font-size: 13px; max-width: 980px }
.matrix-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
.matrix-toolbar-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 900; color: #5b6f75; width: 100%; margin-top: 2px }
.matrix-chip { border: 1px solid #d7e8e4; background: #f7fbfa; color: #25524f; border-radius: 999px; padding: 8px 12px; cursor: pointer; font-weight: 900; font-size: 13px }
.matrix-chip.active { background: linear-gradient(180deg, var(--db-teal), var(--db-teal2)); color: white; border-color: transparent; box-shadow: 0 10px 20px rgba(31,167,162,.16) }
.matrix-grid { display: grid; gap: 14px }
.matrix-row { border: 1px solid #e0ece8; background: linear-gradient(180deg, #fbfdfc, #f7faf9); border-radius: 24px; padding: 14px }
.matrix-row-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; margin-bottom: 12px; flex-wrap: wrap }
.matrix-row-head h3 { font-size: 18px; margin: 0 }
.matrix-row-head p { font-size: 12px }
.matrix-track { display: grid; grid-template-columns: repeat(4, minmax(205px,1fr)); gap: 12px }
.matrix-card { border: 1px solid #e0ece8; background: #fff; border-radius: 20px; padding: 14px; display: grid; grid-template-columns: 130px minmax(0,1fr); gap: 14px; align-items: center; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease }
.matrix-card:hover { transform: translateY(-2px); box-shadow: 0 14px 24px rgba(22,34,38,.09); border-color: #89d5cf }
.matrix-card.dim { opacity: .36 }
.matrix-card-title { grid-column: 1/-1; font-weight: 950; font-size: 15px }
.matrix-donut { width: 116px; height: 116px; border-radius: 50%; position: relative; background: #eaf1ef; box-shadow: inset 0 0 0 1px rgba(0,0,0,.04) }
.matrix-donut::after { content: ""; position: absolute; inset: 20px; background: #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.04) }
.matrix-center { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; line-height: 1 }
.matrix-center strong { font-size: 28px; letter-spacing: -.04em }
.matrix-center span { font-size: 11px; color: var(--db-muted) }
.matrix-legend { display: grid; gap: 6px; align-content: center }
.matrix-leg-row { display: grid; grid-template-columns: 12px minmax(0,1fr) auto; gap: 7px; align-items: center; font-size: 12px }
.matrix-leg-row strong { text-align: right }
.matrix-dominant { grid-column: 1/-1; border-top: 1px solid #e5efec; margin-top: 2px; padding-top: 8px; font-size: 12px; color: #3e6461; line-height: 1.35 }
.matrix-empty { border: 1px dashed #d8e9e5; border-radius: 18px; background: #f8fbfa; color: var(--db-muted); padding: 18px; text-align: center; font-size: 13px }

/* --- Risk pill --- */
.risk-pill { display: inline-block; border-radius: 999px; padding: 4px 8px; background: var(--c); color: #fff; font-weight: 900 }

/* --- Age EPCI panel (vulnerabilites) --- */
.age-epci-panel { margin: 10px 0 12px; padding: 10px; border: 1px solid rgba(31,103,100,.18); border-radius: 18px; background: rgba(255,255,255,.75); box-shadow: 0 4px 18px rgba(20,60,60,.08) }
.age-epci-panel .age-title { font-weight: 800; color: #173b3a; font-size: 13px; margin-bottom: 2px }
.age-epci-panel .age-sub { font-size: 11px; color: #6b7c7a; line-height: 1.25; margin-bottom: 8px }
.age-buttons { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; margin-bottom: 8px }
.age-btn { border: 1px solid rgba(31,103,100,.18); background: #fff; color: #173b3a; border-radius: 12px; padding: 8px 6px; font-weight: 800; font-size: 12px; cursor: pointer }
.age-btn.active { background: #35c2bf; color: #fff; border-color: #35c2bf }
.age-opacity { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #6b7c7a }
.age-opacity input { width: 100% }
.age-legend { display: grid; grid-template-columns: repeat(3,22px); grid-auto-rows: 16px; gap: 2px; margin-top: 8px }
.age-legend span { display: block; border-radius: 3px; border: 1px solid rgba(0,0,0,.08) }
.age-loading { font-size: 11px; color: #6b7c7a; margin-top: 6px }

/* --- Bubble public (vulnerabilites) --- */
.bubble-public { width: var(--s); height: var(--s); border-radius: 50%; background: var(--c); border: 0; box-shadow: none; opacity: .8 }
.public-popup .pop-grid { grid-template-columns: 1fr auto }

/* --- Leaflet tile --- */
.leaflet-tile-pane { filter: saturate(.92) contrast(.96) brightness(1.03) }

/* --- EPCI tooltip --- */
.epci-tooltip { background: rgba(255,255,255,.96); border: 1px solid #d7e8e4; border-radius: 12px; color: #244b48; box-shadow: 0 8px 18px rgba(22,34,38,.12) }

/* --- Mini rows (below cards) --- */
.mini-list { display: grid; gap: 8px }
.mini-row { display: grid; grid-template-columns: 1fr 90px; gap: 10px; align-items: center; font-size: 12px }
.mini-row strong { text-align: right }

/* --- Horizon grid (vulnerabilites) --- */
.horizon-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px }

/* --- Responsive dashboard --- */
@media (max-width:1320px) {
  .kpis { grid-template-columns: 126px 126px }
  .bailleur-strip, .sat-grid { grid-template-columns: repeat(4,1fr) }
  .main-grid, .below { grid-template-columns: 1fr }
  .source-card { grid-column: auto; grid-row: auto }
  .map-card { height: 620px; min-height: 620px }
  .map-card #map { height: 100%; min-height: 620px }
  .social-grid { grid-template-columns: 1fr 1fr }
  .source-list { grid-template-columns: 1fr }
  .source-card .source-list { grid-template-columns: repeat(2, minmax(0,1fr)) }
  .matrix-track { grid-template-columns: repeat(2, minmax(205px,1fr)) }
}
@media (max-width:720px) {
  .app { padding: 12px }
  .app .hero { grid-template-columns: 1fr }
  .hero-copy { grid-template-columns: 1fr }
  .kpis { grid-template-columns: repeat(2,1fr) }
  .bailleur-strip, .sat-grid { grid-template-columns: repeat(2,1fr); position: static }
  .map-filters, .map-filter-card { position: relative; top: auto; left: auto; margin: 10px; width: auto }
  .map-card { display: flex; flex-direction: column }
  .frow, .filter-line, .geo-shortcuts,
  .metric-kpis, .profile-grid, .metric-buttons,
  .social-grid, .donut-grid, .horizon-grid { grid-template-columns: 1fr }
  .legend, .basemap-note { position: relative; right: auto; left: auto; bottom: auto; margin: 10px 14px 0; display: block }
  .social-head { display: block }
  .bar-row, .compare-row { grid-template-columns: 1fr }
  .source-list, .source-card .source-list { grid-template-columns: 1fr }
  .legend-summary { grid-template-columns: 1fr }
  .matrix-track { grid-template-columns: 1fr }
  .matrix-card { grid-template-columns: 112px minmax(0,1fr) }
  .epci-communes { grid-template-columns: 1fr }
  .geo-shortcuts { grid-template-columns: 1fr }
  .multi-menu { position: relative; top: auto; max-height: 220px }
}
