/* =====================================================================
   NAVRHUM — Feuille de style
   Langage visuel iOS / macOS : typographie système, listes groupées,
   surfaces blanches sur fond gris, une seule couleur d'accent.
   ===================================================================== */

/* ------------------------------------------------------------ CLAIR */
:root {
  --bg:        #f2f2f7;
  --carte-bg:  #ffffff;
  --champ-bg:  #f2f2f7;
  --survol:    #f7f7fa;
  --sep:       rgba(60, 60, 67, .17);
  --sep-fort:  rgba(60, 60, 67, .29);

  --label:     #1c1c1e;
  --label-2:   #6c6c70;
  --label-3:   #a0a0a6;

  --bleu:      #0071e3;
  --bleu-fill: #0071e3;
  --bleu-doux: rgba(0, 113, 227, .11);

  --orange:      #b45f00;
  --orange-fill: #ff9500;
  --orange-doux: rgba(255, 149, 0, .15);

  --rouge:      #c4241c;
  --rouge-fill: #ff3b30;
  --rouge-doux: rgba(255, 59, 48, .12);

  --vert:      #1b7a3d;
  --vert-fill: #34c759;
  --vert-doux: rgba(52, 199, 89, .15);

  --verre:  rgba(255, 255, 255, .82);
  --ombre:  0 8px 30px rgba(0, 0, 0, .12);
  --ombre-s: 0 1px 3px rgba(0, 0, 0, .09);

  --fond-carte: #dfe6ec;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

/* -------------------------------------------------------------- NUIT */
[data-theme="nuit"] {
  --bg:        #000000;
  --carte-bg:  #1c1c1e;
  --champ-bg:  #2c2c2e;
  --survol:    #2c2c2e;
  --sep:       rgba(84, 84, 88, .55);
  --sep-fort:  rgba(120, 120, 128, .6);

  --label:     #ffffff;
  --label-2:   #98989f;
  --label-3:   #6e6e73;

  --bleu:      #0a84ff;
  --bleu-fill: #0a84ff;
  --bleu-doux: rgba(10, 132, 255, .18);

  --orange:      #ff9f0a;
  --orange-fill: #ff9f0a;
  --orange-doux: rgba(255, 159, 10, .18);

  --rouge:      #ff453a;
  --rouge-fill: #ff453a;
  --rouge-doux: rgba(255, 69, 58, .18);

  --vert:      #30d158;
  --vert-fill: #30d158;
  --vert-doux: rgba(48, 209, 88, .18);

  --verre:  rgba(28, 28, 30, .84);
  --ombre:  0 8px 30px rgba(0, 0, 0, .6);
  --ombre-s: 0 1px 3px rgba(0, 0, 0, .4);

  --fond-carte: #10151b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--label);
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -.01em;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font-family: inherit; letter-spacing: inherit;
  -webkit-appearance: none; appearance: none;
  -webkit-border-radius: 0; border-radius: 0;
  -webkit-tap-highlight-color: transparent;
}
input[type="checkbox"] { -webkit-appearance: auto; appearance: auto; }
input[type="time"]::-webkit-date-and-time-value { text-align: right; }
input::-webkit-search-decoration, input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ================================================================ APP */
#app {
  display: grid;
  grid-template-columns: 400px 1fr;
  grid-template-rows: 56px 1fr;
  grid-template-areas: "entete entete" "panneau carte";
  height: 100vh;
  height: 100dvh;
}

/* ============================================================= ENTÊTE */
header {
  grid-area: entete;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: var(--verre);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--sep);
  z-index: 1200;
}

.logo { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.logo-mark {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 8px; background: var(--bleu-fill); color: #fff;
}
.logo-mark svg { width: 18px; height: 18px; }
.logo-texte b { font-size: 16px; font-weight: 600; letter-spacing: .5px; }

.entete-outils { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.btn-rond {
  border-radius: 50%;
  width: 32px; height: 32px; display: grid; place-items: center;
  background: transparent; border: none; border-radius: 50%;
  color: var(--bleu); font-size: 16px; cursor: pointer;
  transition: background .15s;
}
.btn-rond:hover { background: var(--champ-bg); }

/* =========================================================== ACCUEIL */
#accueil {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 3000;
  background: var(--bg); overflow-y: auto;
  display: flex; transition: opacity .3s ease, transform .3s ease;
}
#accueil.parti { opacity: 0; transform: scale(1.015); pointer-events: none; }

.accueil-inner { width: 100%; max-width: 780px; margin: auto; padding: 56px 28px 64px; }

.accueil-haut { display: flex; align-items: center; margin-bottom: 44px; }
.accueil-haut .logo-mark { width: 34px; height: 34px; border-radius: 9px; }
.accueil-haut .logo-mark svg { width: 20px; height: 20px; }
.accueil-marque { font-size: 17px; font-weight: 600; letter-spacing: .5px; margin-left: 11px; }

.accueil-salut { font-size: 17px; color: var(--label-2); margin-bottom: 4px; }
.accueil-titre {
  font-size: 40px; font-weight: 700; line-height: 1.1;
  letter-spacing: -1.4px; margin-bottom: 34px;
}

.accueil-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.tuile {
  display: flex; align-items: center; gap: 15px;
  padding: 18px 18px;
  background: var(--carte-bg); border: none; border-radius: 18px;
  cursor: pointer; text-align: left; color: var(--label);
  transition: transform .18s ease, background .18s;
}
.tuile:hover { transform: scale(1.015); background: var(--survol); }
.tuile:active { transform: scale(.985); }
.tuile:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }

.tuile .tuile-icone {
  width: 44px; height: 44px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 21px;
  border-radius: 12px; background: var(--bleu-fill); color: #fff;
}
.tuile:nth-child(2) .tuile-icone { background: var(--orange-fill); }
.tuile:nth-child(3) .tuile-icone { background: var(--vert-fill); }
.tuile:nth-child(4) .tuile-icone { background: #8e8e93; }

.tuile b { display: block; font-size: 16.5px; font-weight: 600; color: var(--label); }
.tuile span { font-size: 13.5px; color: var(--label-2); line-height: 1.35; }

.accueil-pied {
  margin-top: 26px; text-align: center;
  font-size: 13px; color: var(--label-2);
}

/* =========================================================== PANNEAU */
#panneau {
  grid-area: panneau;
  background: var(--bg);
  border-right: .5px solid var(--sep);
  display: flex; flex-direction: column; min-height: 0;
}

