:root { --fond: #f6f5f2; --texte: #1d1d1b; --bord: #c9c6bd; --accent: #8a1538;
  --vert: #1b7a3a; --bleu: #1f5fbf; --orange: #b85c00; --violet: #6b3fa0; --rouge: #b3261e; --gris: #6b6b6b; }
* { box-sizing: border-box; }
body { margin: 0; font: 17px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--fond); color: var(--texte); }
.bandeau { background: #fff3c4; border-bottom: 1px solid #e0c96b; padding: .4rem 1rem; font-size: .9rem; text-align: center; }
.carte-connexion { max-width: 26rem; margin: 3rem auto; background: #fff; padding: 2rem; border: 1px solid var(--bord); border-radius: 8px; }
h1 { margin-top: 0; color: var(--accent); }
label { display: block; font-weight: 600; margin-top: 1rem; }
input, select, button { font: inherit; width: 100%; padding: .7rem; margin-top: .3rem; border: 1px solid var(--bord); border-radius: 6px; min-height: 48px; }
button { background: var(--accent); color: #fff; border: none; font-weight: 600; margin-top: 1.4rem; cursor: pointer; }
button.secondaire { background: #fff; color: var(--accent); border: 1px solid var(--accent); width: auto; margin: 0; }
button:focus-visible, input:focus-visible, select:focus-visible, li:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
.aide { font-size: .88rem; color: #555; }
.erreur { color: var(--rouge); font-weight: 600; min-height: 1.4em; }
.entete { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; background: #fff; border-bottom: 1px solid var(--bord); }
.outils { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .5rem 1rem; align-items: end; padding: .5rem 1rem 0; }
.outils .champ.large { grid-column: span 2; }
.outils label { margin: 0; font-size: .9rem; }
.marge { margin: .3rem 1rem .6rem; }
.ligne { display: flex; gap: .4rem; align-items: center; }
.ligne select, .ligne input { width: auto; flex: 1; margin: 0; }
.ligne button { width: auto; margin: 0; }
.disposition { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; padding: 0 1rem 1rem; }
.carte { margin: 0; background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: .5rem; }
.carte-leaflet { width: 100%; height: 60vh; min-height: 320px; border-radius: 6px; background: #e6e4dc; }
.compte-groupe { background: transparent; border: none; box-shadow: none; font-weight: 700; color: var(--accent); }
figcaption { font-size: .8rem; color: #555; }
.liste { list-style: none; margin: 0; padding: 0; max-height: 70vh; overflow: auto; }
.liste li { display: flex; gap: .7rem; align-items: center; background: #fff; border: 1px solid var(--bord); border-radius: 6px; padding: .6rem .8rem; margin-bottom: .4rem; cursor: pointer; }
.pastille { flex: none; display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; color: #fff; font-size: .82rem; font-weight: 700; }
.pastille::before { font-size: .9rem; }
.vert { background: var(--vert); } .vert::before { content: "✔"; }
.bleu { background: var(--bleu); } .bleu::before { content: "✎"; }
.orange { background: var(--orange); } .orange::before { content: "☎"; }
.violet { background: var(--violet); } .violet::before { content: "↺"; }
.rouge { background: var(--rouge); } .rouge::before { content: "✖"; }
.gris { background: var(--gris); } .gris::before { content: "?"; }
.fiche { margin: 0 1rem 1rem; background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: 1rem; }
@media (max-width: 760px) { .disposition { grid-template-columns: 1fr; } .outils { grid-template-columns: 1fr; } }

.actions-entete { display: flex; gap: .5rem; }
.boutons { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.boutons button { width: auto; margin: 0; }
.attente { display: inline-block; margin-left: .4rem; font-size: .82rem; font-weight: 700; color: var(--orange); }
.encart { background: #f3f0e6; border-left: 4px solid var(--accent); padding: .6rem .8rem; margin: .8rem 0; font-size: .92rem; }
.liste li.proposition { display: block; cursor: default; }

/* Fiche détaillée et formulaires (incrément 3) */
.section { border-top: 1px solid var(--bord); padding: .6rem 0; }
.section summary { font-weight: 700; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .4rem 1rem; }
.grille-cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .2rem 1rem; }
.champ-fiche { display: block; margin-top: .6rem; font-weight: 600; }
.champ-fiche > span { display: block; font-size: .9rem; }
.radio { display: flex; gap: .5rem; align-items: center; font-weight: 400; margin-top: .4rem; min-height: 44px; }
.radio input { width: 1.3rem; height: 1.3rem; min-height: 0; margin: 0; }
.modes { border: 1px solid var(--bord); border-radius: 6px; margin-top: 1rem; }
.liste.courte { max-height: 14rem; }
.fiche .boutons .ligne { flex: 1 1 20rem; }
.repere { width: 28px; height: 28px; background: var(--accent); border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.neutre { background: #fff; color: var(--texte); border: 1px solid var(--gris); } .neutre::before { content: "○"; }
.defilement { overflow-x: auto; margin: .5rem 0; }
.apercu { border-collapse: collapse; font-size: .85rem; }
.apercu th, .apercu td { border: 1px solid var(--bord); padding: .3rem .5rem; text-align: left; white-space: nowrap; }
.apercu th { background: #f3f0e6; }
.regle { border: 1px solid var(--bord); border-radius: 6px; padding: .4rem .8rem; margin: .6rem 0; }

/* Vue « Vision » (mode boussole) : plein écran au-dessus de l'application. */
body.vision-active { overflow: hidden; }
.vision { position: fixed; inset: 0; z-index: 2000; background: #222; color: #fff; }
.vision video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vision-etiquettes { position: absolute; inset: 0; }
.vision .ancre { position: absolute; transform: translate(-50%, -100%); }
.etiquette { display: inline-flex; flex-direction: column; align-items: flex-start; gap: .1rem; min-height: 44px; width: auto;
  max-width: 46vw; padding: .35rem .6rem; margin: 0; border-radius: 10px; border: 2px solid #fff; color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.6); text-align: left; font-size: .95rem; line-height: 1.15; }
.etiquette .picto { font-size: 1.1rem; font-weight: 700; }
.etiquette .nom { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.etiquette .mot { font-size: .8rem; }
.etiquette.petite { flex-direction: row; align-items: center; gap: .4rem; max-width: none; }
.etiquette.vert { background: #1b7a3a; } .etiquette.bleu { background: #1f5fbf; } .etiquette.orange { background: #b85c00; }
.etiquette.violet { background: #6b3fa0; } .etiquette.rouge { background: #b3261e; } .etiquette.gris { background: #555; }
.etiquette.neutre { background: rgba(255,255,255,.92); color: #1a1a1a; border-color: #555; }
.vision-haut { position: absolute; top: 0; left: 0; right: 0; padding: .5rem .8rem; background: linear-gradient(rgba(0,0,0,.7), transparent); }
.vision-precision { margin: 0; font-size: .85rem; }
.vision-message { margin: .3rem 0 0; font-weight: 700; }
.vision-bas { position: absolute; bottom: 0; left: 0; right: 0; display: flex; gap: .5rem; padding: .6rem; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.vision-bas button { flex: 1; margin: 0; }
.fleche { position: absolute; top: 50%; padding: .4rem .6rem; background: rgba(0,0,0,.6); border-radius: 8px; font-weight: 700; }
.fleche.gauche { left: .3rem; } .fleche.droite { right: .3rem; }
.vision-choix { position: absolute; left: .6rem; right: .6rem; bottom: 5rem; background: #fff; color: #1a1a1a; border-radius: 10px; padding: .8rem;
  display: flex; flex-direction: column; gap: .5rem; max-height: 60vh; overflow-y: auto; }
.vision-liste { position: absolute; top: 4.5rem; left: .6rem; right: .6rem; display: flex; flex-direction: column; gap: .4rem; }
.ligne-liste { display: flex; align-items: center; gap: .6rem; }
/* Ordre d'empilement explicite : les étiquettes ne recouvrent jamais les commandes. */
.vision-etiquettes { z-index: 1; pointer-events: none; }
.vision-etiquettes .ancre, .vision-etiquettes .vision-liste, .vision-etiquettes .fleche { pointer-events: auto; }
.vision-haut { z-index: 2; pointer-events: none; }
.vision-bas { z-index: 3; }
.vision-choix { z-index: 4; }
/* Téléphone : l'en-tête passe à la ligne au lieu d'élargir la page (sinon le navigateur dézoome tout). */
.entete { flex-wrap: wrap; gap: .4rem; }
.actions-entete { display: flex; flex-wrap: wrap; gap: .4rem; }
.actions-entete button { width: auto; margin: 0; }
html, body { max-width: 100%; overflow-x: hidden; }
.vision { height: 100dvh; }
.vision-choix[hidden], .vision [hidden] { display: none !important; }
.etiquette::before { content: none !important; }

.bandeau.reel { background: #8b1a1a; color: #fff; }
.lien-invitation { word-break: break-all; font-family: monospace; background: #f4f4f4; padding: .5em; }

.presence-etat { margin: 0; padding: .3em .8em; font-size: .85em; background: #eef4ff; }
.presence-alerte { position: fixed; left: .5em; right: .5em; bottom: .5em; z-index: 2000; background: #fff; border: 2px solid #1f4e9c;
  border-radius: 10px; padding: .8em; box-shadow: 0 4px 18px rgba(0,0,0,.25); max-width: 40em; margin: 0 auto; }
.presence-choix { display: block; width: 100%; text-align: left; margin: .3em 0; padding: .6em; background: #f6f8fb; color: inherit; border: 1px solid #ccd; }
