/* Layout : panneau (recherche, filtres, liste/fiche/classement) à gauche, carte à droite ; empilés sur mobile */
:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --fg: #1d2421;
  --muted: #66716b;
  --line: #dfe3de;
  --accent: #d2451e;      /* piment */
  --accent-soft: #fbe6de;
  --ok: #2f7d5b;
  --ok-soft: #e2f1ea;
  --wait: #8a6d1d;
  --wait-soft: #f6efd9;
  --star: #e0a100;
  /* Couleurs des catégories sur la carte (fixes : le fond de carte reste clair en mode sombre) */
  --c-restaurant: #e4572e;
  --c-bar: #8e44ad;
  --c-loisir: #1e88c7;
  --c-wait: #a8a29a;
  --veg: #3d7a1f;
  --veg-soft: #e6f2dc;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#121614; --panel:#1a1f1d; --fg:#e8ece9; --muted:#9aa59f; --line:#2c3430;
          --accent:#ff7a52; --accent-soft:#3a2219; --ok:#5cc293; --ok-soft:#1b2e25;
          --wait:#e3c46a; --wait-soft:#2f2a18; --star:#f2c14e; --veg:#8fd16a; --veg-soft:#1f2e17; color-scheme: dark; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.45 var(--body); }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { display: grid; grid-template-columns: 420px 1fr; height: 100%; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.head { padding: 16px 18px 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* Menu des langues, à côté du bouton de connexion */
.brand { flex-wrap: wrap; }
.brand .brandname { flex: 1 1 220px; }
.brandtools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; margin-left: auto; }
.langsel { border: 1.5px solid var(--line); background: transparent; color: var(--fg); border-radius: 999px; padding: 6px 8px; font: inherit; font-size: 13px; cursor: pointer; max-width: 130px; }
/* Avis traduits */
.trbtn { justify-self: start; font-size: 12px; }
.trnote { display: block; font-size: 12px; color: var(--muted); }
/* Arabe (de droite à gauche) : la carte garde son sens habituel */
[dir="rtl"] .mapwrap, [dir="rtl"] .leaflet-container { direction: ltr; }
/* Noms, adresses et avis écrits en lettres latines : chacun garde son propre sens d'écriture */
[dir="rtl"] :is(.sub, dd, h2, h3, .ctext, .ask-card b) { unicode-bidi: plaintext; }
[dir="rtl"] a[href^="tel:"], [dir="rtl"] .price { direction: ltr; unicode-bidi: isolate; }
h1 { font: 800 22px/1.08 var(--display); margin: 0; letter-spacing: -0.02em; text-wrap: balance; min-width: 0; }
h1 span { color: var(--accent); }
h1 small { display: block; font: 500 12px var(--body); color: var(--muted); letter-spacing: 0; margin-top: 3px; }

.userbtn { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: transparent; color: var(--fg);
  border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; font: 600 13px var(--body); flex: 0 0 auto; }
.userbtn.out { padding: 7px 14px; background: var(--fg); color: var(--panel); border-color: var(--fg); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font: 700 13px var(--body); flex: 0 0 auto; }
.userbtn .pts { color: var(--muted); font-weight: 500; }

.search { position: relative; }
.search input { width: 100%; padding: 11px 14px 11px 40px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--fg); font: 500 16px var(--body); }
.search input:focus { outline: none; border-color: var(--accent); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.filters { display: flex; gap: 8px; }
.filters select { flex: 1; min-width: 0; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: 500 14px var(--body); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--fg); border-radius: 999px;
  padding: 4px 10px; font: 500 13px var(--body); cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; background: none; border: 0; border-bottom: 2.5px solid transparent; padding: 10px; font: 600 14px var(--body); color: var(--muted); cursor: pointer; }
.tabs button.on { color: var(--fg); border-bottom-color: var(--accent); }