/* Contrôle segmenté façon iOS */
.segments {
  display: flex; gap: 2px; margin: 12px 16px;
  padding: 2px; border-radius: 9px;
  background: var(--champ-bg);
}
[data-theme="nuit"] .segments { background: #1c1c1e; }

.segment {
  border-radius: 7px;
  flex: 1; padding: 6px 0;
  background: transparent; border: none; border-radius: 7px;
  color: var(--label); font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: background .18s, box-shadow .18s;
}
.segment.actif { background: var(--carte-bg); box-shadow: var(--ombre-s); font-weight: 600; }

.vues { flex: 1; overflow-y: auto; min-height: 0; padding: 4px 16px 28px; }
.vue { display: none; }
.vue.actif { display: block; animation: apparait .22s ease; }
@keyframes apparait { from { opacity: 0; } to { opacity: 1; } }

/* ======================================================= LISTE GROUPÉE */
.groupe {
  background: var(--carte-bg);
  border-radius: 12px; overflow: hidden;
  margin-bottom: 22px;
}
.groupe-titre {
  font-size: 12.5px; font-weight: 500; letter-spacing: .2px;
  text-transform: uppercase; color: var(--label-2);
  padding: 4px 16px 7px;
}

.ligne {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; min-height: 46px;
  background: var(--carte-bg);
  transition: background .12s;
}
.ligne + .ligne::before {
  content: ""; position: absolute; left: 16px; right: 0; top: 0;
  height: .5px; background: var(--sep);
}
.ligne.cliquable { cursor: pointer; }
.ligne.cliquable:hover { background: var(--survol); }
.ligne.cliquable::after {
  content: "›"; margin-left: auto; color: var(--label-3);
  font-size: 20px; line-height: 1; font-weight: 300;
}

.ligne-corps { flex: 1; min-width: 0; }
.ligne-titre { font-size: 16px; font-weight: 400; }
.ligne-sous { font-size: 13px; color: var(--label-2); margin-top: 1px; }
.ligne-valeur { font-size: 15.5px; color: var(--label-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ligne-valeur.bleu { color: var(--bleu); font-weight: 500; }

/* Champs de formulaire dans une ligne */
.ligne label { flex: 0 0 46%; font-size: 16px; color: var(--label); }
.ligne input, .ligne select {
  flex: 1; min-width: 0; width: auto;
  background: transparent; border: none; padding: 0;
  color: var(--label-2); font-size: 16px; text-align: right;
}
.ligne input:focus, .ligne select:focus { outline: none; color: var(--bleu); }
.ligne input::placeholder { color: var(--label-3); }
.ligne input[type="number"], .ligne input[type="time"] { font-variant-numeric: tabular-nums; }
.ligne select {
  appearance: none; cursor: pointer; padding-right: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a6' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M8 10l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0 center; background-size: 13px;
}
.ligne input[type="checkbox"] {
  flex: 0 0 auto; width: 21px; height: 21px; accent-color: var(--vert-fill); cursor: pointer;
}

/* Recherche façon iOS */
.recherche {
  position: relative; margin-bottom: 14px;
}
.recherche input {
  border-radius: 10px;
  width: 100%; padding: 9px 12px 9px 33px;
  background: var(--champ-bg); border: none; border-radius: 10px;
  color: var(--label); font-size: 16px;
}
.recherche input:focus { outline: none; box-shadow: 0 0 0 3px var(--bleu-doux); }
.recherche::before {
  content: "⌕"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--label-3); font-size: 17px; pointer-events: none;
}

/* Filtres */
.filtres { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.puce {
  border-radius: 100px;
  padding: 6px 13px; border-radius: 100px; border: none;
  background: var(--carte-bg); color: var(--label);
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s;
}
.puce:hover { background: var(--survol); }
.puce.actif { background: var(--bleu-fill); color: #fff; }

/* Badges */
.badge {
  font-size: 11.5px; font-weight: 500;
  padding: 2px 7px; border-radius: 6px;
  background: var(--champ-bg); color: var(--label-2);
}
.badge.orange { background: var(--orange-doux); color: var(--orange); }
.badge.bleu   { background: var(--bleu-doux);   color: var(--bleu); }
.badge.rouge  { background: var(--rouge-doux);  color: var(--rouge); }
.badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }

/* ============================================================ BOUTONS */
.btn {
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 12px 16px;
  border: none; border-radius: 12px;
  background: var(--bleu-fill); color: #fff;
  font-size: 16px; font-weight: 500; cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.985); }

.btn.gris { background: var(--carte-bg); color: var(--bleu); }
.btn.rouge { background: var(--carte-bg); color: var(--rouge); }
.btn-rang { display: flex; gap: 10px; margin-bottom: 22px; }

/* =========================================================== RÉSULTATS */
.stats {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--carte-bg); border-radius: 12px; overflow: hidden;
  margin-bottom: 22px;
}
.stat-case { padding: 15px 16px; position: relative; }
.stat-case:nth-child(odd)::after {
  content: ""; position: absolute; right: 0; top: 12px; bottom: 12px;
  width: .5px; background: var(--sep);
}
.stat-case:nth-child(n+3)::before {
  content: ""; position: absolute; left: 16px; right: 16px; top: 0;
  height: .5px; background: var(--sep);
}
.stat-case b {
  display: block; font-size: 25px; font-weight: 600; line-height: 1.15;
  letter-spacing: -.6px; font-variant-numeric: tabular-nums;
}
.stat-case b small { font-size: 14px; font-weight: 400; color: var(--label-2); letter-spacing: 0; }
.stat-case span { font-size: 12.5px; color: var(--label-2); }

.jauge { padding: 14px 16px 16px; background: var(--carte-bg); border-radius: 12px; margin-bottom: 22px; }
.jauge-piste { height: 8px; background: var(--champ-bg); border-radius: 100px; overflow: hidden; }
.jauge-barre { height: 100%; border-radius: 100px; background: var(--vert-fill); transition: width .5s ease; }
.jauge-barre.attention { background: var(--orange-fill); }
.jauge-barre.critique  { background: var(--rouge-fill); }
.jauge-legende { display: flex; justify-content: space-between; font-size: 13px; color: var(--label-2); margin-top: 9px; }

.note {
  padding: 12px 16px; border-radius: 12px; margin-bottom: 22px;
  font-size: 14px; line-height: 1.5; background: var(--carte-bg); color: var(--label-2);
}
.note.ok     { background: var(--vert-doux);   color: var(--vert); }
.note.warn   { background: var(--orange-doux); color: var(--orange); }
.note.danger { background: var(--rouge-doux);  color: var(--rouge); }

.vide {
  padding: 30px 20px; text-align: center;
  color: var(--label-2); font-size: 14.5px; line-height: 1.55;
  background: var(--carte-bg); border-radius: 12px; margin-bottom: 22px;
}

/* Segments de route */
.segments-table { width: 100%; border-collapse: collapse; background: var(--carte-bg); border-radius: 12px; overflow: hidden; margin-bottom: 22px; }
.segments-table th {
  text-align: left; padding: 10px 12px;
  font-size: 12px; font-weight: 500; color: var(--label-3);
  border-bottom: .5px solid var(--sep);
}
.segments-table td {
  padding: 11px 12px; font-size: 14px; color: var(--label-2);
  border-bottom: .5px solid var(--sep); font-variant-numeric: tabular-nums;
}
.segments-table tr:last-child td { border-bottom: none; }
.segments-table td:first-child { color: var(--label); }

/* Étapes de route */
.etape-num {
  width: 26px; height: 26px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--bleu-fill); color: #fff;
  font-size: 13px; font-weight: 600;
}
.etape-num.wp { background: var(--orange-fill); }
.ligne input.etape-nom-edit {
  flex: 1; min-width: 0; background: transparent; border: none;
  color: var(--label); font-size: 16px; text-align: left; padding: 0;
}
.ligne input.etape-nom-edit:focus { outline: none; color: var(--bleu); }
.etape-sup {
  background: none; border: none; color: var(--label-3);
  font-size: 21px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.etape-sup:hover { color: var(--rouge); }
.poignee { color: var(--label-3); cursor: grab; font-size: 15px; user-select: none; }
.ligne.glisse { opacity: .4; }

/* Compas */
.compas { display: grid; place-items: center; padding: 18px 0 10px; background: var(--carte-bg); border-radius: 12px 12px 0 0; }
.compas svg { width: 132px; height: 132px; }
.compas-aiguille { transition: transform .5s cubic-bezier(.2,.8,.2,1); transform-origin: 60px 60px; }
.compas-cercle { fill: none; stroke: var(--sep-fort); }
.compas-lettre { fill: var(--label-3); }
.compas-nord   { fill: var(--label-2); font-weight: 600; }
.compas-nord-a { fill: var(--bleu-fill); }
.compas-sud-a  { fill: var(--sep-fort); }
.compas-valeur { fill: var(--label); }

.pastille { width: 9px; height: 9px; border-radius: 50%; background: var(--label-3); flex-shrink: 0; }
.pastille.on { background: var(--vert-fill); }
.pastille.err { background: var(--rouge-fill); }

/* =============================================================== CARTE */
#carte { grid-area: carte; height: 100%; background: var(--fond-carte); }
.leaflet-container { background: var(--fond-carte); font-family: var(--sans); }

/* Les bulles passent au-dessus des outils flottants, jamais dessous */
.leaflet-pane.leaflet-popup-pane { z-index: 950; }

.leaflet-control-attribution {
  background: var(--verre) !important; color: var(--label-3) !important;
  font-size: 10px !important; border-radius: 6px 0 0 0;
}
.leaflet-control-attribution a { color: var(--label-2) !important; }
.leaflet-control-zoom { border: none !important; box-shadow: var(--ombre-s) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-bar a { background: var(--verre) !important; color: var(--bleu) !important; border-color: var(--sep) !important; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.leaflet-bar a:hover { background: var(--carte-bg) !important; }

.leaflet-popup-content-wrapper {
  background: var(--carte-bg); color: var(--label);
  border-radius: 14px; box-shadow: var(--ombre); border: .5px solid var(--sep);
}
.leaflet-popup-tip { background: var(--carte-bg); }
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; line-height: 1.45; }

/* Croix de fermeture : cible tactile confortable, toujours visible */
.leaflet-popup-close-button {
  width: 30px !important; height: 30px !important;
  top: 5px !important; right: 5px !important;
  display: grid !important; place-items: center;
  border-radius: 50%;
  background: var(--champ-bg) !important;
  color: var(--label-2) !important;
  font: 400 19px/1 var(--sans) !important;
  padding: 0 !important;
}
.leaflet-popup-close-button:hover { background: var(--survol) !important; color: var(--label) !important; }
.leaflet-tooltip {
  background: var(--carte-bg) !important; color: var(--label) !important;
  border: .5px solid var(--sep) !important; border-radius: 8px !important;
  box-shadow: var(--ombre-s) !important; font-size: 12.5px !important;
}
.leaflet-tooltip-top::before { border-top-color: var(--sep) !important; }

.popup-titre { font-size: 15px; font-weight: 600; padding-right: 26px; line-height: 1.25; }
.popup-sous { font-size: 12px; color: var(--label-2); margin-top: 1px; }
.popup-dist { font-size: 12.5px; color: var(--bleu); font-weight: 500; margin-top: 3px; }
.popup-note { font-size: 12.5px; color: var(--label-2); margin: 6px 0; }
.popup-tel {
  display: inline-block; margin-top: 6px;
  font-size: 13px; font-weight: 500; color: var(--bleu) !important; text-decoration: none;
}
.popup-actions { display: flex; gap: 7px; margin-top: 10px; }
.popup-actions button {
  flex: 1; padding: 8px 6px; font-size: 13.5px; font-weight: 500;
  border: none; border-radius: 9px; cursor: pointer;
  background: var(--bleu-fill); color: #fff; font-family: var(--sans);
}
.popup-actions button.sec { background: var(--champ-bg); color: var(--bleu); }

/* Marqueurs */
.marqueur-port {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2.5px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.3);
  color: #fff; font-size: 12px;
}
.marqueur-port.p-marina    { background: var(--bleu-fill); }
.marqueur-port.p-port      { background: #5ac8fa; }
.marqueur-port.p-mouillage { background: var(--orange-fill); }

.marqueur-bateau {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bleu-fill); border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,.35);
}
.marqueur-wp {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--orange-fill); border: 2.5px solid #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,.3);
  display: grid; place-items: center;
  color: #fff; font: 600 12px/1 var(--sans); cursor: grab;
}
.marqueur-wp:active { cursor: grabbing; }

