/* public commune pages: same tokens as the app, readable on a phone first */
:root {
  --bg: #f4f5f7; --panel: #fff; --ink: #14171f; --ink2: #3b4150; --muted: #6b7280; --line: #e5e7eb; --line2: #eef0f3; --soft: #f7f8fa;
  --accent: #2448c7; --accent2: #5b7cfa; --accent-soft: #e9eefc; --ok: #138a52; --err: #c0362c;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --panel: #171a21; --ink: #eef0f4; --ink2: #c9cdd6; --muted: #8b93a3; --line: #2a2f3a; --line2: #222631; --soft: #1d2129;
    --accent: #8aa5ff; --accent2: #aabdff; --accent-soft: #1f2a4d; --ok: #4cc58a; --err: #ff8577; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.6 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 12px; }
.brand { font-weight: 750; color: var(--ink); display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.brand i { width: 26px; height: 26px; border-radius: 6.5px; background: url(/static/brand/icone.svg) center / cover; display: inline-block; flex: none; }
.btn, .cta button { height: 40px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--accent); color: #fff; font: 600 14px Inter, system-ui, sans-serif;
  display: inline-flex; align-items: center; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.crumbs { margin: 18px 0 6px; font-size: 13px; color: var(--muted); } .crumbs b { color: var(--ink2); font-weight: 600; }
h1 { font-size: clamp(28px, 6vw, 42px); line-height: 1.1; letter-spacing: -.03em; margin: 6px 0 10px; } h1 span { color: var(--muted); font-weight: 600; }
.lead { color: var(--ink2); font-size: 16.5px; margin: 0 0 20px; max-width: 760px; }
.figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.figs.small .fig b { font-size: 20px; }
.fig { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.fig span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; }
.fig b { display: block; font-size: 24px; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.fig b.good { color: var(--ok); } .fig b.bad { color: var(--err); }
.fig em { display: block; font-style: normal; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.fig i { font-style: normal; font-weight: 650; } .fig i.up { color: var(--ok); } .fig i.down { color: var(--err); }
.cta { display: flex; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px; margin: 20px 0 8px; }
.cta input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 15px Inter, system-ui, sans-serif; padding: 0 10px; height: 44px; }
.cta input:focus { outline: none; } .cta button { height: 44px; }
section { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin: 18px 0; }
section h2 { margin: 0 0 8px; font-size: 21px; letter-spacing: -.02em; } section h3 { margin: 18px 0 8px; font-size: 15px; } section h3 small { color: var(--muted); font-weight: 500; }
section p { color: var(--ink2); margin: 0 0 12px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line2); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; }
td.n, th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; } td small { color: var(--muted); font-size: 12px; margin-left: 4px; }
table.kv td:first-child { color: var(--muted); font-weight: 600; width: 34%; } table.kv td small { display: block; margin: 2px 0 0; }
.chart { width: 100%; height: auto; display: block; margin: 6px 0 4px; }
.chart text { fill: var(--muted); font: 11px Inter, system-ui, sans-serif; } .chart .g { stroke: var(--line2); } .chart .lb { font-weight: 650; font-size: 12px; }
.bars { display: grid; gap: 6px; max-width: 560px; margin-bottom: 16px; }
.bar { display: grid; grid-template-columns: 26px 1fr 58px; gap: 10px; align-items: center; }
.bar .cl { display: grid; place-items: center; height: 24px; border-radius: 5px; color: #fff; font-weight: 700; font-size: 13px; }
.bar div { height: 12px; background: var(--soft); border-radius: 6px; overflow: hidden; } .bar div i { display: block; height: 100%; border-radius: 6px; }
.bar b { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag { background: #fdf1e1; color: #b45309; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600; }
@media (prefers-color-scheme: dark) { .tag { background: #3a2a12; color: #f0a94a; } }
.links { display: flex; flex-wrap: wrap; gap: 8px 14px; } .links a { font-size: 14px; }
.final { background: linear-gradient(135deg, var(--accent-soft), var(--panel)); }
.src, .dim { color: var(--muted); font-size: 12.5px; } .src { margin: 10px 0 30px; }
footer { border-top: 1px solid var(--line); padding: 18px 0 28px; font-size: 13px; color: var(--muted); } footer a { color: var(--muted); }
@media (max-width: 760px) {
  .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fig b { font-size: 20px; }
  .cols { grid-template-columns: minmax(0, 1fr); gap: 0; }
  section { padding: 16px 14px; border-radius: 14px; }
  .cta { flex-direction: column; } .cta button { justify-content: center; }
  .top .btn { padding: 0 12px; font-size: 13px; height: 36px; }
  th, td { padding: 7px 4px; font-size: 13.5px; }
}
/* questions about the town (FAQ, also published as structured data) */
.faq details { border-top: 1px solid var(--line2); padding: 12px 0; } .faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 500; } .faq details[open] summary::after { content: "–"; }
.faq details p { margin: 8px 0 0; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--accent); }
/* page listing the towns */
.jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.jump a { font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--ink2); }
.jump a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
section[id] { scroll-margin-top: 72px; }
.villes { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-top: 6px; }
.villes a { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line2); background: var(--soft); color: var(--ink); }
.villes a:hover { border-color: var(--accent); text-decoration: none; }
.villes b { font-weight: 650; font-size: 14.5px; } .villes span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
/* header menu, wider pages (rankings) */
.top .menu { display: flex; gap: 18px; margin-left: auto; margin-right: 8px; }
.top .menu a { color: var(--ink2); font-weight: 550; font-size: 14px; }
@media (max-width: 760px) { .top .menu { display: none; } }
main.wide { max-width: 1240px; }
.lead .dim { font-size: 13px; }
.more { margin: 14px 0; font-size: 14px; }
.links.big { margin: 4px 0 14px; gap: 10px; }
.links.big a { font-weight: 650; padding: 8px 14px; border-radius: 10px; background: var(--accent-soft); }
.links.big a:hover { text-decoration: none; filter: brightness(1.03); }
/* comparison and sortable tables */
table.sortable th[data-k] { cursor: pointer; user-select: none; white-space: nowrap; }
table.sortable th[data-k]:hover { color: var(--accent); }
table.sortable th[data-dir="desc"]::after { content: " ▾"; } table.sortable th[data-dir="asc"]::after { content: " ▴"; }
tr.me td { background: var(--accent-soft); font-weight: 650; }
/* guides */
article.guide, article.outil-page { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px 28px; margin: 12px 0 18px; }
article h1 { margin-top: 0; }
article .maj { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.bref { background: var(--accent-soft); border-radius: 12px; padding: 12px 16px; color: var(--ink); font-size: 16px; margin: 0 0 18px; }
article h2 { font-size: 22px; letter-spacing: -.02em; margin: 30px 0 10px; scroll-margin-top: 72px; }
article h3 { font-size: 16.5px; margin: 20px 0 8px; }
article p, article li { color: var(--ink2); font-size: 15.5px; line-height: 1.7; }
article ul, article ol { padding-left: 22px; margin: 0 0 14px; } article li { margin: 4px 0; }
article table { margin: 8px 0 16px; font-size: 14.5px; }
article blockquote { margin: 12px 0; padding: 4px 16px; border-left: 3px solid var(--accent); color: var(--ink2); }
article .encart { background: var(--soft); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 16px; margin: 14px 0; }
article .encart > :last-child { margin-bottom: 0; }
article .habiscope { background: linear-gradient(135deg, var(--accent-soft), var(--panel)); border: 1px solid var(--line); border-radius: 14px; padding: 4px 18px 10px; margin: 24px 0; }
article .habiscope h2 { margin-top: 14px; }
article details { border-top: 1px solid var(--line2); padding: 12px 0; } article details:first-of-type { border-top: 0; }
article summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
article summary::-webkit-details-marker { display: none; }
article summary::after { content: "+"; color: var(--muted); font-weight: 500; } article details[open] summary::after { content: "–"; }
article details p { margin: 8px 0 0; }
ul.sources li, ul.sources a { font-size: 13.5px; }
ul.related { margin: 0; padding-left: 20px; } ul.related li { margin: 6px 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 10px 0 18px; }
.cards .card { display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; color: var(--ink); }
.cards .card:hover { border-color: var(--accent); text-decoration: none; }
.cards .card b { font-size: 16px; letter-spacing: -.01em; } .cards .card span { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
/* free tools */
.outil { background: var(--soft); border: 1px solid var(--line2); border-radius: 14px; padding: 16px; margin: 6px 0 22px; }
.outil-form { display: grid; gap: 12px; }
.outil-form fieldset { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; }
.outil-form legend { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: 6px; padding: 0; }
.outil-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink2); position: relative; }
.outil-form label.chk { flex-direction: row; align-items: center; gap: 8px; font-weight: 550; }
.outil-form input[type=number], .outil-form input[type=text], .outil-form input[type=date], .outil-form select {
  height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: 15px Inter, system-ui, sans-serif; padding: 0 10px; min-width: 0; width: 100%; }
.outil-form input:focus, .outil-form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.outil-form button { justify-self: start; height: 40px; padding: 0 18px; border-radius: 10px; border: 0; background: var(--accent); color: #fff; font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; }
.outil .resultat { margin-top: 14px; }
.outil .resultat:empty { display: none; }
.outil .resultat h3 { margin: 4px 0 8px; } .outil .resultat .figs { margin-bottom: 12px; }
.outil .resultat .fig b small { font-size: 13px; color: var(--muted); font-weight: 600; }
.outil table.kv td small { display: block; color: var(--muted); font-size: 12.5px; margin: 2px 0 0; font-weight: 400; }
.outil td.warn b { color: #b45309; } .outil td.ok b { color: var(--ok); }
@media (prefers-color-scheme: dark) { .outil td.warn b { color: #f0a94a; } }
.outil tr.cur td { background: var(--accent-soft); }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.err { color: var(--err); font-weight: 600; }
.verdict { border-radius: 12px; padding: 12px 14px; font-weight: 650; color: var(--ink); }
.verdict.bad { background: color-mix(in srgb, var(--err) 14%, transparent); } .verdict.warn { background: color-mix(in srgb, #f0b40f 22%, transparent); }
.verdict.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); }
.timeline { display: flex; gap: 8px; margin: 12px 0 2px; }
.timeline div { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--panel); }
.timeline div.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.timeline b { display: block; font-size: 18px; } .timeline span { color: var(--muted); font-size: 13px; }
/* commune search suggestions */
.ac { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; margin-top: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 28px -8px rgba(16,24,40,.25); overflow: hidden; }
.ac button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; border: 0; background: none; color: var(--ink); padding: 9px 12px; font: 14px Inter, system-ui, sans-serif; cursor: pointer; }
.ac button span { color: var(--muted); font-size: 12.5px; } .ac button.on, .ac button:hover { background: var(--accent-soft); }
@media (max-width: 760px) {
  article.guide, article.outil-page { padding: 18px 16px; }
  article p, article li { font-size: 15px; }
  .timeline { flex-direction: column; }
}
