/* ===========================
   Eau Courante — Global CSS
   =========================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;700;900&display=swap');

:root {
  --blue:    #0077b6;
  --blue-d:  #023e8a;
  --blue-l:  #90e0ef;
  --good:    #2ecc71;
  --mid:     #f39c12;
  --bad:     #e74c3c;
  --bg:      #f4f9ff;
  --card-bg: #ffffff;
  --text:    #1a2e44;
  --muted:   #666;
  --radius:  12px;
}

body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---- Header ---- */
.site-header { background: var(--blue-d); color: white; padding: 14px 24px; }
.header-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.logo { color: white; font-size: 1.4em; font-weight: 700; }
nav a { color: rgba(255,255,255,0.85); margin-left: 20px; font-size: .95em; }
nav a:hover { color: white; text-decoration: none; }

/* ---- Hero ---- */
.hero { background: linear-gradient(135deg, var(--blue), #00b4d8); color: white; padding: 70px 20px; text-align: center; }
.hero-inner { max-width: 680px; margin: 0 auto; }
.hero h1 { font-size: 2em; line-height: 1.3; margin-bottom: 12px; }
.hero p { opacity: .9; margin-bottom: 28px; font-size: 1.05em; }

.search-form { display: flex; border-radius: 50px; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,.2); max-width: 560px; margin: 0 auto; }
.search-form input { flex: 1; padding: 16px 24px; font-size: 1em; border: none; outline: none; }
.search-form button { padding: 16px 28px; background: var(--blue-d); color: white; border: none; font-size: 1em; font-weight: 700; cursor: pointer; }
.search-form button:hover { background: #03045e; }

/* ---- Stats bar ---- */
.stats-bar { display: flex; justify-content: center; gap: 40px; padding: 32px 20px; background: white; flex-wrap: wrap; border-bottom: 1px solid #e0e8f0; }
.stat-item { text-align: center; }
.stat-item .num { display: block; font-size: 2em; font-weight: 700; color: var(--blue); }
.stat-item .label { font-size: .9em; color: var(--muted); }

/* ---- Container ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 48px 20px; }
.container h2 { font-size: 1.5em; margin-bottom: 24px; color: var(--blue-d); }

/* ---- Breadcrumb ---- */
.breadcrumb { max-width: 1100px; margin: 0 auto; padding: 12px 20px; font-size: .9em; color: var(--muted); }
.breadcrumb a { color: var(--muted); }

/* ---- Ville grid ---- */
.ville-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.ville-card { background: white; border-radius: var(--radius); padding: 16px; display: flex; align-items: center; gap: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.06); transition: transform .15s, box-shadow .15s; }
.ville-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.1); text-decoration: none; }
.ville-nom { flex: 1; font-weight: 500; color: var(--text); }
.score-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.score-dot.good { background: var(--good); }
.score-dot.mid  { background: var(--mid); }
.score-dot.bad  { background: var(--bad); }
.score-badge { font-size: .8em; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.score-badge.good { background: #d4edda; color: #155724; }
.score-badge.mid  { background: #fff3cd; color: #856404; }
.score-badge.bad  { background: #f8d7da; color: #721c24; }

/* ---- Theme grid ---- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.theme-card { background: white; border-radius: var(--radius); padding: 28px; box-shadow: 0 2px 12px rgba(0,0,0,.07); border-left: 4px solid var(--blue); transition: transform .15s; }
.theme-card:hover { transform: translateY(-3px); text-decoration: none; }
.theme-card.danger { border-color: var(--bad); }
.theme-card.warning { border-color: var(--mid); }
.theme-card.info { border-color: var(--blue); }
.theme-card .icon { font-size: 2em; display: block; margin-bottom: 10px; }
.theme-card h3 { font-size: 1.1em; margin-bottom: 8px; color: var(--text); }
.theme-card p { font-size: .9em; color: var(--muted); }

/* ---- Commune hero ---- */
.commune-hero { background: linear-gradient(135deg, var(--blue-d), var(--blue)); color: white; padding: 48px 20px; text-align: center; }
.commune-hero .container { padding-top: 0; padding-bottom: 0; }
.commune-hero h1 { font-size: 2em; margin-bottom: 8px; }
.commune-meta { opacity: .85; margin-bottom: 24px; font-size: .95em; }
.score-main { display: inline-block; padding: 20px 40px; border-radius: var(--radius); margin-bottom: 20px; }
.score-main.good { background: rgba(46,204,113,.2); border: 2px solid var(--good); }
.score-main.mid  { background: rgba(243,156,18,.2);  border: 2px solid var(--mid); }
.score-main.bad  { background: rgba(231,76,60,.2);   border: 2px solid var(--bad); }
.score-number { font-size: 3em; font-weight: 700; line-height: 1; }
.score-number span { font-size: .4em; opacity: .7; }
.score-label { font-size: 1em; margin-top: 4px; }
.conformite-row { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; margin-top: 10px; }
.conf-item { text-align: center; }
.conf-item strong { display: block; font-size: .85em; opacity: .8; margin-bottom: 4px; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: .85em; font-weight: 600; }
.badge.good { background: #d4edda; color: #155724; }
.badge.bad  { background: #f8d7da; color: #721c24; }

/* ---- Param cards ---- */
.param-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.param-card { background: white; border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.06); border-top: 4px solid #e0e0e0; transition: transform .15s; text-decoration: none; color: var(--text); }
.param-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.1); text-decoration: none; }
.param-card.good { border-color: var(--good); }
.param-card.mid  { border-color: var(--mid); }
.param-card.bad  { border-color: var(--bad); }
.param-icon { font-size: 1.8em; }
.param-name { font-weight: 600; font-size: .95em; }
.param-val { font-size: 1.3em; font-weight: 700; color: var(--blue-d); }
.param-limit { font-size: .8em; color: var(--muted); }
.param-bar { height: 6px; background: #e8e8e8; border-radius: 3px; margin-top: 4px; }
.bar-fill { height: 100%; border-radius: 3px; }
.bar-fill.good { background: var(--good); }
.bar-fill.mid  { background: var(--mid); }
.bar-fill.bad  { background: var(--bad); }
.no-data { color: var(--muted); font-style: italic; font-size: .9em; }

/* ---- Chart ---- */
.chart-wrap { background: white; border-radius: var(--radius); padding: 24px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }

/* ---- Conseils ---- */
.conseils { display: flex; flex-direction: column; gap: 16px; }
.conseil { background: white; border-radius: var(--radius); padding: 20px 24px; border-left: 4px solid var(--blue); }
.conseil.danger  { border-color: var(--bad); background: #fff5f5; }
.conseil.warning { border-color: var(--mid); background: #fffbf0; }
.conseil.info    { border-color: var(--blue); background: #f0f7ff; }
.conseil strong { display: block; margin-bottom: 8px; }
.btn-affil { display: inline-block; margin-top: 12px; padding: 10px 20px; background: var(--blue); color: white; border-radius: 8px; font-weight: 600; font-size: .9em; }
.btn-affil:hover { background: var(--blue-d); text-decoration: none; }

/* ---- FAQ ---- */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
details { background: white; border-radius: var(--radius); padding: 16px 20px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
summary { cursor: pointer; font-weight: 600; list-style: none; }
summary::before { content: none; }
details[open] summary::before { content: none; }
details p { margin-top: 12px; color: var(--muted); }

/* ---- Recherche ---- */
.results-list { display: flex; flex-direction: column; gap: 8px; }
.result-item { background: white; border-radius: 8px; padding: 16px 20px; display: flex; align-items: center; gap: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.result-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }

/* ---- Footer ---- */
.site-footer { background: #0f1f3d; color: rgba(255,255,255,.65); font-size: .875em; margin-top: 72px; }
.site-footer a { color: rgba(255,255,255,.8); text-decoration: none; transition: color .15s; }
.site-footer a:hover { color: white; }
.disclaimer { margin-top: 8px; font-size: .8em; opacity: .6; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.4em; }
  .commune-hero h1 { font-size: 1.5em; }
  .param-cards { grid-template-columns: 1fr 1fr; }
  .stats-bar { gap: 20px; }
  nav { display: none; }
}

/* ---- Pagination ---- */
.pagination { display:flex; gap:8px; flex-wrap:wrap; margin-top:32px; align-items:center; }
.page-link { padding:8px 14px; background:white; border-radius:8px; color:var(--blue); font-weight:600; box-shadow:0 2px 6px rgba(0,0,0,.06); }
.page-link:hover { background:var(--blue); color:white; text-decoration:none; }
.page-current { padding:8px 14px; background:var(--blue); color:white; border-radius:8px; font-weight:700; }
.page-dots { padding:8px 4px; color:var(--muted); }

/* ---- Intro text ---- */
.intro-text { background:white; border-radius:var(--radius); padding:24px 28px; box-shadow:0 2px 10px rgba(0,0,0,.06); font-size:1.05em; line-height:1.8; }
.intro-text .good { color: var(--good); }
.intro-text .mid  { color: var(--mid); }
.intro-text .bad  { color: var(--bad); }

/* ---- Compare table ---- */
.compare-table { background:white; border-radius:var(--radius); box-shadow:0 2px 10px rgba(0,0,0,.06); overflow:hidden; }
.compare-table table { width:100%; border-collapse:collapse; }
.compare-table th { background:var(--blue-d); color:white; padding:12px 16px; text-align:left; font-size:.9em; }
.compare-table td { padding:12px 16px; border-bottom:1px solid #f0f0f0; font-size:.9em; }
.compare-table tr:last-child td { border-bottom:none; }
.compare-table td.good { color:#155724; font-weight:700; }
.compare-table td.mid  { color:#856404; font-weight:700; }
.compare-table td.bad  { color:#721c24; font-weight:700; }
.compare-table tr:hover td { background:#f8fbff; }

/* ---- Charts row ---- */
.charts-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:20px; }
.chart-wrap h3 { font-size:1em; margin-bottom:12px; color:var(--blue-d); }

/* ---- Prélèvements ---- */
.prelevements-list { display:flex; flex-direction:column; gap:10px; }
.prel-item { background:white; border-radius:8px; padding:14px 18px; display:flex; align-items:center; gap:16px; flex-wrap:wrap; box-shadow:0 2px 8px rgba(0,0,0,.05); font-size:.9em; }
.prel-date { font-weight:700; color:var(--blue-d); min-width:90px; }
.prel-concl { color:var(--muted); flex:1; }

/* ---- Param vs ---- */
.param-vs { font-size:.75em; color:var(--muted); margin-top:2px; }

/* ---- Region grid ---- */
.region-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:16px; }
.region-card { background:white; border-radius:var(--radius); padding:18px; box-shadow:0 2px 8px rgba(0,0,0,.06); }
.region-emoji { font-size:1.8em; display:block; margin-bottom:6px; }
.region-card strong { display:block; font-size:.95em; margin-bottom:8px; color:var(--text); }
.region-depts { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.dept-link { background:#e8f4ff; color:var(--blue); padding:3px 9px; border-radius:12px; font-size:.8em; font-weight:600; }
.dept-link:hover { background:var(--blue); color:white; text-decoration:none; }

/* ---- Theme link ---- */
.theme-link { display:inline-block; margin-top:12px; font-weight:600; color:var(--blue); font-size:.9em; }

/* ---- Comparateur ---- */
.compare-form { background:white; border-radius:var(--radius); padding:32px; box-shadow:0 2px 12px rgba(0,0,0,.07); margin-bottom:32px; }
.compare-inputs { display:flex; gap:20px; align-items:center; flex-wrap:wrap; margin-bottom:20px; }
.compare-input-wrap { flex:1; min-width:200px; position:relative; }
.compare-input-wrap label { display:block; font-weight:600; margin-bottom:6px; font-size:.9em; color:var(--muted); }
.compare-input-wrap input { width:100%; padding:12px 16px; border:2px solid #e0e8f0; border-radius:8px; font-size:1em; outline:none; }
.compare-input-wrap input:focus { border-color:var(--blue); }
.vs-badge { font-size:1.4em; font-weight:900; color:var(--blue-d); flex-shrink:0; }
.btn-compare { padding:14px 32px; background:var(--blue); color:white; border:none; border-radius:8px; font-size:1em; font-weight:700; cursor:pointer; }
.btn-compare:hover { background:var(--blue-d); }
.compare-result { background:white; border-radius:var(--radius); box-shadow:0 2px 12px rgba(0,0,0,.07); overflow:hidden; }
.compare-header { display:grid; grid-template-columns:1fr auto 1fr; gap:16px; padding:24px; text-align:center; background:var(--bg); }
.compare-col h2 { font-size:1.2em; margin-bottom:4px; }
.compare-col p { color:var(--muted); font-size:.9em; }
.compare-center { display:flex; align-items:center; font-size:2em; color:var(--muted); }
.compare-table-full { width:100%; border-collapse:collapse; }
.compare-table-full th { background:var(--blue-d); color:white; padding:12px 16px; font-size:.9em; }
.compare-table-full td { padding:12px 16px; border-bottom:1px solid #f0f0f0; font-size:.9em; text-align:center; }
.compare-table-full td.param-label { text-align:left; background:#fafafa; }
.compare-table-full td.good { color:#155724; font-weight:700; }
.compare-table-full td.bad  { color:#721c24; font-weight:700; }
.compare-links { display:flex; gap:16px; padding:20px; flex-wrap:wrap; }

/* ---- Autocomplete ---- */
.autocomplete-box { position:absolute; top:100%; left:0; right:0; background:white; border:1px solid #e0e8f0; border-radius:0 0 8px 8px; box-shadow:0 8px 24px rgba(0,0,0,.12); z-index:1000; display:none; }
.ac-item { display:flex; align-items:center; gap:10px; padding:10px 14px; cursor:pointer; text-decoration:none; color:var(--text); border-bottom:1px solid #f5f5f5; }
.ac-item:hover { background:#f0f7ff; text-decoration:none; }
.ac-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.ac-dot.good { background:var(--good); }
.ac-dot.mid  { background:var(--mid); }
.ac-dot.bad  { background:var(--bad); }
.ac-nom { flex:1; font-size:.95em; font-weight:500; }
.ac-dept { font-size:.8em; color:var(--muted); }
.header-search { flex:1; max-width:320px; }
.header-search-wrap { position:relative; }
.header-search input { width:100%; padding:8px 14px; border:1px solid rgba(255,255,255,.3); border-radius:20px; background:rgba(255,255,255,.15); color:white; font-size:.9em; outline:none; }
.header-search input::placeholder { color:rgba(255,255,255,.7); }
.header-search input:focus { background:white; color:var(--text); border-color:white; }

/* ---- Compare table for dept page ---- */
.compare-table-full td.param-label small { color:var(--muted); font-weight:normal; }

@media (max-width:640px) {
  .compare-inputs { flex-direction:column; }
  .compare-header { grid-template-columns:1fr; }
  .region-grid { grid-template-columns:1fr 1fr; }
  .charts-row { grid-template-columns:1fr; }
}

/* ---- 2col layout ---- */
.content-2col { display:grid; grid-template-columns:1fr 1fr; gap:32px; align-items:start; }
@media(max-width:768px){ .content-2col { grid-template-columns:1fr; } }

/* ---- Risk cards ---- */
.risk-cards { display:flex; flex-direction:column; gap:10px; }
.risk-card { background:white; border-radius:8px; padding:14px 16px; display:flex; gap:12px; align-items:flex-start; box-shadow:0 2px 6px rgba(0,0,0,.05); border-left:4px solid #e0e0e0; }
.risk-card span { font-size:1.6em; flex-shrink:0; }
.risk-card strong { display:block; font-size:.9em; margin-bottom:2px; }
.risk-card p { font-size:.85em; color:var(--muted); margin:0; }
.risk-card.danger  { border-color:var(--bad);  background:#fff5f5; }
.risk-card.warning { border-color:var(--mid);  background:#fffbf0; }
.risk-card.safe    { border-color:var(--good); background:#f0fdf4; }

/* ---- Risk bar ---- */
.risk-bar-wrap { position:relative; margin-top:8px; }
.risk-scale { display:flex; border-radius:6px; overflow:hidden; height:28px; }
.risk-seg { display:flex; align-items:center; justify-content:center; font-size:.75em; font-weight:600; color:white; }
.risk-seg.good { background:var(--good); }
.risk-seg.mid  { background:var(--mid); }
.risk-seg.bad  { background:var(--bad); }
.risk-cursor { position:absolute; top:28px; transform:translateX(-50%); font-size:.75em; font-weight:700; color:var(--text); text-align:center; }

/* ---- Hardness scale ---- */
.hardness-scale { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.hs-item { flex:1; min-width:100px; text-align:center; padding:12px 8px; border-radius:8px; background:#f5f5f5; border:2px solid transparent; }
.hs-item span { font-size:1.5em; display:block; }
.hs-item strong { display:block; font-size:.85em; margin:4px 0; }
.hs-item small { font-size:.75em; color:var(--muted); }
.hs-item.hs-active { background:#e8f4ff; border-color:var(--blue); }

/* ---- Subpages grid ---- */
.subpages-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:10px; }
.subpage-link { background:white; border-radius:8px; padding:14px 16px; text-align:center; color:var(--text); box-shadow:0 2px 8px rgba(0,0,0,.06); font-weight:500; font-size:.9em; position:relative; transition:transform .15s; }
.subpage-link:hover { transform:translateY(-2px); text-decoration:none; box-shadow:0 4px 16px rgba(0,0,0,.1); }
.subpage-link small { display:block; color:var(--muted); font-weight:normal; margin-top:2px; }
.subpage-link.has-alert { border:2px solid var(--bad); }
.subpage-link.subpage-main { background:var(--blue-d); color:white; }
.alert-dot { position:absolute; top:6px; right:8px; background:var(--bad); color:white; border-radius:50%; width:16px; height:16px; font-size:.7em; display:flex; align-items:center; justify-content:center; font-weight:700; }

/* ---- Hero danger ---- */
.commune-hero.hero-danger { background:linear-gradient(135deg,#c0392b,#e74c3c); }

/* ---- Hero search (nouvelle version ergonomique) ---- */
.hero-search-wrap { max-width:580px; margin:0 auto; position:relative; }
.hero-search-inner { position:relative; }
.hero-search-inner input {
  width:100%; padding:18px 160px 18px 22px;
  font-size:1.05em; border:none; border-radius:50px;
  box-shadow:0 4px 24px rgba(0,0,0,.25); outline:none;
  color:var(--text); background:white;
}
.hero-search-inner button {
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  padding:11px 22px; background:var(--blue-d); color:white;
  border:none; border-radius:40px; font-size:.9em;
  font-weight:700; cursor:pointer; white-space:nowrap;
}
.hero-search-inner button:hover { background:#03045e; }
.hero-ac-box {
  position:absolute; top:calc(100% + 6px); left:0; right:0;
  background:white; border-radius:14px;
  box-shadow:0 8px 32px rgba(0,0,0,.18);
  overflow:hidden; z-index:100; display:none;
}
.hero-ac-item {
  display:flex; align-items:center; gap:12px;
  padding:13px 18px; text-decoration:none; color:var(--text);
  border-bottom:1px solid #f3f3f3; transition:background .1s;
}
.hero-ac-item:last-child { border-bottom:none; }
.hero-ac-item:hover, .hero-ac-item.ac-selected { background:#f0f7ff; text-decoration:none; }
.ac-main { flex:1; font-weight:600; font-size:.95em; }
.ac-sub  { font-size:.82em; color:var(--muted); }
.ac-arrow { color:var(--blue); font-size:.9em; }

/* ---- A-Z navigation ---- */
.az-nav { display:flex; flex-wrap:wrap; gap:6px; margin:16px 0 24px; }
.az-link { padding:7px 12px; background:white; border-radius:8px; font-weight:700; font-size:.9em; color:var(--blue); box-shadow:0 2px 6px rgba(0,0,0,.06); }
.az-link:hover { background:var(--blue); color:white; text-decoration:none; }
.letter-group { margin-bottom:32px; }
.letter-heading { font-size:1.8em; color:var(--blue-d); border-bottom:3px solid var(--blue-l); padding-bottom:6px; margin-bottom:12px; }
.back-to-top { display:inline-block; margin-top:10px; font-size:.85em; color:var(--muted); }
.back-to-top:hover { color:var(--blue); }

/* ---- Sticky A-Z bar ---- */
@media (min-width:768px) {
  .az-nav { position:sticky; top:0; background:var(--bg); z-index:50; padding:8px 0; border-bottom:1px solid #e0e0e0; }
}

/* ===== LUCIDE ICONS ===== */
.icon    { width:20px; height:20px; display:inline-block; vertical-align:middle; stroke:currentColor; }
.icon-xs { width:14px; height:14px; display:inline-block; vertical-align:middle; stroke:currentColor; }
.icon-sm { width:16px; height:16px; display:inline-block; vertical-align:middle; stroke:currentColor; margin-right:4px; }
.icon-hero { width:40px; height:40px; display:block; margin:0 auto 12px; stroke:white; opacity:.9; }
.theme-icon { width:36px; height:36px; display:block; margin-bottom:14px; stroke:currentColor; }
.region-icon { width:24px; height:24px; display:block; margin-bottom:8px; stroke:var(--blue); }
.search-icon { position:absolute; right:12px; top:50%; transform:translateY(-50%); stroke:var(--muted); pointer-events:none; width:16px; height:16px; }

/* ===== HEADER SEARCH ===== */
.header-search-wrap { position:relative; flex:1; max-width:320px; }
.header-search-wrap input {
  width:100%; padding:9px 36px 9px 14px;
  border:1px solid rgba(255,255,255,.25); border-radius:24px;
  background:rgba(255,255,255,.12); color:white; font-size:.9em; outline:none;
  transition:all .2s;
}
.header-search-wrap input::placeholder { color:rgba(255,255,255,.65); }
.header-search-wrap input:focus { background:white; color:var(--text); border-color:white; }
.header-search-wrap input:focus + .search-icon { stroke:var(--blue); }
.header-search-wrap input:focus::placeholder { color:#aaa; }

/* ===== HERO SEARCH ===== */
.hero-search-wrap { margin-top:24px; }
.hero-search-box {
  position:relative; max-width:580px; margin:0 auto;
  background:white; border-radius:50px;
  box-shadow:0 8px 32px rgba(0,0,0,.2);
  display:flex; align-items:center;
}
.hero-search-icon { width:20px; height:20px; stroke:var(--muted); flex-shrink:0; margin-left:20px; }
.hero-search-box input {
  flex:1; padding:18px 20px; font-size:1.05em;
  border:none; outline:none; background:transparent; border-radius:50px;
}
.autocomplete-hero { border-radius:0 0 24px 24px; top:calc(100% + 4px); }

/* ===== A-Z NAVIGATION ===== */
.az-nav {
  position:sticky; top:0; z-index:100;
  background:white; padding:12px 16px;
  border-radius:var(--radius); box-shadow:0 2px 12px rgba(0,0,0,.08);
  display:flex; flex-wrap:wrap; gap:6px; margin-bottom:24px;
}
.az-link {
  display:inline-flex; align-items:center; justify-content:center;
  width:32px; height:32px; border-radius:6px;
  font-weight:700; font-size:.85em; color:var(--blue);
  background:#e8f4ff; text-decoration:none; transition:all .15s;
}
.az-link:hover { background:var(--blue); color:white; text-decoration:none; }

.letter-section { margin-bottom:32px; }
.letter-heading {
  font-size:1.4em; font-weight:800; color:var(--blue-d);
  padding:8px 0; border-bottom:2px solid var(--blue-d);
  margin-bottom:12px; display:flex; align-items:center; gap:8px;
}
.back-to-top { font-size:.8em; color:var(--muted); display:block; text-align:right; margin-top:8px; }

/* ===== COMMUNE TABLE ===== */
.commune-table-wrap { overflow-x:auto; }
.commune-table { width:100%; border-collapse:collapse; }
.commune-table th {
  background:#f4f9ff; color:var(--blue-d); padding:10px 14px;
  font-size:.85em; text-align:left; border-bottom:2px solid #e0e8f0;
  white-space:nowrap;
}
.commune-table td { padding:9px 14px; border-bottom:1px solid #f0f0f0; font-size:.9em; }
.commune-table tr:hover td { background:#fafcff; }
.commune-table td.good { color:var(--good); font-weight:600; }
.commune-table td.mid  { color:var(--mid); font-weight:600; }
.commune-table td.bad  { color:var(--bad); font-weight:600; }

/* ===== FOOTER ===== */
.footer-inner { max-width:1200px; margin:0 auto; padding:48px 24px 0; }
.footer-top { margin-bottom:40px; padding-bottom:32px; border-bottom:1px solid rgba(255,255,255,.08); }
.footer-brand { display:flex; align-items:flex-start; gap:20px; }
.footer-brand img { flex-shrink:0; margin-top:2px; }
.footer-brand p { font-size:.87em; line-height:1.6; max-width:480px; color:rgba(255,255,255,.55); }
.footer-cols { display:grid; grid-template-columns:repeat(4,1fr); gap:32px; margin-bottom:40px; }
.footer-col strong { display:block; color:rgba(255,255,255,.95); margin-bottom:14px; font-size:.82em; text-transform:uppercase; letter-spacing:.06em; }
.footer-col a { display:block; color:rgba(255,255,255,.6); font-size:.87em; margin-bottom:8px; transition:color .15s; }
.footer-col a:hover { color:white; }
.footer-badge { margin-top:16px; padding-top:16px; border-top:1px solid rgba(255,255,255,.08); font-size:.82em; display:flex; flex-wrap:wrap; gap:4px; align-items:center; color:rgba(255,255,255,.4); }
.footer-badge a { display:inline; color:rgba(255,255,255,.6); margin-bottom:0; }
.footer-bottom { border-top:1px solid rgba(255,255,255,.08); padding:20px 0 28px; display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:8px; font-size:.82em; color:rgba(255,255,255,.35); }
@media(max-width:640px){
  .footer-cols { grid-template-columns:1fr 1fr; gap:24px; }
  .footer-brand { flex-direction:column; gap:12px; }
  .nav-toggle { display:flex; }
  nav { display:none; position:absolute; top:60px; left:0; right:0; background:var(--blue-d); padding:16px; flex-direction:column; }
  nav.nav-open { display:flex; }
  nav a { padding:10px 0; border-bottom:1px solid rgba(255,255,255,.1); margin:0; }
}
.nav-toggle { display:none; background:none; border:none; color:white; cursor:pointer; padding:4px; }

/* ===== RANKING ROW ===== */
.ranking-row { display:flex; flex-wrap:wrap; gap:12px; justify-content:center; margin-top:20px; }
.rank-badge {
  background:rgba(255,255,255,.15); border-radius:12px; padding:10px 18px;
  text-align:center; color:white; font-size:.85em; min-width:110px;
  border:1px solid rgba(255,255,255,.2);
}
.rank-badge strong { display:block; font-size:1.15em; }
.rank-badge.good { background:rgba(39,174,96,.25); border-color:rgba(39,174,96,.4); }
.rank-badge.bad  { background:rgba(231,76,60,.25);  border-color:rgba(231,76,60,.4); }

/* ===== HERO 2COL ===== */
.hero-2col { display:grid; grid-template-columns:1fr 1fr; gap:32px; align-items:start; }
@media(max-width:768px){ .hero-2col { grid-template-columns:1fr; } }

/* ===== RADAR ===== */
.radar-wrap h2 { margin-bottom:4px; }

/* ===== MAP ===== */
.map-wrap h2 { margin-bottom:4px; }

/* ===== USAGE GRID ===== */
.usage-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
@media(max-width:640px){ .usage-grid { grid-template-columns:repeat(2,1fr); } }
.usage-card {
  border-radius:var(--radius); padding:18px 16px; text-align:center;
  border:2px solid #e8f0fe; background:#f8faff; transition:transform .15s;
}
.usage-card:hover { transform:translateY(-2px); }
.usage-card.good  { border-color:#b7efc5; background:#f0fff4; }
.usage-card.mid   { border-color:#ffe08a; background:#fffbeb; }
.usage-card.bad   { border-color:#ffc9c9; background:#fff5f5; }
.usage-icon { width:32px; height:32px; display:block; margin:0 auto 10px; stroke:var(--blue-d); }
.usage-card.good .usage-icon  { stroke:#27ae60; }
.usage-card.mid  .usage-icon  { stroke:#e67e22; }
.usage-card.bad  .usage-icon  { stroke:#e74c3c; }
.usage-label   { font-size:.85em; color:var(--muted); margin-bottom:6px; }
.usage-verdict { font-weight:700; font-size:.9em; }
.usage-verdict.good { color:#27ae60; }
.usage-verdict.mid  { color:#e67e22; }
.usage-verdict.bad  { color:#e74c3c; }

/* ===== TREND GRID ===== */
.trend-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
@media(max-width:768px){ .trend-grid { grid-template-columns:1fr; } }
.trend-card {
  background:white; border:1px solid #e8f0fe; border-radius:var(--radius);
  padding:20px; box-shadow:0 2px 8px rgba(0,0,0,.04);
}
.trend-header { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.trend-arrow { margin-left:auto; font-weight:700; font-size:1em; padding:2px 8px; border-radius:20px; background:#f4f4f4; }
.trend-arrow.good { background:#e8fff0; color:var(--good); }
.trend-arrow.bad  { background:#fff0f0; color:var(--bad); }
.trend-vals { font-size:.85em; display:flex; align-items:center; gap:8px; margin-bottom:12px; color:var(--muted); }
.trend-sep { color:#bbb; }
.chart-mini canvas { max-height:60px !important; }

/* ===== PARAM ICON SVG ===== */
.param-icon-svg { width:28px; height:28px; display:block; margin:0 auto 8px; stroke:currentColor; }
.param-trend { font-size:.72em; margin-top:4px; display:block; font-weight:600; }
.param-trend.good { color:var(--good); }
.param-trend.bad  { color:var(--bad); }

/* ===== BTN SECONDARY ===== */
.btn-secondary {
  display:inline-block; padding:10px 20px; border-radius:24px;
  background:#e8f4ff; color:var(--blue-d); font-weight:600; font-size:.9em;
  text-decoration:none; transition:all .15s;
}
.btn-secondary:hover { background:var(--blue); color:white; text-decoration:none; }

/* ===== HERO SCORE ROW ===== */
.hero-score-row { display:flex; flex-wrap:wrap; align-items:center; gap:24px; justify-content:center; margin-top:16px; }
.hero-ranking { display:flex; flex-wrap:wrap; gap:12px; }
.rank-item { background:rgba(255,255,255,.15); border-radius:10px; padding:10px 16px; color:white; font-size:.82em; text-align:center; border:1px solid rgba(255,255,255,.2); min-width:100px; }
.rank-item strong { display:block; font-size:1.1em; }
.rank-item span { opacity:.8; font-size:.9em; }
.rank-item.good { background:rgba(39,174,96,.3); border-color:rgba(39,174,96,.5); }
.rank-item.bad  { background:rgba(231,76,60,.3);  border-color:rgba(231,76,60,.5); }
.hero-ranking-text { color:rgba(255,255,255,.9); font-size:.95em; margin-top:12px; text-align:center; }
.hero-ranking-text strong { color:white; }

/* ===== INTRO SECTION ===== */
.intro-section { background:linear-gradient(135deg,#f0f7ff,#e8f4ff); padding:32px 0; margin-bottom:0; }
.intro-card { background:white; border-radius:16px; padding:28px 32px; box-shadow:0 2px 16px rgba(0,119,182,.08); border-left:4px solid var(--blue); }
.intro-card h2 { margin-bottom:12px; }
.intro-lead { font-size:1.05em; line-height:1.75; color:var(--text); }
.intro-detail { font-size:.88em; color:var(--muted); margin-top:8px; display:flex; align-items:center; gap:6px; }

/* ===== SECTION INTRO TEXT ===== */
.section-intro { color:var(--muted); font-size:.9em; margin:-4px 0 20px; line-height:1.6; }

/* ===== PARAM DETAIL GRID ===== */
.param-detail-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:20px; }
@media(max-width:768px){ .param-detail-grid { grid-template-columns:1fr; } }
.param-detail-card {
  background:white; border-radius:14px; padding:22px; border:2px solid #e8f0fe;
  text-decoration:none; color:var(--text); transition:all .2s; display:block;
  box-shadow:0 2px 8px rgba(0,0,0,.04);
}
.param-detail-card:hover { transform:translateY(-3px); box-shadow:0 8px 24px rgba(0,0,0,.1); text-decoration:none; }
.param-detail-card.good { border-color:#b7efc5; }
.param-detail-card.mid  { border-color:#ffe08a; }
.param-detail-card.bad  { border-color:#ffc9c9; }
.pdc-header { display:flex; align-items:center; gap:14px; margin-bottom:0; }
.pdc-icon { width:36px; height:36px; flex-shrink:0; stroke:var(--blue); }
.param-detail-card.good .pdc-icon { stroke:#27ae60; }
.param-detail-card.mid  .pdc-icon { stroke:#e67e22; }
.param-detail-card.bad  .pdc-icon { stroke:#e74c3c; }
.pdc-name { font-size:.82em; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.pdc-val  { font-size:1.5em; font-weight:800; color:var(--text); line-height:1.1; }
.pdc-val span { font-size:.5em; color:var(--muted); font-weight:400; }
.pdc-badge { margin-left:auto; font-size:.75em; font-weight:700; padding:4px 10px; border-radius:20px; white-space:nowrap; }
.pdc-badge.good { background:#e8fff0; color:#27ae60; }
.pdc-badge.mid  { background:#fff8e1; color:#e67e22; }
.pdc-badge.bad  { background:#fff0f0; color:#e74c3c; }
.pdc-bar { position:relative; background:#f0f0f0; border-radius:4px; height:6px; margin:14px 0 4px; overflow:hidden; }
.pdc-bar .bar-label { position:absolute; right:0; top:-16px; font-size:.7em; color:var(--muted); }
.pdc-text { font-size:.88em; line-height:1.65; color:#444; margin:12px 0 8px; }
.pdc-trend { font-size:.78em; font-weight:700; margin-bottom:8px; }
.pdc-trend.good { color:var(--good); }
.pdc-trend.bad  { color:var(--bad); }
.pdc-cta { font-size:.8em; color:var(--blue); font-weight:600; margin-top:8px; }
.param-detail-card:hover .pdc-cta { text-decoration:underline; }

/* ===== TREND NARRATIVE ===== */
.trend-narrative { font-size:.85em; line-height:1.6; color:#555; margin:10px 0 8px; }
.trend-narrative strong { color:var(--text); }

/* ===== CONSEIL HEADER ===== */
.conseil-header { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.conseil-header strong { font-size:1em; }

/* ===== USAGE EXPL ===== */
.usage-expl { font-size:.78em; color:#666; margin-top:6px; line-height:1.5; }

/* ===== CHARTS FULL GRID ===== */
.charts-full-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
@media(max-width: 768px) { .charts-full-grid { grid-template-columns: 1fr; } }

.chart-full-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid #e8f0fe;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.chart-full-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.chart-full-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1em;
}
.chart-full-title strong { font-size: 1.05em; }
.chart-unit { color: var(--muted); font-size: .85em; }
.chart-full-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.chart-last-val { font-size: .82em; font-weight: 700; }

/* ===== N/D (Non disponible) ===== */
.nd {
  color: #bbb;
  font-size: .82em;
  font-style: italic;
  letter-spacing: .02em;
}

/* ===== LAYOUT CONSISTENCY OVERHAUL ===== */

/* Conteneur global cohérent */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px;
}
@media(max-width: 768px) {
  .container { padding: 28px 16px; }
}

/* Espacement vertical entre sections */
section.container + section.container { padding-top: 0; }

/* Toutes les sections avec card ont le même fond et border-radius */
.section-card {
  background: white;
  border-radius: 16px;
  padding: 28px 32px;
  border: 1px solid #e8f0fe;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}

/* Grilles 2 colonnes — hauteur égale */
.hero-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: stretch;
}
.hero-2col > div {
  background: white;
  border-radius: 16px;
  padding: 28px;
  border: 1px solid #e8f0fe;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
@media(max-width: 768px) {
  .hero-2col { grid-template-columns: 1fr; }
}

/* Grille param-detail : hauteur égale */
.param-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  align-items: stretch;
}
.param-detail-card {
  display: flex;
  flex-direction: column;
}
.param-detail-card .pdc-text { flex: 1; }

/* Charts full grid : hauteur égale */
.charts-full-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  align-items: stretch;
}
.chart-full-card {
  display: flex;
  flex-direction: column;
}
.chart-full-card canvas { flex: 1; }

/* Trend grid */
.trend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}
.trend-card {
  display: flex;
  flex-direction: column;
}
.trend-card .chart-mini { margin-top: auto; }

/* Usage grid */
.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: stretch;
}
.usage-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Titres de section — cohérence */
section.container h2 {
  font-size: 1.25em;
  font-weight: 700;
  color: var(--blue-d);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
section.container h2 svg { flex-shrink: 0; }

/* Conseils */
.conseils { display: flex; flex-direction: column; gap: 16px; }
.conseil {
  border-radius: 12px;
  padding: 20px 24px;
  border-left: 4px solid;
}
.conseil.good    { background: #f0fff4; border-color: var(--good); }
.conseil.warning { background: #fffbeb; border-color: #e67e22; }
.conseil.danger  { background: #fff5f5; border-color: var(--bad); }
.conseil.info    { background: #f0f7ff; border-color: var(--blue); }

/* FAQ */
.faq-list details {
  border-radius: 12px;
  border: 1px solid #e3eaf6;
  background: white;
  overflow: hidden;
  transition: box-shadow .15s;
}
.faq-list details:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.faq-list details[open] {
  border-color: #c0d0f0;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.faq-list details summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: .95em;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #1a2a4a;
  user-select: none;
}
.faq-list details summary::-webkit-details-marker { display: none; }
.faq-list details summary::after {
  content: '';
  margin-left: auto;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: #e8f0fe;
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform .2s ease;
}
.faq-list details[open] summary::after {
  transform: rotate(180deg);
  background: #dce8ff;
}
.faq-list details[open] summary {
  color: var(--blue);
  border-bottom: 1px solid #e3eaf6;
}
.faq-list details .faq-body,
.faq-list details p {
  padding: 14px 20px 16px;
  color: #444;
  line-height: 1.75;
  font-size: .92em;
  margin-top: 0;
}
.faq-list details p strong { color: #1a2a4a; }
.faq-list details p a { color: var(--blue); }

/* Tableau commune cohérent */
.commune-table-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e8f0fe;
}
.commune-table { border-collapse: collapse; width: 100%; }
.commune-table th { padding: 12px 16px; }
.commune-table td { padding: 10px 16px; }

/* Breadcrumb */
.breadcrumb {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 32px 0;
  font-size: .85em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
@media(max-width: 768px) { .breadcrumb { padding: 10px 16px 0; } }

@media(max-width: 640px) {
  .param-detail-grid { grid-template-columns: 1fr; }
  .charts-full-grid  { grid-template-columns: 1fr; }
  .trend-grid        { grid-template-columns: 1fr; }
  .usage-grid        { grid-template-columns: repeat(2, 1fr); }
}

/* Map wrap — prend toute la hauteur de la card */
.map-wrap {
  display: flex;
  flex-direction: column;
}
.map-wrap #communeMap {
  flex: 1;
  min-height: 240px;
}

/* ===== MOBILE RESPONSIVE — OVERHAUL ===== */
@media (max-width: 768px) {
  /* Header */
  .site-header .container { padding: 0 16px; gap: 8px; }
  .logo img { height: 32px !important; }
  .header-nav { display: none; }

  /* Hero */
  .hero { padding: 40px 16px; }
  .hero h1 { font-size: 1.6em; }

  /* Stats bar */
  .stats-bar { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 20px 16px; }

  /* Grilles 2 colonnes → 1 colonne */
  .hero-2col,
  .param-detail-grid,
  .charts-full-grid,
  .content-2col { grid-template-columns: 1fr !important; }

  /* Grilles 3 colonnes → 2 colonnes */
  .trend-grid,
  .usage-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Grilles stats homepage */
  .kpi-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .kpi-grid-3 { grid-template-columns: 1fr !important; }

  /* Conformite row */
  .conformite-row { flex-wrap: wrap; gap: 8px; }
  .conf-item { min-width: 140px; }

  /* Tableaux */
  .compare-table-full,
  .commune-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Score hero */
  .score-hero-row { flex-direction: column; gap: 16px; align-items: flex-start; }

  /* Container padding */
  .container { padding: 24px 16px; }

  /* Sections */
  section.container h2 { font-size: 1.1em; }

  /* Compare form */
  .compare-inputs { flex-direction: column; }
  .vs-badge { align-self: center; margin: 4px 0; }

  /* Cards */
  .theme-grid { grid-template-columns: 1fr !important; }
  .region-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .ville-grid { grid-template-columns: 1fr !important; }

  /* Subpages nav */
  .subpages-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Map */
  #communeMap { min-height: 200px !important; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.35em; }
  .stats-bar { grid-template-columns: 1fr; }
  .trend-grid,
  .usage-grid { grid-template-columns: 1fr !important; }
  .region-grid { grid-template-columns: 1fr !important; }
  .subpages-grid { grid-template-columns: 1fr !important; }
  .score-number { font-size: 2.5em !important; }
  .hero-ranking { flex-direction: column; gap: 8px; }
}

/* ===== SUBPAGES GRID — données visibles ===== */
.subpages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.subpage-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 12px;
  background: white;
  border: 1px solid #e8f0fe;
  border-radius: 12px;
  text-decoration: none;
  color: var(--dark);
  gap: 6px;
  transition: box-shadow .15s, border-color .15s;
  min-height: 72px;
}
.subpage-link:hover {
  box-shadow: 0 4px 14px rgba(0,119,182,.12);
  border-color: var(--blue);
}
.subpage-link.has-alert {
  border-color: #ffc0cb;
  background: #fff8f8;
}
.subpage-link.subpage-main {
  background: var(--blue-d);
  border-color: var(--blue-d);
  color: white;
}
.subpage-link.subpage-main:hover {
  background: var(--blue);
  border-color: var(--blue);
}
.subpage-link .subpage-label {
  font-size: .85em;
  font-weight: 600;
  color: inherit;
}
.subpage-link .subpage-val {
  font-size: .78em;
  font-weight: 700;
  color: var(--blue);
  background: #eef4fb;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.subpage-link.has-alert .subpage-val { color: var(--bad); background: #fff0f0; }
.subpage-link.subpage-main .subpage-val { color: white; background: rgba(255,255,255,.2); }
.subpage-link .subpage-val.bad { color: var(--bad); background: #fff0f0; }
.subpage-link .subpage-val.nd  { color: #bbb; background: #f5f5f5; font-weight: 400; }

@media(max-width:420px){ .footer-cols { grid-template-columns:1fr; } }
