:root {
  --fond: #f3f5f8; --carte: #ffffff; --texte: #1d2430; --doux: #5d6878; --bord: #d9dee6;
  --accent: #1f4e79; --accent-clair: #e3edf7; --alerte: #b5541c; --alerte-clair: #fbeee0; --rouge: #b42318;
  --vert: #2e7d32; --ombre: 0 1px 3px rgba(20, 40, 70, .1);
}
@media (prefers-color-scheme: dark) {
  :root { --fond: #12161c; --carte: #1c222b; --texte: #e8edf3; --doux: #a2adbb; --bord: #323b47;
    --accent: #7fb2e5; --accent-clair: #1f2f42; --alerte: #f0a36b; --alerte-clair: #3a2a1e; --rouge: #f08080; --vert: #7cc47f; --ombre: none; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, "Segoe UI", sans-serif; background: var(--fond); color: var(--texte); }
header { background: var(--carte); border-bottom: 1px solid var(--bord); padding: 12px 16px 0; position: sticky; top: 0; z-index: 1000; }
h1 { margin: 0 0 8px; font-size: 20px; }
.titre-appli { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.titre-appli h1 { display: flex; align-items: center; gap: 10px; }
.logo-entete { width: 34px; height: 34px; }
.compte { color: var(--doux); font-size: 14px; }
nav { display: flex; gap: 4px; overflow-x: auto; }
nav button { border: 0; background: none; padding: 10px 14px; border-bottom: 3px solid transparent; color: var(--doux); font-weight: 600; cursor: pointer; white-space: nowrap; border-radius: 0; }
nav button.actif { color: var(--accent); border-bottom-color: var(--accent); }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.vue { display: none; } .vue.actif { display: block; }
.entete-vue { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
h2 { font-size: 22px; margin: 8px 0; } h3 { font-size: 16px; margin: 14px 0 6px; }
.aide { color: var(--doux); font-size: 14px; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: var(--ombre); }
.carte h3 { margin-top: 0; }
.carte.cliquable { cursor: pointer; } .carte.cliquable:hover { border-color: var(--accent); }
button { font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--bord); background: var(--carte); color: var(--texte); cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primaire { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (prefers-color-scheme: dark) { button.primaire { color: #0d1620; } }
button.petit { padding: 4px 10px; font-size: 13px; }
button.danger { color: var(--rouge); }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--bord); border-radius: 8px; background: var(--fond); color: var(--texte); }
input.large { flex: 1; min-width: 0; }
.champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; }
.champs label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--doux); }
.champs label.case { flex-direction: row; align-items: center; gap: 8px; color: var(--texte); }
.ligne-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.chiffres { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--doux); margin-top: 8px; }
.chiffres b { color: var(--texte); }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--accent-clair); color: var(--accent); }
.badge.oui { color: var(--vert); } .badge.non { color: var(--rouge); } .badge.alerte { background: var(--alerte-clair); color: var(--alerte); }
/* isolation : les boutons de la carte (z-index Leaflet) restent sous l'en-tête quand on fait défiler la page. */
.carte-map, .carte-domicile { height: 420px; border-radius: 10px; border: 1px solid var(--bord); isolation: isolate; }
.choix-membres { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0; }
.choix-membres label { display: flex; gap: 6px; align-items: center; }
.messages { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.message { background: var(--fond); border-radius: 10px; padding: 6px 10px; }
.message .qui { font-size: 12px; color: var(--doux); }
.erreur { color: var(--rouge); }
dialog { border: 1px solid var(--bord); border-radius: 14px; background: var(--carte); color: var(--texte); max-width: 520px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, .35); }
ul.liste { margin: 0; padding-left: 18px; }

