body{font:16px/1.5 system-ui,Segoe UI,Roboto,Arial;padding:1rem;max-width:1000px;margin:auto}
header{display:flex;gap:1rem;align-items:center;justify-content:space-between}
th {text-align:left; vertical-align:top; padding-right:15px;}
#list{columns:2;gap:1rem;list-style:none;padding:0}
#list li{break-inside:avoid;padding:.3rem 0}
.card{border:1px solid #eee;padding:.7rem;border-radius:10px;margin:.5rem 0;background:#fff}
.mono{font-family:ui-monospace,Consolas,monospace;overflow:auto;background:#fafafa;padding:.6rem;border-radius:8px}
@media (max-width:700px){ #list{columns:1} }
button{padding:.5rem .8rem;border-radius:8px;border:1px solid #ccc;background:#f7f7f7;cursor:pointer}
button:disabled{opacity:.6;cursor:not-allowed}
table{font-size:15px}
a{color:#0645ad;text-decoration:none}
a:hover{text-decoration:underline}
/* === Dashboard RFU (ajouts légers) === */
.kpi-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.8rem;margin:.6rem 0}
.legend{font-size:.95rem;color:#555;margin:.35rem 0;padding-left:0}
.legend li{margin:.25rem 0}
.chart-wrap{display:grid;grid-template-columns:1fr 2fr;gap:12px;margin:.75rem 0}
.chart{border:1px solid #eee;border-radius:10px;background:#fff;padding:8px;overflow:hidden}
.chart h4{margin:.2rem .2rem .6rem;font-size:.95rem}
.chart-box{height:220px}
.mini-bench{display:grid;grid-template-columns:1fr 1fr;gap:.8rem;margin:.75rem 0}
.bench{border:1px solid #eee;border-radius:10px;background:#fff;padding:.6rem}
.rule{position:relative;height:8px;border-radius:6px;background:linear-gradient(90deg,#e8e8e8,#f3f3f3);margin:.2rem 0}
.rule .pin{position:absolute;top:-6px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:10px solid #0b5cff}
.rule-labels{display:flex;justify-content:space-between;font-size:.8rem;color:#666;margin-top:.25rem}
.mapbox{height:420px;border-radius:8px;overflow:hidden}
@media (max-width:900px){
  .kpi-row{grid-template-columns:repeat(2,minmax(0,1fr))}
  .chart-wrap{grid-template-columns:1fr}
  .mini-bench{grid-template-columns:1fr}
}
/* === CFI-10 badge & dashboard tweaks === */
.header-tools{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.cfi-badge{display:inline-flex;align-items:center;gap:.5rem;border:1px solid #eee;background:#fff;border-radius:999px;padding:.25rem .6rem}
.cfi-title{font-size:.9rem;color:#555}
.cfi-score{font-weight:700}
.cfi-gauge{position:relative;width:90px;height:8px;background:#eee;border-radius:6px;overflow:hidden}
.cfi-fill{position:absolute;left:0;top:0;bottom:0;background:#0b5cff;border-radius:6px}
.kpi-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.8rem;margin:.6rem 0}

/* Header en grille pour placer le compteur à droite, sous le titre */
.page-header--grid{
  display:grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items:end;
  row-gap:.35rem;
}
.page-header--grid .title{ grid-column:1; grid-row:1 / span 2; }
.header-back{ grid-column:2; grid-row:1; justify-self:end; }
/* Cartes patrimoine (listes) */
.herit-card { display:grid; grid-template-columns: 220px 1fr; gap:14px; padding:12px; border:1px solid #eee; border-radius:10px; background:#fff; margin:.6rem 0; }
.herit-media img { width:100%; height:150px; object-fit:cover; border-radius:8px; }
.herit-media .noimg{height:150px; display:flex; align-items:center; justify-content:center; background:#f5f7ff; color:#586a9b; border-radius:8px; padding:8px; text-align:center}
.herit-body h4{ margin:.1rem 0 .25rem; }
.herit-body .meta{ margin:.15rem 0 .35rem; color:#444; }
.herit-body .desc{ margin:.35rem 0; }
.herit-body .links{ margin:.35rem 0 0; }
.btn-map{ padding:.35rem .6rem; border:1px solid #cfd7ef; border-radius:8px; background:#f6f8ff; cursor:pointer; }
@media (max-width:720px){
  .herit-card{ grid-template-columns: 1fr; }
  .herit-media img,.herit-media .noimg{ height:180px; }
}
/* Compteur CFI */
.cfi-meter{ grid-column:2; grid-row:2; justify-self:end; display:flex; align-items:center; gap:.6rem; position:relative }
.meter-svg{ width:84px; height:84px }
.meter-label{ line-height:1.1 }
.meter-label small{ color:#666; margin-left:.1rem }
.meter-meta{ margin-top:.1rem }

/* Tooltip léger au survol */
.cfi-meter::after{
  content: attr(data-tip);
  position:absolute; right:0; bottom:100%;
  transform: translateY(-8px);
  background:#111; color:#fff; font-size:.82rem; line-height:1.25;
  padding:.55rem .6rem; border-radius:8px; width: min(420px, 70vw);
  opacity:0; pointer-events:none; transition:.15s ease; box-shadow:0 8px 24px rgba(0,0,0,.18);
  white-space:normal; text-wrap:pretty;
}
.cfi-meter:hover::after{ opacity:1 }

/* Fix Leaflet vs images responsives : NE PAS redimensionner les tuiles */
.leaflet-container img {
  max-width: none !important;
}
.leaflet-container img.leaflet-tile,
.leaflet-container img.leaflet-marker-icon,
.leaflet-container img.leaflet-marker-shadow {
  width: auto !important;
  height: auto !important;
}

.grid.photos{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px}
.card.photo{border:1px solid #eee;border-radius:10px;overflow:hidden;background:#fff}
.card.photo img{display:block;width:100%;height:140px;object-fit:cover}
.card.photo .noimg{height:140px;display:flex;align-items:center;justify-content:center;background:#f5f7ff;color:#586a9b;padding:8px;text-align:center}
.kv {margin-left:0px;}

/* RFU - lisibilité labels/valeurs (si pas déjà présent) */
.kv.rfu-rows { width:100%; border-collapse: collapse; margin-top:6px; }
.kv.rfu-rows td { border:1px solid #eee; padding:.45rem .55rem; vertical-align:middle; font-weight:400; }
.kv.rfu-rows td.lbl { text-align:left; }
.kv.rfu-rows td.num1 { width:140px; text-align:right; white-space:nowrap; }
.kv.rfu-rows td.num2 { width:60px; text-align:right; white-space:nowrap; }
.kv.rfu-rows tr.hdr td { font-weight:600; background:#fafafa; }
.rfu-rule svg { display:block; width:100%; height:28px; }
.chart-box{ min-height: 200px; }
/* Sécurise la hauteur des zones graphiques RFU + réglettes */
.chart-box{ min-height: 200px; }
.rfu-rule svg { display:block; width:100%; height:32px; }

/* (option) labels du top5 un peu plus lisibles sur 2 lignes */
#rfu-bars text { fill:#222; }
/* Sécurise la hauteur des zones graphiques RFU + réglettes */
.chart-box{ min-height: 200px; }
.rfu-rule svg { display:block; width:100%; height:32px; }

/* (option) labels du top5 un peu plus lisibles sur 2 lignes */
#rfu-bars text { fill:#222; }

.chart-box{ min-height: 200px; } /* garanti un peu d'espace sous le donut / top5 */
/* Patrimoine - liste à plat */
.pat-list{display:flex;flex-direction:column;gap:12px}
.pat-row{display:grid;grid-template-columns:220px 1fr; gap:12px; border:1px solid #eee; border-radius:10px; background:#fff; padding:10px}
.pat-photo{width:100%; height:160px; overflow:hidden; border-radius:8px; background:#f5f7ff; display:flex; align-items:center; justify-content:center}
.pat-photo img{width:100%; height:100%; object-fit:cover; display:block}
.pat-photo .noimg{padding:6px; text-align:center; color:#586a9b}
.pat-info{display:flex; flex-direction:column; gap:.3rem}
.pat-title{margin:.1rem 0 .2rem; font-size:1.05rem}
.pat-meta{list-style:none; margin:.15rem 0; padding:0; color:#444}
.pat-meta li{margin:.1rem 0}
.pat-txt{margin:.2rem 0; color:#222}
@media (max-width:760px){
  .pat-row{grid-template-columns:1fr}
  .pat-photo{height:180px}
}