.etiquette {
  background: var(--verre); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: 100px; padding: 3px 10px;
  font: 500 12px/1.4 var(--sans); color: var(--label);
  white-space: nowrap; box-shadow: var(--ombre-s);
  font-variant-numeric: tabular-nums;
}
.etiquette.mesure { color: var(--orange); transform: translate(12px, -8px); }

/* Outils : une seule pile groupée */
.outils {
  position: absolute; top: 14px; right: 14px; z-index: 900;
  display: flex; flex-direction: column;
  background: var(--verre); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-radius: 12px; box-shadow: var(--ombre-s); overflow: hidden;
}
.outil {
  width: 42px; height: 42px; position: relative;
  display: grid; place-items: center;
  background: transparent; border: none;
  color: var(--bleu); font-size: 17px; cursor: pointer;
  transition: background .15s;
}
.outil + .outil::before {
  content: ""; position: absolute; left: 8px; right: 8px; top: 0;
  height: .5px; background: var(--sep);
}
.outil:hover { background: var(--champ-bg); }
.outil.actif { background: var(--bleu-fill); color: #fff; }
.outil.actif::before, .outil.actif + .outil::before { background: transparent; }

/* Pastilles du pointeur de sonde */
.pastille-sonde {
  transform: translate(-50%, -50%);
  padding: 5px 11px; border-radius: 100px;
  background: var(--carte-bg); border: 2.5px solid var(--bleu-fill);
  color: var(--label); font: 600 13.5px/1 var(--sans);
  white-space: nowrap; box-shadow: 0 2px 9px rgba(0,0,0,.35);
  font-variant-numeric: tabular-nums;
}
.pastille-sonde.ok      { border-color: var(--vert-fill); }
.pastille-sonde.warn    { border-color: var(--orange-fill); }
.pastille-sonde.danger  { border-color: var(--rouge-fill); color: var(--rouge); }
.pastille-sonde.attente,
.pastille-sonde.erreur  { border-color: var(--sep-fort); color: var(--label-3); }

/* Panneau des calques */
#calques {
  position: absolute; top: 14px; right: 66px; z-index: 940;
  width: 236px; padding: 12px 14px; border-radius: 14px;
  background: var(--verre);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--ombre);
  opacity: 0; transform: translateX(8px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
#calques.on { opacity: 1; transform: translateX(0); pointer-events: auto; }
.calques-titre {
  font-size: 12px; font-weight: 500; color: var(--label-2);
  text-transform: uppercase; letter-spacing: .2px; margin-bottom: 8px;
}
.calque {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 0; cursor: pointer;
}
.calque + .calque { border-top: .5px solid var(--sep); }
.calque input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--bleu-fill); }
.calque span { font-size: 12.5px; color: var(--label-2); line-height: 1.35; }
.calque b { display: block; font-size: 14.5px; font-weight: 400; color: var(--label); }

