/* === Thème global BoatAssist === */
:root{
  --bg: #0b1a33;        /* bleu marine */
  --text: #f1f5f9;      /* clair */
  --muted: #94a3b8;
  --primary: #0ea5e9;   /* accent */
  --card: #0f2346;
}

/* Reset simple */
*{ box-sizing: border-box; margin:0; padding:0; }
html,body{ height:100%; }
body{
  min-height:100vh;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Splash */
.splashscreen{
  display:flex; align-items:center; justify-content:center;
  background: var(--bg);
}
.splash-container{ text-align:center; }

/* Layout générique */
header, footer{ padding: 16px; text-align:center; }
main{ padding: 16px; }

/* Cartes / panneaux */
.card{
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

/* Boutons */
button{
  appearance:none; border:0; border-radius:14px;
  padding:14px 16px; font-weight:700; color:#fff; background: var(--primary);
}
button:active{ transform: translateY(1px); }
button.muted{ background:#1f324f; color: var(--muted); }

/* Utilitaires */
.center{ display:grid; place-items:center; }
.grid{ display:grid; gap:12px; }
.text-muted{ color: var(--muted); }

/* === TABBAR GLOBALE === */
.tabbar{
  position: fixed !important;
  left: 0; right: 0; bottom: 0;
  height: 68px;
  background: #0b1120;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 8px); /* <- ajoute du padding bas */
  z-index: 100000;
  box-shadow: 0 -6px 20px rgba(0,0,0,.35);
}

.tab-item {
  flex: 1;
  text-align: center;
  color: #ffffff;
  font-size: 12px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tab-item .icon {
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
}

.tab-sos {
  background: linear-gradient(135deg, #ef4444, #f97316); /* rouge-orangé */
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 64px;
  height: 64px;
  font-size: 16px;
  font-weight: bold;
  margin-top: -32px; /* fait dépasser au-dessus de la barre */
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.tab-sos:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Hauteur carte : occupe l'écran - tabbar (64px) - header (~60px) */
.map-main { padding: 0; }
#map {
  height: calc(100vh - 64px - 60px);
  width: 100%;
}

/* Marqueur "ma position" (point bleu pulsant) */
.me-icon .dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #0ea5e9;
  box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7); }
  70%  { box-shadow: 0 0 0 18px rgba(14, 165, 233, 0); }
  100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}

/* Bouton recenter */
.recenter-btn {
  background: #0ea5e9;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  cursor: pointer;

  /* pousse le bouton au-dessus de la zone safe iOS */
  margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 0px); /*Passer à 80 en PWA */
}

.recenter-btn:active{ transform: scale(0.96); }

/* MapLibre: hauteur (plein écran - header - tabbar) */
#maplibre {
  height: calc(100vh - 60px - 64px);
  width: 100%;
}

/* Marqueur pulsant "moi" */
.me-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: #0ea5e9;
  box-shadow: 0 0 0 0 rgba(14,165,233,0.6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(14,165,233,0.6); }
  70%  { box-shadow: 0 0 0 20px rgba(14,165,233,0); }
  100% { box-shadow: 0 0 0 0 rgba(14,165,233,0); }
}

/* Contrôles MapLibre */
.ml-control {
  background: #0ea5e9;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  cursor: pointer;
}
.ml-control:active { transform: scale(0.96); }

/* Bouton boussole (état actif) */
.compass-btn.active {
  background: linear-gradient(135deg, #10b981, #22c55e);
}

/* Controls MapLibre au-dessus de la tabbar et du home indicator iOS */
.maplibregl-ctrl, .maplibregl-ctrl-group {
  z-index: 2001; /* tabbar est à 1000 chez toi */
}
.maplibregl-ctrl-bottom-right {
  margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 0px); /* passe au-dessus de la tabbar */
}
/* bouton personnalisé (recenter / boussole) reste visible et clickable */
.ml-control { pointer-events: auto; }

