:root {
  /* Palette lagon (contrastes AA vérifiés sur fond blanc/sable) */
  --lagon: #0a6275;
  --lagon-clair: #dff1f4;
  --ocean: #0b3b53;
  --sable: #f6f2ea;
  --texte: #12262e;
  --texte-doux: #43565d;
  --bord: #c9d6da;
  --blanc: #ffffff;
  --ouvert: #0f7a4f;
  --bientot: #8f5300;
  --ferme: #a8321f;
  /* Zones de sécurité : Capacitor expose --safe-area-inset-*, les navigateurs récents env() */
  --haut-sur: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --bas-sur: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --nav-h: calc(4rem + var(--bas-sur));
  --logo-h: 1.7rem; /* bande laissée libre pour le logo et les mentions Google Maps */
  --ombre: 0 -4px 24px rgba(11, 59, 83, .18);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* l'attribut hidden l'emporte toujours sur un display défini ailleurs */
html { height: 100%; }
/* min-height et non height : avec une hauteur fixe, la marge du bas (barres de navigation) ne compte plus dans la zone défilable et le dernier contenu reste caché */
body { min-height: 100%; }
body { margin: 0; font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--texte); background: var(--sable); padding-bottom: var(--nav-h); }
a { color: var(--lagon); }
:focus-visible { outline: 3px solid #e08a00; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Barre de navigation en bas ---------- */
.nav-bas { padding-bottom: var(--bas-sur); position: fixed; z-index: 1000; left: 0; right: 0; bottom: 0; height: var(--nav-h); display: flex; background: var(--blanc); border-top: 1px solid var(--bord); }
.nav-bas a, .nav-bas button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; font: inherit; font-size: .8rem; font-weight: 600; color: var(--texte-doux); background: none; border: 0; text-decoration: none; cursor: pointer; }
.nav-bas .ico { font-size: 1.35rem; line-height: 1; }
.nav-bas [aria-current="page"] { color: var(--lagon); box-shadow: inset 0 3px 0 var(--lagon); }

/* ---------- Pages classiques ---------- */
header.site { background: var(--ocean); color: var(--blanc); padding: calc(.75rem + var(--haut-sur)) 1rem .75rem; display: flex; align-items: center; gap: .6rem; }
header.site .logo { font-weight: 700; font-size: 1.2rem; color: var(--blanc); text-decoration: none; display: flex; align-items: center; gap: .5rem; }
header.site img { width: 1.8rem; height: 1.8rem; border-radius: .4rem; }
main { max-width: 42rem; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.45rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }

input, select, textarea { font: inherit; padding: .65rem .75rem; border: 1px solid #5d6f75; border-radius: .6rem; background: var(--blanc); color: var(--texte); max-width: 100%; }
label { display: block; font-weight: 600; margin: .75rem 0 .25rem; }
form input, form select, form textarea { width: 100%; }

.btn { font: inherit; font-weight: 600; padding: .6rem 1rem; min-height: 2.75rem; border: 2px solid var(--lagon); border-radius: .75rem; background: var(--lagon); color: var(--blanc); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.btn.secondaire { background: var(--blanc); color: var(--lagon); }
.btn.danger { background: var(--blanc); color: var(--ferme); border-color: var(--ferme); }
.btn[disabled] { opacity: .6; cursor: wait; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }

.message { padding: .75rem 1rem; border-radius: .6rem; background: var(--lagon-clair); color: var(--ocean); margin: .75rem 0; }
.message.erreur { background: #f8e3df; color: var(--ferme); }
.panneau { background: var(--blanc); border: 1px solid var(--bord); border-radius: .9rem; padding: 1rem; margin-bottom: 1rem; }
.meta { color: var(--texte-doux); font-size: .9rem; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.liste { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }

/* ---------- Badges de statut ---------- */
.badge { display: inline-block; padding: .05rem .55rem; border-radius: 1rem; font-size: .8rem; font-weight: 700; color: var(--blanc); background: var(--ouvert); vertical-align: middle; }
.badge.bientot { background: var(--bientot); }
.badge.ferme { background: var(--ferme); }

/* ---------- Avatars et marqueurs ronds ---------- */
.avatar { position: relative; flex: none; width: 2.9rem; height: 2.9rem; border-radius: 50%; display: grid; place-items: center; color: var(--blanc); font-weight: 700; font-size: 1.05rem; border: 3px solid var(--blanc); box-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.avatar::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--blanc); background: var(--ouvert); }
.avatar.bientot::after { background: var(--bientot); }
.avatar.ferme::after { background: var(--ferme); }
.marqueur { position: relative; background: none; border: 0; padding: 0 0 .55rem; cursor: pointer; }
.marqueur .avatar { position: relative; z-index: 1; width: 3.3rem; height: 3.3rem; font-size: 1.15rem; border-width: 3px; transition: transform .15s; transform-origin: 50% 100%; }
.marqueur::after { content: ""; position: absolute; left: 50%; bottom: .15rem; width: .85rem; height: .85rem; background: var(--blanc); transform: translateX(-50%) rotate(45deg); box-shadow: 2px 2px 4px rgba(0, 0, 0, .25); }
.marqueur.actif .avatar { transform: scale(1.2); }
.marqueur.st-ouvert::before { content: ""; position: absolute; left: 50%; top: 0; width: 3.3rem; height: 3.3rem; margin-left: -1.65rem; border-radius: 50%; background: var(--ouvert); opacity: .35; animation: pulse 2s ease-out infinite; }
@keyframes pulse { from { transform: scale(1); opacity: .4; } to { transform: scale(1.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .marqueur::before { animation: none !important; } .sheet { transition: none; } }
.moi { width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--lagon); border: 3px solid var(--blanc); box-shadow: 0 0 0 6px rgba(10, 98, 117, .25); }
.marqueur .avatar { width: 2.6rem; height: 2.6rem; }

/* ---------- Écran carte plein écran ---------- */
body.page-carte { overflow: hidden; padding: 0; }
#carte-zone { position: fixed; inset: 0 0 var(--nav-h) 0; z-index: 0; }
#carte { width: 100%; height: 100%; }

.bandeau { position: fixed; z-index: 900; top: calc(.6rem + var(--haut-sur)); left: .6rem; right: .6rem; display: grid; gap: .4rem; pointer-events: none; }
.bandeau > * { pointer-events: auto; box-shadow: 0 2px 10px rgba(0,0,0,.2); margin: 0; }

/* ---------- En-tête flottant de cercle ---------- */
.entete-cercle { position: relative; display: flex; align-items: center; gap: .6rem; background: var(--blanc); border-radius: 2rem; padding: .35rem .5rem .35rem .35rem; }
.cercle-bouton { font: inherit; font-weight: 700; color: var(--ocean); background: var(--lagon-clair); border: 0; border-radius: 2rem; padding: .5rem .9rem; min-height: 2.75rem; cursor: pointer; white-space: nowrap; }
.cercle-avatars { display: flex; flex: 1; justify-content: flex-end; overflow: hidden; padding-left: .6rem; }
.cercle-avatars button { background: none; border: 0; padding: 0; margin-left: -.6rem; cursor: pointer; }
.cercle-avatars .avatar { width: 2.5rem; height: 2.5rem; font-size: .9rem; }
.cercle-avatars .plus { align-self: center; margin-left: .4rem; font-weight: 700; color: var(--texte-doux); }
.cercle-menu { position: absolute; top: calc(100% + .4rem); left: 0; z-index: 2; list-style: none; margin: 0; padding: .35rem; background: var(--blanc); border-radius: 1rem; box-shadow: 0 4px 16px rgba(0,0,0,.25); min-width: 13rem; }
.cercle-menu button { width: 100%; text-align: left; font: inherit; padding: .65rem .8rem; border: 0; border-radius: .6rem; background: none; cursor: pointer; color: var(--texte); }
.cercle-menu button[aria-current="true"] { background: var(--lagon-clair); font-weight: 700; }

#btn-position[hidden] { display: none; }
#btn-position { position: fixed; z-index: 900; right: .6rem; bottom: calc(var(--nav-h) + var(--logo-h) + 1rem); width: 3rem; height: 3rem; padding: 0; border-radius: 50%; font-size: 1.3rem; }

/* ---------- Fiche du marchand (s'ouvre au clic sur une bulle) ---------- */
.sheet { position: fixed; z-index: 950; left: .6rem; right: .6rem; bottom: calc(var(--nav-h) + var(--logo-h) + .4rem); max-width: 40rem; margin: 0 auto; max-height: min(62vh, calc(100vh - var(--nav-h) - var(--logo-h) - 7rem)); background: var(--blanc); border-radius: 1.25rem; box-shadow: var(--ombre); display: flex; flex-direction: column; }
.sheet[hidden] { display: none; }
.sheet-corps { overflow-y: auto; padding: 1rem; overscroll-behavior: contain; }
.infos { list-style: none; padding: 0; margin: .25rem 0 .5rem; color: var(--texte-doux); font-size: .95rem; }
.infos li { padding: .1rem 0; }
.barre-recherche { display: flex; gap: .4rem; background: var(--blanc); border-radius: 2rem; padding: .35rem; }
.barre-recherche[hidden] { display: none; }
.barre-recherche input { flex: 1; border-radius: 2rem; }
.barre-recherche .btn { border-radius: 2rem; padding: .4rem .9rem; }

.ligne-marchand { display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left; font: inherit; color: inherit; background: var(--blanc); border: 1px solid var(--bord); border-radius: 1.1rem; padding: .75rem .9rem; cursor: pointer; box-shadow: 0 1px 4px rgba(11, 59, 83, .08); }
.ligne-marchand .avatar { width: 3.6rem; height: 3.6rem; font-size: 1.25rem; }
.ligne-marchand .texte { flex: 1; min-width: 0; }
.ligne-marchand strong { display: block; font-size: 1.05rem; }
.ligne-marchand .texte > span { display: block; }
.ligne-marchand .droite { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.ligne-marchand .dist { font-weight: 700; color: var(--ocean); white-space: nowrap; }

/* ---------- Fiche marchand ---------- */
.fiche-tete { display: flex; align-items: center; gap: .8rem; margin-bottom: .5rem; }
.fiche-tete h2 { margin: 0; }
.retour { margin-bottom: .5rem; }
.produits-liste { margin: .5rem 0; }
.ligne-produit { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: center; padding: .55rem 0; border-top: 1px solid var(--bord); }
.stock { display: inline-flex; align-items: center; gap: .4rem; }
.stock button { width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 2px solid var(--lagon); background: var(--blanc); color: var(--lagon); font-size: 1.4rem; font-weight: 700; cursor: pointer; }
.stock output { min-width: 2.2rem; text-align: center; font-weight: 700; font-size: 1.1rem; }

/* ---------- Espace marchand : bouton fixe ---------- */
.barre-ouverture { position: fixed; z-index: 990; left: 0; right: 0; bottom: var(--nav-h); padding: .6rem 1rem; background: var(--blanc); border-top: 1px solid var(--bord); box-shadow: var(--ombre); }
.barre-ouverture .btn { width: 100%; font-size: 1.2rem; min-height: 3.4rem; }
.btn.ouvert-on { background: var(--ouvert); border-color: var(--ouvert); }
.btn.ferme-on { background: var(--ferme); border-color: var(--ferme); }
body.avec-barre { padding-bottom: calc(var(--nav-h) + 5rem); }

/* ---------- Cercles et lieux ---------- */
.puce { font: inherit; font-weight: 600; padding: .35rem .8rem; border-radius: 1rem; border: 1px solid var(--lagon); background: var(--blanc); color: var(--lagon); cursor: pointer; }
.puce[aria-pressed="true"] { background: var(--lagon); color: var(--blanc); }
.puces { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
/* Filtres rapides de la carte : une seule ligne qui défile sur le côté */
.filtres { display: flex; gap: .4rem; overflow-x: auto; padding: .15rem 0 .35rem; scrollbar-width: none; box-shadow: none !important; }
.filtres::-webkit-scrollbar { display: none; }
.filtres[hidden] { display: none; }
.filtres .puce { flex: none; white-space: nowrap; min-height: 2.5rem; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
/* Statistiques du marchand */
.stats-cartes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin: .5rem 0; }
.stat { background: var(--lagon-clair); border-radius: .8rem; padding: .6rem .7rem; display: flex; flex-direction: column; gap: .1rem; }
.stat strong { font-size: 1.7rem; line-height: 1.1; color: var(--ocean); }
.stat-icone { font-size: 1.2rem; }
.stat-libelle { font-size: .9rem; font-weight: 600; color: var(--texte); }
.stats-graphique { margin: .6rem 0 0; }
.stats-barres { display: flex; align-items: flex-end; gap: 2px; height: 5rem; padding: .3rem; background: var(--blanc); border: 1px solid var(--bord); border-radius: .7rem; }
.stats-barres .barre { flex: 1; min-width: 2px; background: var(--lagon); border-radius: 2px 2px 0 0; }
/* ---------- Icônes GéoTahiti (SVG en ligne, couleur du texte) ---------- */
.ico-svg { width: 1.25em; height: 1.25em; vertical-align: -.25em; flex: none; }
.btn .ico-svg, .puce .ico-svg { margin-right: .3em; }
.nav-bas .ico { display: flex; align-items: center; justify-content: center; padding: .15rem .9rem; border-radius: 1rem; }
.nav-bas .ico .ico-svg { width: 1.55rem; height: 1.55rem; vertical-align: 0; }
.nav-bas [aria-current="page"] .ico { background: var(--lagon-clair); }

/* ---------- Premier lancement guidé ---------- */
.intro { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: flex-end; justify-content: center; background: rgba(11, 59, 83, .88); padding: 1rem; padding-bottom: calc(1rem + var(--bas-sur, 0px)); }
.intro-carte { background: var(--blanc); border-radius: 1.4rem; width: 100%; max-width: 26rem; padding: 1.4rem 1.2rem 1.1rem; text-align: center; color: var(--ocean); box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.intro-icone { width: 5rem; height: 5rem; margin: 0 auto .8rem; border-radius: 50%; background: var(--lagon-clair); color: var(--lagon); display: flex; align-items: center; justify-content: center; }
.intro-icone .ico-svg { width: 2.6rem; height: 2.6rem; vertical-align: 0; }
.intro-carte h2 { font-size: 1.4rem; margin: 0 0 .4rem; }
.intro-carte p { margin: 0 0 .9rem; color: var(--texte); line-height: 1.5; }
.intro-points { display: flex; justify-content: center; gap: .4rem; margin: .2rem 0 1rem; }
.intro-points span { width: .55rem; height: .55rem; border-radius: 50%; background: var(--bord); }
.intro-points span.actif { background: var(--lagon); width: 1.4rem; border-radius: .4rem; }
.intro-actions { display: flex; gap: .5rem; justify-content: center; }
.intro-actions .btn { flex: 1; }
/* ---------- Feuille de partage ---------- */
.partage-fond { position: fixed; inset: 0; z-index: 3500; display: flex; align-items: flex-end; justify-content: center; background: rgba(11, 59, 83, .6); }
.partage-feuille { background: var(--blanc); border-radius: 1.2rem 1.2rem 0 0; width: 100%; max-width: 30rem; padding: 1rem 1rem calc(1rem + var(--bas-sur, 0px)); display: grid; gap: .6rem; max-height: 90vh; overflow-y: auto; }
.partage-feuille h2 { margin: 0; font-size: 1.2rem; color: var(--ocean); }
.partage-feuille textarea { width: 100%; }
.partage-lien { word-break: break-all; margin: 0; }
.partage-boutons { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.partage-boutons .btn { justify-content: center; text-align: center; }

/* Statistiques : provenance des visites par lien */
.stats-sources { margin-top: .6rem; }
.stats-liste { list-style: none; margin: .2rem 0 0; padding: 0; display: grid; gap: .25rem; }
.stats-liste li { display: flex; justify-content: space-between; gap: .6rem; padding: .35rem .6rem; background: var(--lagon-clair); border-radius: .6rem; }
/* Liste de démarrage */
.progression { height: .7rem; background: var(--lagon-clair); border-radius: .4rem; overflow: hidden; margin: .4rem 0; }
.progression span { display: block; height: 100%; width: 0; background: var(--lagon); border-radius: .4rem; transition: width .4s; }
.demarrage-liste { list-style: none; margin: .3rem 0 0; padding: 0; display: grid; gap: .3rem; }
.demarrage-liste a, .demarrage-liste .lien { font-weight: 600; text-align: left; }
/* Offre de bienvenue, tournée, parrainage */
.offre-fiche { background: #fff4d6; border-left: 4px solid #d9a21b; border-radius: .6rem; padding: .6rem .8rem; margin: .6rem 0; color: #5a3d00; }
.offre-fiche .ico-svg { margin-right: .3em; }
.tournee { margin: .6rem 0; }
.tournee ul { list-style: none; margin: .3rem 0 0; padding: 0; display: grid; gap: .2rem; font-size: .95rem; }
.tournee li.aujourdhui { font-weight: 700; color: var(--lagon); }
.tournee-jour { display: inline-block; min-width: 2.2rem; font-weight: 700; }
.ajout-tournee { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .4rem; margin-top: .6rem; }
.ajout-tournee #t-lieu, .ajout-tournee .btn { grid-column: 1 / -1; }
.ligne-tournee { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .35rem .6rem; background: var(--lagon-clair); border-radius: .6rem; }
.offre-fond { position: fixed; inset: 0; z-index: 3500; background: rgba(11, 59, 83, .92); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.offre-carte { background: var(--blanc); border-radius: 1.4rem; max-width: 24rem; width: 100%; padding: 1.6rem 1.2rem; text-align: center; color: var(--ocean); }
.offre-icone { width: 4.5rem; height: 4.5rem; margin: 0 auto .6rem; border-radius: 50%; background: #fff4d6; color: #b57f00; display: flex; align-items: center; justify-content: center; }
.offre-icone .ico-svg { width: 2.4rem; height: 2.4rem; vertical-align: 0; }
.offre-carte h2 { margin: .1rem 0 .6rem; font-size: 1.5rem; }
.offre-texte { font-size: 1.4rem; font-weight: 800; margin: .4rem 0 1rem; line-height: 1.3; }
.offre-preuve { margin: 0 0 .3rem; color: var(--ouvert); }
/* Retour d'action toujours visible, même quand on est en bas d'un long formulaire */
main > #msg:not([hidden]) { position: sticky; top: calc(.5rem + var(--haut-sur, 0px)); z-index: 900; box-shadow: 0 3px 12px rgba(0, 0, 0, .25); font-weight: 600; }
.pied-compte { text-align: center; margin: 1rem 0 4.5rem; }
.pied-compte .btn-suppr-compte { color: var(--ferme); }
.installer { margin-top: .8rem; }
.message-jour { background: var(--lagon-clair); border-left: 4px solid var(--lagon); border-radius: .6rem; padding: .6rem .8rem; margin: .6rem 0; color: var(--ocean); }
.cases-groupe { border: 0; padding: 0; margin: .6rem 0 0; }
.cases-groupe legend { font-weight: 600; padding: 0; margin-bottom: .3rem; }
.alerte-lieu { background: var(--ocean); color: var(--blanc); }
.alerte-lieu a { color: #bfeaf2; }

/* ---------- Mode démo : avatar du visiteur ---------- */
.marqueur-moi { pointer-events: none; }
.marqueur-moi::before { display: none; }
.avatar.moi-av { background: var(--ocean); font-size: .95rem; box-shadow: 0 0 0 6px rgba(255, 255, 255, .45), 0 1px 6px rgba(0, 0, 0, .5); }
.avatar.moi-av::after { display: none; }

/* ---------- Statuts : ouvert = vert et lumineux, fermé = grisé ---------- */
.avatar { overflow: visible; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.ouvert { border-color: var(--ouvert); box-shadow: 0 0 0 3px rgba(15, 122, 79, .35), 0 0 16px 5px rgba(60, 220, 130, .6); }
.avatar.bientot { border-color: var(--bientot); box-shadow: 0 0 0 3px rgba(143, 83, 0, .3), 0 0 12px 3px rgba(255, 170, 40, .5); }
.avatar.ferme { border-color: #9aa5a8; box-shadow: none; filter: grayscale(1) brightness(.9); opacity: .78; }
.avatar .liv { position: absolute; right: -6px; top: -6px; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--blanc); display: grid; place-items: center; font-size: .75rem; box-shadow: 0 1px 3px rgba(0,0,0,.4); filter: none; }
.marqueur.st-ouvert::after { background: var(--ouvert); }
.marqueur.st-bientot::after { background: var(--bientot); }
.marqueur.st-ferme::after { background: #9aa5a8; }

/* ---------- Itinéraire et mobilité ---------- */
.route-info { margin: .5rem 0; padding: .6rem .8rem; border-radius: .7rem; background: var(--lagon-clair); color: var(--ocean); font-weight: 600; }
.route-info[hidden] { display: none; }
.route-info.erreur { background: #f8e3df; color: var(--ferme); font-weight: 400; }
.etiquettes { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0; }
.etiquette { display: inline-block; padding: .15rem .65rem; border-radius: 1rem; font-size: .85rem; font-weight: 600; background: var(--lagon-clair); color: var(--ocean); }

/* ---------- Avatar dans le profil marchand ---------- */
.apercu-avatar { display: flex; align-items: center; gap: 1rem; margin: .5rem 0; }
.apercu-avatar .avatar { width: 4.5rem; height: 4.5rem; font-size: 1.5rem; }
.case { display: flex; align-items: center; gap: .6rem; font-weight: 600; margin: .75rem 0 .25rem; }
.case input { width: 1.4rem; height: 1.4rem; }

/* Pendant un itinéraire, la fiche est réduite pour laisser voir le trajet sur la carte */
.sheet.avec-route { max-height: 36vh; }

/* ---------- Tableaux réduits : profil marchand et marchandises ---------- */
.repli { background: var(--blanc); border: 1px solid var(--bord); border-radius: .9rem; margin-bottom: .75rem; }
.repli summary { display: flex; flex-direction: column; gap: .1rem; padding: .6rem .9rem; cursor: pointer; list-style: none; min-height: 2.75rem; justify-content: center; }
.repli summary::-webkit-details-marker { display: none; }
.repli summary::after { content: "▾"; position: absolute; right: 1.6rem; color: var(--texte-doux); }
.repli { position: relative; }
.repli[open] summary::after { content: "▴"; }
.repli-titre { font-weight: 700; }
.repli-corps { padding: 0 .9rem .9rem; }
.repli-corps label { margin: .5rem 0 .15rem; font-size: .9rem; }
.repli-corps input, .repli-corps textarea { padding: .45rem .6rem; }
.ligne-avatar { display: flex; align-items: center; gap: .7rem; }
.ligne-avatar .avatar { width: 3.2rem; height: 3.2rem; font-size: 1.1rem; }
.champ-fichier { flex: 1; min-width: 0; }
.champ-fichier input { font-size: .85rem; }
.btn.mini { min-height: 2.25rem; padding: .25rem .7rem; font-size: .9rem; }
.cases { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.cases .case { margin: .4rem 0 0; font-size: .95rem; }
.cases .case input { width: 1.2rem; height: 1.2rem; }

.etat { margin: 0 0 .6rem; padding: .5rem .8rem; border-radius: .7rem; background: var(--lagon-clair); color: var(--ocean); font-size: .92rem; }
.panneau.compact { padding: .7rem .8rem; }
.panneau.compact h2 { margin: 0 0 .5rem; font-size: 1.05rem; }
.ajout-produit { display: grid; grid-template-columns: 1fr 5.5rem 4.5rem 2.75rem; gap: .4rem; margin-bottom: .4rem; }
.ajout-produit input { width: 100%; padding: .5rem .6rem; min-width: 0; }
.ajout-produit .btn { padding: 0; font-size: 1.4rem; }
@media (max-width: 30rem) {
  .ajout-produit { grid-template-columns: 1fr 1fr 2.75rem; }
  .ajout-produit #n-nom { grid-column: 1 / -1; }
}
.produit-ligne { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .5rem; padding: .35rem 0; border-top: 1px solid var(--bord); }
.produit-nom { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.produit-nom strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.produit-ligne .stock { gap: .25rem; }
.produit-ligne .stock button { width: 2.5rem; height: 2.5rem; font-size: 1.2rem; }
.produit-ligne .stock output { min-width: 1.8rem; font-size: 1rem; }
.icone-sup { width: 2.5rem; height: 2.5rem; border: 0; background: none; font-size: 1.1rem; cursor: pointer; border-radius: .5rem; }
.icone-sup:hover { background: #f8e3df; }
body.avec-barre { padding-bottom: calc(var(--nav-h) + 4.6rem); }
.barre-ouverture { padding: .45rem 1rem; }
.barre-ouverture .btn { min-height: 3rem; font-size: 1.1rem; }

/* ---------- Photos de l'étal ---------- */
.galerie { display: flex; gap: .5rem; overflow-x: auto; scroll-snap-type: x mandatory; margin: .5rem 0; padding-bottom: .25rem; }
.galerie img { height: 8rem; width: auto; max-width: 80%; flex: none; border-radius: .8rem; scroll-snap-align: start; object-fit: cover; background: var(--lagon-clair); }
/* Photos de l'étal : 4 emplacements, le premier (principale) occupe toute la largeur */
.emplacements { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .5rem 0; }
.emplacement { position: relative; border: 2px dashed var(--bord); border-radius: .8rem; padding: .4rem; min-height: 7rem; display: flex; flex-direction: column; gap: .3rem; background: var(--blanc); }
.emplacement.principal { grid-column: 1 / -1; border-color: var(--lagon); min-height: 9rem; }
.emplacement:not(.vide) { border-style: solid; padding: 0; overflow: hidden; }
.emplacement img { width: 100%; height: 7rem; object-fit: cover; display: block; }
.emplacement.principal img { height: 12rem; }
.emplacement-titre { font-size: .8rem; font-weight: 700; color: var(--ocean); }
.emplacement:not(.vide) .emplacement-titre { position: absolute; left: .4rem; bottom: .4rem; background: rgba(11, 59, 83, .85); color: #fff; border-radius: .5rem; padding: .15rem .5rem; }
.emplacement-actions { display: grid; gap: .3rem; margin-top: auto; }
.photo-supprimer { position: absolute; top: .3rem; right: .3rem; width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 1rem; cursor: pointer; }
.photo-principale { position: absolute; top: .3rem; left: .3rem; font: inherit; font-size: .75rem; font-weight: 700; border: 0; border-radius: .6rem; padding: .25rem .5rem; background: rgba(255, 255, 255, .92); color: var(--ocean); cursor: pointer; }
/* Fiche client : la photo principale (la première) est plus grande que les autres */
.galerie img:first-child { height: 11rem; }
.vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: .5rem; margin-bottom: .5rem; }
.vignette { position: relative; margin: 0; }
.vignette img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .7rem; display: block; }
.vignette button { position: absolute; top: .25rem; right: .25rem; width: 2rem; height: 2rem; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 1rem; cursor: pointer; }

.lien { font: inherit; background: none; border: 0; padding: .4rem 0; color: var(--lagon); text-decoration: underline; cursor: pointer; min-height: 2.5rem; }

/* ---------- Personnes des cercles ---------- */
.avatar.pers { border-color: var(--lagon); box-shadow: 0 0 0 3px rgba(10, 98, 117, .3), 0 0 12px 3px rgba(31, 181, 214, .55); }
.avatar.pers::after { display: none; }
.marqueur.st-pers::after { background: var(--lagon); }
.marqueur-pers .etiquette-pers { position: absolute; z-index: 2; top: -1.15rem; left: 50%; transform: translateX(-50%); padding: .05rem .5rem; border-radius: .7rem; background: rgba(11, 59, 83, .88); color: #fff; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.menu-titre { padding: .45rem .8rem .1rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-doux); }

/* ---------- Page Cercles ---------- */
.ligne-formulaire { display: flex; gap: .4rem; }
.ligne-formulaire input { flex: 1; min-width: 0; }
.ligne-cercle { display: flex; flex-direction: column; gap: .1rem; }
.zone-invit, .zone-membres { margin-top: .5rem; }
.code-invit { font: 700 1.5rem ui-monospace, Consolas, monospace; letter-spacing: .18em; color: var(--ocean); }
.membre-ligne { display: flex; align-items: center; gap: .7rem; padding: .45rem 0; border-top: 1px solid var(--bord); }
.membre-ligne .avatar { width: 2.6rem; height: 2.6rem; font-size: .95rem; }
.membre-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }

.guide { margin: .4rem 0 .6rem; padding-left: 1.3rem; font-size: .92rem; }
.guide li { margin: .25rem 0; }

.bascule { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 .8rem; }
.bascule .puce { padding: .55rem 1rem; min-height: 2.75rem; }

/* ---------- Avatar modifiable d'un geste ---------- */
.avatar-edition { display: flex; align-items: center; gap: .9rem; margin: -.3rem 0 .9rem; flex-wrap: wrap; }
.avatar-edition .avatar { width: 4rem; height: 4rem; font-size: 1.3rem; }
.avatar-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
#carte-profil .actions { margin-top: .6rem; }

/* ---------- Bouton de mode sur la carte (marchands) ---------- */
.chip-mode { align-self: flex-start; font: inherit; font-size: .85rem; font-weight: 700; padding: .45rem .9rem; min-height: 2.5rem; border-radius: 1.4rem; border: 2px solid var(--lagon); background: var(--blanc); color: var(--ocean); cursor: pointer; justify-self: start; }

.banniere-notif { position: fixed; z-index: 2000; left: .6rem; right: .6rem; top: calc(.6rem + var(--haut-sur)); display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .8rem 1rem; border-radius: 1rem; background: var(--ocean); color: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.banniere-notif strong { display: block; }
.banniere-notif span { font-size: .92rem; color: #dbeef3; }
