:root{
  --brand:#176B50;
  --brand-deep:#0F4B38;
  --brand-tint:#E7F1EC;
  --ink:#18302A;
  --ink-soft:#63746E;
  --paper:#F6F8F7;
  --paper-raised:#FFFFFF;
  --line:#DFE9E4;
  --line-strong:#C7D6CE;
  --orange:#E8A044;
  --blue:#3E8BC4;
  --danger:#C1443C;
  --radius:14px;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;overflow-x:hidden;width:100%;-webkit-text-size-adjust:100%;text-size-adjust:100%;}
body{
  background:var(--paper);
  color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  min-height:100vh;
}
h1,h2,h3{
  font-weight:800;
  letter-spacing:-0.01em;
  margin:0;
}
.mono{ font-family:'SF Mono','Courier New',monospace; }
#app{
  max-width:480px;
  margin:0 auto;
  min-height:100vh;
  background:var(--paper);
  display:flex;
  flex-direction:column;
  position:relative;
  border-left:1px solid var(--line);
  border-right:1px solid var(--line);
}

/* ---- Header ---- */
header.topbar{
  background:var(--paper-raised);
  border-bottom:1px solid var(--line);
  padding:calc(14px + env(safe-area-inset-top)) 18px 14px;
  position:sticky;
  top:0;
  z-index:20;
}
header.topbar .row{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
header.topbar .brand-block{
  display:flex;
  align-items:center;
  gap:11px;
}
header.topbar .logo{
  width:44px;height:44px;
  border-radius:50%;
  background:var(--brand);
  color:#fff;
  display:flex;align-items:center;justify-content:center;
  font-weight:800;
  font-size:19px;
  flex:none;
}
header.topbar .brand{
  font-size:16px;
  font-weight:800;
  letter-spacing:0.03em;
  color:var(--ink);
}
header.topbar .brand .brand-b{ color:#C8891A; }
header.topbar .brand small{
  display:block;
  font-weight:700;
  letter-spacing:0;
  font-size:11.5px;
  color:var(--ink-soft);
  margin-top:2px;
}
.lang-badge{
  border:1px solid var(--line-strong);
  border-radius:100px;
  padding:6px 12px;
  font-size:11.5px;
  font-weight:800;
  color:var(--brand);
  background:var(--paper-raised);
  cursor:pointer;
  flex:none;
}
.icon-btn{
  background:none;border:1px solid var(--line-strong);color:var(--ink);
  border-radius:100px;width:34px;height:34px;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
}
.header-actions{ display:flex; gap:8px; align-items:center; }

/* ---- Content ---- */
main{
  flex:1;
  padding:18px 18px 96px;
  overflow-y:auto;
}
.section{ display:none; animation:fadeIn 0.2s ease; }
.section.active{ display:block; }
@keyframes fadeIn{ from{opacity:0;} to{opacity:1;} }

.eyebrow{
  font-size:12px;
  color:var(--ink-soft);
  margin:0 0 4px;
}
h2.screen-title{
  font-size:26px;
  line-height:1.15;
  margin-bottom:6px;
}
p.screen-sub{
  font-size:14px;
  color:var(--ink-soft);
  margin:0 0 16px;
  max-width:60ch;
}

/* ---- Progress bar (wizard) ---- */
.progress-track{
  height:5px;
  border-radius:100px;
  background:var(--line);
  overflow:hidden;
  margin-bottom:20px;
}
.progress-fill{
  height:100%;
  background:var(--brand);
  border-radius:100px;
  transition:width 0.25s ease;
}

/* ---- Big option cards (wireframe-style full-width buttons) ---- */
.opt-list{ display:flex; flex-direction:column; gap:10px; }
.opt-card{
  background:var(--paper-raised);
  border:1.5px solid var(--line-strong);
  border-radius:var(--radius);
  padding:16px 18px;
  font-size:15px;
  color:var(--ink);
  cursor:pointer;
  text-align:left;
  display:flex;
  align-items:center;
  gap:10px;
  transition:border-color 0.15s, background 0.15s;
}
.opt-card:active{ transform:scale(0.99); }
.opt-card.strong{ font-weight:800; }
.opt-card.selected{
  border-color:var(--brand);
  background:var(--brand-tint);
}
.opt-card.brand{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
  font-weight:800;
  justify-content:center;
}
.opt-card .ic{ flex:none; width:20px; height:20px; color:var(--brand); }
.opt-card.recording{ border-color:var(--danger); background:#FBEEEC; color:var(--danger); animation:rec-pulse 1.2s ease-in-out infinite; }
.opt-card small{ display:block; font-weight:400; color:var(--ink-soft); font-size:12px; margin-top:2px; }

/* ---- Buttons ---- */
.btn{
  width:100%;
  background:var(--brand);
  color:#fff;
  border:none;
  border-radius:var(--radius);
  padding:15px;
  font-size:15px;
  font-weight:800;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.btn:active{ background:var(--brand-deep); }
.btn-voir-partages{ padding:13.5px 15px; }
.btn.secondary{
  background:var(--paper-raised);
  color:var(--brand);
  border:1.5px solid var(--brand);
}
.btn.ghost{
  background:none;
  color:var(--ink-soft);
  border:1.5px solid var(--line-strong);
}
.btn.small{ padding:10px; font-size:13px; }
/* Variante pill, alignée à droite du titre (écran Se déplacer) plutôt que
   seule au-dessus — maquette fournie par l'utilisateur. Format harmonisé
   pour tous les boutons retour/annuler de l'app : toujours cette pill,
   toujours positionnée à droite (via .screen-top-bar ou .backlink-row). */
.backlink-pill{
  background:none; border:1.5px solid var(--brand); color:var(--brand);
  font-size:12.5px; font-weight:800; padding:8px 14px; border-radius:100px; cursor:pointer;
  white-space:nowrap; flex:none;
}
/* Ligne d'en-tête d'écran : eyebrow/titre à gauche, pill retour/annuler à droite. */
.screen-top-bar{
  display:flex; align-items:flex-start; justify-content:space-between; gap:10px;
}
/* Pour les écrans sans eyebrow/titre statique au même endroit (détails,
   dont le titre est injecté dynamiquement dans le corps) : la pill seule,
   toujours poussée à droite. */
.backlink-row{
  display:flex; justify-content:flex-end; margin-bottom:10px;
}

/* ---- Stat row (accueil) ---- */
.stat-row{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-bottom:18px;
}
.stat-tile{
  background:var(--paper-raised);
  border:1.5px solid var(--line-strong);
  border-radius:var(--radius);
  padding:12px 8px;
  text-align:center;
  cursor:pointer;
}
.stat-tile:active{ transform:scale(0.97); }
.stat-tile .n{ font-size:22px; font-weight:800; color:var(--ink); }
.stat-tile .l{ font-size:10.5px; color:var(--ink-soft); margin-top:2px; }
.stat-tile.st-probleme .n{ color:var(--orange); }
.stat-tile.st-initiative .n{ color:var(--blue); }
.stat-tile.st-action .n{ color:var(--brand); }

/* ---- Services utiles — grille de rubriques en cartes (maquette utilisateur) ---- */
.rubrique-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:12px; }
.rubrique-card{
  display:flex; flex-direction:column; align-items:stretch;
  background:var(--paper-raised); border:none; border-radius:var(--radius);
  overflow:hidden; padding:0; text-align:left;
  box-shadow:0 1px 4px rgba(15,46,34,0.1);
}
.rubrique-photo{ width:100%; aspect-ratio:3/2; display:flex; align-items:center; justify-content:center; }
.rubrique-title{ font-weight:800; font-size:12.5px; color:var(--ink); padding:7px 8px 6px; line-height:1.2; }
.rubrique-card:has(.rubrique-sub) .rubrique-title{ padding-bottom:1px; }
.rubrique-sub{ display:block; font-size:10.5px; color:var(--ink-soft); padding:0 8px 7px; }

/* ---- Ligne "Partager" : Photo/Vidéo/Parler/Écrire (nouvelle maquette, page principale) ---- */
.share-row{
  display:flex; justify-content:space-between; gap:6px;
  margin-bottom:16px;
}
.share-ic{
  display:flex; flex-direction:column; align-items:center; gap:6px;
  background:none; border:none;
  font-size:11.5px; font-weight:700; color:var(--ink);
  flex:1;
}
.share-ic .ic{
  width:56px; height:56px;
  display:flex; align-items:center; justify-content:center;
  border-radius:50%;
  border:none;
  color:var(--brand);
}
.share-ic:active .ic{ transform:scale(0.95); }
/* Une couleur d'icône + un fond léger par action, pour les distinguer au premier
   coup d'œil (Photo/Vidéo/Parler/Écrire) plutôt qu'un seul jeu de couleurs. */
.share-ic-photo .ic{ color:#2878C8; background:#EAF4FC; }
.share-ic-video .ic{ color:#D4473F; background:#FCECEA; }
.share-ic-parler .ic{ color:#7654A3; background:#F2ECF8; }
.share-ic-ecrire .ic{ color:#C98212; background:#FFF4DC; }

/* ---- Accès rapides Services utiles / Urgences ---- */
.quick-pills{ display:flex; gap:8px; margin-bottom:20px; }
.pill-btn{
  flex:1;
  display:flex; align-items:center; justify-content:center; gap:6px;
  background:var(--brand-tint);
  border:none;
  color:var(--brand);
  border-radius:100px;
  padding:10px 12px;
  font-size:12.5px; font-weight:700;
}
.pill-btn:active{ background:#DCEBE3; }
.pill-danger{ background:#FCEBEA; border:none; color:var(--danger); }
.pill-danger:active{ background:#F7D9D6; }

/* ---- Ligne de stats compacte (remplace les 3 pavés) ---- */
.stat-inline{
  display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:6px;
  font-size:13px; color:var(--ink-soft);
  margin-top:18px;
}
.stat-inline span[onclick]{ cursor:pointer; }
.stat-inline b{ color:var(--ink); font-weight:800; }
.stat-inline .sep{ color:var(--line-strong); }

/* ---- Section label ---- */
.section-label{
  display:flex; align-items:center; gap:7px;
  font-size:12.5px; font-weight:800; letter-spacing:0.02em;
  color:var(--ink); text-transform:uppercase;
  margin:22px 0 10px;
}
.section-label:first-child{ margin-top:0; }
.section-label::before{ content:''; display:block; width:4px; height:14px; border-radius:2px; background:#C98212; flex:none; }

/* ---- Cards (feed) ---- */
.card{
  background:var(--paper-raised);
  border:1.5px solid var(--line);
  border-radius:var(--radius);
  padding:14px;
  margin-bottom:10px;
  cursor:pointer;
  animation:itemPop 0.35s ease backwards;
}
@keyframes itemPop{
  from{ opacity:0; transform:translateY(6px); }
  to{ opacity:1; transform:translateY(0); }
}
.card .row-top{ display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.fav-star{ font-size:18px; color:var(--line-strong); cursor:pointer; line-height:1; flex:none; margin-left:auto; }
.fav-star.active{ color:var(--orange); }
.kind-dot{ width:9px; height:9px; border-radius:50%; flex:none; }
.kind-dot.k-probleme{ background:var(--orange); }
.kind-dot.k-idee{ background:var(--orange); opacity:0.55; }
.kind-dot.k-initiative{ background:var(--blue); }
.kind-dot.k-action{ background:var(--brand); }
.card .cat{ font-size:11px; color:var(--ink-soft); font-weight:700; text-transform:uppercase; letter-spacing:0.02em; }
.status-pill{
  margin-left:auto;
  font-size:10px; font-weight:800;
  padding:3px 9px; border-radius:100px;
  background:var(--line); color:var(--ink-soft);
}
.status-pill.p-a_verifier{ background:#FDEFDC; color:#8A5A16; }
.status-pill.p-mobilisation{ background:#E4EEF8; color:var(--blue); }
.status-pill.p-action{ background:var(--brand-tint); color:var(--brand); }
.status-pill.p-transmis{ background:#FBEEEC; color:var(--danger); }
.status-pill.p-pris_en_compte{ background:#E4EEF8; color:var(--blue); }
.status-pill.p-intervention_prevue{ background:#E4EEF8; color:var(--blue); }
.status-pill.p-resolu{ background:#E4F3EA; color:#1F7A45; }
.status-pill.p-clos{ background:var(--line); color:var(--ink-soft); }
.card-thumb{ display:block; width:calc(100% + 28px); height:140px; object-fit:cover; margin:-14px -14px 10px -14px; border-radius:var(--radius) var(--radius) 0 0; background:var(--line); }
.card-thumb-video{ display:flex; align-items:center; justify-content:center; font-size:34px; color:var(--ink-soft); }
/* Aperçu "un partage récent" de l'accueil : grande photo, titre court, quartier
   — volontairement sans badge ni compteur (voir homeFeedCardHtml). Pas de
   cadre visible (contrairement à .card générique) : ombre légère à la place. */
.home-feed-card{ border:none; box-shadow:0 1px 4px rgba(15,46,34,0.1); }
.home-feed-photo{ display:block; width:calc(100% + 28px); height:220px; object-fit:cover; margin:-14px -14px 10px -14px; border-radius:var(--radius) var(--radius) 0 0; background:var(--line); }
.home-feed-photo-video{ display:flex; align-items:center; justify-content:center; font-size:44px; color:var(--ink-soft); }
.home-feed-quartier{ font-size:12.5px; color:var(--ink-soft); margin:0; }
.home-feed-card h3{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; text-overflow:ellipsis; }
.card h3{ font-size:15px; margin-bottom:3px; }
.card p{ font-size:12.5px; color:var(--ink-soft); margin:0; line-height:1.4; }
.card .meta{ font-size:11px; color:var(--ink-soft); margin-top:8px; display:flex; gap:10px; align-items:center; }
.card .meta .card-counters{ margin-left:auto; white-space:nowrap; }

.chips{ display:flex; gap:7px; overflow-x:auto; padding-bottom:4px; margin-bottom:12px; }
.chips::-webkit-scrollbar{ display:none; }
.chip{
  flex:none;
  border:1.5px solid var(--line-strong);
  background:var(--paper-raised);
  border-radius:100px;
  padding:7px 14px;
  font-size:12.5px;
  color:var(--ink-soft);
  cursor:pointer;
  display:flex; align-items:center; gap:6px;
}
.chip.active{ background:var(--ink); border-color:var(--ink); color:#fff; }
.chip.active.c-probleme{ background:var(--orange); border-color:var(--orange); }
.chip.active.c-initiative{ background:var(--blue); border-color:var(--blue); }
.chip.active.c-action{ background:var(--brand); border-color:var(--brand); }

.empty{
  text-align:center;
  padding:30px 14px;
  color:var(--ink-soft);
  font-size:13px;
}

/* ---- Carte Explorer (Leaflet) ---- */
.map-wrap{
  border-radius:var(--radius);
  overflow:hidden;
  border:1.5px solid var(--line-strong);
  margin-bottom:12px;
  position:relative;
  /* Leaflet's own panes use z-index 200-700 internally; without a stacking
     context trapped here, those values compare against the page's global
     stacking order and can float above later elements with a much lower
     z-index (e.g. the bottom-sheet overlay) despite appearing earlier in
     the DOM. isolation:isolate contains them to this element. */
  isolation:isolate;
}
#leafletMap{ width:100%; height:260px; background:var(--line); }
.map-hint{
  position:absolute; left:8px; bottom:8px;
  background:rgba(255,255,255,0.92);
  padding:5px 10px;
  border-radius:100px;
  font-size:10.5px;
  color:var(--ink-soft);
}
.goxio-bubble{
  border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  color:#fff;
  font-weight:800;
  border:2px solid #fff;
  box-shadow:0 2px 8px rgba(15,46,34,0.25);
}
.moto-pin{
  width:28px; height:28px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:15px; line-height:1;
  border:2px solid #fff;
  box-shadow:0 2px 8px rgba(15,46,34,0.3);
}
.moto-pin-pickup{ background:var(--ink); }
.moto-pin-driver{ background:var(--brand-tint); }

/* ---- Choix du transport (Moto/Taxi), écran Se déplacer ---- */
.vehicle-toggle{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:4px; }
.vehicle-card{
  position:relative;
  width:100%; box-sizing:border-box;
  background:var(--paper-raised); border:1.5px solid var(--line-strong); border-radius:var(--radius);
  padding:14px; display:flex; flex-direction:row; align-items:center; gap:10px;
}
.vehicle-card.selected{ border-color:var(--brand); background:var(--brand-tint); }
.vehicle-card .vc-emoji{ font-size:28px; line-height:1; flex:none; }
.vehicle-card .vc-label{ font-weight:800; font-size:15px; color:var(--ink); display:block; }
.vehicle-card .vc-count{ font-size:12px; color:var(--brand); font-weight:700; display:block; }
.vehicle-card .vc-text{ display:flex; flex-direction:column; align-items:flex-start; gap:2px; flex:1; }
.vehicle-card .vc-check{
  position:absolute; top:6px; right:6px; width:16px; height:16px; border-radius:50%;
  background:var(--brand); color:#fff; font-size:10px; font-weight:800;
  display:flex; align-items:center; justify-content:center;
}
/* ---- Champs Départ/Arrivée (Liste · écrire · parler), écran Se déplacer ---- */
.field-row{
  display:flex; align-items:center; gap:6px;
  border:1.5px solid var(--brand); border-radius:100px;
  padding:6px; margin-bottom:4px;
}
.field-row input[type=text]{
  flex:1; border:none; background:none; padding:8px 2px; margin:0; font-size:14px; min-width:0;
}
.field-list-btn{
  display:flex; align-items:center; gap:4px; white-space:nowrap;
  background:var(--paper-raised); border:1.5px solid var(--line-strong); border-radius:100px;
  padding:8px 12px; font-size:11.5px; font-weight:700; color:var(--ink); flex:none;
}
.field-mic-btn{
  width:34px; height:34px; border-radius:50%; background:var(--brand); color:#fff;
  display:flex; align-items:center; justify-content:center; flex:none; border:none;
}
.field-mic-btn.recording{ background:var(--danger); animation:rec-pulse 1.2s ease-in-out infinite; }
.field-wave{
  display:none; align-items:center; justify-content:center; gap:2px;
  height:48px; margin:2px 0 10px; background:#0B1E17; border-radius:10px;
  overflow:hidden;
}
.field-wave.active{ display:flex; }
.field-wave .wbar{ width:3px; background:var(--danger); animation:wave-pulse 0.9s ease-in-out infinite alternate; }

.leaflet-tooltip.goxio-map-label{
  background:var(--paper-raised);
  border:1px solid var(--line-strong);
  border-radius:100px;
  padding:4px 10px;
  font-size:11px;
  font-weight:700;
  color:var(--ink);
  box-shadow:0 2px 6px rgba(15,46,34,0.15);
}
.leaflet-control-attribution{ font-size:9px; padding:0 4px; }
.leaflet-tooltip.goxio-map-label::before{ display:none; }
.map-legend{ display:flex; flex-wrap:wrap; gap:8px 14px; margin-bottom:12px; }
.legend-item{ display:inline-flex; align-items:center; gap:5px; font-size:11px; color:var(--ink-soft); }
.legend-dot{ width:9px; height:9px; border-radius:50%; flex:none; }
.quartier-info-card{
  background:var(--paper-raised);
  border:1.5px solid var(--line-strong);
  border-radius:var(--radius);
  padding:14px;
  margin-bottom:14px;
}
.quartier-info-card .qi-eyebrow{ font-size:10.5px; font-weight:800; letter-spacing:0.05em; text-transform:uppercase; color:var(--brand); margin-bottom:3px; }
.quartier-info-card h3{ font-size:17px; margin-bottom:2px; }
.quartier-info-card .qi-alias{ font-size:12px; color:var(--ink-soft); margin-bottom:10px; }
.quartier-info-card .qi-counts{ display:flex; flex-direction:column; gap:6px; border-top:1px solid var(--line); padding-top:10px; }
.qi-count-row{ display:flex; align-items:center; gap:8px; font-size:13px; }
.qi-count-row .dot{ width:9px;height:9px;border-radius:50%; flex:none; }

/* ---- Wizard nature/catégorie tiles ---- */
.nature-grid{ display:flex; flex-direction:column; gap:10px; }

/* ---- Détails étape (photo/audio) ---- */
.media-row{ display:flex; gap:10px; margin-bottom:10px; }
.media-btn{
  flex:1;
  background:var(--paper-raised);
  border:1.5px dashed var(--line-strong);
  border-radius:var(--radius);
  padding:16px 8px;
  text-align:center;
  cursor:pointer;
  font-size:12.5px;
  color:var(--ink-soft);
  font-weight:700;
}
.media-btn.active{ border-style:solid; border-color:var(--brand); color:var(--brand); background:var(--brand-tint); }
.media-btn.recording{ border-style:solid; border-color:var(--danger); color:var(--danger); background:#FBEEEC; animation:rec-pulse 1.2s ease-in-out infinite; }
@keyframes rec-pulse{ 0%,100%{ opacity:1; } 50%{ opacity:0.6; } }
.media-btn .ic{ display:block; margin:0 auto 6px; width:22px; height:22px; }

/* ---- Caméra vidéo plein cadre (nouvelle maquette §5, bouton Vidéo de l'accueil) ---- */
.video-capture{
  position:relative;
  background:#000;
  border-radius:var(--radius);
  overflow:hidden;
  margin-bottom:14px;
}
.video-capture video#videoLiveEl, .video-capture video#photoLiveEl{
  width:100%; height:58vh; max-height:520px; min-height:320px;
  object-fit:cover; display:block;
}
.video-duration-badge{
  position:absolute; top:12px; left:50%; transform:translateX(-50%);
  background:rgba(0,0,0,0.55); color:#fff; font-size:12.5px; font-weight:700;
  padding:4px 10px; border-radius:100px;
}
.video-duration-picker{
  position:absolute; bottom:88px; left:50%; transform:translateX(-50%);
  display:flex; gap:4px; background:rgba(0,0,0,0.4); padding:4px; border-radius:100px;
}
.dur-opt{ background:none; border:none; color:#fff; font-size:11.5px; font-weight:700; padding:6px 10px; border-radius:100px; }
.dur-opt.active{ background:#fff; color:var(--ink); }
.video-controls{
  position:absolute; bottom:14px; left:0; right:0;
  display:flex; align-items:center; justify-content:space-around; padding:0 18px;
}
.vc-side{ display:flex; flex-direction:column; align-items:center; gap:4px; background:none; border:none; color:#fff; font-size:10.5px; font-weight:700; }
.vc-record{
  width:64px; height:64px; border-radius:50%;
  background:var(--danger); border:4px solid #fff;
  display:flex; align-items:center; justify-content:center; color:#fff;
}
.vc-record svg{ width:26px; height:26px; }
.vc-record.recording{ background:#B3271E; }
.vc-shutter{
  width:64px; height:64px; border-radius:50%;
  background:#fff; border:4px solid rgba(255,255,255,0.5);
}
.vc-shutter:active{ transform:scale(0.92); }
.vc-mic{
  width:64px; height:64px; border-radius:50%;
  background:var(--brand); border:4px solid #fff;
  display:flex; align-items:center; justify-content:center; color:#fff;
}
.vc-mic svg{ width:26px; height:26px; }
.vc-mic.recording{ background:var(--danger); animation:rec-pulse 1.2s ease-in-out infinite; }
.vc-side[disabled]{ opacity:0.35; }
.video-preview-full{ width:100%; max-height:58vh; border-radius:var(--radius); background:#000; margin-bottom:12px; display:block; }
.video-review-actions{ display:flex; gap:8px; margin-bottom:14px; }

/* ---- Capture audio plein cadre (nouvelle maquette §4-5, bouton Parler de l'accueil) ---- */
.audio-capture{
  background:#0B1E17; border-radius:var(--radius);
  padding:32px 16px 22px; text-align:center; margin-bottom:14px;
}
.audio-wave{ display:flex; align-items:center; justify-content:center; gap:3px; height:56px; margin-bottom:12px; }
.wbar{ width:4px; border-radius:3px; background:var(--brand); display:inline-block; }
.audio-capture.recording .wbar{ animation:wave-pulse 0.9s ease-in-out infinite alternate; background:#fff; }
@keyframes wave-pulse{ from{ opacity:0.5; transform:scaleY(0.7); } to{ opacity:1; transform:scaleY(1); } }
.audio-duration{ color:#fff; font-size:22px; font-weight:800; margin-bottom:18px; font-variant-numeric:tabular-nums; }
.audio-controls-row{ display:flex; align-items:center; justify-content:space-around; padding:0 8px; }
.video-review-actions .btn{ flex:1; }
.voice-precision{ margin-bottom:16px; }
input[type=text], input[type=tel], textarea, select{
  width:100%;
  background:var(--paper-raised);
  border:1.5px solid var(--line-strong);
  border-radius:var(--radius);
  padding:13px 14px;
  font-size:14px;
  color:var(--ink);
  font-family:inherit;
  margin-bottom:10px;
}
textarea{ min-height:90px; resize:vertical; }
label.field-label{ font-size:12.5px; font-weight:700; color:var(--ink-soft); margin:0 0 6px; display:block; }
.photo-preview{ width:100%; border-radius:var(--radius); margin-bottom:10px; display:block; }
.video-preview{ width:100%; max-height:280px; border-radius:var(--radius); margin-bottom:10px; display:block; background:#000; }
.video-wrap{ position:relative; margin-bottom:10px; }
.video-wrap .video-preview{ margin-bottom:0; }
.video-play-overlay{
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:56px; height:56px; border-radius:50%; background:rgba(255,255,255,0.92);
  border:none; display:flex; align-items:center; justify-content:center;
  font-size:20px; color:var(--brand); cursor:pointer; box-shadow:0 4px 14px rgba(0,0,0,0.25);
  padding-left:3px; /* recentre visuellement le triangle ▶ */
}
.video-duration{
  position:absolute; bottom:10px; right:10px; background:rgba(0,0,0,0.65); color:#fff;
  font-size:11px; font-weight:700; padding:2px 7px; border-radius:6px;
}

/* ---- Récap ---- */
.recap-block{
  background:var(--paper-raised);
  border:1.5px solid var(--line-strong);
  border-radius:var(--radius);
  padding:14px;
  margin-bottom:14px;
}
.recap-row{ display:flex; justify-content:space-between; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); font-size:13px; }
.recap-row:last-child{ border-bottom:none; }
.recap-row .k{ color:var(--ink-soft); flex:none; }
.recap-row .v{ text-align:right; font-weight:600; }
.rules-note{ font-size:11.5px; color:var(--ink-soft); line-height:1.5; margin-bottom:16px; }

/* ---- Confirmation ---- */
.ref-block{
  background:var(--brand-tint);
  border:1.5px solid var(--brand);
  border-radius:var(--radius);
  padding:20px;
  text-align:center;
  margin-bottom:18px;
}
.ref-block .lbl{ font-size:11.5px; color:var(--brand); font-weight:700; margin-bottom:6px; }
.ref-block .ref{ font-size:22px; font-weight:800; letter-spacing:0.02em; color:var(--brand-deep); cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.ref-block .secret{ font-size:12px; color:var(--ink-soft); margin-top:8px; }

/* ---- Détail (situation/initiative/action) ---- */
.detail-hero{ margin-bottom:16px; }
.detail-hero .kind-row{ display:flex; align-items:center; gap:7px; margin-bottom:8px; }
.detail-hero h2{ font-size:22px; margin-bottom:6px; }
.detail-hero .meta{ font-size:12.5px; color:var(--ink-soft); }
.detail-photo{ width:100%; border-radius:var(--radius); margin:14px 0; display:block; }
.detail-desc{ font-size:14px; line-height:1.6; color:var(--ink); margin-bottom:16px; white-space:pre-wrap; }
.action-row{ display:flex; gap:8px; margin-bottom:16px; }
.action-row .btn{ flex:1; }
.needs-list{ display:flex; flex-direction:column; gap:8px; margin-bottom:16px; }
.need-item{
  display:flex; justify-content:space-between; align-items:center;
  background:var(--paper-raised); border:1.5px solid var(--line); border-radius:10px;
  padding:10px 12px; font-size:13px;
}
.need-item .status-tag{ font-size:10.5px; font-weight:800; padding:2px 8px; border-radius:100px; background:var(--line); color:var(--ink-soft); }
.need-item .status-tag.fulfilled{ background:var(--brand-tint); color:var(--brand); }
.updates-list{ display:flex; flex-direction:column; gap:10px; margin-bottom:16px; }
.update-item{ border-left:2.5px solid var(--brand); padding-left:12px; }
.update-item .u-meta{ font-size:11px; color:var(--ink-soft); margin-bottom:3px; }
.update-item p{ font-size:13px; margin:0; line-height:1.5; }
.comments-list{ display:flex; flex-direction:column; gap:10px; margin-bottom:12px; }
.comments-list .update-item{ border-left-color:var(--ink-soft); }
.comment-form{ display:flex; flex-direction:column; gap:8px; margin-bottom:20px; }
.comment-form textarea{ resize:vertical; }

/* ---- Suivi sans compte ---- */
.status-timeline{ display:flex; flex-direction:column; gap:0; margin:18px 0; }
.tl-step{ display:flex; gap:12px; }
.tl-step .tl-dot-col{ display:flex; flex-direction:column; align-items:center; }
.tl-step .tl-dot{ width:14px; height:14px; border-radius:50%; background:var(--line-strong); border:2px solid var(--paper); flex:none; }
.tl-step .tl-line{ width:2px; flex:1; background:var(--line-strong); min-height:22px; }
.tl-step.done .tl-dot{ background:var(--brand); }
.tl-step.done .tl-line{ background:var(--brand); }
.tl-step .tl-label{ font-size:13px; padding-bottom:22px; color:var(--ink-soft); }
.tl-step.done .tl-label{ color:var(--ink); font-weight:700; }

/* ---- Mes activités tabs ---- */
.tabs-row{ display:flex; gap:6px; margin-bottom:14px; background:var(--line); border-radius:100px; padding:3px; }
.tabs-row button{
  flex:1; border:none; background:none; padding:9px; border-radius:100px;
  font-size:12.5px; font-weight:700; color:var(--ink-soft); cursor:pointer;
}
.tabs-row button.active{ background:var(--paper-raised); color:var(--ink); }

/* ---- Admin quartiers ---- */
.quartier-item{
  display:flex; align-items:center; gap:11px;
  background:var(--paper-raised); border:1.5px solid var(--line-strong);
  border-radius:var(--radius); padding:12px 14px; margin-bottom:8px;
}
.quartier-item .qcode{
  font-size:10px; font-weight:800; color:#fff; background:var(--brand);
  border-radius:6px; padding:3px 6px; flex:none;
}
.quartier-item .qi-name{ font-weight:700; font-size:13.5px; }
.quartier-item .qi-alias-sm{ font-size:11px; color:var(--ink-soft); }
.quartier-item .qi-status{ margin-left:auto; font-size:10.5px; color:var(--ink-soft); }
.quartier-item button.qi-del{ background:none; border:none; color:var(--danger); cursor:pointer; padding:4px; }

/* ---- Nav bottom ---- */
nav.tabbar{
  position:fixed; bottom:0; left:50%; transform:translateX(-50%);
  width:100%; max-width:480px;
  background:var(--paper-raised);
  border-top:1px solid var(--line);
  display:flex; align-items:center; justify-content:space-around;
  padding:8px 6px calc(8px + env(safe-area-inset-bottom));
  z-index:30;
}
nav.tabbar button{
  background:none; border:none; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; gap:3px;
  color:var(--ink-soft); font-size:10.5px;
  padding:4px 8px;
  flex:1;
}
nav.tabbar button svg{ width:20px; height:20px; }
nav.tabbar .nav-ic{
  width:30px; height:30px;
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  transition:background 0.15s, color 0.15s;
}
nav.tabbar button.active{ color:var(--brand); }
nav.tabbar button.active .nav-ic{ background:var(--brand); color:#fff; }
/* Le retour à l'accueil doit rester repérable même depuis un autre onglet. */
/* Le retour à l'accueil doit rester repérable en permanence, actif ou non. */
nav.tabbar button[data-tab="accueil"] .nav-ic{ background:var(--brand); color:#fff; }

/* ---- Toast ---- */
#toast{
  position:fixed; bottom:86px; left:50%; transform:translateX(-50%) translateY(20px);
  background:var(--ink); color:#fff;
  padding:11px 18px; border-radius:100px;
  font-size:12.5px;
  opacity:0; pointer-events:none;
  transition:opacity 0.2s, transform 0.2s;
  z-index:50;
  max-width:88%;
  text-align:center;
}
#toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

/* ---- Feuille du bas (bottom sheet) — ex. "Où êtes-vous ?" pour Se déplacer ---- */
.sheet-backdrop{
  position:fixed; inset:0; background:rgba(15,46,34,0.45);
  display:flex; align-items:flex-end; justify-content:center;
  z-index:1000;
}
.sheet{
  width:100%; max-width:480px;
  background:var(--paper-raised);
  border-radius:20px 20px 0 0;
  padding:8px 18px calc(18px + env(safe-area-inset-bottom));
  max-height:80vh; overflow-y:auto;
  animation:sheet-up 0.2s ease;
}
@keyframes sheet-up{ from{ transform:translateY(16px); opacity:0.6; } to{ transform:translateY(0); opacity:1; } }
.sheet-handle{ width:36px; height:4px; border-radius:100px; background:var(--line-strong); margin:4px auto 14px; }
.sheet-title{ font-size:19px; margin-bottom:12px; }
.sheet-row{
  width:100%; display:flex; align-items:center; gap:10px;
  background:var(--paper-raised); border:1.5px solid var(--line-strong); border-radius:var(--radius);
  padding:13px 14px; margin-bottom:8px; text-align:left;
}
.sheet-row.selected{ border-color:var(--brand); background:var(--brand-tint); }
.sheet-row-icon{ font-size:17px; color:var(--brand); flex:none; }
.sheet-row-text{ display:flex; flex-direction:column; gap:1px; }
.sheet-row-label{ font-weight:800; font-size:14.5px; color:var(--ink); }
.sheet-row-sub{ font-size:12px; color:var(--ink-soft); }
.sheet-row-chevron{ margin-left:auto; color:var(--ink-soft); }
.sheet-row-accent{ border-color:var(--brand); color:var(--brand); }
.sheet-row-accent .sheet-row-label{ color:var(--brand); }

/* ---- Auth ---- */
.auth-continue{ text-align:center; margin-top:14px; font-size:12.5px; color:var(--ink-soft); text-decoration:underline; cursor:pointer; }

@media (min-width:700px){
  #app{
    max-width:820px;
    min-height:auto;
    border:1px solid var(--line);
    margin:24px auto;
    box-shadow:0 4px 24px rgba(0,0,0,0.06);
  }
  body{ background:#EDEFEA; }
  nav.tabbar{
    order:1; position:static; max-width:none;
    left:auto; transform:none;
    border-top:none; border-bottom:1px solid var(--line-strong);
  }
  header.topbar{ order:0; }
  main{ order:2; padding-bottom:32px; }
  .stat-row{ grid-template-columns:repeat(3,1fr); }
  #leafletMap{ height:340px; }
}