/* --- Contrôle statut GPS (SVG + précision + coordonnées) --- */
.gps-ctrl.maplibregl-ctrl { z-index: 2001; }
.maplibregl-ctrl-top-left{
  margin-left: 12px;
  margin-top: calc(env(safe-area-inset-top, 0px) + 12px);
}
.gps-ctrl .gps-btn{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  min-width: 110px;  /* plus large */
  min-height: 58px;  /* plus haut */
  padding: 6px 10px;
  border:0; border-radius: 12px;
  background:#ef4444; /* rouge par défaut */
  color:#fff; font-size:14px; font-weight:600; cursor:pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  text-align:center;
}
.gps-ctrl .gps-btn svg{ width:22px; height:22px; fill:currentColor; margin-bottom:4px; }
.gps-ctrl .gps-btn.ok{ background:#22c55e; }     /* vert */
.gps-ctrl .gps-btn.search{ background:#f59e0b; } /* orange */
.gps-ctrl .gps-btn:active{ transform:scale(.96); }
.gps-info{ font-variant-numeric:tabular-nums; }
.gps-coords{ font-size:11px; opacity:.85; line-height:1.2; margin-top:2px; }

/* ====== PROFIL ====== */
body {
  background:#0b1120; /* même fond que splash/nav */
  font-family: system-ui, sans-serif;
}

.header {
  max-width:680px;
  margin:24px auto 0;
  color:#fff;
  padding:0 4px;
}

.header h1 {
  font-size:1.6rem;
  margin-bottom:0.25em;
}

.header p {
  font-size:0.9rem;
  opacity:0.8;
}

.card {
  max-width:680px;
  margin:24px auto;
  background:#0b1a33;
  color:#fff;
  border-radius:16px;
  padding:20px;
  box-shadow:0 4px 20px rgba(0,0,0,0.3);
}

.row {
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}

.row.full {
  grid-template-columns:1fr;
}

label {
  font-size:14px;
  opacity:.9;
  display:block;
  margin-bottom:4px;
}

input, select {
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.15);
  background:#0f2040;
  color:#fff;
  font-size:15px;
}

input:focus, select:focus {
  outline:none;
  border-color:#0ea5e9;
  box-shadow:0 0 0 2px rgba(14,165,233,0.3);
}

.actions {
  display:flex;
  gap:12px;
  justify-content:flex-end;
  margin-top:16px;
}

button {
  padding:10px 14px;
  border-radius:10px;
  border:0;
  background:#0ea5e9;
  color:#fff;
  font-weight:700;
  cursor:pointer;
  transition:background 0.2s ease;
}

button:hover { background:#0284c7; }

button.secondary {
  background:#1f2f4d;
}
button.secondary:hover {
  background:#2a3b63;
}

.muted { opacity:.8; font-size:13px; }
.success { color:#22c55e; font-weight:700; }
.error { color:#f87171; font-weight:700; }
.readonly { opacity:.8; }

/* Login — ligne indicatif + numéro */
.input-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  align-items: center;
}
.input-row select,
.input-row input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.15);
  background: #0f2040;
  color: #fff;
  font-size: 15px;
}
.input-row select:focus,
.input-row input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14,165,233,.3);
}
/* ——— TABBAR (classe .tabbar) ——— */
html, body { height: 100%; }

.tabbar{
  position: fixed !important;
  left: 0; right: 0; bottom: 0;
  height: 68px !important;
  background: #0b1120 !important; /* bleu marine */
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  align-items: center; justify-items: center;
  padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 28px);
  z-index: 100000 !important;
  box-shadow: 0 -6px 20px rgba(0,0,0,.35);
  opacity: 1 !important;
  visibility: visible !important;
}

.tabbar .tab{
  display:flex; flex-direction:column; align-items:center; gap:4px;
  color:#fff; text-decoration:none; opacity:.85;
  font-size:12px; line-height:1;
}
.tabbar .tab.active{ opacity:1; }
.tabbar .tab .ico svg{ width:22px; height:22px; fill:#fff; }

/* bouton SOS central */
.tabbar .sos-btn{
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 30% 30%, #ff7a59, #ef4444);
  color:#fff; font-weight:900; font-size:18px; letter-spacing:.5px;
  box-shadow: 0 8px 24px rgba(239,68,68,.6);
  transform: translateY(-14px);
}
.tabbar .sos-btn:active{ transform: translateY(-12px) scale(.98); }
.tabbar .sos-btn.pulse{ animation: sosPulse .4s ease; }
@keyframes sosPulse { 0%{ transform:translateY(-14px) scale(1);} 50%{ transform:translateY(-14px) scale(1.06);} 100%{ transform:translateY(-14px) scale(1);} }

/* laisser de la place au contenu */
body { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important; }

/* si un calque plein écran recouvre, on le remet derrière */
.fullscreen, .overlay, .page, .content, .maplibregl-canvas, #maplibre {
  z-index: auto !important;
}