.fonds-choix { display: flex; gap: 5px; margin-bottom: 6px; }
.fond {
  flex: 1; padding: 7px 2px; border: none; border-radius: 8px;
  background: var(--champ-bg); color: var(--label);
  font-size: 12.5px; font-weight: 500; cursor: pointer; transition: background .15s;
}
.fond:hover { background: var(--survol); }
.fond.actif { background: var(--bleu-fill); color: #fff; }

#iso-badge {
  position: absolute; left: 14px; bottom: 40px; z-index: 900;
  padding: 7px 13px; border-radius: 100px;
  background: var(--verre);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--ombre-s);
  font-size: 12.5px; font-weight: 500; color: var(--label-2);
  white-space: nowrap; display: none;
}
#iso-badge.on { display: block; }
#iso-badge b { color: var(--label); }
body.navigation #iso-badge { display: none !important; }

.etiquette-iso {
  transform: translate(-50%, -50%);
  padding: 1px 5px; border-radius: 4px;
  background: var(--verre); color: var(--label);
  font: 500 10.5px/1.3 var(--sans); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Chiffres de sonde, façon carte marine */
.sonde-chiffre {
  transform: translate(-50%, -50%);
  font: 600 13px/1 var(--sans); font-variant-numeric: tabular-nums;
  color: #0b3d5c; white-space: nowrap; text-align: center;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 5px #fff, 1px 1px 0 #fff, -1px -1px 0 #fff;
}
[data-theme="nuit"] .sonde-chiffre {
  color: #bfe6ff;
  text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 5px #000, 1px 1px 0 #000, -1px -1px 0 #000;
}
.sonde-chiffre.faible { color: #9c1c14; }
[data-theme="nuit"] .sonde-chiffre.faible { color: #ff8a80; }

@media (max-width: 900px) {
  #calques { right: 58px; width: 214px; }
}

/* Météo */
.meteo-principal {
  display: flex; align-items: center; gap: 16px;
  padding: 16px; background: var(--carte-bg); border-radius: 14px; margin-bottom: 22px;
}
.meteo-vent b {
  display: block; font-size: 42px; font-weight: 600; line-height: .9;
  letter-spacing: -1.6px; font-variant-numeric: tabular-nums;
}
.meteo-vent span { font-size: 12.5px; color: var(--label-2); }
.meteo-fleche { margin-left: auto; text-align: center; }
.meteo-fleche svg { width: 56px; height: 56px; }
.meteo-fleche div { font-size: 13px; font-weight: 500; margin-top: 2px; }

.meteo-table { width: 100%; border-collapse: collapse; background: var(--carte-bg);
  border-radius: 12px; overflow: hidden; margin-bottom: 22px; }
.meteo-table th {
  text-align: left; padding: 9px 10px; font-size: 12px; font-weight: 500;
  color: var(--label-3); border-bottom: .5px solid var(--sep);
}
.meteo-table td {
  padding: 10px; font-size: 13.5px; color: var(--label-2);
  border-bottom: .5px solid var(--sep); font-variant-numeric: tabular-nums;
}
.meteo-table tr:last-child td { border-bottom: none; }
.meteo-table td:first-child { color: var(--label); font-weight: 500; }

.chargement { padding: 34px 20px; text-align: center; color: var(--label-2); font-size: 14.5px; }

/* Bandeau d'aide */
#bandeau {
  position: absolute; top: 14px; left: 50%;
  transform: translateX(-50%) translateY(-64px);
  z-index: 950; display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 16px; border-radius: 100px;
  background: var(--verre); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--ombre); color: var(--label);
  font-size: 13.5px; white-space: nowrap; opacity: 0;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .3s;
  pointer-events: none;
}
#bandeau.on { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
#bandeau button {
  background: var(--bleu-fill); color: #fff; border: none; border-radius: 100px;
  padding: 6px 14px; font-size: 13px; font-weight: 500; cursor: pointer;
}

/* ==================================================== BANDEAU VITESSE */
#hud {
  position: absolute; left: 14px; bottom: 14px; z-index: 940;
  width: 232px; padding: 16px 18px;
  background: var(--verre); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-radius: 18px; box-shadow: var(--ombre);
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity .3s, transform .3s;
}
#hud.on { opacity: 1; transform: translateY(0); pointer-events: auto; }

