:root {
  --green: #0b6b4f;
  --green-2: #12a37a;
  --green-soft: #e3f4ed;
  --ink: #15201c;
  --muted: #5c6b65;
  --line: #e2e8e5;
  --bg: #f5f7f6;
  --card: #ffffff;
  --amber: #b35c00;
  --amber-soft: #fff1e0;
  --radius: 14px;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--green); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand { min-width: 0; flex: 1; }
.brand > div { min-width: 0; }
.brand h1 { margin: 0; font-size: 17px; letter-spacing: .1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand p { margin: 0; font-size: 12.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Logo : croix de pharmacie + horloge (« daba » = maintenant) */
.logo-mark { width: 36px; height: 36px; flex: none; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.logo-croix { fill: #fff; }
.logo-cadran { fill: var(--green); }
.logo-aiguilles { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.daba { font-style: normal; color: #bdebd3; }
.brand .titre { display: flex; align-items: center; gap: 6px; min-width: 0; }
.badge-beta { flex-shrink: 0; display: inline-block; vertical-align: middle; padding: 1px 7px 2px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.5; color: #0b6b4f; background: #bdebd3; }
.note-beta { font-weight: 600; }
.brand h1 { font-weight: 800; letter-spacing: -.02em; font-size: 19px; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.12); color: #fff;
  padding: 8px 12px; border-radius: 999px; font: 600 13.5px var(--font); cursor: pointer;
  white-space: nowrap; flex: none;
}
.btn-ghost[aria-pressed="true"] { background: #fff; color: var(--green); }

/* Filtres */
.filters { background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 16px; }
.select-ville { display: block; position: relative; }
.select-ville::after {
  content: ""; position: absolute; inset-inline-end: 14px; top: 50%; width: 8px; height: 8px; pointer-events: none;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg);
}
.select-ville input {
  width: 100%; min-height: 44px; appearance: none; -webkit-appearance: none; font: 600 15px var(--font); color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding-block: 11px; padding-inline: 14px 36px;
  text-overflow: ellipsis;
}
.select-ville input:focus { outline: none; border-color: var(--green-2); box-shadow: 0 0 0 3px var(--green-soft); }
.select-ville input::placeholder { color: var(--muted); font-weight: 500; }
/* Liste des villes : se filtre à la saisie, passe au-dessus de la carte */
#ville-liste {
  position: absolute; z-index: 1200; inset-inline: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  max-height: min(60vh, 360px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.14);
}
#ville-liste li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-height: 44px; padding: 10px 12px;
  border-radius: 8px; cursor: pointer; font: 600 15px var(--font); color: var(--ink);
}
#ville-liste li[aria-selected="true"] { background: var(--green-soft); }
#ville-liste li .ar { font-weight: 500; color: var(--muted); font-size: 14px; }
#ville-liste li .sans { flex-basis: 100%; font-weight: 500; font-size: 12.5px; color: var(--muted); }
#ville-liste li { flex-wrap: wrap; }
#ville-liste li.aucune { cursor: default; color: var(--muted); font-weight: 500; }
/* Suggestions de villes sous la recherche (« Taza » tapé dans la recherche) */
.sugg-villes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; list-style: none; padding: 4px 2px 10px; font-size: 13px; color: var(--muted); }
.sugg-villes button {
  min-height: 36px; padding: 6px 12px; border: 1px solid var(--green-2); border-radius: 999px; background: var(--green-soft);
  color: var(--green); font: 600 13px var(--font); cursor: pointer;
}
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; }
.seg button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 8px;
  font: 600 13px var(--font); color: var(--muted); cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
/* Onglets : pharmacies de garde / toutes les pharmacies */
.onglets {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
  padding: 4px; margin-bottom: 10px; background: #e7ece9; border-radius: 14px;
}
.onglets button {
  display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 8px;
  border: 0; border-radius: 11px; background: transparent; color: var(--muted);
  font: 700 14px var(--font); cursor: pointer; transition: background .2s, color .2s, box-shadow .2s;
}
.onglets button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.onglets button:focus-visible { outline: 2px solid var(--green-2); outline-offset: 2px; }
.live { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--green-2); box-shadow: 0 0 0 3px rgba(18,163,122,.2); }

/* Annuaire : recherche + tri, sans carte */
.recherche {
  flex: 1 1 200px; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; color: var(--muted);
}
.recherche:focus-within { border-color: var(--green-2); box-shadow: 0 0 0 3px var(--green-soft); }
.recherche input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: 500 15px var(--font); color: var(--ink); }
/* Feuille « Autres cartes » (dialog natif, ancré en bas sur mobile) */
.feuille {
  /* max-width : le navigateur réserve sinon ~1 em de chaque côté d'un <dialog> ; sur téléphone la feuille doit toucher les bords */
  width: min(100%, 480px); max-width: 100%; max-height: 80vh; margin: auto auto 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  border: 0; border-radius: 20px 20px 0 0; background: var(--card); color: var(--ink); font-family: var(--font);
  box-shadow: 0 -8px 30px rgba(0,0,0,.18);
}
.merci { border: 0; border-radius: 18px; padding: 24px 22px 18px; width: min(340px, calc(100vw - 40px)); text-align: center; box-shadow: 0 20px 50px rgba(10, 20, 16, .25); background: var(--card); color: var(--ink); }
.merci::backdrop { background: rgba(10, 20, 16, .45); }
.merci-icone { color: var(--green); }
.merci p { margin: 10px 0 18px; font-size: 15px; line-height: 1.45; }
.merci .act { width: 100%; justify-content: center; }
.feuille::backdrop { background: rgba(10, 20, 16, .45); }
@media (min-width: 560px) { .feuille { margin: auto; border-radius: 20px; } }
.feuille-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.feuille-tete h2 { margin: 2px 0 0; font-size: 17px; line-height: 1.3; }
.feuille-sous { margin: 0; font-size: 12.5px; color: var(--muted); }
.btn-fermer { flex: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.feuille-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; overflow-y: auto; }
.feuille-liste a {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink);
  font: 700 15px var(--font); text-decoration: none;
}
.feuille-liste a:active { background: var(--green-soft); }
.feuille-liste a svg { color: var(--green); flex: none; }
/* Trois onglets : texte sur deux lignes si besoin */
.onglets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.onglets button { font-size: 13px; line-height: 1.2; min-height: 48px; text-align: center; }
#onglet-urgences svg { color: #b42318; flex: none; }

