html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

#map {
  position: absolute;
  inset: 0;
  height: 100dvh;
  background: #e5e7eb;
}

.safe-top { padding-top: max(0.5rem, env(safe-area-inset-top)); }
.safe-bottom { padding-bottom: max(1rem, env(safe-area-inset-bottom)); }

.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Boutons icônes */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  color: #374151;
  background: #f3f4f6;
  transition: background 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover { background: #e5e7eb; }

/* Sélecteur d'espèces (chips radio) */
.species-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  white-space: nowrap;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  border-radius: 9999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.15s;
}
.species-chip:hover { border-color: #a7f3d0; }
.species-chip[aria-checked="true"] {
  background: #065f46;
  border-color: #065f46;
  color: #fff;
  box-shadow: 0 1px 3px rgba(6, 95, 70, 0.35);
}
.chip-dot {
  width: 0.7rem;
  height: 0.7rem;
  flex-shrink: 0;
  border-radius: 9999px;
  box-shadow: 0 0 0 2px #fff;
}
.all-dot { background: conic-gradient(#92400e, #d97706, #1f2937, #ca8a04, #92400e); }

/* Liste déroulante d'espèces */
.sp-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.sp-row:hover { background: #ecfdf5; }
.sp-all { font-weight: 600; border-bottom: 1px solid #e5e7eb; }
.sp-check { width: 1.1rem; height: 1.1rem; accent-color: #047857; }

/* Filtre de probabilité minimale */
.min-chip {
  flex: 1; padding: 0.3rem 0; border-radius: 9999px; border: 1px solid #e5e7eb;
  background: #fff; font-size: 11px; font-weight: 600; color: #374151;
}
.min-chip[aria-pressed="true"] { background: #065f46; border-color: #065f46; color: #fff; }

/* Fonds de carte en noir & blanc */
.tiles-gray { filter: grayscale(1) contrast(1.05) brightness(1.08); }

/* Ligne d'espèce dans le panneau */
.sp-line {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  padding: 0.4rem 0.5rem; border-radius: 0.75rem; border: 1px solid #e5e7eb;
  background: #fff; text-align: left; font-size: 0.8125rem;
}
.sp-line[aria-pressed="true"] { border-color: #047857; background: #ecfdf5; box-shadow: 0 0 0 1px #047857 inset; }

/* Curseur de date */
.day-range {
  --fill: 0%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 9999px;
  background: linear-gradient(to right, #047857 var(--fill), #e5e7eb var(--fill));
  outline: none;
}
.day-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #047857;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.day-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #047857;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

/* Panneau : bottom sheet (mobile) / colonne latérale (≥ md) */
#panel {
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 72dvh;
  border-radius: 1.25rem 1.25rem 0 0;
  transform: translateY(105%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#panel.open { transform: translateY(0); }

@media (min-width: 768px) {
  #panel {
    left: auto;
    top: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    width: 24rem;
    max-height: none;
    border-radius: 1.25rem;
    transform: translateX(calc(100% + 1.5rem));
  }
  #panel.open { transform: translateX(0); }
}

/* Graphique de pluie : barres de prévision hachurées */
.bar-forecast {
  background: repeating-linear-gradient(135deg, #7dd3fc 0 3px, #bae6fd 3px 6px);
}
.today-col { position: relative; }
.today-col::before {
  content: "auj.";
  position: absolute;
  top: -2px;
  left: -3px;
  font-size: 8px;
  color: #6b7280;
  border-left: 1px dashed #9ca3af;
  padding-left: 2px;
  height: 100%;
}

/* Contrôle de géolocalisation */
.locate-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #1f2937;
  cursor: pointer;
}
.locate-btn:hover { background: #f4f4f4; }
.locate-btn.active { color: #1a73e8; }

/* Point de géolocalisation */
.me-marker { background: none; border: 0; }
.me-dot {
  position: absolute; inset: 3px; border-radius: 50%;
  background: #1a73e8; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.5);
}
.me-pulse {
  position: absolute; inset: 0; border-radius: 50%; background: rgba(26,115,232,.45);
  animation: me-pulse 2s ease-out infinite;
}
@keyframes me-pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #d1fae5;
  border-top-color: #047857;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.leaflet-tooltip { font-size: 12px; }
.leaflet-container { font-family: inherit; }
.leaflet-bottom.leaflet-left .leaflet-control { margin-bottom: 0; }
