:root {
  --fond: #F4F6F5;
  --surface: #FFFFFF;
  --encre: #15212B;
  --gris: #55636E;
  --trait: #DDE3E1;
  --trait-doux: #EDF0EF;
  --champ: #C9D1CE;
  --vert: #0E6464;
  --vert-fonce: #0A4A4A;
  --vert-clair: #D9ECEA;
  --orange: #B4501A;
  --orange-clair: #F8E6DA;
  --rayon: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--fond);
  color: var(--encre);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--vert); }
a:hover { color: var(--vert-fonce); }
button, input, select, textarea { font-family: inherit; font-size: 15px; color: var(--encre); }
h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
h2 { margin: 0; font-size: 17px; font-weight: 600; }
p { margin: 0; }
.gris { color: var(--gris); }
.petit { font-size: 13px; }

/* ── mise en page ─────────────────────────────────────────── */
.page { max-width: 720px; margin: 0 auto; padding: 20px 16px 110px; display: flex; flex-direction: column; gap: 22px; }
.entete { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pile { display: flex; flex-direction: column; gap: 10px; }
.ligne { display: flex; align-items: center; gap: 10px; }
.grille-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.carte-bloc { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px; }
.liste { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); display: flex; flex-direction: column; overflow: hidden; }
.liste > * + * { border-top: 1px solid var(--trait-doux); }
.item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 14px; text-decoration: none; color: var(--encre); }
.item:hover { background: #FAFBFB; color: var(--encre); }
.item .titre { font-size: 15px; font-weight: 500; }
.item .sous { font-size: 13px; color: var(--gris); }
.item .droite { font-size: 13px; font-weight: 600; white-space: nowrap; text-align: right; }
.vide { padding: 18px 14px; color: var(--gris); font-size: 14px; }

.chiffre { font-size: 26px; font-weight: 700; }
.pastille { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.pastille.orange { color: var(--orange); background: var(--orange-clair); }
.pastille.verte { color: var(--vert); background: var(--vert-clair); }
.pastille.grise { color: var(--gris); background: var(--trait-doux); }
.orange { color: var(--orange); }
.vert { color: var(--vert); }

/* ── boutons ──────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--vert); background: var(--surface); color: var(--vert);
  font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--vert-clair); color: var(--vert-fonce); }
.btn.plein { background: var(--vert); color: #FFFFFF; }
.btn.plein:hover { background: var(--vert-fonce); color: #FFFFFF; }
.btn.neutre { border-color: var(--champ); color: var(--encre); font-weight: 500; }
.btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.lien-btn { background: none; border: none; color: var(--vert); font-weight: 600; text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0 8px; }

.puces { display: flex; gap: 8px; flex-wrap: wrap; }
.puces.defile { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.puces.defile::-webkit-scrollbar { display: none; }
.puce { flex: 0 0 auto; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--champ);
  background: var(--surface); color: var(--encre); font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; }
.puce[aria-pressed="true"], .puce.active { background: var(--encre); border-color: var(--encre); color: #FFFFFF; }
.puce.verte[aria-pressed="true"] { background: var(--vert); border-color: var(--vert); }

label { font-size: 13px; font-weight: 600; color: var(--gris); }
input[type=text], input[type=password], input[type=search], input[type=datetime-local], input[type=tel], select, textarea {
  width: 100%; min-height: 46px; border: 1px solid var(--champ); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .puce:focus-visible, a:focus-visible {
  outline: 3px solid #7FB8B4; outline-offset: 1px; }

.case { width: 28px; height: 28px; min-width: 28px; border-radius: 8px; border: 2px solid var(--vert); background: var(--surface);
  color: #FFFFFF; font-weight: 700; cursor: pointer; padding: 0; }
.case[aria-pressed="true"] { background: var(--vert); }

.bandeau { text-decoration: none; background: var(--vert); color: #FFFFFF; border-radius: var(--rayon); padding: 16px;
  display: flex; flex-direction: column; gap: 6px; }
.bandeau:hover { color: #FFFFFF; background: var(--vert-fonce); }
.bandeau .sur { font-size: 13px; font-weight: 600; color: #CFE6E3; }
.bandeau .gros { font-size: 18px; font-weight: 600; line-height: 1.3; }
.bandeau.sombre { background: var(--encre); }

/* ── onglets ──────────────────────────────────────────────── */
.onglets { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--trait); scrollbar-width: none; }
.onglets::-webkit-scrollbar { display: none; }
.onglet { flex: 0 0 auto; min-height: 46px; padding: 0 12px; display: inline-flex; align-items: center; text-decoration: none;
  color: var(--gris); font-size: 14px; font-weight: 500; border-bottom: 3px solid transparent; white-space: nowrap; }
.onglet.actif { color: var(--vert); font-weight: 700; border-bottom-color: var(--vert); }

/* ── navigation ───────────────────────────────────────────── */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; background: var(--surface); border-top: 1px solid var(--trait);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 4px calc(10px + env(safe-area-inset-bottom)); }
.nav a { text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0;
  color: var(--gris); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.nav a::before { content: ""; width: 28px; height: 3px; border-radius: 3px; background: transparent; }
.nav a.actif { color: var(--vert); font-weight: 700; }
.nav a.actif::before { background: var(--vert); }
@media (min-width: 900px) {
  .nav a { font-size: 14px; }
  .nav { top: 0; bottom: auto; border-top: none; border-bottom: 1px solid var(--trait); grid-template-columns: repeat(5, 150px);
    justify-content: center; padding: 4px 8px; }
  .page { padding-top: 84px; padding-bottom: 40px; }
  .carte-page { top: 62px !important; bottom: 0 !important; }
}

/* ── carte ────────────────────────────────────────────────── */
.carte-page { position: fixed; left: 0; right: 0; top: 0; bottom: 74px; display: flex; flex-direction: column; }
.carte-outils { background: var(--surface); border-bottom: 1px solid var(--trait); padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 8px; }
#carte { flex: 1 1 auto; background: #E6EBE8; }
.legende { background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; padding: 8px 10px; font-size: 12px;
  display: flex; flex-direction: column; gap: 5px; }
.legende span.rond { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.rond.neuve { background: #E07A3A; border: 2px solid #B4501A; }
.rond.libre { background: #FFFFFF; border: 2px solid #6B7A84; }
.rond.contact { background: #8CC5C0; border: 2px solid #0E6464; }
.rond.rdv { background: #0E6464; border: 2px solid #0A4A4A; }
.compteur { background: var(--encre); color: #FFFFFF; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.volet { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 900; background: var(--surface); border-radius: 18px;
  border: 1px solid var(--trait); box-shadow: 0 8px 24px rgba(21,33,43,0.18); padding: 16px; display: flex; flex-direction: column; gap: 10px;
  max-width: 520px; margin: 0 auto; }
.volet[hidden] { display: none; }
.suggestions { position: absolute; left: 14px; right: 14px; z-index: 1100; background: var(--surface); border: 1px solid var(--trait);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(21,33,43,0.14); overflow: hidden; }
.suggestions button { display: block; width: 100%; text-align: left; background: none; border: none; padding: 12px 14px; cursor: pointer; }
.suggestions button + button { border-top: 1px solid var(--trait-doux); }
.groupe-carte { background: var(--vert); color: #FFFFFF; border: 2px solid #FFFFFF; border-radius: 999px; font-weight: 700;
  font-size: 13px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,0.25); }

/* ── fenêtre « Signaler » ─────────────────────────────────── */
.fond-modal { position: fixed; inset: 0; z-index: 3000; background: rgba(21,33,43,0.45); display: flex; flex-direction: column; justify-content: flex-end; }
.fond-modal[hidden] { display: none; }
.modal { background: var(--surface); border-radius: 20px 20px 0 0; padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px; max-width: 620px; width: 100%; margin: 0 auto; }
@media (min-width: 900px) { .fond-modal { justify-content: center; } .modal { border-radius: 20px; } }
.signaler { align-self: center; }

.message { padding: 12px 14px; border-radius: 12px; background: var(--orange-clair); color: var(--orange); font-weight: 600; }
.info-source { font-size: 12px; font-weight: 600; }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple td, table.simple th { text-align: left; padding: 8px 6px; border-top: 1px solid var(--trait-doux); vertical-align: top; }

/* ── alertes et économie ─────────────────────────────────── */
.alerte { background: var(--surface); border: 1px solid var(--trait); border-left: 4px solid var(--vert); border-radius: 14px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.alerte.nouveau { border-left-color: var(--orange); }
.alerte.alerte-rouge { border-left-color: #9B2C1F; }
.interrupteur { width: 50px; height: 30px; min-width: 50px; border-radius: 999px; border: none; background: #C9D1CE; position: relative; cursor: pointer; padding: 0; }
.interrupteur::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.interrupteur[aria-checked="true"] { background: var(--vert); }
.interrupteur[aria-checked="true"]::after { left: 23px; }
.page.large { max-width: 1240px; }
.grille-tn { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; max-width: 520px; }
.case-tn { aspect-ratio: 1 / 1; border-radius: 12px; border: 1px solid rgba(21,33,43,.08); padding: 6px; display: flex; flex-direction: column;
  justify-content: space-between; text-decoration: none; color: var(--encre); }
.case-tn.clair { color: #fff; }
.case-tn.choisi { outline: 3px solid var(--orange); outline-offset: -3px; }
.case-tn .n { font-size: 10.5px; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; hyphens: auto; }
@media (min-width: 600px) { .case-tn .n { font-size: 12px; } }
.case-tn .v { font-size: 14px; font-weight: 700; }
.deux-colonnes { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.deux-colonnes > * { flex: 1 1 420px; min-width: 0; }
.barres { display: flex; align-items: flex-end; gap: 6px; height: 100px; }
.barres > div { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