/* ===== Profil (vue) ===== */
.profile-header {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* avatar à gauche */
  gap: 1rem; /* espace entre avatar et infos texte */
}


.avatar-btn{
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px dashed rgba(255,255,255,.35);
  background: rgba(255,255,255,.06);
  color: #fff;
  display:flex; align-items:center; justify-content:center;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
}
.avatar-btn:hover{ background: rgba(255,255,255,.12); }
.avatar-btn:active{ transform: scale(.97); }
.avatar-btn .plus{ font-size: 28px; line-height: 1; }

.id-block .name{
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: .2px;
}
.id-block .pseudo{
  font-size: .95rem;
  opacity: .85;
  margin-top: 2px;
}

.profile-card h2{
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.1rem;
}
.info-list{
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 10px;
}
.info-list li{
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  background: #0f2040;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
}
.info-list li span{
  opacity: .85;
}
.info-list li strong{
  color: #fff; font-weight: 700; margin-left: 12px;
}

.profile-card .actions{
  display: flex; justify-content: flex-end; margin-top: 14px;
}
.profile-card .btn{
  display:inline-block;
  padding: 10px 14px;
  background:#0ea5e9; color:#fff; text-decoration: none;
  border-radius: 10px; font-weight: 800;
}
.profile-card .btn:hover{ background:#0284c7; }

/* Bouton avatar (profil utilisateur) */
.avatar-btn {
  width: 120px;          /* augmente la taille (ex: 80px → 120px) */
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  margin: 0 auto 1rem 0;  /* aligne + espace à gauche */
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Image à l’intérieur */
.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none; /* remplacé par JS si photo présente */
}

/* Le petit "+" si pas d’image */
.avatar-btn .plus {
  font-size: 2rem;
  color: #fff;
  background: #0ea5e9;
  border-radius: 50%;
  width: 50%;
  height: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}
/* cache le plus si image présente */
.avatar-btn.has-img .plus{ display:none; }

/* Empêche le zoom auto sur iOS en forçant min 16px */
input, select, textarea, button {
  font-size: 16px !important;
}

/* ===== carte bateau ===== */
.boat-card h2{ margin:0 0 10px 0; font-size:1.1rem; }
.boat-header{ display:grid; grid-template-columns: 92px 1fr; gap:14px; align-items:flex-start; }
.boat-photo{
  width: 92px; height: 92px; border-radius: 12px; border:2px dashed rgba(255,255,255,.35);
  background: rgba(255,255,255,.06); color:#fff; display:flex; align-items:center; justify-content:center;
  position:relative; overflow:hidden; cursor:pointer;
}
.boat-photo img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:none; }
.boat-photo.has-img .plus{ display:none; }
.info-list.compact li{ padding:8px 10px; }
.boat-card .btn{
  display:inline-block;
  padding: 10px 14px;
  background:#0ea5e9; color:#fff; text-decoration: none;
  border-radius: 10px; font-weight: 800;
}
.logout-wrap {
  max-width: 680px;
  margin: 32px auto;
  padding: 0 12px 80px; /* espace sous le bouton */
  text-align: center;
}


.btn-logout {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  background: #dc2626; /* rouge vif */
  color: #fff;
  cursor: pointer;
  transition: background .2s ease;
}
.btn-logout:hover {
  background: #b91c1c;
}
.btn-logout:active {
  transform: scale(.98);
}

body {
  padding-bottom: calc(140px + var(--safe-bottom, 0px)) !important;
}