.hud-haut { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hud-sog b {
  display: block; font-size: 46px; font-weight: 600; line-height: .9;
  letter-spacing: -2.4px; font-variant-numeric: tabular-nums; color: var(--label);
}
.hud-sog span { display: block; font-size: 12px; color: var(--label-2); margin-top: 7px; }
.hud-cap { text-align: right; padding-bottom: 4px; }
.hud-cap b { display: block; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hud-cap span { font-size: 11.5px; color: var(--label-2); }

.hud-cible {
  margin-top: 14px; padding-top: 12px; border-top: .5px solid var(--sep); display: none;
}
.hud-cible.on { display: block; }
.hud-cible-nom { font-size: 14px; font-weight: 600; color: var(--bleu); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-cible-val {
  display: flex; justify-content: space-between; margin-top: 4px;
  font-size: 13px; color: var(--label-2); font-variant-numeric: tabular-nums;
}

/* ================================================= MODE NAVIGATION ====
   Carte plein écran, informations réduites à l'essentiel, gros caractères
   lisibles en plein soleil et à bout de bras.
   ===================================================================== */
.btn-naviguer {
  background: var(--vert-fill); font-size: 17px; font-weight: 600; padding: 15px;
}
[data-theme="nuit"] .btn-naviguer { color: #04120a; }

#nav-ecran {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  z-index: 1000; display: none; pointer-events: none;
  flex-direction: column; justify-content: space-between;
}
body.navigation #nav-ecran { display: flex; }

/* En navigation, la carte occupe tout l'écran */
body.navigation #app {
  grid-template-columns: 1fr; grid-template-rows: 1fr;
  grid-template-areas: "carte";
}
body.navigation header,
body.navigation #panneau,
body.navigation .legende,
body.navigation #legende-traces,
body.navigation #hud,
body.navigation .leaflet-control-zoom { display: none !important; }

body.navigation .outils {
  top: calc(84px + env(safe-area-inset-top)); right: calc(14px + env(safe-area-inset-right));
}

/* ---- Bandeau du haut ---- */
.nav-haut {
  display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right))
           12px calc(12px + env(safe-area-inset-left));
  pointer-events: auto;
  background: linear-gradient(180deg, var(--verre) 62%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
}

.nav-btn {
  width: 46px; height: 46px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--carte-bg); border: none; border-radius: 50%;
  color: var(--bleu); font-size: 19px; cursor: pointer;
  box-shadow: var(--ombre-s);
}
.nav-btn.actif { background: var(--bleu-fill); color: #fff; }

.nav-haut-infos { flex: 1; display: flex; justify-content: space-around; gap: 8px; }
.nav-haut-infos div { text-align: center; }
.nav-haut-infos b {
  display: block; font-size: 19px; font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: -.4px;
}
.nav-haut-infos span { font-size: 11px; color: var(--label-2); }

/* Fond sous le bateau : passe au rouge s'il reste moins de 2 m sous la quille */
.nav-fond.alerte-fond b { color: var(--rouge); }
.nav-fond.alerte-fond span { color: var(--rouge); }
@media (max-width: 420px) {
  .nav-haut-infos b { font-size: 16px; }
  .nav-haut-infos span { font-size: 9.5px; }
}

/* ---- Bloc du bas ---- */
.nav-bas {
  padding: 14px calc(14px + env(safe-area-inset-right))
           calc(14px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left));
  pointer-events: auto;
  background: linear-gradient(0deg, var(--verre) 68%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
}

.nav-cible {
  padding: 12px 16px; margin-bottom: 12px;
  background: var(--carte-bg); border-radius: 14px; box-shadow: var(--ombre-s);
  display: none;
}
.nav-cible.on { display: block; }
.nav-cible-nom {
  font-size: 16px; font-weight: 600; color: var(--bleu);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-cible-detail {
  display: flex; justify-content: space-between; gap: 10px; margin-top: 5px;
  font-size: 13.5px; color: var(--label-2);
}
.nav-cible-detail b { color: var(--label); font-size: 16px; font-variant-numeric: tabular-nums; }

.nav-finale {
  display: none; justify-content: space-between; gap: 10px;
  margin-top: 9px; padding-top: 9px; border-top: .5px solid var(--sep);
  font-size: 13px; color: var(--label-2);
}
.nav-finale.on { display: flex; }
.nav-finale b { color: var(--label); font-variant-numeric: tabular-nums; }
.nav-finale span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-mesures { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }

.nav-vitesse b {
  display: block; font-size: 86px; font-weight: 700; line-height: .82;
  letter-spacing: -5px; font-variant-numeric: tabular-nums;
  color: var(--label);
}
.nav-vitesse span {
  display: block; font-size: 14px; color: var(--label-2); margin-top: 8px; letter-spacing: 0;
}

.nav-cap-bloc { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; }
.nav-rose { width: 58px; height: 58px; }
.nav-cap-bloc b { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -1px; }

.nav-alerte {
  position: absolute; left: 50%; top: calc(88px + env(safe-area-inset-top));
  transform: translateX(-50%);
  padding: 9px 18px; border-radius: 100px;
  background: var(--orange-fill); color: #fff;
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
  box-shadow: var(--ombre); display: none; pointer-events: auto;
}
.nav-alerte.on { display: block; }

/* Paysage : on ramène tout sur les côtés pour dégager la carte */
@media (orientation: landscape) and (max-height: 500px) {
  .nav-vitesse b { font-size: 62px; letter-spacing: -3px; }
  .nav-haut { padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 8px; }
  .nav-bas { padding-top: 8px; }
  .nav-cible { margin-bottom: 8px; padding: 9px 14px; }
  .nav-haut-infos b { font-size: 17px; }
}

/* ====================================================== LÉGENDE TRACÉS */
#legende-traces {
  position: absolute; right: 14px; bottom: 14px; z-index: 900;
  padding: 10px 13px; border-radius: 12px;
  background: var(--verre);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--ombre-s);
  font-size: 12.5px; color: var(--label-2);
  display: none;
}
#legende-traces.on { display: block; }
#legende-traces div { display: flex; align-items: center; gap: 8px; margin: 3px 0; }

@media (max-width: 900px) {
  #legende-traces { bottom: auto; top: 14px; left: 14px; right: auto; font-size: 11.5px; padding: 8px 11px; }
}

/* ============================================================= COMPTE */
.pastille-compte {
  width: 32px; height: 32px; flex-shrink: 0;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: var(--champ-bg); color: var(--label-2);
  font: 600 12.5px/1 var(--sans); cursor: pointer;
  transition: background .15s;
}
.pastille-compte:hover { background: var(--survol); }
.pastille-compte.connecte { background: var(--bleu-fill); color: #fff; }
.accueil-haut .pastille-compte { width: 34px; height: 34px; margin-left: 10px; }

/* Au-dessus du verrou : depuis l'écran de verrou on peut ouvrir son compte
   pour changer d'adresse, la fiche doit donc passer devant. */
#compte {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 4700; display: none;
}
#compte.on { display: block; }