/* Favoris */
.tete-droite { flex: none; display: flex; align-items: center; gap: 4px; }
.fav { width: 44px; height: 44px; margin: -10px -10px -10px 0; display: grid; place-items: center; border: 0; background: transparent; color: #8a9893; cursor: pointer; border-radius: 12px; }
.fav svg { fill: none; }
.fav[aria-pressed="true"] { color: #b26a00; }
.fav[aria-pressed="true"] svg { fill: currentColor; }
.fav:focus-visible { outline: 2px solid var(--green-2); }
/* Partager une fiche : même bouton que l'étoile, juste avant elle */
.fav.partage-fiche { margin-inline-end: 0; color: var(--muted, #5c6b65); }
.favori-garde { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: #fff4e0; color: #6b3d00; font-weight: 700; font-size: 14px; cursor: pointer; }

/* Urgences */
.bloc-urgences h2 { margin: 4px 0 10px; font-size: 15px; }
.bloc-urgences .numeros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bloc-urgences .numeros a {
  display: flex; flex-direction: column; justify-content: center; min-height: 64px; padding: 8px 12px;
  border-radius: 14px; background: #fdecea; color: #7a1610; text-decoration: none;
}
.bloc-urgences .numeros strong { font-size: 24px; line-height: 1.1; color: #b42318; }
.bloc-urgences .numeros span { font-size: 13px; font-weight: 600; }
.note-urgences { margin: 10px 0 14px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.badge.urgences { background: #fdecea; color: #b42318; }
.pin.hop { background: #b42318; }
.vue-urgences .foot .urgence { display: none; }

/* Menu « Plus » */
.feuille-liste button {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink);
  font: 700 15px var(--font); text-align: start; cursor: pointer;
}
.feuille-liste button svg, .feuille-liste a svg { color: var(--green); flex: none; }
.compte-menu { margin-inline-start: auto; min-width: 24px; padding: 2px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 13px; text-align: center; }
.lien-retour { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; margin: 0 0 2px; padding: 0; border: 0; background: none; color: var(--green); font: 700 13px var(--font); cursor: pointer; }
.plus-contenu { overflow-y: auto; }
.plus-contenu .list { margin-top: 4px; }
.plus-contenu .feuille-sous { margin: 0 0 10px; }
.phrase-montree { display: grid; gap: 16px; padding: 18px 4px 8px; text-align: center; }
.phrase-ar { margin: 0; font: 800 34px/1.5 "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif; color: var(--ink); }
.phrase-fr { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.35; color: var(--ink); }
.phrase-moi { margin: 0; font-size: 15px; color: var(--muted); }
.card.compact { padding: 12px 14px; }
.card.compact .actions { margin-top: 10px; }
.limite { margin: 0; padding: 12px; text-align: center; font-size: 13px; color: var(--muted); }
@keyframes apparait { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.list.anim { animation: apparait .22s ease-out; }
@media (prefers-reduced-motion: reduce) { .list.anim { animation: none; } .onglets button { transition: none; } }

.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.toggle input { accent-color: var(--green); width: 17px; height: 17px; }

/* Carte + liste */
#map { height: 42vh; min-height: 240px; background: #dfe7e3; position: relative; z-index: 0; isolation: isolate; } /* contient les couches Leaflet (z-index jusqu'à 1000) sous l'en-tête */
.sheet {
  position: relative; margin-top: -16px; z-index: 500;
  background: var(--bg); border-radius: 18px 18px 0 0; padding: 14px 16px 24px;
  box-shadow: 0 -4px 14px rgba(0,0,0,.06);
}
.sheet::before {
  content: ""; display: block; width: 38px; height: 4px; border-radius: 4px;
  background: #cfd8d4; margin: 0 auto 10px;
}
.count { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }
.carte-note { margin-top: -6px; font-size: 12.5px; }

/* « Pourquoi certaines pharmacies n'apparaissent pas ? » sous la liste */
.pourquoi { margin: 14px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 13.5px; color: var(--muted); }
.pourquoi summary { cursor: pointer; font-weight: 700; color: var(--ink, inherit); }
.pourquoi p { margin: 8px 0; line-height: 1.5; }
.pourquoi a { font-weight: 700; color: #0b6b4f; }

/* Bandeau de première visite */
.astuce { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: #e6f4ee; color: #073f30; font-size: 14px; }
.astuce p { margin: 0 0 8px; font-weight: 600; }
.astuce-actions { display: flex; gap: 8px; justify-content: flex-end; }
.astuce-actions button { border: 0; border-radius: 999px; padding: 7px 14px; font: 700 13px var(--font); cursor: pointer; }
.astuce-aide { background: transparent; color: #0b6b4f; text-decoration: underline; }
.astuce-ok { background: #0b6b4f; color: #fff; }

/* Page « Comment ça marche » */
.aide-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.aide-liste li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.45; }
.aide-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; background: #e6f4ee; color: #0b6b4f; display: inline-flex; align-items: center; justify-content: center; }
.aide-ic svg { width: 18px; height: 18px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 14px; scroll-margin-top: 140px;
}
.card.active { border-color: var(--green-2); box-shadow: 0 0 0 2px var(--green-soft); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card h2 { margin: 0; font-size: 16px; line-height: 1.25; }
.meta { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.ar { margin: 1px 0 0; font-size: 14px; color: var(--ink); }
.adr { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.dist { flex: none; font: 700 13px var(--font); color: var(--green); white-space: nowrap; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.badge { font: 600 12px var(--font); padding: 3px 8px; border-radius: 6px; background: var(--green-soft); color: var(--green); }
.badge.closed { background: var(--amber-soft); color: var(--amber); }
.badge.unknown { background: var(--amber-soft); color: var(--amber); }
.badge.plain { background: #eef1f0; color: var(--ink); }
.badge.nomap { background: transparent; color: var(--muted); border: 1px dashed #c5cfcb; }
.badge.type-jour { background: #fff6d6; color: #7a5a00; }
.badge.type-nuit { background: #e5e9fb; color: #2c3e91; }
.badge.type-24h { background: var(--green-soft); color: var(--green); }
.card.inconnu { background: #fbfcfb; }
.sep { font-size: 12.5px; font-weight: 700; color: var(--amber); padding: 10px 2px 0; }
.notice { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.4; }
.notice.warn { background: var(--amber-soft); color: #6b3700; }
.notice.info { background: var(--green-soft); color: var(--green); }
.btn-ghost:disabled { opacity: .7; }
.actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.act {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; border-radius: 10px; text-decoration: none;
  font: 700 13.5px var(--font); border: 1px solid var(--line); color: var(--ink); background: var(--card);
}
.act.call { background: var(--green); border-color: var(--green); color: #fff; }
.act svg { flex: none; }
.act.disabled { color: var(--muted); background: var(--bg); font-weight: 600; }

.empty { text-align: center; padding: 28px 10px; color: var(--muted); font-size: 14px; }
.foot { margin-top: 20px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.foot p { margin: 0 0 6px; }
/* Compteur de visiteurs : discret, même ton que le bas de page */
.compteur { margin: 10px 0 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.compteur-titre { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.compteur-total { margin: 0 0 6px; font-size: 12.5px; }
.compteur-total strong { font-size: 18px; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; }
.compteur dl { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.compteur dl div { min-width: 0; }
.compteur dt { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compteur dd { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 340px) { .compteur dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Marqueurs */
.pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--green); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3);
  display: grid; place-items: center;
}
.pin span { transform: rotate(45deg); color: #fff; font: 800 15px var(--font); line-height: 1; }
.pin.ferme { background: #9aa8a2; }
.me-dot {
  width: 22px; height: 22px; border-radius: 50%; background: #1a73e8; border: 4px solid #fff;
  box-shadow: 0 0 0 2px rgba(26,115,232,.35), 0 2px 6px rgba(0,0,0,.35);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(26,115,232,.45), 0 2px 6px rgba(0,0,0,.35); } 100% { box-shadow: 0 0 0 16px rgba(26,115,232,0), 0 2px 6px rgba(0,0,0,.35); } }

@media (max-width: 380px) { .btn-ghost span { display: none; } }
html[lang="zgh"] .btn-ghost span, html[lang="de"] .btn-ghost span { display: none; } /* libellé long : icône seule */

@media (min-width: 900px) {
  main { display: grid; grid-template-columns: 1fr 420px; height: calc(100vh - 120px); }
  #map { height: 100%; }
  .sheet { margin-top: 0; border-radius: 0; overflow-y: auto; box-shadow: none; border-left: 1px solid var(--line); }
  .sheet::before { display: none; }
}

/* ---------- En-tête : bouton langue ---------- */
.top-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.btn-icon {
  display: inline-flex; align-items: center; gap: 4px; border: 1px solid rgba(255,255,255,.45);
  background: rgba(255,255,255,.12); color: #fff; padding: 8px 10px; border-radius: 999px;
  font: 700 12.5px var(--font); cursor: pointer;
}
.btn-rond { padding: 8px; }
/* Petits téléphones : en-tête compact pour que « PharmaDaba » reste lisible (globe seul pour la langue) */
@media (max-width: 420px) {
  .top-actions { gap: 5px; }
  .btn-icon { padding: 7px 8px; }
  .btn-rond { padding: 7px; }
  #lang-code { display: none; }
  .brand { gap: 8px; }
  .brand h1 { font-size: 16.5px; }
  .btn-libelle, .btn-ghost span { display: none; }
  .btn-ghost { padding: 7px; }
  .top-actions svg { width: 18px; height: 18px; }
}
[dir="rtl"] .brand h1, [dir="rtl"] .btn-ghost, [dir="rtl"] body { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", var(--font); }
.credits { font-size: 11.5px; opacity: .8; }

/* ---------- Page d'accueil ---------- */
.landing {
  position: fixed; inset: 0; z-index: 3000; overflow-y: auto; color: #fff;
  background: radial-gradient(120% 80% at 20% 0%, #14a37a 0%, #0b6b4f 45%, #073f30 100%);
}
.motif { position: absolute; inset: 0; overflow: hidden; pointer-events: none; color: rgba(255,255,255,.13); }
.motif svg { position: absolute; transform: rotate(var(--r)); animation: flotte 14s ease-in-out infinite alternate; }
@keyframes flotte {
  from { transform: translateY(0) rotate(var(--r)); }
  to { transform: translateY(-26px) rotate(calc(var(--r) + 25deg)); }
}
.landing-inner {
  position: relative; min-height: 100%; max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column; justify-content: center; gap: 26px;
  padding: calc(28px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
}
.landing-brand { text-align: center; }
.logo-mark.big { width: 76px; height: 76px; display: inline-block; border-radius: 17px; filter: drop-shadow(0 10px 22px rgba(0,0,0,.25)); }
.landing h1 { font-weight: 800; letter-spacing: -.02em; }
.landing h1 { margin: 14px 0 6px; font-size: 27px; line-height: 1.2; letter-spacing: .2px; }
.landing h1 span { display: block; font-size: 22px; opacity: .9; margin-top: 2px; }
.landing-sous-titre { margin: 0 0 8px; font-size: 16px; opacity: .9; }
.tagline { margin: 0 auto; max-width: 30ch; font-size: 15.5px; opacity: .92; line-height: 1.45; }

.slides { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 20px; padding: 18px 0 12px; backdrop-filter: blur(4px); }
.slides-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; text-align: center; padding: 0 22px; }
.slide p { margin: 12px auto 0; max-width: 28ch; font-size: 16px; font-weight: 600; line-height: 1.4; }
.slide-art { position: relative; height: 92px; display: flex; justify-content: center; align-items: center; gap: 14px; }
.slide-art .ico {
  display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px;
  background: #fff; color: var(--green); box-shadow: 0 8px 22px rgba(0,0,0,.18);
}
.slide-art .ico svg { width: 32px; height: 32px; }
.slide-art .i1 { width: 76px; height: 76px; border-radius: 22px; background: #eafff6; transform: translateY(-4px); }
.slide-art .i1 svg { width: 42px; height: 42px; }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.dots button { width: 8px; height: 8px; padding: 0; border-radius: 99px; border: 0; background: rgba(255,255,255,.4); cursor: pointer; transition: width .2s; }
.dots button[aria-selected="true"] { width: 22px; background: #fff; }

.langs {
  text-align: center; padding: 18px 16px 14px; border-radius: 22px;
  background: rgba(255,255,255,.14); border: 2px solid rgba(255,255,255,.55);
  animation: appel 2.4s ease-in-out 3;
}
@keyframes appel { 50% { box-shadow: 0 0 0 8px rgba(255,255,255,.18); } }
.langs-title { margin: 0 0 4px; font-weight: 800; font-size: 21px; line-height: 1.25; }
.langs-aide { margin: 0 0 14px; font-size: 15px; font-weight: 600; opacity: .95; }
.langs-aide::before { content: "\1F446\00a0"; }
.landing-retour {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 14px 0 8px;
  border-radius: 99px; border: 1.5px solid rgba(255,255,255,.7); background: rgba(255,255,255,.14);
  color: #fff; font: 700 15px var(--font); cursor: pointer;
}
.landing-retour[hidden] { display: none; }
[dir="rtl"] .landing-retour { align-self: flex-start; padding: 0 8px 0 14px; }
[dir="rtl"] .landing-retour svg { transform: scaleX(-1); }
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lang-btn {
  min-height: 52px; border-radius: 14px; border: 0; cursor: pointer;
  background: #fff; color: var(--green); font: 700 16.5px var(--font);
  box-shadow: 0 6px 16px rgba(0,0,0,.15); transition: transform .12s;
}
.lang-btn:hover, .lang-btn:focus-visible { transform: translateY(-2px); outline: 3px solid rgba(255,255,255,.5); }
.lang-btn[aria-pressed="true"] { background: #eafff6; }
/* Tifinagh : police Noto Sans Tifinagh (Google Fonts), absente de nombreux téléphones */
:lang(zgh), [lang="zgh"] body, html[lang="zgh"] body { font-family: "Noto Sans Tifinagh", var(--font); }
.free { margin: 14px 0 0; font-size: 13px; opacity: .8; }

/* Écrans courts : haut de page compact pour que les langues restent visibles sans défiler */
@media (max-height: 860px) {
  .landing-inner { gap: 14px; padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .logo-mark.big { width: 54px; height: 54px; }
  .landing h1 { margin: 8px 0 2px; font-size: 24px; }
  .landing-sous-titre { margin: 0 0 4px; font-size: 14.5px; }
  .tagline { font-size: 14px; line-height: 1.35; }
  .slides { padding: 10px 0 8px; }
  .slide-art { height: 58px; gap: 10px; }
  .slide-art .ico { width: 44px; height: 44px; border-radius: 14px; }
  .slide-art .ico svg { width: 24px; height: 24px; }
  .slide-art .i1 { width: 54px; height: 54px; border-radius: 16px; transform: none; }
  .slide-art .i1 svg { width: 30px; height: 30px; }
  .slide p { margin-top: 6px; font-size: 14.5px; line-height: 1.3; }
  .dots { margin-top: 6px; }
  .langs { padding: 12px 12px 10px; }
  .langs-title { font-size: 19px; }
  .langs-aide { margin-bottom: 10px; font-size: 14px; }
  .lang-grid { gap: 8px; }
  .lang-btn { min-height: 46px; font-size: 16px; }
  .free { margin-top: 8px; }
}
@media (max-height: 700px) { .tagline { display: none; } .landing-retour { min-height: 34px; } }
@media (prefers-reduced-motion: reduce) { .motif svg, .langs { animation: none; } }

/* RTL : textes latins (adresses) alignés comme le reste de la carte */
[dir="rtl"] .card-head > div > * { text-align: right; }
[dir="rtl"] .badge.plain, .dist { unicode-bidi: isolate; }

/* ---------- Rappel + urgences ---------- */
.rappel {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  font-size: 14px; font-weight: 600; color: var(--green);
}
.rappel svg { flex: none; }
.urgence {
  margin: 4px 0 14px; padding: 14px; border-radius: 16px;
  background: #1a1420; border: 1px solid #5c1a24; color: #f3f4f6;
}
.urgence h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 16px; color: #ff8a8a; }
.urgence-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.urgence-grid a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px;
  border-radius: 12px; background: #1f2937; border: 1px solid #5c1a24; text-decoration: none; color: #cbd5e1;
  font-size: 12px; text-align: center; line-height: 1.2;
}
.urgence-grid a strong { font-size: 19px; color: #ff8a8a; }
.urgence-grid a:active { transform: scale(.97); }
@media (max-width: 340px) { .urgence-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Signature ---------- */
.signature { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px !important; }
.signature a { color: var(--green); font-weight: 600; }
.btn-signaler { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); text-decoration: none; font-size: 13px; }

.lien-pro {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 12px 14px;
  border: 1px dashed var(--green-2); border-radius: 12px; background: var(--green-soft);
  color: var(--green); font-weight: 700; font-size: 14px; text-decoration: none;
}
.lien-pro svg { flex: none; }

/* « Partager PharmaDaba » (bas de page) */
.btn-partager {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 12px; padding: 12px 14px;
  border: 0; border-radius: 12px; background: var(--green); color: #fff; font: inherit; text-align: start; cursor: pointer;
}
.btn-partager svg { flex: none; }
.btn-partager strong { display: block; font-size: 15px; }
.btn-partager small { display: block; font-size: 12.5px; opacity: .9; }
.btn-partager:active { filter: brightness(.95); }
.partage-url { margin-inline-start: auto; font-size: 12.5px; color: var(--muted); font-weight: 500; }

/* Retours des visiteurs : « Signaler » et « Je suis devant » sous les boutons d'une pharmacie */
.retours { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
/* Vrais boutons (contour blanc, icône, verbe) et non des pastilles : la pastille pleine est réservée à l'étiquette « Signalée fermée » */
.retours button { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.retours button:hover { color: var(--green); border-color: var(--green); }
.retours button:active { transform: translateY(1px); }
.retours button svg { flex: none; }
.badge.signalee { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber); }
.retours button.pas-de-garde { border-color: var(--amber); color: var(--amber); }
.retours button.pas-de-garde:hover { color: var(--amber); border-color: var(--amber); background: var(--amber-soft); }
.retour-form { display: grid; gap: 10px; margin-top: 10px; }
.retour-form label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.retour-form .retour-texte { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.retour-form input:not([type=radio]), .retour-form select { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line, #d9e2dd); border-radius: 10px; background: var(--card); color: var(--ink); }
.retour-form input[aria-invalid="true"], .retour-form input[aria-invalid="true"]:focus { border-color: #b42318; outline: 2px solid #b42318; outline-offset: 0; }
.retour-form .retour-msg.sous-champ { margin: -4px 0 0; font-size: 12.5px; }
.retour-form .piege { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.retour-form [hidden] { display: none; }
.retour-form textarea { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line, #d9e2dd); border-radius: 10px; resize: vertical; }
.retour-devant { margin-top: 12px; width: 100%; }
.retour-msg { margin: 12px 0 0; font-size: 13.5px; color: var(--green); }
.retour-msg.ko { color: #b42318; }

/* Menu Plus > Installer l'application */
.installer-aide { display: grid; justify-items: center; gap: 14px; padding: 8px 4px 4px; text-align: center; }
.installer-aide img { border-radius: 16px; }
.installer-aide p { margin: 0; line-height: 1.5; }

/* Badge Bêta : sur téléphone, pastille posée sous le logo pour que « PharmaDaba » reste lisible */
@media (max-width: 420px) {
  .brand { position: relative; }
  .brand .badge-beta { position: absolute; inset-inline-start: 0; bottom: -4px; width: 36px; box-sizing: border-box; padding: 0 2px; text-align: center; font-size: 8px; letter-spacing: 0; line-height: 1.6; overflow: hidden; white-space: nowrap; box-shadow: 0 0 0 2px #0b6b4f; }
  [dir="rtl"] .brand .badge-beta { width: auto; min-width: 36px; padding: 0 3px; font-size: 8.5px; line-height: 1.5; }
}
.signature .version { color: var(--muted, #5c6b65); font-variant-numeric: tabular-nums; border: 1px solid #d5dfda; border-radius: 8px; padding: 3px 10px; background: #fff; line-height: 1.4; }

/* L'attribution Leaflet / OpenStreetMap / Overture (obligatoire) reste au-dessus du bloc de liste qui chevauche la carte de 16 px */
#map .leaflet-bottom { bottom: 18px; }

/* Réseaux sociaux : icônes du bas de page */
.reseaux { display: inline-flex; gap: 6px; }
.reseau { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--green); border: 1px solid #d5dfda; background: #fff; }
.reseau:hover, .reseau:focus-visible { background: var(--green); color: #fff; }
