/* Maillon — styles de la coquille (en-tête, navigation, rail) et des écrans du maillage (salons, carte, radar,
   boussole, SOS, paquet, réglages, parcours d'accueil). Les couleurs suivent le système visuel du réseau social
   (social.css redéfinit --fond, --carte, --ligne… à partir de --s-*) : thèmes nuit / papier / auto.
   Tailles en rem : elles suivent la taille du texte choisie (--echelle). Cibles tactiles de 44 px au moins. */
:root {
  --fond: #0b1020;
  --fond2: #111831;
  --carte: #161f3d;
  --carte2: #1d2850;
  --ligne: #26325e;
  --texte: #e8ecf8;
  --doux: #93a0c6;
  --bleu: #3b82f6;
  --bleu-clair: #7fb0ff;
  --orange: #ff8a1f;
  --orange-clair: #ffb36b;
  --rouge: #ff3b4e;
  --vert: #2ed47a;
  --sos: #c8102a;
  --rayon: 16px;
  --cible: 44px;
  --haut: env(safe-area-inset-top, 0px);
  --basz: env(safe-area-inset-bottom, 0px);
  --gauche: env(safe-area-inset-left, 0px);
  --droite: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--fond); color: var(--texte); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--bleu-clair); }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { display: flex; flex-direction: column; height: 100dvh; max-width: 760px; margin: 0 auto; padding-left: var(--gauche); padding-right: var(--droite); }
#app > main { flex: 1; min-height: 0; }
main:focus { outline: none; }