/* ATTENTION — deux lignes ont été supprimées ici, et il ne faut pas les
   remettre :

     #compte .fiche-fond  { opacity: 0; … }
     #compte .fiche-carte { opacity: 0; … }

   Elles reprenaient mot pour mot ce que .fiche-fond et .fiche-carte
   font déjà plus bas. Mais en le disant avec un identifiant, elles
   pesaient plus lourd que la règle générique qui révèle le panneau :

     #compte .fiche-fond   →  un id + une classe
     .visible > .fiche-fond →  deux classes

   Un identifiant l'emporte sur n'importe quel nombre de classes. Le
   panneau Mon compte s'ouvrait donc — display: block — mais restait
   totalement transparent, tout en couvrant l'écran entier. D'où un
   bouton « R » qui semblait mort, et une application qui ne répondait
   plus tant qu'on n'avait pas rechargé la page.

   La règle : ne jamais redéclarer le gabarit des fiches avec un
   sélecteur d'identifiant. */

/* Boutons des fournisseurs */
.btn-fournisseur {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px 16px; margin-bottom: 10px;
  border: none; border-radius: 12px;
  font-family: var(--sans); font-size: 16px; font-weight: 500;
  cursor: pointer; transition: opacity .15s;
}
.btn-fournisseur:hover { opacity: .85; }
.btn-fournisseur i { font-style: normal; font-size: 18px; line-height: 1; }
.btn-fournisseur.google { background: #fff; color: #1f1f1f; box-shadow: inset 0 0 0 1px rgba(60,60,67,.22); }
.btn-fournisseur.apple  { background: #000; color: #fff; }
[data-theme="nuit"] .btn-fournisseur.apple { background: #fff; color: #000; }

.separateur {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0; font-size: 13px; color: var(--label-3);
}
.separateur::before, .separateur::after {
  content: ""; flex: 1; height: .5px; background: var(--sep);
}

.champ-email {
  width: 100%; padding: 13px 15px; margin-bottom: 10px;
  background: var(--carte-bg); border: none; border-radius: 12px;
  color: var(--label); font-size: 16px;
}
.champ-email:focus { outline: none; box-shadow: 0 0 0 3px var(--bleu-doux); }

.champ-code {
  width: 100%; padding: 16px; margin-bottom: 10px;
  background: var(--carte-bg); border: none; border-radius: 12px;
  color: var(--label); font-size: 30px; font-weight: 600;
  text-align: center; letter-spacing: 10px; font-variant-numeric: tabular-nums;
}
.champ-code:focus { outline: none; box-shadow: 0 0 0 3px var(--bleu-doux); }
.champ-code::placeholder { color: var(--label-3); letter-spacing: 10px; }

.compte-avatar {
  width: 62px; height: 62px; margin: 0 auto 14px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--bleu-fill); color: #fff;
  font-size: 23px; font-weight: 600;
}
.compte-avatar.paye { background: var(--vert-fill); }
.compte-identite { text-align: center; margin-bottom: 22px; }

.compte-identite b { display: block; font-size: 18px; font-weight: 600; }
.compte-identite span { font-size: 14px; color: var(--label-2); }

/* ========================================================== FICHE PORT */
#fiche { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 3500; display: none; }
#fiche.on { display: block; }

.fiche-fond {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0, 0, 0, .32);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .28s;
}
/* Générique, et non plus « #fiche » : tout panneau qui réutilise ce
   gabarit se révèle en recevant la classe .visible. C'est ce qui
   manquait à Meet-Me — l'écran s'ouvrait, parfaitement transparent. */
.visible > .fiche-fond { opacity: 1; }

.fiche-carte {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -46%) scale(.97);
  width: min(460px, calc(100% - 32px)); max-height: 84vh;
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  opacity: 0; transition: opacity .28s, transform .28s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
.visible > .fiche-carte { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.fiche-barre { display: none; }

.fiche-entete {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 20px 20px 14px; background: var(--bg);
}
.fiche-entete h2 { font-size: 22px; font-weight: 700; letter-spacing: -.5px; line-height: 1.2; }
.fiche-entete p { font-size: 14px; color: var(--label-2); margin-top: 3px; }
.fiche-entete .btn-rond { flex-shrink: 0; margin-left: auto; }

.fiche-corps { overflow-y: auto; padding: 0 20px 22px; -webkit-overflow-scrolling: touch; }

/* Boutons d'action ronds façon fiche contact iOS */
.actions-rondes { display: flex; gap: 10px; margin-bottom: 22px; }
.action-ronde {
  flex: 1; padding: 12px 4px 10px;
  background: var(--carte-bg); border: none; border-radius: 12px;
  color: var(--bleu); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: background .15s;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-decoration: none;
}
.action-ronde:hover { background: var(--survol); }
.action-ronde i { font-style: normal; font-size: 19px; }
.action-ronde.off { color: var(--label-3); pointer-events: none; opacity: .5; }

.ligne a { color: var(--bleu); text-decoration: none; }
.ligne a:hover { text-decoration: underline; }
.ligne-valeur.lien { color: var(--bleu); }

@media (max-width: 900px) {
  .fiche-carte {
    left: 0; top: auto; bottom: 0;
    transform: translate(0, 100%);
    width: 100%; max-height: 90vh;
    border-radius: 18px 18px 0 0;
  }
  .visible > .fiche-carte { transform: translate(0, 0); }
  .fiche-barre {
    display: block; width: 38px; height: 5px; border-radius: 100px;
    background: var(--sep-fort); margin: 8px auto 0;
  }
  .fiche-entete { padding-top: 14px; }
  .fiche-corps { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}

/* ============================================================== ANCRE */
.ancre-bandeau {
  padding: 16px; border-radius: 14px; margin-bottom: 22px;
  background: var(--carte-bg);
}
.ancre-bandeau.veille { background: var(--vert-doux); }
.ancre-bandeau.derape { background: var(--rouge-doux); }

.ancre-titre {
  display: flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 600; margin-bottom: 12px;
}
.ancre-mesures { display: flex; gap: 20px; }
.ancre-mesures div b {
  display: block; font-size: 24px; font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: -.5px;
}
.ancre-mesures div span { font-size: 12px; color: var(--label-2); }

.marqueur-ancre {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--label); border: 3px solid #fff;
  box-shadow: 0 2px 7px rgba(0,0,0,.4);
  display: grid; place-items: center; color: #fff; font-size: 14px;
}

/* Plein écran d'alarme */
#alarme {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 5000;
  display: none; place-items: center;
  background: var(--rouge-fill); color: #fff;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
}
#alarme.on { display: grid; animation: pulseAlarme 1s steps(1) infinite; }
@keyframes pulseAlarme {
  0%, 49% { background: var(--rouge-fill); }
  50%, 100% { background: #8f1b14; }
}
.alarme-inner { max-width: 340px; }
.alarme-icone { font-size: 58px; margin-bottom: 14px; }
#alarme h2 { font-size: 28px; font-weight: 700; letter-spacing: -.6px; margin-bottom: 10px; }
#alarme p { font-size: 16px; line-height: 1.5; margin-bottom: 26px; opacity: .95; }
#alarme .btn { background: #fff; color: var(--rouge); font-size: 17px; font-weight: 600; padding: 15px; }

/* ============================================================== VERROU */
#verrou {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 4800;
  display: none; overflow-y: auto; -webkit-overflow-scrolling: touch;
  /* Fond PLEIN et opaque : cet écran doit masquer complètement l'app.
     Il pointait vers une variable de couleur inexistante, d'où un fond
     transparent et la page d'accueil qui se lisait au travers. */
  background: var(--bg);
  padding: calc(26px + env(safe-area-inset-top)) 20px calc(30px + env(safe-area-inset-bottom));
}
#verrou.on { display: block; }
.verrou-inner {
  max-width: 380px; margin: 0 auto; text-align: center;
  animation: verrou-entre .35s cubic-bezier(.2,.8,.2,1) both;
}
/* Le champ e-mail et le bouton méritent de l'air : c'est le premier
   geste demandé à quelqu'un qui ne connaît pas encore l'app. */
#verrou-inscription { margin-bottom: 4px; }
#verrou-inscription .champ-email { margin-bottom: 12px; }
#verrou-inscription .btn { margin-bottom: 12px; }
#verrou .note { margin-bottom: 4px; }
@keyframes verrou-entre {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.verrou-logo {
  width: 54px; height: 54px; margin: 0 auto 18px;
  color: var(--bleu);
}
.verrou-logo svg { width: 30px; height: 30px; }
#verrou h2 {
  font-size: 26px; font-weight: 700; letter-spacing: -.7px;
  line-height: 1.15; margin-bottom: 10px;
}
.verrou-sous {
  font-size: 15.5px; line-height: 1.5; color: var(--label-2);
  margin-bottom: 24px;
}
#verrou .groupe-titre { text-align: left; }
#verrou .groupe { text-align: left; margin-bottom: 6px; }
#verrou .btn-rang { margin-top: 18px; }

.offre {
  text-align: center; padding: 18px; margin-bottom: 14px;
  background: var(--carte-bg); border-radius: 14px;
}
.offre b {
  display: block; font-size: 38px; font-weight: 700;
  letter-spacing: -1.4px; line-height: 1;
}
.offre span { font-size: 14px; color: var(--label-2); }

/* Saisie d'un code de gratuité */
.zone-code { display: flex; gap: 8px; align-items: stretch; }
.zone-code .btn { width: auto; flex-shrink: 0; padding-left: 20px; padding-right: 20px; }

.champ-code-cadeau {
  flex: 1; min-width: 0; padding: 14px 16px;
  background: var(--carte-bg); border: none; border-radius: 12px;
  color: var(--label); font-size: 19px; font-weight: 600;
  text-align: center; letter-spacing: 3px; text-transform: uppercase;
}
.champ-code-cadeau:focus { outline: none; box-shadow: 0 0 0 3px var(--bleu-doux); }
.champ-code-cadeau::placeholder {
  color: var(--label-3); letter-spacing: 3px; font-weight: 500;
}

/* ====================================================== APPEL MEET-ME */
/* Bandeau qui surgit du haut. Sous l'alarme de mouillage (5000) et sous
   le toast, mais au-dessus de tout le reste : on doit le voir depuis
   n'importe quel écran. */
#mm-appel {
  position: fixed; left: 0; right: 0; z-index: 4950;
  top: calc(env(safe-area-inset-top) + 8px);
  padding: 0 10px; display: none;
}
#mm-appel.on { display: block; }
#mm-appel.visible .mm-appel-carte { transform: translateY(0); opacity: 1; }