/* Bottom sheet */
.sheet.hidden { display:none; }
.sheet { position:fixed; inset:0; z-index:100002; }
.sheet-backdrop { position:absolute; inset:0; background:rgba(0,0,0,.4); }
.sheet-panel{
  position:absolute; left:0; right:0; bottom:0;
  background:#0b1120; color:#fff;
  border-top-left-radius:16px; border-top-right-radius:16px;
  padding:14px 14px calc(14px + env(safe-area-inset-bottom,0px));
  box-shadow: 0 -12px 40px rgba(0,0,0,.5);
  transform: translateY(100%); opacity:0; transition: transform .28s ease, opacity .28s ease;
}
.sheet.open .sheet-panel{ transform: translateY(0); opacity:1; }
.sheet-grip{ width:60px; height:5px; border-radius:3px; background:#2a3a60; margin:6px auto 12px; }

.sheet-panel h3{ margin:0 0 10px 0; }
.sheet-panel label{ display:block; margin:10px 0 6px; font-weight:700; }
.sheet-panel select, .sheet-panel textarea{
  width:100%; padding:10px; border-radius:10px; border:1px solid #223056; background:#0f1a33; color:#fff; font-size:16px;
}
.sheet-panel .check{ display:flex; align-items:flex-start; gap:8px; margin-top:10px; }
.sheet-panel .check input{ margin-top:4px; }
.muted{ color:#a7b7d6; font-size:13px; margin:6px 0 0; }

/* Slider SOS */
.slider-wrap{ position:relative; margin-top:14px; padding:10px 0; }
.slider-label{ display:block; text-align:center; margin-bottom:6px; color:#a7b7d6; }
#sosSlider{
  -webkit-appearance:none; width:100%; height:50px; background:#132041; border-radius:30px; outline:none;
}
#sosSlider::-webkit-slider-thumb{
  -webkit-appearance:none; width:90px; height:90px; border-radius:50%;
  background:#dc2626; border:4px solid #0b1120; box-shadow:0 4px 12px rgba(0,0,0,.4);
}
#sosSlider::-moz-range-thumb{
  width:90px; height:90px; border-radius:50%; background:#dc2626; border:4px solid #0b1120;
}
.slider-bubble{
  position:absolute; top:36px; left:10px; width:90px; height:90px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; color:#fff; font-weight:900; pointer-events:none;
}

/* Ouverture/fermeture transitions */
.sheet.open .sheet-backdrop{ animation: fadeIn .28s ease forwards; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

/* Sheet container */
.sheet.hidden { display:none; }
.sheet{ position:fixed; inset:0; z-index:100002; }

/* Backdrop flouté + foncé */
.sheet-backdrop{
  position:absolute; inset:0;
  background:rgba(3,12,28,.55);
  backdrop-filter: blur(4px);
  opacity:0; transition:opacity .25s ease;
}
.sheet.open .sheet-backdrop{ opacity:1; }

/* Panel */
.sheet-panel{
  position:absolute; left:0; right:0; bottom:0;
  background:#0f1a33; color:#fff;
  border-top-left-radius:18px; border-top-right-radius:18px;
  box-shadow:0 -18px 50px rgba(0,0,0,.6);
  transform: translateY(100%); opacity:.8;
  transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .28s ease;
  /* hauteur max + scroll interne élégant */
  max-height: calc(88vh - env(safe-area-inset-top,0px));
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom,0px));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet.open .sheet-panel{ transform:translateY(0); opacity:1; }