.count { padding: 9px 18px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.count b { color: var(--fg); }
.list, .detail, .board { overflow-y: auto; flex: 1; min-height: 0; }
.item { padding: 12px 18px; border-bottom: 1px solid var(--line); cursor: pointer; display: grid; gap: 5px; }
.item:hover, .item.sel { background: var(--accent-soft); }
.item .top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.item h3 { margin: 0; font: 600 16px var(--display); min-width: 0; }
.price { font: 700 15px var(--display); white-space: nowrap; font-variant-numeric: tabular-nums; }
.price small { font: 500 11px var(--body); color: var(--muted); }
.sub { font-size: 13px; color: var(--muted); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.dishes { display: flex; flex-wrap: wrap; gap: 4px; }
.dish { font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.dish.hit { background: var(--accent); color: #fff; border-color: var(--accent); }
.empty { padding: 28px 18px; color: var(--muted); }
.pill { font: 600 11px var(--body); text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 6px; }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.wait { color: var(--wait); background: var(--wait-soft); }
.pill.veg { color: var(--veg); background: var(--veg-soft); text-transform: none; letter-spacing: 0; }
.tile.vegtile { border-color: var(--veg); background: var(--veg-soft); }
.pill.form { color: var(--fg); background: var(--bg); border: 1px solid var(--line); text-transform: none; letter-spacing: 0; font-weight: 500; }
.stars { color: var(--star); letter-spacing: 1px; white-space: nowrap; }

.foot { padding: 12px 18px; border-top: 1px solid var(--line); }
.btn { width: 100%; padding: 12px; border: 0; border-radius: 10px; background: var(--fg); color: var(--panel);
  font: 600 15px var(--body); cursor: pointer; }
.btn:hover { opacity: .9; }
.btn.ghost { background: transparent; color: var(--fg); border: 1.5px solid var(--line); }
.btn.small { width: auto; padding: 6px 12px; font-size: 13px; }
.btn.okb { background: var(--ok); color: #fff; }
.link { background: none; border: 0; color: var(--muted); font: 500 13px var(--body); cursor: pointer; padding: 0; text-decoration: underline; }
.link.danger { color: var(--accent); }

/* Fiche restaurant */
.detail { padding: 14px 18px 24px; display: grid; gap: 18px; align-content: start; }
.detail h2 { margin: 0; font: 800 24px/1.1 var(--display); text-wrap: balance; }
.detail h4 { margin: 0 0 8px; font: 600 12px var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.prices { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.prices div { padding: 10px 8px; text-align: center; border-right: 1px solid var(--line); display: grid; gap: 2px; }
.prices div:last-child { border-right: 0; }
.prices span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.prices b { font: 700 17px var(--display); font-variant-numeric: tabular-nums; }
.facts { display: grid; gap: 6px; font-size: 14px; }
.facts div { display: flex; gap: 8px; }
.facts dt { color: var(--muted); min-width: 120px; }
.facts dd { margin: 0; }
.incl { display: flex; flex-wrap: wrap; gap: 6px; }
.incl span { font-size: 13px; padding: 2px 9px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-weight: 500; }
.scores { display: grid; gap: 4px; font-size: 14px; }
.scores div { display: flex; justify-content: space-between; gap: 8px; }
.review { border: 1.5px solid var(--ok); background: var(--ok-soft); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.review .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.review p, .comment p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.adminbox { border: 1.5px dashed var(--wait); background: var(--wait-soft); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; color: var(--wait); font-size: 14px; }
.adminbox .row { display: flex; gap: 8px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: zoom-in; display: block; }
.comment { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment.featured { background: var(--wait-soft); border-radius: 10px; padding: 12px; border-bottom: 0; margin-bottom: 6px; }
.comment:last-child { border-bottom: 0; }
.who { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.who b { font-weight: 600; }
.who small { color: var(--muted); }
.lvl { font-size: 12px; color: var(--muted); }
.comment .gallery { grid-template-columns: repeat(4, 1fr); }
.actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.vote { border: 1.5px solid var(--line); background: transparent; color: var(--fg); border-radius: 999px; padding: 3px 10px; font: 500 13px var(--body); cursor: pointer; }
.vote.on { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.vote:disabled { opacity: .55; cursor: default; }

.cform { display: grid; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.cform textarea { width: 100%; min-height: 80px; resize: vertical; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--fg); font: 15px var(--body); }
.cform textarea:focus { outline: none; border-color: var(--accent); }
.raterow { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.rate { display: flex; }
.rate button { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--line); padding: 0 2px; }
.rate button.on { color: var(--star); }
.previews { display: flex; gap: 6px; flex-wrap: wrap; }
.previews img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.filebtn { display: inline-flex; align-items: center; gap: 6px; font: 500 14px var(--body); cursor: pointer;
  border: 1.5px dashed var(--line); border-radius: 8px; padding: 8px 12px; color: var(--fg); justify-self: start; }
.filebtn input { display: none; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; color: var(--ok); }
.gate { text-align: center; padding: 18px; border: 1.5px dashed var(--line); border-radius: 12px; display: grid; gap: 10px; justify-items: center; color: var(--muted); }

/* Classement */
.board { padding: 14px 18px 24px; display: grid; gap: 18px; align-content: start; }
.rank { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rank.me { background: var(--accent-soft); border-radius: 8px; padding-inline: 8px; }
.rank .n { font: 700 16px var(--display); color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.rank .p { font: 700 15px var(--display); font-variant-numeric: tabular-nums; }
.rules { width: 100%; border-collapse: collapse; font-size: 14px; }
.rules td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.rules td:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.levels div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.levels b { display: block; font-size: 14px; }

/* Accueil */
.home { overflow-y: auto; flex: 1; min-height: 0; padding: 18px 18px 24px; display: grid; gap: 22px; align-content: start; }
.hero { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.hero-text { min-width: 0; }
.hero .hello { margin-top: 10px; font-size: 14px; color: var(--fg); }
.hero .intro { margin: 0 0 8px; font: 600 19px/1.25 var(--display); color: var(--fg); text-wrap: balance; }
.hero .intro b { color: var(--accent); }
.hero-cesar { width: 104px; height: auto; display: block; filter: drop-shadow(0 6px 10px rgba(0,0,0,.15)); }
.brandname { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brandface { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--accent-soft); border: 2px solid var(--accent); flex: 0 0 auto; }
.pill .face { width: 16px; height: 16px; border-radius: 50%; vertical-align: -4px; margin-right: 5px; background: #fff; object-fit: cover; }
img.avatar { object-fit: cover; background: var(--accent-soft); }
.avatar.sm { width: 24px; height: 24px; font-size: 11px; }
@media (max-width: 400px) { .hero-cesar { width: 80px; } .brandface { width: 44px; height: 44px; } }
.hero h2 { margin: 0 0 6px; font: 800 28px/1.05 var(--display); letter-spacing: -0.02em; text-wrap: balance; }
.hero h2 em { font-style: normal; color: var(--accent); }
.hero p { margin: 0; color: var(--muted); }
.hero b { color: var(--fg); font-variant-numeric: tabular-nums; }
.sec-title { margin: 0 0 8px; font: 600 12px var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { border: 1.5px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 12px; padding: 12px 6px; cursor: pointer;
  display: grid; gap: 2px; justify-items: center; text-align: center; font: 600 13px var(--body); }
.tile:hover { border-color: var(--accent); }
.tile .e { font-size: 26px; line-height: 1.15; }
.tile small { font-weight: 500; color: var(--muted); font-size: 11px; }
.tile.none { opacity: .55; }
/* Vignette de groupe : effet « pile de cartes » pour montrer qu'elle en contient plusieurs */
.tile.group { box-shadow: 3px 3px 0 -1px var(--bg), 3px 3px 0 0 var(--line), 6px 6px 0 -1px var(--bg), 6px 6px 0 0 var(--line); }
.tiles.big .tile { padding: 18px 6px; font-size: 15px; }
.tiles.big .tile .e { font-size: 34px; }
.subchips { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; margin-top: 2px; border-top: 1px dashed var(--line); }
.top3 { display: grid; gap: 8px; }
.top3 button { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left; border: 1px solid var(--line); background: var(--panel);
  color: var(--fg); border-radius: 12px; padding: 10px 12px; cursor: pointer; font: 14px var(--body); }
.top3 button:hover { border-color: var(--accent); }
.top3 b { font: 600 15px var(--display); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; font-size: 14px; counter-increment: s; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font: 700 14px var(--display); }

/* Barre de tri, favoris, itinéraire */
.count { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tools { display: flex; gap: 6px; }
.mini { padding: 5px 9px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: 500 13px var(--body); cursor: pointer; }
.mini.on { border-color: var(--accent); color: var(--accent); }
.fav { color: var(--accent); }
.go { display: flex; gap: 8px; flex-wrap: wrap; }
.go a, .go button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1.5px solid var(--line);
  background: transparent; color: var(--fg); font: 600 14px var(--body); text-decoration: none; cursor: pointer; }
.go a.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.go button.on { color: var(--accent); border-color: var(--accent); }
.mepin { width: 16px; height: 16px; border-radius: 50%; background: #2b6fd6; border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(43,111,214,.3); }

/* Assistant « Demande à César » : bouton flottant sur la carte, panneau de discussion à droite */
.ask-fab { position: fixed; z-index: 1200; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 8px; padding: 5px 16px 5px 5px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font: 600 15px var(--body); cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.ask-fab img { width: 40px; height: 40px; border-radius: 50%; background: #fff; object-fit: cover; }
.ask-fab:hover { filter: brightness(1.05); }
.ask { position: fixed; z-index: 1500; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(390px, calc(100vw - 32px)); height: min(640px, calc(100vh - 32px)); display: flex; flex-direction: column;
  background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); overflow: hidden; }
.ask-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--accent-soft); }
.ask-head img { width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); object-fit: cover; }
.ask-head div { flex: 1; min-width: 0; display: grid; }
.ask-head b { font: 700 16px var(--display); }
.ask-head small { color: var(--muted); font-size: 12px; }
.ask-close { background: none; border: 0; font-size: 18px; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.ask-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; display: grid; gap: 8px; }
.msg.bot p { margin: 0; }
.ask-card { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; text-align: left; width: 100%; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--fg); cursor: pointer; font: 13px var(--body); }
.ask-card:hover { border-color: var(--accent); }
.ask-card b { font: 600 14px var(--display); }
.ask-card .sub { font-size: 12px; }
.ask-sugg { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px; }
.ask-sugg button { border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 999px; padding: 5px 10px; font: 500 12px var(--body); cursor: pointer; }
.ask-sugg button:hover { border-color: var(--accent); }
.ask-form { display: flex; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.ask-form input { flex: 1; min-width: 0; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); font: 15px var(--body); }
.ask-form input:focus { outline: none; border-color: var(--accent); }
.ask-form .btn { width: auto; padding: 10px 14px; }
@media (max-width: 760px) {
  .ask-fab { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .ask-fab span { display: none; }
  .ask-fab { padding: 5px; }
  .ask { inset: 0; width: 100%; height: 100%; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
}

#map { height: 100%; width: 100%; }
.mapwrap { position: relative; min-height: 0; }
.banner { position: absolute; z-index: 500; top: 12px; left: 50%; transform: translateX(-50%);
  background: var(--fg); color: var(--panel); padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.toast { position: fixed; z-index: 2000; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%);
  background: var(--fg); color: var(--panel); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; max-width: calc(100% - 32px); }

/* Fenêtres */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(460px, calc(100% - 32px)); max-height: calc(100% - 32px);
  background: var(--panel); color: var(--fg); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10,15,12,.55); }
.dform { padding: 20px; display: grid; gap: 14px; }
.dform h2 { margin: 0; font: 800 22px var(--display); }
.dform p { margin: 0; color: var(--muted); font-size: 14px; }
.dform label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; }
.dform label small { font-weight: 400; color: var(--muted); }
.dform input, .dform select { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--fg); font: 15px var(--body); }
.dform input:focus, .dform select:focus { outline: none; border-color: var(--accent); }
.dform fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.dform legend { font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 6px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.grid4 label { font-weight: 500; font-size: 12px; color: var(--muted); }
.grid4 input { padding: 8px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { display: flex; gap: 6px; align-items: center; font-weight: 500; font-size: 14px; }
.checks input { width: auto; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; min-width: 0; }
.pos { font-size: 13px; color: var(--muted); }
.pos.ok { color: var(--ok); font-weight: 600; }
.err { color: var(--accent); font-size: 13px; min-height: 1em; }
.demo { font-size: 12px; color: var(--wait); background: var(--wait-soft); padding: 8px 10px; border-radius: 8px; }
.prof { display: flex; gap: 14px; align-items: center; }
.prof .avatar { width: 56px; height: 56px; font-size: 22px; }
.bar { height: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.hours { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 14px; }
.scout { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.scout > div:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.scout small { font-size: 12px; color: var(--muted); }
.levels small { color: var(--muted); font-size: 12px; }
#lightbox { width: auto; max-width: 92vw; background: transparent; box-shadow: none; }
#lightbox { padding: 12px; background: var(--panel); }
#lightbox::backdrop { background: rgba(10,15,12,.85); }
.lb { margin: 0 0 10px; display: grid; gap: 8px; }
.lb img { max-width: 100%; max-height: 74vh; border-radius: 10px; display: block; margin: 0 auto; }
.lb figcaption { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.lb figcaption b { color: var(--fg); }
.photos { display: grid; gap: 10px; }
.item.has-thumb { position: relative; padding-right: 92px; }
.item .thumb { position: absolute; right: 18px; top: 12px; width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }

.leaflet-popup-content { font: 14px var(--body); }
.leaflet-popup-content h3 { margin: 0 0 4px; font: 600 16px var(--display); }
.pin { width: 24px; height: 24px; background: var(--c-restaurant); border: 2px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.pin i { display: block; transform: rotate(45deg); color: #fff; font: 700 12px/20px var(--body); text-align: center; font-style: normal; }
.pin.restaurant, .dot.restaurant { background: var(--c-restaurant); }
.pin.bar, .dot.bar { background: var(--c-bar); }
.pin.loisir, .dot.loisir { background: var(--c-loisir); }
.pin.wait { background: var(--c-wait); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; flex: 0 0 auto; }
.dot.tick { width: 14px; height: 14px; color: #fff; font: 700 9px/14px var(--body); text-align: center; font-style: normal; vertical-align: -2px; }
.chip.on .dot { box-shadow: 0 0 0 2px #fff; }
.legend { background: var(--panel); color: var(--fg); padding: 6px 10px; border-radius: 10px; box-shadow: 0 1px 6px rgba(0,0,0,.2);
  display: flex; flex-wrap: wrap; gap: 4px 12px; font: 500 12px var(--body); max-width: 260px; }
.legend span { display: inline-flex; align-items: center; white-space: nowrap; }

/* Bulles qui regroupent les épingles proches */
.cluster { display: grid; place-items: center; border-radius: 50%; color: #fff; font: 700 14px var(--body); border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.35); background: var(--c-restaurant); }
.cluster.bar { background: var(--c-bar); }
.cluster.loisir { background: var(--c-loisir); }

/* Éléments réservés au téléphone */
.searchrow { display: flex; gap: 8px; }
.searchrow .search { flex: 1; min-width: 0; }
.filtbtn, .mtoggle, .mobile-only { display: none; }
.chips { flex-direction: column; flex-wrap: nowrap; }
.chiprow { display: flex; flex-wrap: wrap; gap: 6px; }

/* Téléphone : une vraie appli. En-tête compact en haut, puis soit la carte en plein écran, soit la liste ; barre Carte | Liste en bas. */
@media (max-width: 760px) {
  html, body { height: 100%; overflow: hidden; }
  .app { display: flex; flex-direction: column; height: 100%; }
  .side { display: contents; }
  .head { order: 1; background: var(--panel); padding: 10px max(14px, env(safe-area-inset-right, 0px)) 8px max(14px, env(safe-area-inset-left, 0px)); gap: 8px; }
  h1 { font-size: 17px; }
  h1 small { display: none; }
  .brandface { width: 38px; height: 38px; }
  .userbtn { font-size: 12px; }
  .userbtn.out { padding: 6px 12px; }
  .search input { padding: 9px 12px 9px 36px; }
  .filtbtn { display: block; border: 1.5px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 10px; padding: 0 12px; font: 600 14px var(--body); cursor: pointer; }
  .filtbtn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
  .filters { display: none; }
  .head.show-filters .filters { display: flex; }
  .chiprow { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px 2px; }
  .chiprow::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; }
  .mapwrap { order: 2; flex: 1; min-height: 0; }
  .tabs { order: 3; background: var(--panel); }
  .count { order: 4; background: var(--panel); padding-inline: 14px; }
  .home, .list, .detail, .board { order: 5; background: var(--panel); flex: 1; min-height: 0; overflow-y: auto; }
  .foot { order: 6; background: var(--panel); display: flex; gap: 8px; align-items: center;
    padding: 8px max(14px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); }
  .mtoggle { display: flex; flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
  .mtoggle button { flex: 1; border: 0; background: transparent; color: var(--muted); font: 600 14px var(--body); padding: 9px 6px; border-radius: 9px; cursor: pointer; }
  .mtoggle button.on { background: var(--panel); color: var(--fg); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
  #addBtn { width: 46px; height: 46px; padding: 0; border-radius: 12px; font-size: 22px; flex: 0 0 auto; }
  .addtxt { display: none; }
  .mobile-only { display: inline-flex; }
  /* Mode Carte : la carte prend tout l'espace ; mode Liste : la carte est cachée */
  body.m-map .tabs, body.m-map .count, body.m-map .home, body.m-map .list, body.m-map .detail, body.m-map .board { display: none !important; }
  body.m-list .mapwrap { display: none; }
  .legend { font-size: 11px; padding: 4px 8px; gap: 2px 8px; max-width: 200px; }
  .ask-fab { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .grid4 { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Ouvert / fermé, sponsorisé ===== */
.pill.open { color: var(--ok); background: var(--ok-soft); }
.pill.closed { color: var(--muted); background: var(--bg); border: 1px solid var(--line); }
.pill.spon { color: #fff; background: var(--wait); }
.spon-text { margin: 0; font-size: 13px; color: var(--muted); font-style: italic; }
.detail h4 .pill { margin-left: 6px; vertical-align: 1px; }
.tools { flex-wrap: wrap; justify-content: flex-end; }

/* ===== Signaler / compléter une fiche ===== */
.fixrow { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.cform label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.cform input, .cform select { width: 100%; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--fg); font: 500 15px var(--body); }
.cform input:focus, .cform select:focus { outline: none; border-color: var(--accent); }
.sugg-item { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--fg); }
.sugg-item small { color: var(--muted); }
.facts code { font-size: 12px; background: var(--bg); padding: 1px 6px; border-radius: 4px; }

/* ===== Suggestions de recherche ===== */
.qsugg { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 1200; background: var(--panel); border: 1.5px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .14); padding: 4px; display: grid; max-height: 60vh; overflow-y: auto; }
.qsugg[hidden] { display: none; }
.qsugg button { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; background: none; border: 0;
  padding: 9px 10px; border-radius: 7px; color: var(--fg); font: 500 14px var(--body); cursor: pointer; }
.qsugg button small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.qsugg button:hover, .qsugg button.on { background: var(--accent-soft); }

/* ===== Tableau de bord admin ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.stats div { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 2px; }
.stats b { font: 800 20px var(--display); font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--muted); }
.alist { display: grid; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.arow { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--line); padding: 9px 12px; color: var(--fg); font: 400 14px var(--body); cursor: pointer; }
.arow:last-child { border-bottom: 0; }
.arow:hover { background: var(--accent-soft); }
.arow span { display: grid; min-width: 0; }
.arow span small, .arow > small { color: var(--muted); font-size: 12px; }
.arow > small { text-align: right; }

/* ===== Liens légaux ===== */
.legal-links { font-size: 12px; color: var(--muted); text-align: center; margin: 4px 0 0; line-height: 1.7; }
.legal-links a { color: var(--muted); }

/* ===== Pages légales (legal.html) ===== */
body.page { overflow: auto; }
.page main { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
.page h1 { font: 800 28px/1.15 var(--display); margin: 8px 0 4px; }
.page h2 { font: 800 20px var(--display); margin: 36px 0 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.page h3 { font: 600 15px var(--body); margin: 18px 0 4px; }
.page p, .page li { color: var(--fg); }
.page .todo { background: var(--wait-soft); color: var(--wait); padding: 0 4px; border-radius: 4px; font-weight: 600; }
.page nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.page nav a { padding: 6px 12px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--fg); text-decoration: none; font-size: 14px; }
.page .back { color: var(--accent); font-weight: 600; text-decoration: none; }
.list .more { margin: 12px 18px 20px; width: calc(100% - 36px); }

/* Mention du fond de carte, en bas à gauche sous la légende */
.leaflet-left .leaflet-control-attribution { margin: 0 0 8px 10px !important; padding: 1px 7px; border-radius: 6px; font-size: 11px; background: var(--panel); color: var(--muted); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.leaflet-left .leaflet-control-attribution a { color: var(--muted); }

/* Message si la carte ne charge pas */
.map-err { margin: 40vh auto 0; max-width: 320px; padding: 16px; text-align: center; font-weight: 600; }
.map-err a { color: #d2451e; }
.region-badge span { display: block; transform: translate(-50%, -50%); white-space: nowrap; background: #fff; color: #222; border: 2px solid #d2451e;
  border-radius: 14px; padding: 4px 10px; font: 600 13px/1.3 system-ui, sans-serif; text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.25); cursor: pointer; }
.region-badge small { display: block; font-weight: 400; font-size: 11px; color: #666; }

/* Connexion : liens « créer un compte » et « mot de passe oublié » */
.lswitch { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* Tableau admin : visiteurs en ce moment */
.stats .live { border-color: #2e9d5b; }
.stats .live b { color: #2e9d5b; }