.mm-appel-carte {
  max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 14px;
  background: var(--verre);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-radius: 18px; box-shadow: var(--ombre);
  transform: translateY(-130%); opacity: 0;
  transition: transform .34s cubic-bezier(.2,.8,.2,1), opacity .28s;
}
.mm-appel-icone {
  width: 40px; height: 40px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 20px;
  border-radius: 12px; background: var(--bleu-fill);
}
.mm-appel-corps { flex: 1; min-width: 0; }
.mm-appel-titre {
  font-size: 15px; font-weight: 600; color: var(--label);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mm-appel-sous {
  font-size: 13px; color: var(--label-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mm-appel-btn {
  flex-shrink: 0; padding: 9px 18px; border: none;
  border-radius: 100px; background: var(--bleu-fill); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.mm-appel-fermer { flex-shrink: 0; color: var(--label-2); }

/* Pastille de signes en attente, sur la tuile d'accueil */
.tuile-badge {
  display: inline-block; min-width: 20px; padding: 1px 6px;
  margin-left: 6px; border-radius: 100px;
  background: var(--rouge-fill); color: #fff;
  font-size: 12px; font-weight: 700; text-align: center;
  vertical-align: 1px;
}

/* ============================================================= MEET-ME */
#meetme { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 4650; display: none; }
#meetme.on { display: block; }

.mm-statuts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.mm-statuts .puce { flex: 0 0 auto; }

/* Une pastille d'état sur chaque bateau : ouvert, en attente, signe reçu */
.mm-pastille {
  display: inline-block; margin-left: 8px; padding: 2px 9px;
  border-radius: 100px; font-size: 11.5px; font-weight: 600;
  vertical-align: 2px;
}
.mm-pastille.ouvert  { background: var(--vert-doux);   color: var(--vert); }
.mm-pastille.attente { background: var(--orange-doux); color: var(--orange); }
.mm-pastille.envoye  { background: var(--champ-bg);    color: var(--label-2); }
.mm-pastille.garde   { background: var(--bleu-doux);   color: var(--bleu); margin-left: 0; }

/* Les participants d'une conversation à plusieurs */
.mm-membres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mm-membres .puce.parti { opacity: .5; text-decoration: line-through; }

/* « Romain a ajouté Claire » : au centre, sans bulle. Cela doit se lire
   comme un fait, pas comme un message de quelqu'un. */
.mm-systeme {
  text-align: center; font-size: 12.5px; color: var(--label-3);
  margin: 10px 0; padding: 0 12px; line-height: 1.4;
}

/* Qui parle, dans une conversation à plusieurs */
.mm-de {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--bleu); margin-bottom: 2px;
}

/* Bouton discret en bout de ligne — « Oublier » */
.btn-mini {
  flex: 0 0 auto; margin-left: 10px; padding: 5px 12px;
  border: none; border-radius: 100px; cursor: pointer;
  background: var(--champ-bg); color: var(--label-2);
  font-family: var(--sans); font-size: 12.5px; font-weight: 600;
}
.btn-mini:hover { background: var(--sep); color: var(--label); }

/* ------------------------------------- Les bateaux sur la carte ----
   Seulement quand on est soi-même visible. Un pseudo sous le marqueur :
   sans lui, on ne sait pas lequel est celui à qui l'on parle. */
.marqueur-mm {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
  background: var(--carte-bg); color: var(--label);
  border: 2px solid var(--bleu-fill);
  box-shadow: var(--ombre-s);
}
.marqueur-mm.mm-m-ouvert { border-color: var(--vert-fill);   background: var(--vert-doux); }
.marqueur-mm.mm-m-appel  { border-color: var(--orange-fill); background: var(--orange-doux); }
.marqueur-mm.mm-m-garde  { border-color: var(--bleu-fill);   background: var(--bleu-doux); }
.marqueur-mm-nom {
  position: absolute; top: 32px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 11px; font-weight: 600;
  color: var(--label); background: var(--verre);
  padding: 1px 7px; border-radius: 100px; box-shadow: var(--ombre-s);
  pointer-events: none;
}

.mm-mot { font-style: italic; margin-top: 3px; }

.mm-photo {
  width: 100%; border-radius: 14px; margin-bottom: 16px;
  display: block; background: var(--champ-bg);
}

/* Le fil de discussion. Hauteur bornée : on ne veut pas d'un écran qui
   pousse le champ de saisie hors de vue sur un iPhone. */
.mm-fil {
  max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 4px 2px 10px; margin-bottom: 10px;
}
.mm-bulle {
  max-width: 82%; margin-bottom: 8px; padding: 10px 14px;
  border-radius: 17px; font-size: 15px; line-height: 1.4;
  background: var(--carte-bg); color: var(--label);
  word-wrap: break-word; overflow-wrap: anywhere;
}
.mm-bulle.moi {
  margin-left: auto; background: var(--bleu-fill); color: #fff;
}
.mm-presence { font-size: 13px; color: var(--orange); margin-bottom: 8px; min-height: 18px; }

/* ============================================ PARTAGE DE POSITION ======
   Au-dessus de tout sauf de l'alarme : c'est la première chose qu'on
   voit en ouvrant, et rien ne doit passer devant — sauf une ancre qui
   dérape, qui reste prioritaire sur tout le reste. */
#partage {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  z-index: 4750; display: none;
}
#partage.on { display: block; }

/* Une case à cocher lisible au doigt, pas une case de formulaire */
.case {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px; margin-bottom: 16px;
  background: var(--carte-bg); border-radius: 12px;
  font-size: 14.5px; color: var(--label); cursor: pointer;
}
.case input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--bleu-fill); }

