:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --panel-2: #232730;
  --text: #e9ecf1;
  --muted: #9aa3b2;
  --primary: #34E0A1;
  --primary-h: #2bc48d;
  --primary-text: #0a3d2a;
  --danger: #ef4d4d;
  --ok: #2dbe7b;
  --warn: #f5a623;
  --border: #2b303b;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Segoe UI", "Tahoma", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

/* Ajustements RTL spécifiques */
[dir="rtl"] .check-line input[type="checkbox"] { margin-left: 4px; }
[dir="rtl"] .loc-instructions { text-align: right; }
[dir="rtl"] .loc-instructions ol { padding-right: 18px; padding-left: 0; }
[dir="rtl"] .welcome-points { text-align: right; }
[dir="rtl"] .chat-input-row input { text-align: right; }
[dir="rtl"] .field input { text-align: right; }
[dir="rtl"] input[type="tel"], [dir="rtl"] .phone { direction: ltr; text-align: left; unicode-bidi: embed; }

#map-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
}

.panel {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 280px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  background: rgba(26, 29, 36, 0.95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px 10px;
  z-index: 1000;
  box-shadow: var(--shadow);
}

/* Wizard — panneau bas-droite compact, sans scroll */
.wizard-panel {
  top: auto;
  bottom: 50px;
  left: auto;
  right: 12px;
  width: 290px;
  max-width: calc(100vw - 24px);
  max-height: none;
  overflow-y: visible;
  border-radius: 16px;
  padding: 12px 12px 14px;
}
.wizard-progress { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 12px; }
.wp-step { width: 24px; height: 24px; border-radius: 50%; background: var(--panel-2); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--muted); flex-shrink: 0; transition: all 0.2s; }
.wp-step.active { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.wp-line { flex: 1; height: 2px; background: var(--border); max-width: 36px; }
.wizard-step { animation: fadeIn 0.2s ease; }
.wizard-title { font-size: 15px; font-weight: 700; margin: 0 0 10px; color: var(--text); }
.wizard-next { width: 100%; margin-top: 8px; }
.wizard-nav .wizard-next { width: auto; margin-top: 0; }
.wizard-nav { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.wizard-nav .primary { width: 100%; }
.wizard-nav .ghost-btn { width: 100%; text-align: center; }
.wizard-panel .field { margin-bottom: 6px; }
.wizard-panel .field label { font-size: 12px; margin-bottom: 3px; }
.wizard-panel input[type="text"],
.wizard-panel input[type="tel"] { padding: 8px 10px; font-size: 14px; }

.panel header { margin-bottom: 10px; }
.panel h1 { margin: 0; font-size: 17px; letter-spacing: 0.2px; }
.panel .sub { margin: 2px 0 0; color: var(--muted); font-size: 11px; }

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.fold-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  transition: background 0.15s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fold-btn:hover { background: var(--border); }
.panel.collapsed .fold-btn { transform: rotate(180deg); }
.panel.collapsed .panel-body { display: none; }
.panel.collapsed .sub { display: none; }
.panel.collapsed header { margin-bottom: 0; }
.panel.collapsed { padding: 10px 14px; width: auto; min-width: 200px; max-height: none; overflow: visible; }

.field { margin-bottom: 8px; }
.field-row { display: flex; gap: 8px; }
.field-row .field { flex: 1; margin-bottom: 8px; }

.field label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 3px;
}

.field input {
  width: 100%;
  padding: 7px 9px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus { border-color: var(--primary); }

.role-switch, .seats, .gender-switch { display: flex; gap: 6px; }

.role-btn, .seat-btn, .gender-btn {
  flex: 1;
  padding: 7px 4px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}
.gender-btn:hover { border-color: var(--primary); }
.gender-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
}
.gender-btn[data-gender="F"].active {
  background: #e91e63;
  border-color: #e91e63;
}
.field label .opt { color: var(--muted); text-transform: none; font-size: 9px; }

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 10px;
  background: rgba(233, 30, 99, 0.08);
  border: 1px solid rgba(233, 30, 99, 0.35);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}