/* Points de l'itinéraire (carte et légende) */
.pt { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .45); color: #fff; font: 700 11px/1 system-ui, sans-serif; font-style: normal; }
.pt.passage { width: 20px; height: 20px; background: #f2b84b; color: #3b2a00; font-size: 10px; letter-spacing: -0.5px; }
.pt.passage:empty { width: 14px; height: 14px; }
/* Carte en plein écran */
.bloc-carte:fullscreen { background: #fff; }
.bloc-carte:fullscreen .carte-map { height: 100vh; border: 0; border-radius: 0; }
.bloc-carte.plein-fenetre { position: fixed; inset: 0; z-index: 5000; background: #fff; }
.bloc-carte.plein-fenetre .carte-map { height: 100%; border: 0; border-radius: 0; }
.bouton-plein-ecran { font-size: 18px; line-height: 30px !important; text-decoration: none; }
.pt.depart { background: #2e7d32; } .pt.arrivee { background: #b42318; }
.pt.midi { background: #e07b00; } .pt.hotel { background: #1f4e79; }
.pt.boisson { background: #0277bd; } .pt.contemplation { background: #7b1fa2; }
.pt.miroir { opacity: 0.6; }
/* Étapes de la sortie et recherche d'un lieu */
.etapes { list-style: none; padding: 0; margin: 0 0 10px; }
.etapes li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #eee; }
.etapes li .pt { flex: none; width: 18px; height: 18px; font-size: 10px; }
.etapes li .pt.passage { width: 18px; height: 18px; font-size: 9px; }
.etapes li .pt.passage:empty { width: 12px; height: 12px; margin: 0 3px; }
.etapes li[draggable] { cursor: grab; }
.etapes li.glisse { opacity: 0.4; }
.etapes li.cible-avant { box-shadow: inset 0 3px 0 #1f4e79; }
.etapes li.cible-apres { box-shadow: inset 0 -3px 0 #1f4e79; }
.etapes .poignee { flex: none; width: 12px; color: var(--doux); }
.etapes .nom-etape { flex: 1; min-width: 0; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etapes .nom-etape small { color: var(--doux); }
.etapes li.retour .nom-etape { color: var(--doux); }
.etapes select { max-width: 170px; }
@media (max-width: 520px) { .etapes select { max-width: 120px; } }
.etapes li.separateur { border: 0; font-size: 13px; color: var(--doux); padding-top: 10px; }
.recherche-lieu { position: relative; display: flex; gap: 8px; flex-wrap: wrap; }
.recherche-lieu input { flex: 1; min-width: 200px; }
.suggestions { position: absolute; top: 100%; left: 0; right: 0; z-index: 1000; list-style: none; margin: 2px 0 0; padding: 0;
  background: #fff; border: 1px solid #ccc; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.15); max-height: 320px; overflow-y: auto; }
.suggestions li { padding: 8px 10px; cursor: pointer; }
.suggestions li:hover, .suggestions li.actif { background: #eef4fa; }
.suggestions li small { display: block; color: var(--doux); }
.carte-domicile { height: 260px; border-radius: 6px; margin-top: 8px; }
.marqueur-point { background: none; border: 0; display: flex; align-items: center; justify-content: center; }
.legende { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--doux); margin-top: 8px; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende .pt { width: 16px; height: 16px; font-size: 9px; border-width: 1px; }
.legende .pt.passage { width: 16px; height: 16px; font-size: 9px; }
.popup-point { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.popup-point input, .popup-point select { width: 100%; }

/* Programme jour par jour */
.jour h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.jour h3 .aide { font-weight: 400; }
.demi { display: grid; grid-template-columns: 8.5em 1fr auto; gap: 4px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--bord); }
.demi .moment { font-weight: 600; }
.demi .horaire b { font-variant-numeric: tabular-nums; }
.demi.pause { color: var(--doux); font-size: 14px; padding: 4px 0; }
.alertes { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
@media (max-width: 600px) { .demi { grid-template-columns: 1fr auto; } .demi .moment { grid-column: 1 / -1; } .demi.pause { display: block; } }

/* Pages de connexion et d'accueil d'un lien */
.page-compte main { max-width: 420px; padding-top: 8vh; }
.page-compte form, .page-compte .carte { display: flex; flex-direction: column; gap: 12px; }
.page-compte h1 { display: flex; align-items: center; gap: 10px; }
.page-compte label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--doux); }
.page-compte input[readonly] { opacity: .8; }
.page-compte .erreur:empty { display: none; }
.lien-copie { display: flex; gap: 6px; margin: 8px 0; }
.lien-copie input { flex: 1; min-width: 0; font-size: 13px; }

[hidden] { display: none !important; }