/* Grip */
.sheet-grip{ width:44px; height:5px; border-radius:3px; background:#2a3a60; margin:8px auto 12px; }

/* Titres + labels */
.sheet-panel h3{ margin:0 0 12px; font-size:18px; }
.sheet-panel label{ display:block; margin:12px 0 6px; font-weight:700; }

/* Inputs */
.sheet-panel select,
.sheet-panel textarea{
  width:100%; padding:12px 14px; border-radius:12px;
  border:1px solid #223056; background:#0b1a34; color:#fff; font-size:16px;
}
.sheet-panel textarea{ min-height:96px; resize:vertical; }

/* Lignes d’aide */
.muted{ color:#a7b7d6; font-size:13px; margin:8px 0 0; }

/* Checkboxes (grosses, alignées) */
.check{ display:flex; gap:10px; align-items:flex-start; margin:12px 0 0; }
.check input{
  width:22px; height:22px; margin-top:3px; flex:0 0 22px;
  accent-color:#0ea5e9;
}

/* Slider SOS */
.slider-wrap{ position:sticky; bottom: calc(12px + env(safe-area-inset-bottom,0px)); 
  margin-top:16px; padding-top:6px; background:linear-gradient(180deg,transparent 0%, rgba(15,26,51,.85) 40%, #0f1a33 100%);
}
.slider-label{ display:block; text-align:center; margin-bottom:8px; color:#c7d2fe; font-weight:700; }

#sosSlider{
  -webkit-appearance:none; appearance:none;
  width:100%; height:58px; background:#132041; border:1px solid #23345d;
  border-radius:32px; outline:none; position:relative;
}
#sosSlider::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none;
  width:92px; height:92px; border-radius:50%;
  background:#f43f5e; /* rouge rosé */
  border:5px solid #0f1a33;
  box-shadow:0 10px 20px rgba(244,63,94,.35), 0 2px 6px rgba(0,0,0,.5);
}
#sosSlider::-moz-range-thumb{
  width:92px; height:92px; border-radius:50%;
  background:#f43f5e; border:5px solid #0f1a33;
  box-shadow:0 10px 20px rgba(244,63,94,.35), 0 2px 6px rgba(0,0,0,.5);
}

/* Bulle “SOS” dans le pouce */
.slider-bubble{
  position:relative; /* suit la range via JS */
  width:92px; height:0; /* hack: on ne l’occupe pas dans le flux */
  transform: translateY(-74px); /* place le texte au centre du thumb */
  margin-left:10px; /* position de départ */
  pointer-events:none; display:flex; align-items:center; justify-content:center;
  font-weight:900; font-size:18px; letter-spacing:.5px; color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.6);
}

/* Espacement pour ne pas toucher la tabbar */
body{ padding-bottom: calc(120px + env(safe-area-inset-bottom,0px)); }