/* Lien d'évitement : invisible tant qu'il n'a pas le focus clavier. */
.evitement { position: fixed; z-index: 2000; left: 12px; top: -80px; background: var(--s-texte, #fff); color: var(--s-fond, #000); border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; min-height: var(--cible); }
.evitement:focus { top: calc(8px + var(--haut)); }

/* --- En-tête --- */
.haut { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--haut)) 14px 10px; background: linear-gradient(180deg, #0e1530, var(--fond)); border-bottom: 1px solid var(--ligne); }
.marque { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .3px; font-size: 1.2rem; user-select: none; -webkit-user-select: none; }
.logo { width: 28px; height: 28px; color: var(--orange); filter: drop-shadow(0 0 8px #ff8a1f55); }
.etat { margin-left: auto; display: flex; align-items: center; gap: 7px; background: var(--carte); border: 1px solid var(--ligne); border-radius: 999px; padding: 6px 12px 6px 9px; font-size: .85rem; min-height: var(--cible); color: var(--texte); }
.etat i { width: 10px; height: 10px; border-radius: 50%; background: var(--doux); box-shadow: 0 0 0 3px #93a0c633; flex: none; }
/* L'état ne se lit pas qu'à la couleur : le mot (Orange / Bleu / Isolé) est toujours écrit, et la forme change. */
.etat.orange i { background: var(--orange); box-shadow: 0 0 0 3px #ff8a1f44, 0 0 12px var(--orange); animation: pouls 2s infinite; }
.etat.bleu i { background: var(--bleu); box-shadow: 0 0 0 3px #3b82f644, 0 0 12px var(--bleu); animation: pouls 2s infinite; border-radius: 3px; transform: rotate(45deg); }
.etat:not(.orange):not(.bleu) i { background: transparent; border: 2px solid var(--doux); box-shadow: none; }
.etat small { color: var(--doux); }
@keyframes pouls { 50% { box-shadow: 0 0 0 6px transparent, 0 0 4px currentColor; } }
.haut .h-btn { position: relative; flex: none; min-width: var(--cible); min-height: var(--cible); border-radius: 12px; display: grid; place-items: center; color: var(--texte); background: transparent; border: 0; padding: 0; }
.haut .h-btn svg { width: 22px; height: 22px; }
.sos-bouton { background: var(--sos); border: 0; color: #fff; font-weight: 900; letter-spacing: 1px; border-radius: 12px; padding: 0 12px; min-height: var(--cible); min-width: 52px; box-shadow: 0 4px 18px #ff3b4e55; }
.sos-bouton.actif { animation: clignote 1s infinite; }
@keyframes clignote { 50% { background: #fff; color: var(--sos); } }
.bandeau-sos { background: var(--sos); color: #fff; padding: 8px 14px; display: flex; gap: 10px; align-items: center; font-weight: 600; flex-wrap: wrap; }
.bandeau-sos span { flex: 1; min-width: 12em; }
.bandeau-sos button { margin-left: auto; background: #fff; color: var(--sos); border: 0; border-radius: 10px; padding: 0 14px; min-height: var(--cible); font-weight: 800; }
.bandeau-sos.recu { background: color-mix(in srgb, var(--sos) 85%, #000); }
.bandeau-sos.recu button.second { background: transparent; color: #fff; border: 2px solid #fff; margin-left: 0; }

/* --- Navigation --- */
.bas { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--fond2); border-top: 1px solid var(--ligne); padding-bottom: var(--basz); }
.bas a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 0 7px; min-height: 52px; text-decoration: none; color: var(--doux); font-size: .78rem; }
.bas a svg { width: 23px; height: 23px; }
.bas a.on { color: var(--texte); }
.bas a.on svg { color: var(--orange); }
.bas a .m-avatar { --t: 26px; }
.bas a .nav-ico { display: grid; place-items: center; height: 26px; }
.pastille { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 19px; height: 19px; border-radius: 10px; background: var(--orange); color: #111; font: 700 .75rem/19px system-ui; text-align: center; padding: 0 4px; font-style: normal; }
.rail .rail-admin svg { color: var(--accent-txt, var(--orange)); }
/* Le bouton « Tout Maillon » de l'en-tête ne sert que sans le rail (petits écrans). */
@media (min-width: 1000px) { .haut .h-tout { display: none; } }
/* Téléphone étroit : le logo seul (sans le mot) et des écarts serrés, pour que le bouton SOS reste toujours visible. */
@media (max-width: 440px) {
  .haut { gap: 4px; padding-left: 10px; padding-right: 10px; }
  .marque span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .etat { padding: 6px 10px 6px 8px; gap: 5px; }
  .etat small { display: none; }
}
@media (max-width: 340px) { .haut .h-btn { min-width: 40px; } .sos-bouton { min-width: 46px; padding: 0 8px; } }
/* Icône sans taille donnée (bouton-lien, texte) : à la taille du texte, jamais 300 × 150 par défaut. */
:where(svg[aria-hidden="true"]:not([width]):not([viewBox]):has(> use)) { width: 1.2em; height: 1.2em; flex: none; }
:where(.m-lien) { display: inline-flex; align-items: center; gap: 4px; }

main { overflow: hidden; position: relative; }
.page { height: 100%; overflow-y: auto; padding: 16px; -webkit-overflow-scrolling: touch; }
.titre { font-size: 1.45rem; font-weight: 800; margin: 4px 0 12px; }
.sous { color: var(--doux); margin: -6px 0 14px; }
.carte-bloc { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 14px; margin-bottom: 12px; }
.carte-bloc h3, .carte-bloc h2 { margin: 0 0 6px; font-size: 1.05rem; }
.carte-bloc summary { min-height: var(--cible); padding: 10px 0; cursor: pointer; }
.carte-bloc.bord-bleu { border-color: var(--bleu); }
.carte-bloc.bord-orange { border-color: var(--orange); }
.carte-bloc.bord-rouge { border-color: color-mix(in srgb, var(--rouge) 45%, transparent); }
.ligne { display: flex; align-items: center; gap: 10px; }
.ligne > .grand { flex: 1; min-width: 0; }
.doux { color: var(--doux); }
.petit { font-size: .84rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--ligne); background: var(--carte2); border-radius: 12px; padding: 10px 14px; min-height: var(--cible); font-weight: 600; text-decoration: none; color: var(--texte); text-align: center; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.plein { background: var(--orange); border-color: var(--orange); color: #1a0d00; }
.btn.bleu { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.btn.rouge { background: transparent; border-color: var(--rouge); color: var(--rouge); }
.btn.sos { background: var(--sos); border-color: var(--sos); color: #fff; }
.btn.sos-contour { border-color: var(--sos); }
.btn.sos-arme { background: var(--sos); border-color: var(--sos); color: #fff; }
.btn.large { width: 100%; }
.btn.grand-sos { padding: 16px; font-size: 1.1rem; touch-action: none; user-select: none; -webkit-user-select: none; }
.btn:disabled { opacity: .5; }
.btn.mini { min-height: var(--cible); padding: 4px 10px; font-size: .8rem; }
.champ { width: 100%; background: var(--fond2); border: 1px solid var(--ligne); border-radius: 12px; padding: 12px 14px; outline: none; min-height: var(--cible); }
.champ:focus { border-color: var(--orange); }
.champ:focus-visible, .compose textarea:focus-visible { outline: 3px solid var(--accent-txt, var(--orange)); outline-offset: 1px; }
.grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grille3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.vide { text-align: center; color: var(--doux); padding: 40px 20px; }
.vide svg { width: 56px; height: 56px; color: var(--ligne); }

/* Pages du maillage dans le même cadre que le réseau social (en-tête collant m-entete de social.css). */
.mx { padding: 14px 16px 28px; }
.mx-h2 { font-size: 1rem; margin: 20px 0 10px; display: flex; align-items: baseline; gap: 8px; }
.mx-h2 small { color: var(--doux); font-weight: 500; font-size: .8rem; }
.mx-espace { margin-top: 10px; }
.mx-label { display: block; font-weight: 600; font-size: .84rem; color: var(--doux); margin: 12px 0 6px; }
.mx-liens { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mx-liens .btn { flex: 1 1 9em; }
.rouge-txt { color: var(--rouge); }
.centre { text-align: center; }
.vert-txt { color: var(--vert); }
.peut { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.peut li { font-size: .8rem; border: 1px solid var(--ligne); border-radius: 99px; padding: 3px 10px; }
.peut li::before { content: "✓ "; color: var(--vert); font-weight: 800; }
.conseils { margin: 10px 0 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; font-size: .88rem; }
.etat-grand { display: flex; gap: 12px; align-items: flex-start; }
.etat-grand .pastille-etat { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #fff; background: var(--ligne); }
.etat-grand.orange .pastille-etat { background: var(--orange); color: #1a0d00; }
.etat-grand.bleu .pastille-etat { background: var(--bleu); }
.etat-grand h2 { margin: 0 0 4px; font-size: 1.1rem; }
.etat-grand p { margin: 0; color: var(--doux); font-size: .9rem; }

/* --- Conversation --- */
.discussion { display: grid; grid-template-rows: auto 1fr auto; height: 100%; }
.disc-tete { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--ligne); background: var(--fond2); }
.disc-tete .retour { background: none; border: 0; padding: 0; color: var(--texte); min-width: var(--cible); min-height: var(--cible); display: grid; place-items: center; border-radius: 12px; }
.disc-tete .retour svg { width: 22px; height: 22px; }
.disc-tete b { display: block; }
.disc-tete .grand { flex: 1; min-width: 0; }
.disc-tete .grand b, .disc-tete .grand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.alerte-cle { margin: 8px 12px 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--rouge); color: var(--texte); background: color-mix(in srgb, var(--rouge) 12%, var(--carte)); font-size: .88rem; }
.fil { overflow-y: auto; padding: 12px 12px 4px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 84%; align-self: flex-start; background: var(--carte); border: 1px solid var(--ligne); border-radius: 16px 16px 16px 6px; padding: 8px 11px 6px; position: relative; }
.msg.anim { animation: arrive .25s ease-out; }
.msg.moi { align-self: flex-end; background: color-mix(in srgb, var(--accent, var(--orange)) 15%, var(--carte)); border-color: color-mix(in srgb, var(--accent, var(--orange)) 30%, var(--ligne)); border-radius: 16px 16px 6px 16px; }
.msg.sos { border: 2px solid var(--rouge); background: color-mix(in srgb, var(--rouge) 14%, var(--carte)); }
.msg.pin { border-style: dashed; }
.msg button.lien-pin { background: none; border: 0; padding: 0; color: var(--accent-txt, var(--orange)); font-weight: 600; min-height: var(--cible); text-decoration: underline; }
@keyframes arrive { from { transform: translateY(6px); opacity: 0; } }
.msg .qui { font-size: .84rem; font-weight: 700; color: var(--accent-txt, var(--orange-clair)); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.msg .qui .verif { color: var(--vert); font-weight: 900; }
.msg .texte { white-space: pre-wrap; overflow-wrap: anywhere; }
/* Notes d'un message : envoi en échec, heure d'arrivée (boîtier pas à l'heure), clé non vérifiée. */
.msg .note-msg { font-size: .8rem; color: var(--doux); margin-top: 4px; overflow-wrap: anywhere; }
.msg .note-msg.rouge-txt { color: var(--rouge); }
.msg .meta { display: flex; gap: 8px; align-items: center; font-size: .75rem; color: var(--doux); margin-top: 3px; justify-content: flex-end; flex-wrap: wrap; }
.msg img, .msg video { display: block; max-width: 100%; height: auto; border-radius: 10px; margin: 4px 0; background: #000; }
.msg img.agrandir { cursor: zoom-in; }
.msg img.mini { image-rendering: auto; filter: saturate(1.05); }
.msg audio { width: 230px; max-width: 100%; height: 40px; margin-top: 4px; }
.msg .vid, .msg .aud { min-width: 160px; }
.chemin { display: inline-flex; gap: 2px; align-items: center; }
.chemin i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.chemin i.ble { background: var(--bleu); }
.chemin i.net { background: var(--orange); }
.chemin i.paquet { background: var(--vert); }
.attente { font-size: .8rem; color: var(--accent-txt, var(--orange-clair)); }
.raccourcis { display: flex; gap: 8px; padding: 6px 12px; overflow-x: auto; scrollbar-width: none; }
.raccourcis button { flex: none; background: var(--carte); border: 1px solid var(--ligne); border-radius: 999px; padding: 0 14px; min-height: var(--cible); font-size: .85rem; color: var(--texte); }
.compose { display: flex; gap: 8px; align-items: flex-end; padding: 8px 10px calc(8px + var(--basz)); border-top: 1px solid var(--ligne); background: var(--fond2); }
.compose textarea { flex: 1; resize: none; max-height: 120px; min-height: var(--cible); background: var(--fond); border: 1px solid var(--ligne); border-radius: 20px; padding: 10px 14px; outline: none; }
.compose textarea:focus { border-color: var(--orange); }
.rond { flex: none; width: var(--cible); height: var(--cible); border-radius: 50%; border: 1px solid var(--ligne); background: var(--carte); display: grid; place-items: center; color: var(--texte); padding: 0; font-size: 1.1rem; }
.rond svg { width: 20px; height: 20px; }
.rond.plein { background: var(--orange); border-color: var(--orange); color: #1a0d00; }
.rond.enreg, .rond[aria-pressed="true"] { background: var(--rouge); border-color: var(--rouge); color: #fff; animation: clignote-doux 1.4s infinite; }
#d-micro { touch-action: none; user-select: none; -webkit-user-select: none; }
@keyframes clignote-doux { 50% { opacity: .7; } }
.micro-etat { font-size: .84rem; color: var(--rouge); padding: 0 14px 4px; display: flex; align-items: center; gap: 10px; }
.micro-etat button { background: none; border: 1px solid var(--ligne); border-radius: 10px; color: var(--texte); min-height: var(--cible); padding: 0 10px; }
.limite { font-size: .75rem; color: var(--doux); padding: 0 14px 4px; }

/* --- Listes --- */
.liste { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; background: var(--carte); border: 1px solid var(--ligne); border-radius: 14px; padding: 11px 12px; min-height: 56px; text-align: left; width: 100%; color: var(--texte); text-decoration: none; }
a.item:hover, button.item:hover { border-color: var(--s-trait-fort, var(--ligne)); }
.avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; position: relative; }
.avatar.orange { background: linear-gradient(135deg, #ff9a3d, #e5660a); }
.avatar.bleu { background: linear-gradient(135deg, #5b9bff, #2563eb); }
.avatar.gris { background: #3a4570; }
.avatar.sos { background: var(--sos); }
.avatar.salon { background: linear-gradient(135deg, #8b5cf6, #5b21b6); }
.avatar.pin-av { font-size: 1.3rem; background: var(--carte2); }
.avatar .tag { position: absolute; right: -3px; bottom: -3px; font-size: .8rem; }
.item .grand { flex: 1; min-width: 0; }
.item .grand b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .grand span { display: block; color: var(--doux); font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .actions-item { display: flex; gap: 6px; }
.badge { font-size: .75rem; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--ligne); color: var(--doux); white-space: nowrap; }
.badge.orange { border-color: var(--orange); color: var(--accent-txt, var(--orange-clair)); }
.badge.bleu { border-color: var(--bleu); color: var(--bleu); }
.badge.vert { border-color: var(--vert); color: var(--vert); }
.badge.rouge { border-color: var(--rouge); color: var(--rouge); }
.compteur { flex: none; min-width: 24px; height: 24px; border-radius: 12px; background: var(--orange); color: #111; font: 700 .75rem/24px system-ui; text-align: center; padding: 0 6px; }
.onglets-mx { display: flex; gap: 6px; padding: 0 16px 10px; }
.onglets-mx button { flex: 1; min-height: var(--cible); border-radius: 12px; border: 1px solid var(--ligne); background: transparent; color: var(--doux); font-weight: 600; }
.onglets-mx button[aria-selected="true"] { background: var(--carte2); color: var(--texte); border-color: var(--s-trait-fort, var(--ligne)); }

/* --- Carte --- */
/* La carte forme son propre empilement : ses commandes passent au-dessus de Leaflet, jamais au-dessus des fenêtres. */
.carte-vue { position: absolute; inset: 0; isolation: isolate; }
#map { position: absolute; inset: 0; background: #0d1428; }
#map.cache { visibility: hidden; }
.leaflet-container { background: #0d1428; font: inherit; }
.leaflet-tile-pane { filter: invert(1) hue-rotate(200deg) brightness(.85) contrast(.9) saturate(.6); }
:root[data-theme="papier"] .leaflet-tile-pane { filter: saturate(.85); }
:root[data-theme="papier"] #map, :root[data-theme="papier"] .leaflet-container { background: #e9e4d8; }
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] .leaflet-tile-pane { filter: saturate(.85); }
  :root[data-theme="auto"] #map, :root[data-theme="auto"] .leaflet-container { background: #e9e4d8; }
}
.carte-modes { position: absolute; z-index: 1001; left: 12px; top: 12px; right: 72px; display: flex; gap: 4px; background: color-mix(in srgb, var(--fond) 92%, transparent); border: 1px solid var(--ligne); border-radius: 14px; padding: 3px; max-width: 320px; backdrop-filter: blur(6px); }
.carte-modes button { flex: 1; min-height: var(--cible); border: 0; border-radius: 11px; background: transparent; color: var(--doux); font-weight: 600; }
.carte-modes button[aria-pressed="true"] { background: var(--carte2); color: var(--texte); }
.carte-outils { position: absolute; z-index: 1001; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 8px; }
.carte-outils .rond { background: var(--fond2); box-shadow: 0 4px 14px #0008; }
.legende { position: absolute; z-index: 1001; left: 12px; bottom: 12px; background: color-mix(in srgb, var(--fond) 92%, transparent); border: 1px solid var(--ligne); border-radius: 12px; padding: 8px 10px; font-size: .8rem; display: flex; flex-direction: column; gap: 3px; backdrop-filter: blur(6px); max-width: calc(100% - 90px); }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legende i.pt-orange { background: var(--orange); }
.legende i.pt-bleu { background: var(--bleu); border-radius: 2px; transform: rotate(45deg); }
.legende i.pt-rouge { background: var(--rouge); }
.carte-msg { position: absolute; z-index: 1001; left: 12px; right: 12px; top: 66px; margin: 0; background: var(--carte2); border: 1px solid var(--ligne); border-radius: 12px; padding: 10px 12px; font-size: .85rem; max-width: 460px; }
.carte-liste { position: absolute; inset: 0; z-index: 1000; overflow-y: auto; padding-top: 58px; background: var(--fond); }
.noeud-marq { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 4px #0005; display: grid; place-items: center; font: 800 11px system-ui; color: #fff; }
.noeud-marq.orange { background: var(--orange); box-shadow: 0 0 0 6px #ff8a1f33, 0 0 16px var(--orange); }
.noeud-marq.bleu { background: var(--bleu); box-shadow: 0 0 0 6px #3b82f633, 0 0 16px var(--bleu); }
.noeud-marq.moi { width: 22px; height: 22px; background: #fff; border-color: var(--orange); }
.noeud-marq.sos { background: var(--rouge); animation: clignote-doux 1s infinite; }
.noeud-marq.stick { border-radius: 6px; }
.leaflet-marker-icon:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 50%; }
.pin-marq { font-size: 26px; filter: drop-shadow(0 2px 4px #000a); }
.pin-marq.douteux { opacity: .8; outline: 2px dashed var(--rouge, #ff3b4e); outline-offset: 1px; border-radius: 50%; }
.lien-maille { stroke-dasharray: 4 6; animation: flux 1.2s linear infinite; }
@keyframes flux { to { stroke-dashoffset: -20; } }
#radar { position: absolute; inset: 0; z-index: 1000; width: 100%; height: 100%; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--carte); color: var(--texte); border: 1px solid var(--ligne); }
.leaflet-popup-content { margin: 12px 14px; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--fond) 85%, transparent) !important; color: var(--texte) !important; font-size: 11px; }
.leaflet-control-attribution a { color: var(--doux) !important; }
.leaflet-bar a { width: 40px !important; height: 40px !important; line-height: 40px !important; background: var(--fond2) !important; color: var(--texte) !important; border-color: var(--ligne) !important; }
.leaflet-bottom.leaflet-right { margin-bottom: 18px; }
.types-pins { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.2em, 1fr)); gap: 8px; }
.types-pins .btn { flex-direction: column; gap: 2px; font-size: .78rem; padding: 8px 4px; }
.types-pins .btn span { font-size: 1.4rem; }

/* --- Modale, toasts --- */
.modale { position: fixed; inset: 0; z-index: 1000; background: #02040ccc; display: grid; align-items: end; justify-items: center; backdrop-filter: blur(3px); }
.modale-boite { width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--fond2); border: 1px solid var(--ligne); border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + var(--basz)); animation: monte .25s ease-out; }
.modale-boite:focus { outline: none; }
@keyframes monte { from { transform: translateY(40px); opacity: 0; } }
.modale-boite h2 { margin: 0 0 8px; font-size: 1.2rem; }
.modale-boite .photo-grande { width: 100%; border-radius: 12px; display: block; }
.toasts { position: fixed; z-index: 1100; left: 50%; transform: translateX(-50%); top: calc(64px + var(--haut)); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--carte2); border: 1px solid var(--ligne); border-left: 4px solid var(--orange); border-radius: 12px; padding: 10px 12px; box-shadow: 0 8px 24px #0009; animation: arrive .2s; pointer-events: auto; }
.toast.bleu { border-left-color: var(--bleu); }
.toast.rouge { border-left-color: var(--rouge); }

/* --- Parcours d'accueil (au-dessus de l'appli, page par page) --- */
.accueil-voile { position: fixed; inset: 0; z-index: 1500; background: var(--fond); overflow-y: auto; }
.accueil { min-height: 100%; display: flex; flex-direction: column; padding: calc(20px + var(--haut)) calc(22px + var(--droite)) calc(22px + var(--basz)) calc(22px + var(--gauche)); max-width: 560px; margin: 0 auto; }
.accueil .etapes { display: flex; gap: 6px; margin-bottom: 22px; }
.accueil .etapes i { flex: 1; height: 4px; border-radius: 4px; background: var(--ligne); }
.accueil .etapes i.on { background: var(--orange); }
.accueil .acc-tete { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-height: var(--cible); }
.accueil .acc-tete .retour { background: none; border: 0; color: var(--texte); min-width: var(--cible); min-height: var(--cible); border-radius: 12px; display: grid; place-items: center; padding: 0; }
.accueil .acc-tete .retour svg { width: 22px; height: 22px; }
.accueil .acc-tete small { margin-left: auto; color: var(--doux); font-size: .8rem; }
.accueil h1 { font-size: 1.8rem; line-height: 1.15; margin: 0 0 10px; }
.accueil h1:focus { outline: none; }
.accueil p { color: var(--doux); }
.accueil .bas-acc { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.accueil .legal-acc { font-size: .8rem; text-align: center; color: var(--doux); margin: 4px 0 0; }
.accueil .legal-acc a { color: var(--accent-txt, var(--orange)); }
.deux-mondes { display: grid; gap: 10px; margin: 14px 0; }
.deux-mondes .monde { border: 1px solid var(--ligne); border-radius: 16px; padding: 14px; background: var(--carte); }
.deux-mondes .monde b { display: block; font-size: 1.02rem; margin-bottom: 4px; }
.deux-mondes .monde p { margin: 0; font-size: .9rem; }
.deux-mondes .monde.social { border-left: 4px solid var(--accent, var(--orange)); }
.deux-mondes .monde.maille { border-left: 4px solid var(--bleu); }
@media (min-width: 520px) { .deux-mondes { grid-template-columns: 1fr 1fr; } }
.hero-maille { width: 100%; max-width: 320px; margin: 10px auto 18px; display: block; }
.hero-maille .t-toi { fill: var(--texte); }
.hero-maille .t-net { fill: var(--accent-txt, var(--orange-clair)); }
.perm-grande { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin: 10px 0; }
.perm-grande .ico { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; font-size: 2.6rem; background: var(--carte2); }
.perm-statut { border-radius: 12px; padding: 10px 12px; font-size: .9rem; border: 1px solid var(--ligne); background: var(--carte); color: var(--texte); }
.perm-statut.ok { border-color: var(--vert); }
.perm-statut.non { border-color: var(--rouge); }
.perm { display: flex; gap: 12px; align-items: center; background: var(--carte); border: 1px solid var(--ligne); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.perm .ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--carte2); }
.perm .grand b { display: block; }
.perm .grand span { color: var(--doux); font-size: .84rem; }
.perm .btn { padding: 8px 12px; font-size: .84rem; }
.perm.ok { border-color: #2ed47a66; }
.perm.ok .btn { background: transparent; border-color: var(--vert); color: var(--vert); }
.points-cles { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 10px; }
.points-cles li { display: flex; gap: 10px; align-items: flex-start; }
.points-cles li b { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: .95rem; background: var(--carte2); }
.points-cles li b.pt-bleu { color: var(--bleu); }
.points-cles li b.pt-orange { color: var(--orange); }
.acc-cx { margin: 6px -4px 0; }
.acc-connecte { border: 1px solid var(--vert); border-radius: 14px; padding: 12px 14px; background: var(--carte); color: var(--texte); }

/* --- Boussole, alerte SOS, repérage, panique --- */
.boussole { display: grid; place-items: center; padding: 10px 0; }
.boussole .cadran { width: min(230px, 70vw); aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--ligne); position: relative; background: radial-gradient(circle, var(--carte2), var(--fond2)); }
.boussole .nord { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); font-weight: 800; color: var(--doux); font-size: .8rem; }
.boussole .fleche { position: absolute; inset: 0; display: grid; place-items: center; transition: transform .25s ease-out; }
.boussole .fleche svg { width: 52%; height: 52%; }
.boussole .f-avant { fill: var(--orange); }
.boussole .f-arriere { fill: var(--ligne); }
.boussole .dist { font-size: 2.1rem; font-weight: 900; margin-top: 10px; }
.boussole #b-i { text-align: center; max-width: 30em; }
.alerte-sos { position: fixed; inset: 0; z-index: 1200; background: radial-gradient(circle, #8a0f1f, #2a0208); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: calc(30px + var(--haut)) 24px calc(30px + var(--basz)); gap: 12px; animation: fondSos 2s ease-in-out infinite; }
.alerte-sos:focus { outline: none; }
@keyframes fondSos { 50% { background: radial-gradient(circle, #c4162c, #4a0410); } }
.alerte-sos h2 { font-size: 2.6rem; margin: 0; }
.alerte-sos .qui-sos { font-size: 1.5rem; font-weight: 800; overflow-wrap: anywhere; }
.alerte-sos .quoi-sos { font-size: 1.15rem; overflow-wrap: anywhere; }
.alerte-sos .ou-sos { font-size: 1rem; opacity: .92; }
.alerte-sos .non-verifie { background: #0006; border: 1px solid #fff8; border-radius: 10px; padding: 6px 10px; font-size: .9rem; }
.alerte-sos .grille2 { width: 100%; max-width: 360px; margin-top: 12px; }
.alerte-sos .btn.y-aller { background: #fff; color: #a00; border: 0; }
.alerte-sos .btn.fermer-sos { background: transparent; color: #fff; border-color: #fff; }
.alerte-sos :focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.reperage { position: fixed; inset: 0; z-index: 1300; display: grid; place-items: center; color: #000; font-size: 1.8rem; font-weight: 900; border: 0; width: 100%; animation: strobo 1.6s ease-in-out infinite; }
/* Repérage : pulsation douce (moins d'un éclat par seconde, sans risque pour les personnes photosensibles). */
@keyframes strobo { 0%, 100% { background: #fff; } 50% { background: #ffb36b; } }
.reperage small { font-size: 1rem; display: block; }
.ecran-panique { position: fixed; inset: 0; z-index: 3000; background: #000; color: #fff; display: grid; place-items: center; font-size: 1.1rem; text-align: center; padding: 24px; }
.qr-boite { background: #fff; border-radius: 16px; padding: 14px; width: max-content; max-width: 100%; margin: 10px auto; }
.qr-boite img, .qr-boite svg { display: block; width: min(230px, 64vw); height: auto; aspect-ratio: 1; }
.scan video { width: 100%; border-radius: 14px; background: #000; }
.empreinte { font-size: 2.2rem; text-align: center; letter-spacing: 6px; margin: 18px 0; overflow-wrap: anywhere; }

/* --- Réglages du maillage --- */
.interrupteur { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 99px; background: var(--ligne); border: 2px solid var(--s-trait-fort, var(--doux)); position: relative; flex: none; transition: .2s; margin: 7px 0; cursor: pointer; }
.interrupteur::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--s-texte2, #fff); transition: .2s; }
.interrupteur:checked { background: var(--orange); border-color: var(--orange); }
.interrupteur:checked::after { left: 22px; background: #fff; }
.interrupteur:focus-visible { outline: 3px solid var(--accent-txt, var(--orange)); outline-offset: 2px; }
.reglage { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ligne); }
.reglage:last-child { border-bottom: 0; }
.reglage .grand { flex: 1; min-width: 0; }
.reglage .grand b, .reglage .grand label { display: block; font-weight: 700; }
.reglage .grand span { display: block; color: var(--doux); font-size: .84rem; }
.seg { display: flex; background: var(--fond2); border: 1px solid var(--ligne); border-radius: 12px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { flex: 1 1 5em; border: 0; background: transparent; padding: 0 4px; min-height: var(--cible); border-radius: 9px; font-size: .84rem; color: var(--doux); }
.seg button.on, .seg button[aria-pressed="true"] { background: var(--carte2); color: var(--texte); font-weight: 700; }
.stat { text-align: center; padding: 12px 8px; }
.stat b { display: block; font-size: 1.6rem; }
.stat span { font-size: .78rem; color: var(--doux); }
.stat b.orange { color: var(--orange); }
.stat b.bleu { color: var(--bleu); }
.schema-maille { width: 100%; height: 190px; display: block; }
code.ident { font-size: .8rem; overflow-wrap: anywhere; }

/* Mode intégré (IYADOX OS) */
body.integre .haut { padding-top: 10px; }
body.integre #app { max-width: none; }
.carte-bloc .grand > b, .carte-bloc .grand > h3 { display: block; }
.carte-bloc .grand > span { display: block; }

/* Page « bientôt » (module absent) */
.absent { padding: 40px 20px; text-align: center; max-width: 30em; margin: 0 auto; }
.absent p { color: var(--doux); }

/* --- Réseau social (v1, conservé pour les anciens écrans) --- */
.actions-pub { display: flex; gap: 6px; margin-top: 10px; border-top: 1px solid var(--ligne); padding-top: 8px; }
.actions-pub button { flex: 1; background: none; border: 0; padding: 7px 4px; min-height: var(--cible); border-radius: 10px; color: var(--doux); font-size: .88rem; }
.actions-pub button:hover { background: var(--carte2); }
.actions-pub button.on { color: var(--orange-clair); font-weight: 700; }
.pub a { color: inherit; }
img.avatar { display: block; }
button.carte-bloc { font: inherit; width: 100%; }

/* --- Appels (écran utilisé par appels.js) --- */
.ecran-appel { position: fixed; inset: 0; z-index: 1400; background: radial-gradient(circle at 50% 30%, #1d2850, #05070f); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: calc(40px + var(--haut)) 20px calc(34px + var(--basz)); }
.ecran-appel .ap-centre { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 8vh; }
.ecran-appel .ap-centre h2 { margin: 10px 0 0; font-size: 26px; }
.ecran-appel .ap-centre p { margin: 0; color: #c9cfe3; }
.ecran-appel.en-cours { background: #000; }
#ap-distant { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #05070f; }
#ap-local { position: absolute; right: 14px; top: calc(80px + var(--haut)); width: 110px; aspect-ratio: 3/4; object-fit: cover; border-radius: 14px; border: 2px solid #fff3; background: #111; z-index: 2; }
.ap-tete { position: relative; z-index: 2; display: flex; gap: 10px; align-items: center; align-self: flex-start; background: #0008; padding: 8px 12px 8px 8px; border-radius: 99px; backdrop-filter: blur(6px); }
.ap-boutons { position: relative; z-index: 2; display: flex; gap: 18px; }
.ap-rond { width: 62px; height: 62px; border-radius: 50%; border: 0; background: #ffffff26; color: #fff; font-size: 24px; backdrop-filter: blur(6px); }
.ap-rond.rouge { background: var(--rouge); }
.ap-rond.vert { background: var(--vert); }
.ap-rond.off { background: #fff; color: #111; }
.ap-rond.on { background: var(--orange); }

/* Bandeaux d'information (base bloquée par une autre fenêtre, stockage refusé, message long en cours) : sous
   l'en-tête, au-dessus de la page, sans entrer dans la grille de l'appli. */
.bandeaux-info { position: fixed; z-index: 1050; left: 50%; transform: translateX(-50%); top: calc(64px + var(--haut)); width: min(calc(100vw - 32px), 520px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.bandeau-info { pointer-events: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: var(--carte2); color: var(--texte); border: 1px solid var(--ligne); box-shadow: 0 6px 20px rgb(0 0 0 / .25); font-size: .9rem; }
.bandeau-info span { flex: 1; min-width: 12em; }
.bandeau-info.rouge { border-color: var(--rouge); }
.bandeau-info.bleu { border-color: var(--bleu); }
.bandeau-info .btn { min-height: var(--cible); }
.rail .rail-legal { font-size: 14px; }

/* Mouvements réduits (réglage du téléphone ou de l'appli) : pas de pulsation ni de flux animé. */
@media (prefers-reduced-motion: reduce) {
  .etat i, .sos-bouton.actif, .noeud-marq.sos, .lien-maille, .alerte-sos, .reperage, .rond.enreg, .rond[aria-pressed="true"] { animation: none !important; }
}
:root[data-mouvement="reduit"] .etat i, :root[data-mouvement="reduit"] .lien-maille, :root[data-mouvement="reduit"] .alerte-sos { animation: none !important; }