/* ================================================ PAGES DE TEXTE =======
   CGU et politique de confidentialité. Des pages autonomes, sans carte
   ni JavaScript : elles doivent rester lisibles même si tout le reste
   est cassé, et être imprimables telles quelles. */

body.page-texte {
  display: block; overflow-y: auto; background: var(--bg);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.texte {
  max-width: 720px; margin: 0 auto; padding: 32px 22px 80px;
  color: var(--label); font-size: 16px; line-height: 1.62;
}
.texte h1 { font-size: 30px; letter-spacing: -.5px; margin: 6px 0 4px; }
.texte h2 {
  font-size: 19px; margin: 34px 0 10px; padding-top: 18px;
  border-top: .5px solid var(--sep); letter-spacing: -.2px;
}
.texte p  { margin: 0 0 14px; }
.texte ul { margin: 0 0 16px; padding-left: 22px; }
.texte li { margin-bottom: 7px; }
.texte a  { color: var(--bleu); }
.texte .maj { color: var(--label-3); font-size: 13.5px; margin-bottom: 22px; }
.texte .note { margin: 20px 0; }
.fil-ariane { font-size: 14px; margin-bottom: 18px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .92em; }

/* Le tableau des traitements. Sur téléphone il défile horizontalement
   plutôt que de comprimer les colonnes jusqu'à l'illisible. */
.tableau {
  width: 100%; border-collapse: collapse; margin: 8px 0 18px;
  font-size: 14px; display: block; overflow-x: auto;
}
.tableau th, .tableau td {
  border: .5px solid var(--sep); padding: 9px 11px;
  text-align: left; vertical-align: top; min-width: 120px;
}
.tableau th { background: var(--champ-bg); font-weight: 600; }

/* ========================================================= NOTIFICATION */
#toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px);
  z-index: 4900; padding: 12px 22px;
  background: var(--verre); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  color: var(--label); border-radius: 100px;
  font-size: 14.5px; font-weight: 500; box-shadow: var(--ombre);
  opacity: 0; transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .3s;
  pointer-events: none;
}
#toast.on { transform: translateX(-50%) translateY(0); opacity: 1; }

/* =========================================================== SCROLLBAR */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(120,120,128,.35); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: rgba(120,120,128,.55); }

/* =============================================================== MOBILE */
@media (max-width: 900px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: 52px 1fr 50vh;
    grid-template-areas: "entete" "carte" "panneau";
  }
  #panneau { border-right: none; border-top: .5px solid var(--sep); }
  #hud { width: calc(100% - 28px); left: 14px; right: 14px; bottom: 14px; }
  .hud-sog b { font-size: 38px; }

  /* Outils resserrés et bulles compactes pour dégager la carte */
  .segment { font-size: 12.5px; }
  .outils { top: 10px; right: 10px; }
  .outil { width: 38px; height: 38px; font-size: 15px; }
  .leaflet-popup-content { margin: 11px 13px; font-size: 12.5px; }
  .popup-titre { font-size: 14.5px; }
  .popup-actions button { padding: 9px 6px; font-size: 13px; }
  .accueil-inner { padding: 36px 20px 48px; }
  .accueil-titre { font-size: 30px; letter-spacing: -.9px; }
  .accueil-grille { grid-template-columns: 1fr; }
  .accueil-haut { margin-bottom: 30px; }
}