/* Triggers type “select” custom */
.picker-trigger{
  width:100%; text-align:left; background:#0b1a34; border:1px solid #223056;
  border-radius:12px; padding:12px 14px; color:#fff; display:flex; flex-direction:column; gap:4px;
}
.picker-trigger.disabled{ opacity:.6; pointer-events:none; }
.picker-title{ font-size:16px; font-weight:700; }
.picker-sub{ font-size:13px; color:#a7b7d6; }

/* Overlay picker */
.picker.hidden{ display:none; }
.picker{ position:fixed; inset:0; z-index:100001; }
.picker-backdrop{ position:absolute; inset:0; background:rgba(3,12,28,.55); backdrop-filter:blur(3px); opacity:0; transition:opacity .2s; }
.picker.open .picker-backdrop{ opacity:1; }
.picker-panel{
  position:absolute; left:0; right:0; bottom:0; background:#0f1a33; color:#fff;
  border-top-left-radius:16px; border-top-right-radius:16px; box-shadow:0 -16px 40px rgba(0,0,0,.5);
  transform:translateY(100%); transition:transform .25s cubic-bezier(.2,.8,.2,1);
  max-height: calc(80vh - env(safe-area-inset-top,0px)); overflow:auto; -webkit-overflow-scrolling:touch;
}
.picker.open .picker-panel{ transform:translateY(0); }

.picker-header{ display:flex; align-items:center; justify-content:space-between; padding:10px 14px; border-bottom:1px solid #1c2a4d; }
.picker-header h4{ margin:0; font-size:16px; }
.picker-close{ background:transparent; border:0; color:#9fb3d9; font-size:20px; }

.picker-list{ padding:6px 0; }
.picker-item{
  padding:10px 14px; border-bottom:1px solid #142248; cursor:pointer;
  display:flex; flex-direction:column; gap:4px;
}
.picker-item:hover{ background:#0b1630; }
.picker-item .title{ font-weight:700; }
.picker-item .desc{ font-size:13px; color:#a7b7d6; }
.picker-item.active{ background:rgba(14,165,233,.12); }

.picker-footer{ padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px)); display:flex; justify-content:flex-end; }
.btn.ghost{ background:transparent; border:1px solid #2a3a60; color:#c7d2fe; border-radius:10px; padding:8px 12px; }

/* Bandeau SOS actif (top fixed) */
#sos-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000000;
  background: #dc2626; /* rouge */
  color: #fff;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  display: none; /* caché par défaut, JS l'affiche si alerte */
}
#sos-banner .title { font-weight: 800; letter-spacing: .3px; }
#sos-banner .sub   { font-size: 13px; opacity: .9; margin-top: 2px; }
#sos-banner .wrap  { max-width: 900px; margin: 0 auto; }

body.with-sos-banner {
  /* évite que le contenu passe sous le bandeau */
  padding-top: calc(58px + env(safe-area-inset-top, 0px));
}

/* état SOS actif sur le bouton central */
.tabbar .sos-btn.active {
  background: #b91c1c;           /* rouge sombre */
  color: #fff;
  box-shadow: 0 0 0 8px rgba(220,38,38,.25), 0 10px 25px rgba(0,0,0,.35);
}
.tabbar .sos-btn.active::after {  /* badge */
  content: '•';
  position: absolute;
  top: 8px; right: 14px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,.25);
}
.tabbar .sos-btn {
  position: relative;
  transition: transform .15s ease, box-shadow .25s ease, background .25s ease;
}

#sos-active-popup {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.6);
  z-index: 2000000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sos-popup {
  background: #fff;
  color: #111;
  border-radius: 14px;
  padding: 20px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  animation: popupIn .25s ease;
}

.sos-popup h2 {
  margin: 0 0 8px;
  font-size: 20px;
  color: #b91c1c;
}

.sos-popup p {
  margin: 0 0 18px;
  font-size: 15px;
}

.sos-popup .actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.sos-popup .btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.sos-popup .btn.btn-danger {
  background: #dc2626;
  color: #fff;
}

@keyframes popupIn {
  from { transform: scale(.9); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.sos-reasons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sos-reason {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #1e293b;       /* bleu nuit */
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
}

.sos-reason input[type="radio"] {
  margin-top: 2px;
  transform: scale(1.2);
}

/* ---- UI locale (déplaçable dans style.css) ---- */
    .page { padding: 14px; }
    .card { background:#0f1a33; color:#fff; border-radius:16px; padding:16px; }
    .section-title { font-weight:800; margin:6px 0 10px; font-size:16px; }
    .muted { color:#a7b7d6; font-size:13px; }

    /* Sélecteur déroulant (trigger) */
    .select-trigger{
      display:flex; align-items:center; justify-content:space-between;
      padding:14px 16px; border-radius:12px;
      background:#0b1a34; border:1px solid #223056; color:#fff;
      font-size:16px; cursor:pointer;
    }
    .select-trigger .lbl { opacity:.95; }
    .select-trigger .chev{
      width:18px; height:18px; opacity:.7;
      border:2px solid #8aa0d1; border-left:0; border-top:0;
      transform: rotate(-45deg); margin-left:8px;
    }

    /* Picker plein écran */
    .picker { position:fixed; inset:0; display:none; z-index:2000000; }
    .picker.open { display:block; }
    .picker-backdrop { position:absolute; inset:0; background:rgba(0,0,0,.5); }
    .picker-panel {
      position:absolute; left:0; right:0; bottom:0; background:#0f1a33; color:#fff;
      border-top-left-radius:18px; border-top-right-radius:18px;
      box-shadow:0 -10px 30px rgba(0,0,0,.35); padding:12px 14px 16px;
      max-height:80vh; overflow:auto;
    }
    .picker-title { font-weight:800; margin:8px 0 12px; text-align:center; }
    .picker-actions { display:flex; gap:10px; justify-content:flex-end; margin-bottom:8px; }
    .picker-actions .btn { background:#0b1a34; border:1px solid #223056; color:#fff; padding:8px 10px; border-radius:8px; }
    .picker-item {
      padding:12px 10px; border:1px solid #223056; border-radius:10px;
      background:#0b1a34; margin-bottom:10px; cursor:pointer;
    }
    .picker-item .title { font-weight:700; }
    .picker-item.active { border-color:#3b82f6; box-shadow:0 0 0 2px rgba(59,130,246,.25) inset; }

    .check { display:flex; gap:10px; align-items:flex-start; margin-top:14px; }
    .check input{ width:22px; height:22px; margin-top:3px; accent-color:#0ea5e9; }

    textarea.fin-comment {
      width:100%; padding:12px 14px; border-radius:12px;
      border:1px solid #223056; background:#0b1a34; color:#fff; font-size:16px;
    }

    /* Slider vert "FIN" */
    .slider-wrap{ position:relative; margin-top:16px; padding:10px 0; }
    .slider-label{ display:block; text-align:center; margin-bottom:8px; color:#c7d2fe; font-weight:700; }
    #endSlider{
      -webkit-appearance:none; appearance:none;
      width:100%; height:58px; background:#132041; border:1px solid #23345d;
      border-radius:32px; outline:none; position:relative;
    }
    #endSlider::-webkit-slider-thumb{
      -webkit-appearance:none; appearance:none;
      width:92px; height:92px; border-radius:50%;
      background:#10b981; /* vert */
      border:5px solid #0f1a33;
      box-shadow:0 10px 20px rgba(16,185,129,.35), 0 2px 6px rgba(0,0,0,.5);
    }
    #endSlider::-moz-range-thumb{
      width:92px; height:92px; border-radius:50%;
      background:#10b981; border:5px solid #0f1a33;
      box-shadow:0 10px 20px rgba(16,185,129,.35), 0 2px 6px rgba(0,0,0,.5);
    }
    .slider-bubble{
      position:relative; transform: translateY(-74px);
      width:92px; height:0; margin-left:10px; pointer-events:none;
      display:flex; align-items:center; justify-content:center;
      font-weight:900; font-size:16px; letter-spacing:.3px; color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.6);
    }

    .topbar { padding: 18px 16px calc(8px + env(safe-area-inset-top,0px)); }
    .topbar h1 { margin:0; color:#fff; font-size:28px; text-align:center; }
	
.btn {
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px; padding:12px 14px; border-radius:10px; border:0;
  background:#0ea5e9; color:#fff; font-weight:700; text-decoration:none;
}
.btn:hover { filter:brightness(1.05); }
.btn-block { width:100%; }
.btn-outline {
  background:transparent; color:#e5e7eb; border:1px solid #334155;
}

.section-title {
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 16px;
}
.helper-item {
  padding: 10px 12px;
  border-radius: 8px;
  background: #0b1a34;
  margin-bottom: 8px;
  color: #fff;
}
.helper-name {
  font-weight: 600;
}
.helper-status {
  font-size: 13px;
  color: #9ca3af;
}

.sos-geo-banner {
  background: #1f2937; /* gris bleu foncé */
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
}
.sos-geo-title {
  font-weight: 800;
  margin-bottom: 6px;
  color: #fca5a5; /* rouge doux */
}
.sos-geo-text {
  font-size: 14px;
  color: #d1d5db;
  margin-bottom: 8px;
}
.sos-geo-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: #e5e7eb;
}
.hidden { display: none !important; }

#devmap {
  width: 100%;
  height: 100%;
}
.map-widget {
  position: absolute;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-widget.bottom-left {
  bottom: 12px;
  left: 12px;
}
/* === Compteur de vitesse BoatAssist === */
.ba-speed-widget {
  position: fixed;
  left: 12px;
  bottom: 72px; /* <-- avant 12px, monte de ~60px pour dégager la tabbar */
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0b1120 0%, #0e3c8a 55%, #0ea5e9 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  z-index: 2000; /* au-dessus de la tabbar */
}

.ba-speed-widget .ba-speed-value{
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
}
.ba-speed-widget .ba-speed-unit{
  font-size: 11px;
  opacity: .9;
  margin-top: 2px;
}

/* Optionnel : si tu as d'autres widgets en bas-gauche, ajoute un léger décalage */
#nearby-counter.map-widget.bottom-left{
  bottom: 84px; /* espace au-dessus du speedo */
}

/* Pin rouge simple */
.alert-pin {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #ef4444; /* rouge */
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.alert-pin:hover { transform: scale(1.05); }

/* Popup */
.alert-popup { font: 14px/1.3 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; min-width: 200px; }
.alert-popup .ap-title { font-weight: 600; margin-bottom: 4px; }
.alert-popup .ap-meta { color: #64748b; font-size: 12px; margin-bottom: 8px; }
.alert-popup .ap-btn {
  appearance: none; border: 0; cursor: pointer;
  padding: 8px 10px; border-radius: 10px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb); color: #fff; font-weight: 600;
}