.check-line input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: #e91e63;
}
.check-line small { color: var(--muted); font-size: 10px; margin-left: 4px; text-transform: none; }
.check-line.check-line-blue {
  background: rgba(79, 124, 255, 0.10);
  border-color: rgba(79, 124, 255, 0.35);
}
.check-line.check-line-blue input[type="checkbox"] { accent-color: var(--primary); }

.role-btn:hover, .seat-btn:hover { border-color: var(--primary); }
.role-btn.active, .seat-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
}

.hint { font-size: 11px; color: var(--muted); margin-bottom: 4px; }

.dest {
  padding: 7px 10px;
  background: var(--panel-2);
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.dest.has-value {
  color: var(--text);
  border-style: solid;
  border-color: var(--ok);
}

.dest-meta {
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
  padding: 5px 8px;
  background: var(--panel-2);
  border-radius: 6px;
}

/* Recherche destination */
.dest-search-wrap { position: relative; }
.dest-search-wrap input {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  box-sizing: border-box;
}
.dest-search-wrap input:focus { border-color: var(--primary); outline: none; }
.dest-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  list-style: none;
  margin: 0; padding: 4px 0;
  z-index: 2000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  max-height: 200px;
  overflow-y: auto;
}
.dest-suggestions li {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dest-suggestions li:last-child { border-bottom: none; }
.dest-suggestions li:hover { background: var(--panel-2); }
.sug-name { font-weight: 600; color: var(--text); }
.sug-city { font-size: 12px; color: var(--muted); }
.sug-empty { color: var(--muted); font-size: 13px; cursor: default; }
.sug-empty:hover { background: none; }
.sug-map-pick { border-top: 1px solid var(--border) !important; background: var(--panel-2); }
.sug-map-pick .sug-name { color: var(--primary); }
.dest-or { text-align: center; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }

button.primary, button.danger {
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s, transform 0.05s;
}

button.primary { background: var(--primary); color: var(--primary-text); }
button.primary:hover:not(:disabled) { background: var(--primary-h); }
button.primary:disabled {
  background: #2b303b;
  color: var(--muted);
  cursor: not-allowed;
}

button.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
button.danger:hover { background: rgba(239, 77, 77, 0.1); }
button:active:not(:disabled) { transform: scale(0.98); }

/* Bouton partage trajet */
.share-btn {
  display: block;
  width: 100%;
  padding: 9px;
  border: 1px solid #25d366;
  border-radius: 8px;
  background: rgba(37, 211, 102, 0.08);
  color: #25d366;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s;
}
.share-btn:hover { background: rgba(37, 211, 102, 0.18); }

/* Bouton SOS */
.sos-btn {
  display: block;
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 8px;
  background: var(--danger);
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(239, 77, 77, 0.35);
  animation: pulseSOS 2s ease-in-out infinite;
}
.sos-btn:hover { background: #ff5e5e; }
@keyframes pulseSOS {
  0%, 100% { box-shadow: 0 4px 12px rgba(239, 77, 77, 0.35), 0 0 0 0 rgba(239, 77, 77, 0.5); }
  50% { box-shadow: 0 4px 12px rgba(239, 77, 77, 0.35), 0 0 0 8px rgba(239, 77, 77, 0); }
}

.legal {
  margin: 8px 0 0;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}

.active-panel { width: 280px; }

.counters {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.counters > div {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
}

.counters strong { display: block; font-size: 18px; font-weight: 700; }
.counters span {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.4px;
}

.mode-banner {
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  background: rgba(79, 124, 255, 0.12);
  border: 1px solid rgba(79, 124, 255, 0.3);
  color: #c9d6ff;
}
.meet-marker {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #0f172a;
  border: 2px solid #34E0A1;
  border-radius: 20px;
  padding: 3px 8px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  color: #34E0A1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.meet-icon { font-size: 14px; }
.meet-dist { color: white; }
.dropoff-marker { border-color: #f97316; color: #f97316; }

/* Meilleur conducteur — surbrillance verte pulsante */
.best-match .marker-wrap {
  box-shadow: 0 0 0 3px #16A34A, 0 2px 10px rgba(22,163,74,0.5);
  animation: best-match-pulse 1.8s ease-in-out infinite;
}
@keyframes best-match-pulse {
  0%, 100% { box-shadow: 0 0 0 3px #16A34A, 0 2px 10px rgba(22,163,74,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(22,163,74,0.3), 0 2px 16px rgba(22,163,74,0.6); }
}

.mode-banner.intercity {
  background: rgba(245, 166, 35, 0.12);
  border-color: rgba(245, 166, 35, 0.4);
  color: #ffe1b5;
}

.passengers-list {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.passenger-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  transition: background 0.15s, border-color 0.15s;
}
.passenger-row.clickable { cursor: pointer; }
.passenger-row.clickable:hover {
  background: #2b303b;
  border-color: var(--primary);
}
.passenger-row .name { font-weight: 600; }
.passenger-row .price { color: var(--ok); font-weight: 600; }
.passenger-row .row-unread {
  display: inline-block;
  margin-left: 4px;
  background: var(--danger);
  color: white;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
}

/* Info card + chat */
.info-card {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  z-index: 1100;
  box-shadow: var(--shadow);
  text-align: center;
}

.info-card .close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  color: var(--muted);
  border: none;
  font-size: 22px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
}
.info-card .close:hover { background: var(--panel-2); color: var(--text); }

.info-icon { font-size: 52px; margin-bottom: 10px; }
.info-card h3 { margin: 4px 0 4px; font-size: 26px; }
.info-role {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.info-card .phone {
  display: inline-block;
  padding: 14px 22px;
  font-size: 17px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  margin-bottom: 8px;
}
.info-card .phone:hover { background: var(--primary-h); }
.info-meta { font-size: 16px; color: var(--muted); margin-bottom: 14px; }

.pickup-btn {
  display: block;
  width: 100%;
  padding: 10px;
  margin: 8px 0 4px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: var(--ok);
  color: #062117;
  transition: background 0.15s, transform 0.05s;
}
.pickup-btn:hover { background: #3ed18a; }
.pickup-btn.accepted {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.pickup-btn.accepted:hover { background: rgba(239, 77, 77, 0.08); }
.pickup-btn:disabled { opacity: 0.6; cursor: wait; }
.pickup-btn:active:not(:disabled) { transform: scale(0.98); }

.home-pickup-btn {
  display: block;
  width: 100%;
  padding: 9px 10px;
  margin: 4px 0;
  border-radius: 10px;
  border: 1px solid #f97316;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: #f97316;
  transition: background 0.15s, transform 0.05s;
}
.home-pickup-btn:hover { background: rgba(249,115,22,0.1); }
.home-pickup-btn.active { background: rgba(249,115,22,0.15); }
.home-pickup-btn:disabled { opacity: 0.5; cursor: wait; }
.home-pickup-btn:active:not(:disabled) { transform: scale(0.98); }

.chat-section {
  margin-top: 12px;
  text-align: left;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.chat-header {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.chat-messages {
  max-height: 200px;
  min-height: 80px;
  overflow-y: auto;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 16px 0;
}
.chat-msg {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 10px;
  max-width: 80%;
  word-wrap: break-word;
}
.chat-msg.them {
  align-self: flex-start;
  background: #2d3340;
  color: var(--text);
}
.chat-msg.me {
  align-self: flex-end;
  background: var(--primary);
  color: white;
}
.chat-msg .meta {
  display: block;
  font-size: 10px;
  opacity: 0.6;
  margin-top: 2px;
}
.chat-input-row { display: flex; gap: 6px; }
.chat-input-row input {
  flex: 1;
  padding: 8px 10px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}
.chat-input-row input:focus { border-color: var(--primary); }
.chat-input-row button {
  padding: 8px 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.chat-input-row button:hover { background: var(--primary-h); }

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 2000;
  box-shadow: var(--shadow);
}

/* Marker custom */
.marker-wrap {
  position: relative;
  width: 38px;
  height: 52px;
  will-change: transform;
}
/* Marqueurs voiture : conteneur carré pour que la rotation ne déforme pas le SVG.
   La diagonale du SVG voiture (~72px) détermine la taille minimale.
   Sans ce carré, la boîte englobante change à chaque angle et la voiture semble se déformer. */
.marker-wrap.car-wrap {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--marker-bg, #34E0A1);
  color: white;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.15s;
  position: relative;
  border: none;
}
.marker-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s ease;
  transform-origin: center;
}
/* Pin tail */
.marker::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 13px solid var(--marker-bg, #34E0A1);
}

.marker.me-driver {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  width: 40px;
  height: 58px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.38));
}
.marker.me-driver::after { display: none; }
.marker.me-passenger {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  width: 34px;
  height: 50px;
  filter: drop-shadow(0 3px 7px rgba(0,0,0,0.32));
}
.marker.me-passenger::after { display: none; }
.marker.other-driver {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  width: 42px;
  height: 58px;
  filter: drop-shadow(0 3px 7px rgba(0,0,0,0.3));
}
.marker.other-driver::after { display: none; }
.marker.other-driver.ambient { opacity: 0.5; filter: drop-shadow(0 3px 7px rgba(0,0,0,0.2)) grayscale(30%); }
.marker.other-passenger{ --marker-bg: var(--warn); }
.marker-wrap.is-female .marker.other-passenger { --marker-bg: #e91e63; }
.marker.other-passenger.ambient{ --marker-bg: #FF8C00; opacity: 0.6; }
.marker-wrap.ambient { filter: grayscale(20%); }
.marker.destination { --marker-bg: var(--danger); width: 30px; height: 30px; }
.marker:hover { transform: scale(1.1); }

/* Marqueur "femme" : petit point rose en haut à droite de l'icône */
.marker-wrap.is-female::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #e91e63;
  border: 2px solid white;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

/* Badge above passenger marker (seats + price) */
.marker-badge {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--warn);
  color: #1a1d24;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.marker-badge::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--warn);
}

.leaflet-container { background: #1a1d24; }

/* Bouton discret "Statistiques" en bas à gauche */
.stats-link {
  position: fixed;
  bottom: 12px;
  left: 12px;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px 7px 9px;
  background: rgba(26, 29, 36, 0.78);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.55;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: opacity 0.15s, background 0.15s, border-color 0.15s;
}
.stats-link:hover, .stats-link:active {
  opacity: 1;
  background: rgba(26, 29, 36, 0.96);
  border-color: var(--primary);
}
.stats-link .ico { font-size: 14px; line-height: 1; }
.stats-link .lbl { font-size: 11px; letter-spacing: 0.3px; }

@media (max-width: 480px) {
  .stats-link { bottom: 10px; left: 10px; padding: 6px 10px; }
  .stats-link .lbl { display: none; }
  .stats-link .ico { font-size: 16px; }
}

/* Boutons zoom (en haut à droite, hors carte rotative) */
.zoom-btns {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.zoom-btns button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(26, 29, 36, 0.92);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.zoom-btns button:hover { border-color: var(--primary); }
.zoom-btns button#compassBtn.active { border-color: var(--primary); background: rgba(59, 130, 246, 0.25); }

/* Mapbox GL canvas */
.mapboxgl-canvas { display: block; width: 100% !important; height: 100% !important; }
.mapboxgl-ctrl-attrib, .mapboxgl-ctrl-logo { display: none !important; }

/* Gros banner notification de message */
.big-toast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #4f7cff 0%, #2dbe7b 100%);
  color: white;
  padding: 18px 20px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  z-index: 2500;
  transform: translateY(-100%);
  transition: transform 0.35s cubic-bezier(0.21, 1.02, 0.74, 1);
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.big-toast.show { transform: translateY(0); }
.big-toast .who { font-size: 13px; opacity: 0.9; font-weight: 600; margin-bottom: 2px; }
.big-toast .body { font-size: 16px; }

/* Modal d'arrivée à destination */
.arrival-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}
/* IMPORTANT : sans cette règle, display:flex écrase l'attribut hidden
   et le modal reste visible en permanence. */
.arrival-modal[hidden] { display: none !important; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.arrival-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn { from { transform: scale(0.85); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.arrival-icon { font-size: 56px; margin-bottom: 8px; }
.arrival-card h2 { margin: 0 0 8px; font-size: 22px; color: var(--ok); }
.arrival-card p { margin: 0 0 6px; font-size: 14px; color: var(--text); }
.arrival-countdown { color: var(--muted); font-size: 12px; margin-top: 12px !important; margin-bottom: 18px !important; }
.arrival-countdown strong { color: var(--warn); font-size: 16px; }
.arrival-card .primary { margin-top: 8px; }
.ghost-btn {
  display: block;
  width: 100%;
  padding: 9px;
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 6px;
  text-decoration: underline;
}
.ghost-btn:hover { color: var(--text); }

/* Liste à puces de la modale d'accueil */
.welcome-points {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.welcome-points li { padding: 3px 0; line-height: 1.5; }

/* Gros boutons de choix dans la modale d'accueil */
.big-choice {
  width: 100%;
  padding: 14px 14px !important;
  font-size: 15px !important;
  margin-top: 14px !important;
  line-height: 1.3;
}
.big-choice small {
  display: block;
  font-size: 11px;
  opacity: 0.85;
  font-weight: 500;
  margin-top: 2px;
}
.big-choice.secondary {
  background: var(--panel-2) !important;
  border: 1px solid var(--primary);
  color: var(--text) !important;
}
.big-choice.secondary:hover { background: #2b303b !important; }
.choice-hint {
  font-size: 11px !important;
  color: var(--muted) !important;
  margin: 4px 0 0 !important;
  text-align: center;
}

/* Bouton d'aide géoloc dans le panneau setup */
.help-geo-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.help-geo-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(79, 124, 255, 0.08);
}

/* Instructions visuelles pour réactiver la localisation */
.loc-instructions {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0 18px;
  text-align: left;
  font-size: 13px;
  line-height: 1.6;
}
.loc-instructions strong { color: var(--primary); }
.loc-instructions ol { padding-left: 18px; margin: 6px 0; }
.loc-instructions li { margin-bottom: 4px; }
.loc-instructions .hint { color: var(--muted); font-size: 11px; margin-top: 8px; font-style: italic; }
/* Carte adresse point de ramassage (passager) */
.pickup-address-card {
  background: var(--panel-2);
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  text-align: center;
}
.pickup-addr-title { font-size: 12px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.pickup-addr-name { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 10px; line-height: 1.4; }
.pickup-addr-loading { font-size: 14px; color: var(--muted); }
.pickup-addr-btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.pickup-addr-btn:hover { background: var(--primary-h); }

.denied-step { margin-bottom: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.denied-step-title { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.denied-step ol { margin: 0; padding-right: 18px; padding-left: 0; }
.denied-step li { font-size: 14px; margin-bottom: 5px; line-height: 1.5; }
.denied-step .hint { color: var(--muted); font-size: 12px; margin-top: 6px; font-style: italic; }

/* Indicateur de messages non-lus dans le badge marker (style spécifique) */
.marker-wrap.has-unread .marker {
  animation: pulseDot 1.6s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(239, 77, 77, 0.6); }
  50% { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35), 0 0 0 8px rgba(239, 77, 77, 0); }
}

@media (max-width: 480px) {
  .panel {
    width: 260px;
    left: 8px;
    top: 8px;
    padding: 10px;
  }
  .wizard-panel {
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    max-height: 60vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 18px 18px 0 0 !important;
    padding: 14px 16px calc(20px + env(safe-area-inset-bottom)) 16px !important;
  }
  .wizard-panel .panel-body { box-sizing: border-box; width: 100%; }
  .panel h1 { font-size: 15px; }
  .zoom-btns { top: 8px; right: 8px; }
  .zoom-btns button { width: 32px; height: 32px; font-size: 16px; }
  .big-toast { padding: 14px 16px; font-size: 14px; }
}
