@charset "UTF-8";
html { background: #0b161e; }
body { margin:0; padding:0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size:16px; background: #0b161e; }

/* Allow text selection inside user auth popup */
#user-auth-popup,
#user-auth-popup * {
  user-select: text !important;
  -webkit-user-select: text !important;
  -ms-user-select: text !important;
}

/* Desktop: ouvrir liste/galerie comme vrai overlay au-dessus de la map/header. */
@media screen and (min-width: 769px) {
  body.desktop-list-gallery-overlay-open {
    overflow: hidden !important;
    height: 100dvh;
  }

  body.desktop-list-gallery-overlay-open .impacts-list.active,
  body.desktop-list-gallery-overlay-open .gallery-view.active {
    z-index: 6200 !important;
    overscroll-behavior: contain;
  }

  body.desktop-list-gallery-overlay-open .map-header,
  body.desktop-list-gallery-overlay-open .map-subtitle-section,
  body.desktop-list-gallery-overlay-open .map-title-logo {
    z-index: 1100 !important;
  }
}

#admin-auth-popup,
#admin-auth-popup * {
  user-select: text !important;
  -webkit-user-select: text !important;
  -ms-user-select: text !important;
}

#account-buttons-container,
#user-login-btn,
#pwa-install-btn {
  pointer-events: auto !important;
  z-index: 300000;
  position: relative;
}
#map { position:absolute; top:0; bottom:85px; left:0; right:0; }
#map.timeline-collapsed { bottom:20px; }

/* ✅ POPUP DE BIENVENUE */
.welcome-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.welcome-popup-overlay.show {
  display: flex;
}

.welcome-popup-content {
  background: linear-gradient(135deg, #1c2b36, #26343f);
  border-radius: 15px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
  border: 2px solid #4fc3f7;
  animation: popupSlideIn 0.4s ease-out;
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(50px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.welcome-popup-header {
  padding: 25px 30px 15px;
  border-bottom: 1px solid #4fc3f7;
  text-align: center;
}

.welcome-popup-header h2 {
  color: #4fc3f7;
  margin: 0;
  font-size: 22px;
  font-weight: bold;
}

.welcome-popup-body {
  padding: 20px 25px;
  color: #eee;
  line-height: 1.5;
}

.welcome-popup-body h3 {
  color: #4fc3f7;
  margin: 20px 0 10px 0;
  font-size: 18px;
}

.welcome-popup-body ul {
  margin: 15px 0;
  padding-left: 0;
  list-style: none;
}

.welcome-popup-body li {
  margin: 8px 0;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(79, 195, 247, 0.1);
}

.welcome-popup-body p {
  margin: 15px 0;
}

.welcome-popup-footer {
  padding: 1px 50px 20px;
  text-align: center;
}

.welcome-understand-btn {
  background: #4fc3f7;
  color: #000;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 150px;
}

.welcome-understand-btn:hover {
  background: #29b6f6;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(79, 195, 247, 0.4);
}

.cookie-consent-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 96px;
  z-index: 9800;
  display: none;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(79, 195, 247, 0.65);
  background: rgba(15, 25, 32, 0.96);
  color: #e7f5ff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.cookie-consent-bar.show {
  display: flex;
}

.cookie-consent-text {
  margin: 0;
  flex: 1;
  font-size: 13px;
  line-height: 1.45;
}

.cookie-consent-text a {
  color: #7dd9ff;
  font-weight: 700;
}

.cookie-consent-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-consent-btn {
  border-radius: 8px;
  border: 1px solid rgba(125, 217, 255, 0.5);
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.cookie-consent-btn-secondary {
  background: rgba(10, 21, 29, 0.85);
  color: #d7ecf7;
}

.cookie-consent-btn-primary {
  background: #4fc3f7;
  color: #001019;
  border-color: #4fc3f7;
}

body.fz-intro-overlay-open .pwa-hint {
  display: none !important;
}

.pwa-hint {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 96px;
  z-index: 1200;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(79, 195, 247, 0.65);
  background: rgba(18, 31, 40, 0.96);
  color: #e7f5ff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.pwa-hint.show {
  display: flex;
}

.pwa-hint-text {
  flex: 1;
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.pwa-hint-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pwa-hint-install {
  border: 1px solid #4fc3f7;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  padding: 7px 10px;
  color: #001019;
  background: #4fc3f7;
  font-weight: 700;
}

@media screen and (min-width: 769px) {
  .cookie-consent-bar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(760px, calc(100vw - 28px));
    max-width: 760px;
    bottom: 18px;
  }

  .pwa-hint {
    left: auto;
    right: 14px;
    max-width: 430px;
    bottom: 18px;
  }
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
  #gallery-popup .gallery-close-float {
    display: none !important;
  }
  .cookie-consent-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .cookie-consent-actions {
    justify-content: flex-end;
  }

  .welcome-popup-content {
    max-width: 95%;
    margin: 10px;
  }
  
  .welcome-popup-header,
  .welcome-popup-body,
  .welcome-popup-footer {
    padding: 20px;
  }
  
  .welcome-popup-header h2 {
    font-size: 18px;
  }
  
  .welcome-popup-body h3 {
    font-size: 14px;
  }
}

.required-asterisk {
  color: red;
  font-weight: bold;
  margin-left: 2px;
}

.map-header {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  z-index: 1100;
  max-width: 90vw;
  padding: 8px 20px;
  border-radius: 15px;
  background: rgba(28, 43, 54, 0.8);
}

.map-title {
    color: #4fc3f7 !important;
    padding: 16px 32px !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    text-align: center !important;
    margin: 0 !important;
    letter-spacing: 3px !important;
    
    /* Glow très discret sur le texte uniquement */
    text-shadow: 
        0 0 8px rgba(79, 195, 247, 0.4),
        0 0 16px rgba(79, 195, 247, 0.2) !important;
}

/* Responsive mobile */
@media screen and (max-width: 768px) {
    .map-title {
        font-size: 18px !important;
        padding: 12px 20px !important;
        letter-spacing: 2px !important;
        
        /* Glow encore plus discret sur mobile */
        text-shadow: 
            0 0 6px rgba(79, 195, 247, 0.3),
            0 0 12px rgba(79, 195, 247, 0.15) !important;
    }
}

/* Section sous-titre séparée */
.map-subtitle-section {
  position: absolute;
  top: 70px; /* En dessous du header */
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
}

/* Sous-titre */
.map-subtitle {
  color: #b0cfe0;
  font-size: 12px;
  font-weight: 400;
  background: rgba(28, 43, 54, 0.75);
  padding: 4px 12px;
  border-radius: 12px;
  text-align: center;
  font-style: italic;
}

/* Version mobile */
@media screen and (max-width: 768px) {
  .map-subtitle-section {
    top: 55px; /* Plus près sur mobile */
  }
  
  .map-subtitle {
    font-size: 10px !important;
    padding: 3px 10px !important;
  }
}

/* Style unifié pour les boutons */
.map-btn {
  background: rgba(28, 43, 54, 1);
  color: #4fc3f7;
  border: 1px solid #4fc3f7;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: all 0.2s;
}

.map-btn:hover {
  background: rgba(79, 195, 247, 0.2);
  transform: scale(1.05);
}

/* Bouton Information - Orange discret */
.map-btn.info-btn:hover {
  background: #ff5f5f65 !important;
  border-color: #ff5f5f65 !important;
  color: #ff5f5f65 !important;
  transform: scale(1.05);
}

/* Bouton Discord - Violet discret */
.map-btn.discord-btn:hover {
  background: rgba(88, 101, 242, 0.3) !important;
  border-color: #7579acff !important;
  color: #5865f2 !important;
  transform: scale(1.05);
}

/* Bouton Tour - Jaune discret */
.map-btn.tour-btn:hover {
  background: rgba(241, 196, 15, 0.3) !important;
  border-color: #e4ce78ff !important;
  color: #e4ce78ff !important;
  transform: scale(1.05);
}

/* Marqueur GPS temporaire draggable - version améliorée mobile */
.temp-gps-marker {
  background: transparent !important;
  border: none !important;
  border-radius: 50% !important;
  width: 30px !important;
  height: 30px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 25px !important;
  font-weight: bold !important;
  cursor: grab !important;
  position: relative !important;
  z-index: 1000 !important;
  user-select: none !important;
  touch-action: manipulation !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  filter: drop-shadow(0 0 6px rgba(79, 195, 247, 0.4)) !important;
  transition: transform 0.15s ease, filter 0.15s ease, margin-top 0.15s ease !important;
  color: #4fc3f7 !important;
}

.temp-gps-marker svg {
  width: 39px !important;
  height: 39px !important;
  display: block !important;
}

.temp-gps-marker:hover {
  filter: drop-shadow(0 0 8px rgba(79, 195, 247, 0.6)) !important;
}

/* Style pendant le drag - décalage vers le bas */
.temp-gps-marker:active,
.leaflet-marker-dragging .temp-gps-marker {
  cursor: grabbing !important;
  transform: scale(1.2) !important;
  filter: drop-shadow(0 0 12px rgba(79, 195, 247, 0.8)) !important;
  margin-top: -10px !important; /* Décale l'épingle vers le bas pendant le drag */
}

/* Amélioration mobile - zone tactile plus grande + décalage plus important */
@media screen and (max-width: 768px) {
  .temp-gps-marker {
    width: 44px !important;
    height: 44px !important;
    font-size: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-tap-highlight-color: transparent !important;
    -ms-touch-action: manipulation !important;
  }

  .temp-gps-marker svg {
    width: 44px !important;
    height: 44px !important;
  }
  
  /* Sur mobile, décaler encore plus vers le bas pendant le drag */
  .temp-gps-marker:active,
  .leaflet-marker-dragging .temp-gps-marker {
    margin-top: 25px !important; /* Plus bas sur mobile pour éviter le doigt */
    transform: scale(1.2) !important; /* Légèrement plus gros aussi */
  }
}

.custom-temp-marker {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.temp-gps-add-btn {
  border: 2px solid rgba(255, 241, 199, 0.95);
  border-radius: 999px;
  background: linear-gradient(135deg, #ffcf3f 0%, #ff9f1a 100%);
  color: #14202b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 10px 14px;
  box-shadow:
    0 8px 20px rgba(15, 22, 30, 0.35),
    0 0 0 0 rgba(255, 179, 0, 0.55);
  transition: transform 0.18s ease, filter 0.2s ease, box-shadow 0.25s ease;
  animation: add-impact-pulse 2.2s ease-in-out infinite;
}

.temp-gps-add-btn:hover {
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.06);
  box-shadow:
    0 10px 26px rgba(15, 22, 30, 0.42),
    0 0 0 8px rgba(255, 179, 0, 0.16);
}

/* Popup d'image pleine page */
.image-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2700;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.image-popup.active {
  display: flex;
}

.image-popup-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-popup img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.image-popup-close {
    position: absolute !important;
    top: 0px !important;
    right: 0px !important;
    background: rgba(15, 34, 46, 0.9) !important;
    color: #dff3ff !important;
    border: 1px solid rgba(79, 195, 247, 0.55) !important;
    border-radius: 8px !important;
    width: 42px !important;
    height: 42px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    z-index: 5000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35) !important;
    transition: border-color .15s ease, background .15s ease, transform .15s ease !important;
}

.image-popup-close:hover {
    border-color: #ff8a8a !important;
    background: rgba(70, 28, 28, 0.95) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35) !important;
}

.image-popup-close:active {
    transform: translateY(0) !important;
}

.image-popup-title {
  color: white;
  margin-top: 15px;
  text-align: center;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 16px;
  border-radius: 20px;
}

/* Mobile */
@media screen and (max-width: 768px) {
  .map-title {
    font-size: 15px !important;
    padding: 0px 0px !important;
    flex-grow: 1 !important;
    width: 100% !important;
    max-width: none !important;
    white-space: nowrap !important;
    line-height: 1.1 !important;
    height: auto !important;
    min-height: 30px !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    display: flex !important; 
    align-items: center !important; 
    text-align: center !important; 
  }
  .map-header {
    gap: 2px !important;
    align-items: center !important;
    min-height: 35px !important;
    padding: 4px 3px !important; 
  }
  .map-btn {
    flex-shrink: 0 !important;
    width: 30px !important;
    height: 30px !important;
    font-size: 14px !important;
    margin: 5px 5px !important;
   }
}

.feedback-btn {
  background: #607d8b !important;
  color: white !important;
}
.feedback-btn:hover {
  background: #546e7a !important;
}

/* Popup formulaire feedback */
.feedback-form-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.feedback-form-popup.active {
  display: flex;
}

.feedback-form-content {
  position: relative;
  width: 800px;
  max-width: 95%;
  min-height: 0;
  max-height: 78dvh;
  height: auto;
  background: linear-gradient(135deg, #1c2b36, #26343f);
  border: 2px solid #4fc3f7;
  border-radius: 14px;
  overflow: visible;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6);
}

.feedback-form-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #607d8b;
  color: #fff;
  cursor: pointer;
  z-index: 2;
  font-size: 18px;
  line-height: 1;
}

.feedback-form-close:hover {
  background: #546e7a;
}

#feedback-form-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  display: block;
}

@media screen and (max-width: 768px) {
  .feedback-form-content {
    width: 95%;
    min-height: 300px;
    max-height: 82dvh;
    height: auto;
    border-radius: 12px;
  }
}

/* Popup Info moderne */
.info-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 400000 !important;
  display: none;
  overflow-y: auto;
  padding: 20px;
}

.info-popup.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-popup-content {
  position: relative;
  z-index: 400001 !important;
  background: linear-gradient(135deg, #1c2b36, #26343f);
  border-radius: 15px;
  max-width: 1200px;  
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  border: 2px solid #4fc3f7;
}

.info-popup-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 20px 25px 15px;
  border-bottom: 1px solid #4fc3f7;
}

.info-popup-header h3 {
  color: #4fc3f7;
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.info-popup-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(28, 43, 54, 0.92);
  color: #dff3ff;
  border: 1px solid rgba(79, 195, 247, 0.65);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.info-popup-close:hover {
  background: rgba(79, 195, 247, 0.16);
  border-color: rgba(79, 195, 247, 0.95);
  transform: scale(1.05);
}

.info-popup-body {
  padding: 20px 25px;
  color: #eee;
  line-height: 1.6;
}

.info-section h4 {
  color: #4fc3f7;
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
}

.info-rules {
  margin: 20px 0;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(79, 195, 247, 0.1);
  border-radius: 8px;
  border-left: 4px solid #4fc3f7;
}

.rule-number {
  color: #4fc3f7;
  font-weight: bold;
  margin-right: 5px;
  min-width: 25px;
}

.rule-text {
  color: #eee;
  font-weight: 600;
}

.info-contact {
  text-align: center;
}

.info-contact a {
  font-size: 1.5em;
  text-decoration: none;
  color: #333;
}

.info-contact h4 {
  color: #D4A574;
  margin: 0 0 8px 0;
}

.info-contact p {
  margin: 0;
  color: #b0cfe0;
}

.info-contact a {
  color: #4fc3f7;
  text-decoration: none;
}

.info-contact a:hover {
  text-decoration: underline;
}

.info-footer {
  text-align: center;
  padding-top: 15px;
  border-top: 1px solid #34495e;
  margin-top: 20px;
  color: #88D973;
  font-style: italic;
}

/* Mobile */
@media screen and (max-width: 768px) {
  .info-popup {
    padding: 10px;
  }

  .info-popup-content {
    margin: 6px;
    max-width: calc(100% - 12px);
  }
  
  .info-popup-header,
  .info-popup-body {
    padding: 12px 14px;
  }
}

/* Bouton vidéo avec largeur adaptée au contenu */
.video-button {
  width: auto !important;
  min-width: auto !important;
  max-width: none !important;
  display: inline-block !important;
  padding: 4px 8px !important;
  white-space: nowrap !important;
}

/* Pour les boutons vidéo dans les popups */
.popup-content .video-button {
  width: fit-content !important;
  margin: 0 !important;
}

/* Pour les boutons vidéo dans la liste des impacts */
.impact-item .video-button {
  width: fit-content !important;
  margin: 0 !important;
}

/* Pour les boutons vidéo dans les fiches mobiles */
.mobile-card .video-button {
  width: fit-content !important;
  margin: 0 !important;
}

/* Panneau latéral repositionné près du bouton */
.filter-panel {
    position: absolute;
    top: 80px;
    right: 60px;
    width: 352px;
    font-weight: 400;
    background: rgba(28,43,54,0.92);
    border-radius: 15px;
  border: 1px solid rgba(152,219,250,0.45);
  box-shadow: 0 8px 26px rgba(0,0,0,0.45), 0 0 18px rgba(79,195,247,0.15);
  backdrop-filter: blur(18px) saturate(115%);
  -webkit-backdrop-filter: blur(18px) saturate(115%);
  z-index: 1402;
  display: flex;
  flex-direction: column;
  max-height: 75vh;
  overflow: hidden;
  transition: width 0.3s;
}

@media screen and (min-width: 769px) {
  .filter-panel {
    position: fixed !important;
    top: 130px !important;
    left: auto !important;
    right: 80px !important;
    width: 370px !important;
    transform: none !important;
    transition: right 0.28s cubic-bezier(.4,0,.2,1) !important;
  }

  #toggle-panel {
    display: none !important;
  }

  .filter-panel-resizer {
    display: none !important;
  }
}
.filter-panel-resizer {
  position: absolute;
  top: 0;
  right: -6px;
  width: 12px;
  height: 100%;
  cursor: ew-resize;
}
.filter-panel-resizer::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  right: 5px;
  width: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
}
@media (max-width: 768px) {
  .filter-panel-resizer {
    display: none;
  }
}
.filter-panel label { display: inline-flex; margin-bottom: 0; }

.filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 16px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(79,195,247,0.1);
}

/* Body scrollable */
.filter-panel-body {
  flex: 1;
  padding: 14px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(79,195,247,0.2) transparent;
}
.filter-panel-body::-webkit-scrollbar { width: 4px; }
.filter-panel-body::-webkit-scrollbar-thumb { background: rgba(79,195,247,0.2); border-radius: 4px; }

/* Section filtre */
.filter-panel-body .filter-section { margin-bottom: 8px; }

/* Bouton fermer panneau */
.filter-panel-close {
  width: 26px; height: 26px; border-radius: 7px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.4); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .14s;
  flex-shrink: 0;
}
.filter-panel-close:hover { background: rgba(255,255,255,0.1); color: rgba(255,255,255,.7); }
.filter-panel-close svg { width: 14px; height: 14px; display: block; }

/* Séparateur de section */
.filter-sep { height: 1px; background: rgba(79,195,247,0.08); margin: 5px 0; border: none; }

/* Inputs date */
.sff-date-row { display: flex; gap: 6px; align-items: center; }
.sff-date-label { font-size: 11.5px; font-weight: 700; color: #4fc3f7; white-space: nowrap; }
.sff-date-input {
  flex: 1; padding: 5px 8px; border: 1px solid rgba(79,195,247,0.3);
  border-radius: 6px; background: rgba(38,52,63,0.9);
  color: #eee; font-size: 11px;
}
.sff-date-sep { color: rgba(176,207,224,0.6); font-size: 12px; }
.sff-date-reset {
  width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.35); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .13s;
}
.sff-date-reset:hover { background: rgba(79,195,247,0.1); color: #4fc3f7; }
.sff-date-reset svg { width: 13px; height: 13px; }

.filter-panel-title {
    color: #dff3ff;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .03em;
  }

  .filter-panel h2 {
    font-weight: 400;
  }

.reset-filters-btn {
  width: 28px; height: 28px; border-radius: 7px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.35); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .14s;
}
.reset-filters-btn:hover { background: rgba(79,195,247,0.1); color: #4fc3f7; }
.reset-filters-btn svg { width: 14px; height: 14px; }

/* Bouton réinitialiser en bas du panneau */
.filter-panel-body .fp-drawer-actions {  
  flex-shrink: 0;
}
.filter-panel-body .fp-drawer-actions button {
  width: 100%;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: background .14s, color .14s;
}
.filter-panel-body .fp-drawer-actions button:hover {
  background: rgba(79,195,247,0.1);
  color: #4fc3f7;
  border-color: rgba(79,195,247,0.3);
}

/* Panneau réduit: masquer totalement toute barre résiduelle */
.filter-panel[style*="width: 0px"],
.filter-panel[style*="width:0px"],
.filter-panel[style*="width: 0;"],
.filter-panel[style*="width:0;"] {
  border: none !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

.filter-panel[style*="width: 0px"] .filter-panel-resizer,
.filter-panel[style*="width:0px"] .filter-panel-resizer,
.filter-panel[style*="width: 0;"] .filter-panel-resizer,
.filter-panel[style*="width:0;"] .filter-panel-resizer {
  display: none !important;
}

/* Boutons côte à côte */
.button-row {
  display: flex;
  gap: 10px;
  margin: 4px 0;
  flex-wrap: wrap;
}

.button-row button {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
  min-width: 80px;
}

.button-row .reset-filters-btn {
  flex: 0 0 36px;
  width: 36px;
  min-width: 36px;
  height: 32px;
  padding: 0;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button { width:100%; padding:8px; margin:8px 0; border:none; border-radius:6px; cursor:pointer; font-weight:bold; }
#list-impacts { background: rgba(22, 64, 92, 0.92); color:#eaf6ff; }
#list-impacts:hover {
  background: #4f7fa2;
  color: #ffffff;
  border-color: #8ed8ff;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(79, 195, 247, 0.22);
  filter: brightness(1.08);
}
#list-impacts {
    padding: 6px !important;
    margin: 0 !important;
    border-radius: 999px !important;
    aspect-ratio: 1 / 1;
}

#list-impacts svg {
    width: 100%;
    height: 100%;
    display: block;
}

#list-impacts { background: rgba(22, 64, 92, 0.92) !important; }
#gallery-impacts { background: rgba(22, 64, 92, 0.92); color:#eaf6ff; }
#gallery-impacts:hover {
  background: #4f7fa2;
  color: #ffffff;
  border-color: #8ed8ff;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(79, 195, 247, 0.22);
  filter: brightness(1.08);
}
#gallery-impacts { background: rgba(22, 64, 92, 0.92) !important; }

@media (hover: hover) and (pointer: fine) {
  #list-impacts:hover,
  #gallery-impacts:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(79, 195, 247, 0.22);
  }
}
.author-multi-select {
  position: relative;
  width: auto;
  max-width: 100%;
}

.author-filter-inline {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  margin-top: 0;
  width: 65%;
  gap: 6px;
}

.author-filter-inline #filter-author {
  flex: 1;
  min-width: 0;
}

.author-page-btn {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: rgba(79,195,247,0.07); border: 1px solid rgba(79,195,247,0.2);
  color: rgba(79,195,247,0.6);
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; transition: background .14s, color .14s;
  margin: 0; padding: 0; box-sizing: border-box;
}
.author-page-btn:hover { background: rgba(79,195,247,0.15); color: #4fc3f7; }
.author-page-btn svg { width: 18px; height: 18px; display: block; }

.author-multi-toggle {
  flex: 1;
  min-width: 0; max-width: 100%;
  padding: 7px 12px;
  border: 1px solid rgba(79,195,247,0.3);
  border-radius: 8px;
  background: rgba(38,52,63,0.9);
  color: #dff3ff; font-size: 12px;
  text-align: left; font-weight: normal;
  cursor: pointer; position: relative;
  appearance: none; -webkit-appearance: none;
  margin: 0;
}

.author-multi-toggle::after {
  content: "?";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ccce6;
  font-size: 10px;
}

.author-multi-options {
  display: none;
  position: fixed !important;
  top: 0;
  left: 0;
  right: auto;
  width: 240px;
  max-height: 180px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #1f2e38;
  border: 1px solid #4fc3f7;
  border-radius: 6px;
  z-index: 5700;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  padding: 4px;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(79, 195, 247, 0.65) rgba(18, 34, 45, 0.6);
}

.author-multi-options::-webkit-scrollbar {
  width: 6px;
}

.author-multi-options::-webkit-scrollbar-track {
  background: rgba(18, 34, 45, 0.6);
  border-radius: 999px;
}

.author-multi-options::-webkit-scrollbar-thumb {
  background: rgba(79, 195, 247, 0.65);
  border-radius: 999px;
}

.author-multi-options::-webkit-scrollbar-thumb:hover {
  background: rgba(79, 195, 247, 0.85);
}

.author-multi-search-wrap {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1f2e38;
  padding: 2px 2px 6px;
}

.author-multi-search {
  width: 100%;
  height: 30px;
  padding: 6px 8px;
  border: 1px solid rgba(79, 195, 247, 0.55);
  border-radius: 5px;
  background: #26343f;
  color: #eaf6ff;
  font-size: 11px;
  outline: none;
  box-sizing: border-box;
}

.author-multi-search:focus {
  border-color: #79d3ff;
  box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
}

.author-multi-empty {
  padding: 6px 8px;
  color: #b7d5e7;
  font-size: 11px;
  text-align: center;
}

.author-multi-select.open .author-multi-options {
  display: block;
}

.author-multi-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  color: #eaf6ff;
  font-size: 11px;
  white-space: nowrap;
  border-radius: 4px;
  cursor: pointer;
}

.author-multi-item:hover {
  background: rgba(79, 195, 247, 0.12);
}

.author-multi-item input {
  margin: 0;
  accent-color: #4fc3f7;
}

#filter-tools-row {
  align-items: stretch;
}

#filter-author-section,
#filter-basemap-section {
  display: flex;
  align-items: stretch;
}

#filter-author-section .filter-section-title {
  width: auto;
  flex-shrink: 0;
  margin-right: 6px;
}

#filter-basemap-section {
  flex: 0 0 auto !important;
}

#filter-author-toggle,
#filter-basemap-section select[name="basemap-select"] {
  height: 28px;
  min-height: 28px;
  margin: 0 !important;
  box-sizing: border-box;
  line-height: 1.1;
}

#filter-basemap-section select[name="basemap-select"] {
  width: auto !important;
}

/* Zone de soutien avec boutons côte à côte */
.donation-box { 
  margin-top:10px; padding:8px; background: transparent; border-radius:8px; 
  text-align:center; font-size:12px;
}
.donation-box p { margin:0 0 5px; font-size:11px; }

.donation-buttons {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin: 4px 0;
}

.donation-buttons button { 
  background:#28a745; color:#fff; padding:4px 12px; 
  font-size:11px; flex: 1; margin: 0;
}
.donation-buttons button:hover { background:#218838; }

.feedback-btn {
  background: #607d8b !important;
  color: white !important;
}
.feedback-btn:hover {
  background: #546e7a !important;
}

/* === AUTOCOMPLÉTION AUTEUR === */
.author-input-container {
    position: relative;
    width: 100%;
}

.author-suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 2px solid #4fc3f7;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    display: none;
}

/* === AUTOCOMPLÉTION AUTEUR - VERSION SOMBRE === */
.author-input-container {
    position: relative;
    width: 100%;
}

.author-suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: #1e1e1e;  /* Fond sombre */
    border: 2px solid #4fc3f7;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 9999;
    display: none;
}

.author-suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #444;  /* Bordure sombre */
    transition: background-color 0.2s ease;
    font-size: 14px;
    color: #ffffff;  /* Texte blanc */
}

.author-suggestion-item:hover {
    background-color: #2d2d2d;  /* Hover sombre */
}

.author-suggestion-item:last-child {
    border-bottom: none;
    border-radius: 0 0 6px 6px;
}

.author-suggestion-item strong {
    color: #4fc3f7;  /* Surbrillance bleue claire */
    font-weight: bold;
}

.author-suggestions-empty {
    padding: 12px 15px;
    color: #cccccc;  /* Texte gris clair */
    font-style: italic;
    text-align: center;
}

/* Animation d'apparition */
.author-suggestions-box.show {
    display: block;
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
    .author-suggestions-box {
        font-size: 16px; /* Éviter le zoom sur iOS */
    }
    
    .author-suggestion-item {
        padding: 15px;
        font-size: 16px;
        color: #ffffff;  /* Texte blanc mobile */
    }
}

/* 1080p: compacter légèrement le panneau filtre */
@media screen and (max-height: 1080px) {
  .button-row {
    gap: 10px;
    margin: 6px 0;
  }
  .button-row button {
    padding: 6px;
  }
}

/* Style pour la sélection au clavier */
.author-suggestion-item.selected {
    background-color: #3d3d3d !important;  /* Sélection clavier sombre */
}

/* === BOUTONS DONNÉES FOUDRE === */
.foudre-data-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin: 2px 0;
}

.foudre-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;    
    text-align: center;
    border: none;
    cursor: default;
    user-select: none;
    white-space: nowrap;
}

/* Polarité Positive = Rouge */
.foudre-badge.positif {
    background: linear-gradient(135deg, #f44336da, #f44336);
    color: white;
}

/* Polarité Négative = Bleu */
.foudre-badge.negatif {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
}

/* Couleurs de polarité pour les marqueurs */
.marker-icon.polarite-positif {
  border-color: #ff1f31ff !important; /* Rouge pour positif */
}

.marker-icon.polarite-negatif {
  border-color: #0ea5e9 !important; /* Bleu pour négatif */
}

/* PRIORITÉ AU JAUNE : Les favoris restent jaunes même avec polarité */
.marker-icon.featured {
    border-color: #EDC43E !important; /* Jaune prioritaire sur tout */
}

/* Badge puissance (neutre) */
.foudre-badge.puissance {
    background: linear-gradient(135deg, #607d8b, #455a64);
    color: white;
}

/* Cercles pour les filtres de polarité */
.filter-circle {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 3px solid;
    background: transparent;
    margin-left: 4px;
    vertical-align: middle;
}
.filter-circle.positif {
    border-color: #ff1f31ff !important; /* MÊME couleur que tes marqueurs positifs */
}
.filter-circle.negatif {
    border-color: #0ea5e9 !important; /* MÊME couleur que tes marqueurs négatifs */
}
/* Cercle doré harmonisé avec le même style */
.filter-circle.favorites {
    border-color: #EDC43E !important; /* MÊME couleur que tes marqueurs favoris */
    background: transparent;
}

/* Version mobile plus grande */
@media screen and (max-width: 768px) {
    .foudre-badge {
        padding: 2px 10px;
        font-size: 12px;
        border-radius: 4px;
    }
}

/* Version compacte pour les listes denses */
.foudre-badge.compact {
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 4px;
}

/* Badge phénomènes remarquables - couleur violette pour se distinguer */
.foudre-badge.phenomenes {
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
    color: #ffffff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    margin-right: 8px;
    margin-bottom: 3px; 
    display: inline-block;
    line-height: 1;     
}

/* Gabarit commun pour harmoniser polarité/puissance avec phenomenes/objects */
.foudre-badge.foudre-shape {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    margin-right: 8px;
    margin-bottom: 3px;
    display: inline-block;
    line-height: 1;
}

.phenom-icon {
    display: inline-flex;
    width: 1.1em;
    height: 1.1em;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: -0.1em;
    margin-left: 4px;
}

.phenom-icon.propagation-roche {
    background-image: none;
}
.phenom-icon.propagation-roche::before {
    content: "\303D\FE0F";
    font-size: 1em;
    line-height: 1;
}
.filter-phenom-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    color: #eaf6ff;
    margin-left: 6px;
    font-size: 12px;
    line-height: 1;
}

.filter-toggle-btn.active .filter-phenom-badge {
    background: rgba(255, 255, 255, 0.65);
}

.filter-phenom-badge.power-flash::before {
    content: "\1F4A5";
}

.filter-phenom-badge.traceurs::before {
    content: "\26A1";
}

.filter-phenom-badge.propagation-roche::before {
    content: "\303D\FE0F";
}

.filter-phenom-badge.effet-couronne::before {
    content: "\1F4AB";
}

.filter-toggle-row { display: flex; flex-wrap: wrap; gap: 5px; }

/* Bouton toggle filtre — base */
.filter-toggle-btn {
    display: inline-flex; align-items: center; gap: 5px;
    width: auto; padding: 5px 11px; border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.5); font-size: 12px;
    font-weight: 400;
    cursor: pointer; transition: all .13s; white-space: nowrap;
    margin: 0;
  }
.filter-toggle-btn input { display: none; }

.filter-toggle-btn.active {
    background: #8ed0ed; border-color: rgba(79,195,247,0.55);
    color: #0b1c24; font-weight: 600;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.28), 0 0 0 1px rgba(79,195,247,0.45);
    transform: translateY(1px);
  }

/* Catégories */
.filter-toggle-btn.filter-category-btn { border-color: var(--chip-color, rgba(255,255,255,0.18)); }
.filter-toggle-btn.filter-category-btn.active {
    background: #8ed0ed; color: #0b1c24; font-weight: 600;
    border-color: var(--chip-color);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.28), 0 0 0 2px color-mix(in srgb, var(--chip-color) 35%, transparent);
    transform: translateY(1px);
  }
/* Filtres additionnels — bordures colorées */
.filter-toggle-btn[data-specialty="positif"] { border-color: #ff1f31; }
.filter-toggle-btn[data-specialty="negatif"] { border-color: #0ea5e9; }
.filter-toggle-btn[data-specialty="featured"] { border-color: #EDC43E; }
.filter-toggle-btn[data-specialty="positif"].active  { border-color: #ff1f31; box-shadow: 0 0 0 2px rgba(255,31,49,0.28);  background: rgba(255,31,49,0.1);  color: #ffb0b5; font-weight: 600; transform: translateY(1px); }
.filter-toggle-btn[data-specialty="negatif"].active  { border-color: #0ea5e9; box-shadow: 0 0 0 2px rgba(14,165,233,0.28); background: rgba(14,165,233,0.1); color: #a0d8f8; font-weight: 600; transform: translateY(1px); }
.filter-toggle-btn[data-specialty="featured"].active { border-color: #EDC43E; box-shadow: 0 0 0 2px rgba(237,196,62,0.28); background: rgba(237,196,62,0.1); color: #f8e07a; font-weight: 600; transform: translateY(1px); }


.filter-master-row {
  justify-content: center;
}

.filter-master-controls {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.filter-master-help {
  position: static;
  display: inline-flex;
  align-items: center;
}

.filter-master-help .section-tooltip {
  left: auto;
  right: 0;
  top: calc(100% + 6px);
  bottom: auto;
  z-index: 1216;
  width: min(320px, 100%);
  max-width: min(320px, calc(100vw - 32px));
}

.filter-master-btn {
    position: relative; overflow: visible;
    display: inline-flex; align-items: center; gap: 6px;
    width: auto; padding: 7px 12px; border-radius: 10px; border: 1px solid;
    font-size: 12.5px; font-weight: 400;
    cursor: pointer; transition: filter .15s, transform .15s; white-space: nowrap;
    margin: 0;
  }
.quality-filter-icon {
  position: absolute; top: -8px; right: -8px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.quality-filter-icon svg { width: 18px; height: 18px; fill: #49d685 !important; stroke: none !important; }

@media (hover: hover) and (pointer: fine) {
  .filter-toggle-btn:hover {
    background: #8ed0ed;
    color: #0b1c24;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.22), 0 0 0 1px rgba(79,195,247,0.4);
    transform: translateY(1px);
  }

  .filter-toggle-btn.active:hover {
    background: #4a7a8a;
    color: #c8e8f0;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5), 0 0 0 1px rgba(100,160,180,0.3);
    transform: translateY(1px);
  }

  .filter-toggle-btn.filter-category-btn.active:hover {
    background: #4a7a8a;
    color: #c8e8f0;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5), 0 0 0 1px rgba(100,160,180,0.3);
    transform: translateY(1px);
  }

  .filter-toggle-btn.filter-category-btn:not(.active):hover {
    background: #8ed0ed;
    color: #0b1c24;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.22), 0 0 0 1px rgba(79,195,247,0.4);
    transform: translateY(1px);
  }
}

.filter-master-btn[data-master-filter="reference"] {
  position: relative;
  overflow: visible;
  background: linear-gradient(180deg, rgba(30, 88, 59, 0.96), rgba(19, 58, 40, 0.96));
  border-color: rgba(111, 221, 162, 0.82);
  color: #e8fff3;
}

.filter-master-btn[data-master-filter="reference"].active {
    background: linear-gradient(180deg, #74e1a9, #43b67a);
    border-color: rgba(184, 247, 214, 0.95);
    color: #082414;
    font-weight: 600;
  }

.filter-master-btn[data-master-filter="complement"] {
  background: linear-gradient(180deg, rgba(63, 123, 92, 0.9), rgba(34, 79, 57, 0.9));
  border-color: rgba(140, 228, 181, 0.78);
  color: #eefff6;
}

.filter-master-btn[data-master-filter="complement"].active {
    background: linear-gradient(180deg, #9be6c0, #698577);
    border-color: rgba(205, 250, 230, 0.94);
    color: #0a2518;
    font-weight: 600;
  }

.filter-master-btn[data-master-filter="traces"] {
  background: linear-gradient(180deg, rgba(164, 122, 26, 0.96), rgba(115, 84, 16, 0.96));
  border-color: rgba(255, 197, 88, 0.84);
  color: #fff5dc;
}

.filter-master-btn[data-master-filter="traces"].active {
    background: linear-gradient(180deg, #ffc95c, #e2a31d);
    border-color: rgba(255, 224, 159, 0.95);
    color: #322100;
    font-weight: 600;
  }

@media (hover: hover) and (pointer: fine) {
  .filter-master-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
  }

  .filter-master-btn[data-master-filter="reference"]:hover {
    box-shadow: 0 0 0 2px rgba(111, 221, 162, 0.35), 0 6px 14px rgba(0, 0, 0, 0.3);
  }

  .filter-master-btn[data-master-filter="complement"]:hover {
    box-shadow: 0 0 0 2px rgba(140, 228, 181, 0.32), 0 6px 14px rgba(0, 0, 0, 0.3);
  }

  .filter-master-btn[data-master-filter="traces"]:hover {
    box-shadow: 0 0 0 2px rgba(255, 197, 88, 0.35), 0 6px 14px rgba(0, 0, 0, 0.3);
  }

  /* Hover désactivation sur boutons master actifs */
  .filter-master-btn.active:hover {
    filter: brightness(0.75) saturate(0.6);
    opacity: 0.8;
    transform: translateY(1px);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
  }
}

.filter-master-btn[data-master-filter="reference"]:not(.active) {
  background: rgba(28, 52, 41, 0.9);
  border-color: rgba(111, 221, 162, 0.38);
  color: #caeddc;
}

.filter-master-btn[data-master-filter="complement"]:not(.active) {
  background: rgba(39, 63, 52, 0.9);
  border-color: rgba(140, 228, 181, 0.35);
  color: #d4eee0;
}

.filter-master-btn[data-master-filter="traces"]:not(.active) {
  background: rgba(84, 67, 25, 0.9);
  border-color: rgba(255, 197, 88, 0.42);
  color: #f1dfb8;
}

.filter-master-btn[data-master-filter="reference"] .quality-filter-icon {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 18px;
  height: 18px;
  margin-right: 0;
  z-index: 2;
  pointer-events: none;
}

.filter-master-btn[data-master-filter="reference"] .quality-filter-icon svg {
  width: 18px;
  height: 18px;
  fill: #49d685 !important;
  stroke: #ffffff !important;
}

/* Hover pour les autres boutons de la section */
@media (hover: hover) and (pointer: fine) {
  #reset-filters:hover,
  .timeline-reset-btn:hover,
  .category-info-btn:hover,
  #clear-date-filter:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    color: #ffffff;
  }
}

  /* Titre de section + tooltip */
  .filter-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    font-size: 11.5px;
    font-weight: 400;
    color: #4fc3f7;
    margin: 0;
    width: 100%;
  }

.section-info-btn {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(79,195,247,0.25);
  background: rgba(79,195,247,0.12);
  color: rgba(79,195,247,0.7);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.section-tooltip {
  position: absolute;
  top: 24px;
  left: 0;
  z-index: 1215;
  background: rgba(20, 30, 38, 0.96);
  color: #eaf6ff;
  border: 1px solid rgba(79, 195, 247, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.35;
  box-sizing: border-box;
  width: max-content;
  max-width: min(320px, 100%);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  display: none;
}

.filter-panel .section-tooltip,
.filter-panel .section-tooltip div,
.filter-panel .section-tooltip span {
  color: #eaf6ff;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 400;
  letter-spacing: 0;
  text-shadow: none;
}

.filter-panel .section-tooltip strong {
    color: #4fc3f7 !important;
    font-weight: 400;
  }

.section-tooltip div + div {
  margin-top: 6px;
}

.section-info-btn:hover + .section-tooltip,
.section-tooltip:hover {
  display: block;
}

.filter-collapse-btn {
    width: 16px;
    height: 16px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(79,195,247,0.25);
    background: rgba(79,195,247,0.12);
    color: rgba(255,255,255,0.6);
  cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.18s ease, transform 0.18s ease, filter 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.filter-collapse-btn svg {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
  }

#trace-object-filter-toggle {
  color: #ffffff;
}

#trace-object-filter-toggle svg {
    width: 18px;
    height: 18px;
  }

@media (hover: hover) and (pointer: fine) {
  .filter-collapse-btn:hover {
    color: #ffffff;
    border-color: rgba(79,195,247,0.6);
    background: rgba(79,195,247,0.2);
  }

  .section-info-btn:hover {
    color: #ffffff;
    border-color: rgba(79,195,247,0.6);
    background: rgba(79,195,247,0.2);
  }

  .filter-panel button:hover {
    color: #ffffff;
  }
}

.filter-collapse-btn.is-expanded svg {
    transform: rotate(180deg);
  }

.trace-object-filters-row {
  margin-top: 4px;
}

.trace-object-filter-btn {
  font-size: 11px;
}

.trace-object-filter-empty {
  font-size: 11px;
  color: #9cb8ca;
  margin-left: 4px;
}

@media (max-width: 480px) {
  .section-tooltip {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
  }

  .filter-master-controls {
    align-items: flex-start;
    gap: 6px;
  }

  .filter-master-help .section-tooltip {
    left: auto;
    right: 0;
    top: calc(100% + 6px);
    bottom: auto;
  }
}

@media (max-width: 768px) {
  #filter-master-section .filter-master-controls {
    position: relative;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  #filter-master-section .filter-master-row {
    width: auto;
    flex: 0 0 auto;
    min-width: auto;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 15px;
    margin-top: 0;
  }

  #filter-master-section .filter-master-help {
    position: static;
    width: auto;
    flex: 0 0 auto;
    justify-content: center;
    margin-left: 2px;
  }

  #filter-master-section .filter-master-btn {
    flex: 0 1 auto;
    justify-content: center;
    padding: 8px 8px;
    font-size: 12.5px;
  }
}

.filter-toggle-btn:focus-visible,
.filter-master-btn:focus-visible,
.section-info-btn:focus-visible,
.mobile-filter-toggle:focus-visible {
  outline: 2px solid rgba(79,195,247,0.75);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  /* Mobile: avoid sticky touch ring on category buttons when deactivated */
  .filter-category-btn:not(.active) {
      border-width: 1px !important;
      box-shadow: none !important;
      background: rgba(18, 34, 46, 0.92) !important;
      color: #d9ecf7 !important;
      transform: none !important;
    }
}

@media (max-width: 480px) {
  .filter-toggle-row {
    gap: 6px;
  }

  .filter-toggle-btn {
    padding: 6px 8px;
    font-size: 11px;
    width: max-content;
    margin: 2px;
  }

  .filter-master-btn {
    padding: 9px 14px;
    font-size: 13px;
    min-height: 40px;
  }

  .filter-master-help .section-tooltip {
    width: min(320px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
  }

  #filter-master-section .filter-master-row {
    flex-wrap: nowrap;
    gap: 15px;
    justify-content: center;
  }

  #filter-master-section .filter-master-btn {
    flex: 0 1 auto;
    min-width: auto;
    padding: 7px 7px;
    font-size: 12px;
    min-height: 35px;
  }
}

.foudre-badge.phenomenes.compact {
    padding: 5px 6px;
    font-size: 11px;
    border-radius: 4px;
}

/* Aligner la hauteur/compacité des badges polarité + puissance sur phenomenes compact */
.foudre-badge.positif.compact,
.foudre-badge.negatif.compact,
.foudre-badge.puissance.compact {
    padding: 5px 6px;
    font-size: 11px;
    border-radius: 4px;
    line-height: 1;
}

/* Type d'objet (traces): meme format que phenomenes compact, couleur differente */
.foudre-badge.trace-object-badge {
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
    color: #ffffff;
}

/* Bouton toggle en haut à droite */
#toggle-panel { 
  position:absolute; 
  top:80px; 
  right:10px;
  z-index:1001; 
  background:#4fc3f7; 
  border:none; 
  color:#000; 
  padding:0;
  box-sizing:border-box;
  
  border-radius:50%; 
  cursor:pointer; 
  font-weight:bold; 
  width:42px;
  height:42px; 
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#toggle-panel svg {
  width: 24px;
  height: 24px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}



.map-add-impact-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#map-add-impact {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: auto;
  width: 46px;
  height: 46px;
  border: 2px solid rgba(255, 241, 199, 0.95);
  border-radius: 50%;
  background: linear-gradient(135deg, #ffcf3f 0%, #ff9f1a 100%);
  color: #14202b;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  box-shadow:
    0 8px 20px rgba(15, 22, 30, 0.35),
    0 0 0 0 rgba(255, 179, 0, 0.55);
  transition: transform 0.18s ease, filter 0.2s ease, box-shadow 0.25s ease;
  overflow: visible;
  animation: add-impact-pulse 2.2s ease-in-out infinite;
}

#map-add-impact .map-add-impact-plus {
  transform: translateY(-1px);
}

#map-add-impact:hover {
  transform: translateY(-1px) scale(1.04);
  filter: brightness(1.06);
  box-shadow:
    0 10px 26px rgba(15, 22, 30, 0.42),
    0 0 0 8px rgba(255, 179, 0, 0.16);
}

#map-add-impact:focus-visible {
  outline: 3px solid rgba(255, 217, 102, 0.95);
  outline-offset: 2px;
}

#map-add-impact::after {
  content: attr(aria-label);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(14, 27, 36, 0.92);
  border: 1px solid rgba(79, 195, 247, 0.45);
  color: #f2f8ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
}

#map-add-impact:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

#map-add-impact[aria-expanded="true"]::after {
  opacity: 0;
  visibility: hidden;
}

.map-add-impact-actions {
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  transform: translateY(-50%) translateX(8px);
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 1205;
}

.map-add-impact-wrap.is-open .map-add-impact-actions {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.map-add-impact-wrap.is-open .map-add-impact-action {
  animation: map-add-action-pop 0.2s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

.map-add-impact-wrap.is-open .map-add-impact-action:nth-child(2) {
  animation-delay: 0.07s;
}

.map-add-impact-wrap.is-open .map-add-impact-action:nth-child(3) {
  animation-delay: 0.06s;
}

.map-add-impact-wrap.is-open .map-add-impact-action:nth-child(4) {
  animation-delay: 0.09s;
}

.map-add-impact-action {
  --action-accent: #79d3ff;
  min-width: 142px;
  height: 40px;
  padding: 7px 11px;
  border: 1px solid rgba(79, 195, 247, 0.36);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(16, 31, 42, 0.96), rgba(10, 22, 30, 0.96));
  color: #eef8ff;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
  border-left: 3px solid var(--action-accent);
  transition: background 0.18s ease, transform 0.18s ease, filter 0.18s ease;
}

.map-add-impact-action[data-contribution-action="impact"] {
  --action-accent: #43b67a;
}

.map-add-impact-action[data-contribution-action="trace"] {
  --action-accent: #63bf90;
}

.map-add-impact-action[data-contribution-action="fulgurpedia"] {
  --action-accent: #4fc3f7;
}

.map-add-impact-action[data-contribution-action="videos"] {
  --action-accent: #6ad7ff;
}

.map-add-impact-action:hover,
.map-add-impact-action:focus-visible {
  background: linear-gradient(90deg, rgba(23, 44, 59, 0.99), rgba(16, 31, 43, 0.99));
  transform: translateX(-2px);
  filter: brightness(1.08);
  outline: none;
}

.map-add-impact-action svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--action-accent);
}

.map-add-impact-action img {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  object-fit: contain;
  display: block;
}

.map-add-impact-action span {
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.25px;
  color: #f4faff;
}

@keyframes map-add-action-pop {
  from {
    opacity: 0;
    transform: translateX(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes map-add-action-arc {
  from {
    opacity: 0;
    transform: translate(0, 0) scale(0.82);
  }
  to {
    opacity: 1;
    transform: translate(var(--arc-x, -56px), var(--arc-y, 0px)) scale(1);
  }
}

@keyframes add-impact-pulse {
  0%,
  100% {
    box-shadow:
      0 8px 20px rgba(15, 22, 30, 0.35),
      0 0 0 0 rgba(255, 179, 0, 0.45);
  }
  50% {
    box-shadow:
      0 8px 20px rgba(15, 22, 30, 0.38),
      0 0 0 8px rgba(255, 179, 0, 0.1);
  }
}

.map-view-shortcuts {
  position: absolute;
  top: 138px;
  right: 10px;
  width: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 1001;
}

.map-view-btn {
  position: relative;
  width: 46px;
  height: 46px;
  min-width: 46px;
  padding: 0;
  margin: 0;
  border: 1px solid #4fc3f7;
  border-radius: 999px;
  background: rgba(28, 43, 54, 0.10);
  color: #dff3ff;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease, filter 0.2s ease;
}

.map-view-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(14, 27, 36, 0.92);
  border: 1px solid rgba(79, 195, 247, 0.45);
  color: #f2f8ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
}

.map-view-btn:hover::after,
.map-view-btn:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.map-view-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-view-btn:hover {
  background: rgba(79, 195, 247, 0.25);
}


/* Timeline avec bouton de réduction */
#map-fulgurpedia-btn.map-fulgurpedia-floating::after {
  content: attr(aria-label);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(14, 27, 36, 0.92);
  border: 1px solid rgba(79, 195, 247, 0.45);
  color: #f2f8ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  z-index: 1300;
}

#map-fulgurpedia-btn.map-fulgurpedia-floating:hover::after,
#map-fulgurpedia-btn.map-fulgurpedia-floating:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

#map-fulgurpedia-btn.map-fulgurpedia-floating:hover,
#map-fulgurpedia-btn.map-fulgurpedia-floating:focus-visible {
  background: #4f7fa2;
  color: #ffffff;
  border-color: #8ed8ff;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(79, 195, 247, 0.22);
  filter: brightness(1.08);
}

.timeline-container {
  --timeline-side-w: 0px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 92px;
  background: rgba(12,30,43,0.97) !important;
  border-top: 1px solid #4fc3f7c2;
  padding: 0px 20px 0px 20px;
  z-index: 1190;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible !important;
  transition: height 0.3s, transform 0.3s;
}

.timeline-container.collapsed {
  height: 30px;
  padding: 2px 20px 0px 20px;
}

@media screen and (min-width: 769px) {
  .timeline-container.collapsed {
    height: 34px;
    padding: 2px 20px;
    justify-content: center;
  }

  .timeline-container.collapsed .timeline-side-controls,
  .timeline-container.collapsed .desktop-timeline,
  .timeline-container.collapsed .mobile-timeline-canvas {
    display: none !important;
  }

  .timeline-container.collapsed .timeline-labels {
    display: flex !important;
    margin: 6px var(--timeline-label-right-gap, 50px) 0 calc(var(--timeline-side-w) + 8px);
  }
}

.timeline-toggle {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  width: 71px;
  height: 26px;
  background: rgba(12,30,43,0.72);
  border: 1px solid rgba(37, 146, 197, 0.71);
  border-bottom: none;
  color: rgba(124, 174, 197, 0.95);
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: background .15s;
}

.timeline-toggle svg {
  width: 17px;
  height: 17px;
  transition: transform 0.2s ease;
}

.timeline-container.collapsed .timeline-toggle svg {
  transform: rotate(180deg);
}

.timeline-toggle:hover {
  background: #0c1520;
  box-shadow: none;
}

@media screen and (max-width: 768px) {
  .timeline-toggle {
    top: -30px;
    width: 56px;
    height: 22px;
  }

  .timeline-toggle svg {
    width: 15px;
    height: 15px;
  }
}

.timeline-header {
  color: #4fc3f7;
  font-weight: bold;
  margin-bottom: 0;
  text-align: center;
  font-size: 14px;
}

.timeline-container.collapsed .timeline-header {
  display: none;
}

.timeline {
  position: relative;
  height: 25px;
  margin: 0 50px 0 calc(var(--timeline-side-w) + 8px);
}

.timeline-container.collapsed .timeline {
  display: none;
}

.timeline-track {
  position: absolute;
  width: 100%;
  height: 4px;
  background: #26343f;
  border-radius: 2px;
  top: 10px;
}

.timeline-range {
  position: absolute;
  height: 4px;
  background: #4fc3f7;
  border-radius: 2px;
  top: 10px;
}

.timeline-slider {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #4fc3f7;
  border-radius: 50%;
  top: 5px;
  cursor: grab;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.timeline-slider:active {
  cursor: grabbing;
  transform: scale(1.1);
}

.timeline-slider::after {
  content: "";
  width: 11px;
  height: 11px;
  display: block;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.timeline-markers {
  position: absolute;
  width: calc(100% - 60px);
  left: 30px;
  top: -5px;
  height: 20px;
}

.timeline-marker {
  position: absolute;
  top: -15px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  z-index: 2;
  cursor: pointer;
  opacity: 0.82;
}

.timeline-marker::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  width: max-content;
  max-width: calc(100vw - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(14, 27, 36, 0.92);
  border: 1px solid rgba(79, 195, 247, 0.45);
  color: #f2f8ff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  z-index: 12;
}

.timeline-marker[data-tooltip-side="start"]::after {
  left: 0;
  transform: translateX(0) translateY(4px);
}

.timeline-marker[data-tooltip-side="end"]::after {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(4px);
}

.timeline-marker svg {
  width: 24px;
  height: 24px;
  display: block;
  pointer-events: none;
}

.timeline-marker.timeline-marker-owned .timeline-owned-outline {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.timeline-marker.timeline-marker-complement {
  width: 24px;
  height: 24px;
  top: -5px;
  opacity: 0.55;  
}

.timeline-marker.timeline-marker-owned .timeline-owned-outline svg {
  color: #37ff14af !important;
  opacity: 0.95;
  transform: scale(1.15);
}

.timeline-marker.timeline-marker-owned > svg {
  position: relative;
  z-index: 1;
}

.timeline-marker.timeline-marker-complement.timeline-marker-owned .timeline-owned-outline svg {
  transform: scale(1.12);
}

.timeline-marker.timeline-marker-complement svg {
  width: 20px;
  height: 20px;
  opacity: 0.75 !important; 
}

.timeline-marker:hover {
  transform: translateX(-50%) scale(1.3);
  transition: transform 0.2s;
  opacity: 1;
  z-index: 1010;
}

.timeline-marker:hover::after,
.timeline-marker:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.timeline-marker:focus-visible {
  z-index: 1010;
}

.timeline-marker[data-tooltip-side="start"]:hover::after,
.timeline-marker[data-tooltip-side="start"]:focus-visible::after,
.timeline-marker[data-tooltip-side="end"]:hover::after,
.timeline-marker[data-tooltip-side="end"]:focus-visible::after {
  transform: translateX(0) translateY(0);
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  margin: 6px 50px 0 calc(var(--timeline-side-w) + 8px);
  --timeline-label-right-gap: 50px;
  color: #b0cfe0;
  font-size: 12px;
  background: rgba(79, 195, 247, 0.1);
  padding: 0px 10px;
  border-radius: 10px;
  position: relative;
}

.timeline-dates {
  position: absolute;
  width: 100%;
  top: 18px;
  font-size: 11px;
  color: #b0cfe0;
  height: 20px;
  display: block;
}

@media screen and (max-width: 768px) {
  #map {
    position: absolute;
    top: 0;
    bottom: 0; /* la barre nav fixe couvre le bas, fond sombre sur body évite le blanc */
    left: 0;
    right: 0;
  }
  
  .timeline-container {
    height: 130px; /* ← Ajuster le conteneur aussi */
    justify-content: flex-end;
    padding: 0px 10px 0px 10px;
  }

  .timeline-container.collapsed {
    padding: 2px 10px 0px 10px;
  }
}

.mobile-card {
  --point-tier-accent: #4fc3f7;
  --point-tier-shadow: rgba(79, 195, 247, 0.5);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1c2b36;
  color: #eee;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border: 3px solid var(--point-tier-accent);
  border-bottom: none;
  box-shadow: 0 0 30px var(--point-tier-shadow);
  border-bottom: none; /* Pas de bordure en bas */
  padding: 20px;
  padding-top: 20px;
  transform: translate3d(0, 100%, 0);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), max-height 0.32s ease, padding 0.32s ease, box-shadow 0.32s ease;
  z-index: 2500;
  max-height: 80vh;
  overflow-y: auto;
  display: none;
  will-change: transform, max-height;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  contain: paint;
  isolation: isolate;
}

.mobile-card::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 4px;
  background: var(--point-tier-accent);
  opacity: 0.45;
  border-radius: 2px;
  pointer-events: none;
}

.mobile-card.point-tier-reference {
  --point-tier-accent: #4fc3f7;
  --point-tier-shadow: rgba(79, 195, 247, 0.5);
}

.mobile-card.point-tier-complement {
  --point-tier-accent: #26a69a;
  --point-tier-shadow: rgba(38, 166, 154, 0.5);
}

.mobile-card.point-tier-traces {
  --point-tier-accent: #ff8a26;
  --point-tier-shadow: rgba(255, 138, 38, 0.5);
}

.mobile-card.point-tier-owned {
  --point-tier-accent: #37ff14af;
  --point-tier-shadow: rgba(57, 255, 20, 0.55);
}

.mobile-card.active {
  transform: translate3d(0, 0, 0);
  display: block;
}

/* Nouvel état : fiche minimisée */
.mobile-card.minimized {
  transform: translate3d(0, 0, 0) !important;
  max-height: 76px !important;
  padding-bottom: 12px;
  box-shadow: 0 0 18px var(--point-tier-shadow);
  overflow: hidden !important;
}

#mobile-card-content {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: opacity 0.22s ease, transform 0.32s ease;
  will-change: opacity, transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.mobile-card.minimized #mobile-card-content {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  pointer-events: none;
}

.mobile-card-header {
  position: absolute;
  top: 10px;
  left: 20px;
  right: 20px;
}

.mobile-card-close {
  position: absolute;
  top: 10px;
  right: 15px;
  width: 30px;
  height: 30px;
  background: #607d8b;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 18px;
  display: none;
  align-items: center;
  justify-content: center;
}

.mobile-card-close:hover {
  background: #546e7a;
}

.mobile-card img {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transform-origin: center center;
}

.mobile-card .photos-container > img,
.mobile-card .photos-container > video,
.mobile-card .photos-container > .media-preview,
.mobile-card .photos-container .media-preview img,
.mobile-card .photos-container.trace-square-grid .trace-square-cell > img,
.mobile-card .photos-container.trace-square-grid .trace-square-cell > .media-preview,
.mobile-card .photos-container.trace-square-grid .trace-square-cell > .media-preview img {
  touch-action: pan-y !important;
}

/* === VERSION TRÈS COMPACTE === */
@media screen and (max-width: 768px) {
    #mobile-card-content {
        line-height: 1.2 !important;
        letter-spacing: 0.1px !important;
    }
    
    #mobile-card-content > div {
        margin-bottom: 8px !important;  /* ← Très réduit */
        line-height: 1.1 !important;
        padding: 1px 0 !important;
    }
    
    #mobile-card-content strong {
        margin-right: 4px !important;
    }
}

/* Bouton flottant fiche mobile - VERSION EXTERNE FIXE */
.mobile-card-close-float {
  position: fixed !important;
  bottom: 20px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: #d32f2f !important;
  color: white !important;
  border: none !important;
  border-radius: 20px !important;
  padding: 8px 16px !important;
  font-size: 14px !important;
  font-weight: bold !important;
  cursor: pointer !important;
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.4) !important;
  z-index: 9999 !important; /* Plus haut que la fiche mobile (z-index: 1300) */
  opacity: 0.9 !important;
  transition: opacity 0.3s ease, transform 0.3s ease !important;
  user-select: none !important;
  display: none !important;
  width: auto !important;
  max-width: 120px !important;
  white-space: nowrap !important;
  text-align: center !important;
  pointer-events: auto !important;
  visibility: visible !important !important;
  margin: 0 !important;
  top: auto !important;
  right: auto !important;
}

.mobile-card-close-float:hover {
  opacity: 1 !important;
  transform: translateX(-50%) scale(1.05) !important;
  box-shadow: 0 6px 20px rgba(211, 47, 47, 0.6) !important;
}

/* Affichage conditionnel - fiche active */
.mobile-card.active ~ .mobile-card-close-float {
  display: block !important;
}

/* Version mobile */
@media screen and (max-width: 768px) {
  .mobile-card-close-float {
    bottom: 55px !important;
    padding: 6px 14px !important;
    font-size: 13px !important;
    max-width: 100px !important;
    z-index: 9999 !important;
  }
}

/* Style pour les sélecteurs de fond de carte */
.basemap-selector {
  margin-top: 4px;
}

.basemap-selector label {
  display: flex;
  align-items: center;
  margin-bottom: 3px;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: background 0.2s;
  font-size: 13px;
}

.basemap-selector label:hover {
  background: #26343f;
}

.basemap-selector input[type="radio"] {
  margin-right: 6px;
  width: auto;
}

/* MARQUEURS AVEC CARACTÉRISTIQUES SPÉCIALISÉES - POSITION AJUSTÉE */
.marker-with-specialties {
  position: relative !important;
  width: calc(26.5px + 24px);
  height: calc(26.5px + 24px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  isolation: isolate;
  z-index: 0;
}

/* Badges TOUJOURS derrière - tous marqueurs */
.marker-with-specialties .specialty-badges {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26.5px;
  height: 26.5px;
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
}

.marker-with-specialties .specialty-badge {
  position: absolute;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.45);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  box-shadow: none;
  z-index: 1;
  pointer-events: none;
}

/* Positions fixes */
.specialty-badge.power-flash {
  left: -12px;
  top: -12px;
}

.specialty-badge.traceurs {
  right: -12px;
  top: -12px;
}

.specialty-badge.propagation-roche {
  left: -12px;
  bottom: -12px;
}

.specialty-badge.effet-couronne {
  right: -12px;
  bottom: -12px;
}

/* Réduction des badges uniquement pour les marqueurs Compléments */
.marker-with-specialties.marker-with-specialties-complement .specialty-badge {
  width: 18px;
  height: 18px;
  font-size: 11px;
}

.marker-with-specialties.marker-with-specialties-complement .specialty-badge.power-flash {
  left: -11px;
  top: -11px;
}

.marker-with-specialties.marker-with-specialties-complement .specialty-badge.traceurs {
  right: -11px;
  top: -11px;
}

.marker-with-specialties.marker-with-specialties-complement .specialty-badge.propagation-roche {
  left: -11px;
  bottom: -11px;
}

.marker-with-specialties.marker-with-specialties-complement .specialty-badge.effet-couronne {
  right: -11px;
  bottom: -11px;
}

/* Marqueurs normaux */
.marker-icon {
  position: relative;
  z-index: 2;
  overflow: visible;
}

/* Marqueurs favoris - même placement que les autres */
.marker-icon.featured {
  border-color: #EDC43E !important;
  border-width: 4px !important;
  animation: featuredPulseGold 2s infinite;
  z-index: 2;
}

/* Hover */
.marker-icon:hover {
  z-index: 4;
  transform: scale(1.2);
  transition: transform 0.2s;
}

.marker-icon.featured:hover {
  z-index: 4;
  transform: scale(1.2);
}

/* Symboles */
.specialty-badge.power-flash::before {
  content: "\1F4A5";
}

.specialty-badge.traceurs::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23FFD54F' stroke='%23FFD54F' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 4 14h6l-1 8 9-12h-6z'/%3E%3C/svg%3E");
}

.specialty-badge.propagation-roche::before {
  content: "\303D\FE0F";
}

.specialty-badge.effet-couronne::before {
  content: "\1F4AB";
}

@keyframes featuredPulseGold {
  0% {
    box-shadow: 0 0 0 0 rgba(184, 134, 11, 0.6);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(184, 134, 11, 0.2);
  }
  100% {
    box-shadow: 0 0 0 20px rgba(184, 134, 11, 0);
  }
}

/* Animation pulse jaune avec la forme de l'épingle */
@keyframes featuredPulseYellow {
  0% {
    filter: drop-shadow(0 0 0 rgba(255, 215, 0, 0.6)) drop-shadow(0 0 0 rgba(255, 215, 0, 0.6));
  }
  50% {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8)) drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
  }
  100% {
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0)) drop-shadow(0 0 25px rgba(255, 215, 0, 0));
  }
}

.timeline-marker.featured {
  animation: featuredPulseYellow 3s infinite;
  transform: translateX(-50%) scale(1.1);
  z-index: 10;
}

/* LISERÉ JAUNE SIMPLE POUR LES IMPACTS MIS EN AVANT DANS LA LISTE */
.impact-item.featured {
  border: 3px solid #FFD700 !important;
}

/* Exception pour les liens */
.impact-item.featured a {
  color: #003366 !important;
}

/* Icônes pour les marqueurs */
.marker-icon {
  width: 26.5px;
  height: 26.5px;
  border: 3.5px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Couleurs de polarité sur le cercle du marker (après la règle principale) */
.marker-icon.polarite-positif {
  border-color: #ff1f31ff !important;
}
.marker-icon.polarite-negatif {
  border-color: #0ea5e9 !important;
}
/* Priorité au mis en avant */
.marker-icon.featured {
  border-color: #EDC43E !important;
}

/* Masquer la bordure quand il n'y a pas de polarité */
.marker-icon:not(.polarite-positif):not(.polarite-negatif) {
  border: 2px solid #d8d8d8ff !important;
}

.marker-icon:hover {
  transform: scale(1.2);
  transition: transform 0.2s;
}

/* Couleurs spécifiques par catégorie */
.marker-sol { background: #cfaf9bff; }
.marker-roche { background: #BDB2A0 !important; }
.marker-batiment { background: #adadad; color: #333; }
.marker-vegetation { background: #93d8a4ff; }
.marker-eau { 
  background: #abe2fcff !important; 
  color: white !important;
  font-size: 16px !important;
}

.marker-water-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
  transform: none;
}
.marker-antenne { background: #ABABAB; }
.marker-electrique { background: #ddd86d; color: #000; }

.marker-complements {
  transform: scale(0.756);
  opacity: 0.8;
  z-index: 1 !important;
}

.marker-traces {
  transform: scale(1);
  opacity: 1;
  z-index: 1000 !important;
}

.marker-icon.marker-traces {
  background: transparent !important;
  color: #ff8a26 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Supprime le contour hérité des règles génériques sur les marqueurs traces */
.marker-icon.marker-traces:not(.polarite-positif):not(.polarite-negatif),
.marker-icon.marker-traces.featured,
.marker-icon.marker-traces.polarite-positif,
.marker-icon.marker-traces.polarite-negatif {
  border: none !important;
  box-shadow: none !important;
}

.marker-icon.marker-traces.user-owned:not(.polarite-positif):not(.polarite-negatif),
.marker-icon.marker-traces.user-owned.polarite-positif,
.marker-icon.marker-traces.user-owned.polarite-negatif {
  color: #49e82b !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.marker-icon.marker-traces.featured.user-owned {
  color: #49e82b !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.marker-icon.marker-traces svg {
  width: 27.6px;
  height: 27.6px;
  color: currentColor !important;
}

.marker-icon.marker-traces svg * {
  stroke: currentColor !important;
}

/* Style pour le clustering */
.marker-cluster-small {
  background-color: rgba(79, 195, 247, 0.6);
}
.marker-cluster-small div {
  background-color: rgba(79, 195, 247, 0.8);
}

.marker-cluster-medium {
  background-color: rgba(79, 195, 247, 0.6);
}
.marker-cluster-medium div {
  background-color: rgba(79, 195, 247, 0.8);
}

.marker-cluster-large {
  background-color: rgba(79, 195, 247, 0.6);
}
.marker-cluster-large div {
  background-color: rgba(79, 195, 247, 0.8);
}

.author-button {
  background: linear-gradient(135deg, #6cc7ff, #4aaef0);
  color: #0b1c24 !important;
  border: 1px solid rgba(79, 195, 247, 0.85);
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600 !important;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 0;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, border-color 0.2s ease;
  margin-left: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  width: auto !important;
  min-width: 0 !important;
}

.author-button .inline-action-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  display: inline-block;
}

.author-profile-btn {
  min-width: 0;
  justify-content: center;
  margin-left: 10px;
  background: linear-gradient(135deg, #ffd36b, #ffb347) !important;
  color: #3b2a00 !important;
  border-color: rgba(255, 191, 64, 0.95) !important;
}

.author-profile-btn:hover {
  background: linear-gradient(135deg, #ffe08a, #ffc368) !important;
  color: #3b2a00 !important;
  border-color: rgba(255, 208, 120, 1) !important;
}

.author-button:hover {
  background: linear-gradient(135deg, #86d2ff, #61b7f2);
  color: #0b1c24 !important;
  text-decoration: none;
  transform: translateY(-1px);
  border-color: rgba(120, 210, 255, 0.9);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.author-button:active {
  transform: translateY(0);
}

/* Force spécifiquement pour les boutons vidéo */
.video-button {
  color: #0b1c24 !important;
  background: linear-gradient(135deg, #6cc7ff, #4aaef0) !important;
  border-color: rgba(79, 195, 247, 0.85) !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.video-button:hover {
  color: #0b1c24 !important;
  background: linear-gradient(135deg, #86d2ff, #61b7f2) !important;
  border-color: rgba(79, 195, 247, 0.7) !important;
}

.video-button .inline-action-icon {
  display: inline-block;
  transform: translateY(0);
}

/* Petit repère sur le bouton suggérer (coin haut droit) */
.suggest-btn {
  position: relative;
  overflow: visible;
  background: linear-gradient(135deg, #22323e, #2b3f4b);
  color: #eaf6ff;
  border: 1px solid rgba(79, 195, 247, 0.55);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  flex: 1;
  height: 42px;
  text-align: center;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.suggest-btn:hover {
  border-color: #f39c12;
  background: linear-gradient(135deg, #2b4150, #344d5f);
  transform: translateY(-1px);
}

.gallery-popup-content .favorite-btn,
.leaflet-popup-content .popup-content .favorite-btn,
.mobile-card .favorite-btn,
.mobile-card-content .favorite-btn {
  background: linear-gradient(135deg, #22323e, #2b3f4b);
  color: #eaf6ff;
  border: 1px solid rgba(79, 195, 247, 0.55);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  flex: 1;
  height: 42px;
  text-align: center;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.suggest-help {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(50%, -50%);
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(28, 43, 54, 0.95);
  border: 1px solid rgba(79, 195, 247, 0.9);
  color: #dff4ff;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  padding: 0;
}

.suggest-help-tooltip {
  --suggest-help-shift-x: 0px;
  position: absolute;
  right: -2px;
  bottom: 18px;
  min-width: 160px;
  max-width: 220px;
  width: max-content;
  background: rgba(20, 30, 38, 0.96);
  color: #eaf6ff;
  border: 1px solid rgba(79, 195, 247, 0.45);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 11px;
  line-height: 1.3;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: visible !important;
  text-overflow: clip !important;
  text-align: left;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  opacity: 0;
  visibility: hidden;
  transform: translate(var(--suggest-help-shift-x), 4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
}

.suggest-help.open .suggest-help-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(var(--suggest-help-shift-x), 0);
}

/* Mobile card: afficher l'infobulle sous le "?" pour éviter la découpe */
.mobile-card .suggest-help-tooltip {
  top: 18px;
  bottom: auto;
  right: 0;
  left: auto;
  max-width: min(240px, calc(100vw - 56px));
}

/* Leaflet popup: garder le ? dans le bouton pour ne pas bloquer les clics voisins */
.leaflet-popup-content .suggest-help {
  top: 2px;
  right: 2px;
  transform: none;
}

/* Leaflet popup: zone cliquable pleine sur les boutons d'action */
.leaflet-popup-content .popup-content button {
  width: auto !important;
  margin: 0 !important;
  position: relative;
  z-index: 5;
  pointer-events: auto !important;
}

/* Par défaut, le contenu interne ne capture pas le clic du bouton */
.leaflet-popup-content .popup-content button * {
  pointer-events: none;
}

/* Exception: le ? tooltip doit rester cliquable */
.leaflet-popup-content .popup-content .suggest-help,
.leaflet-popup-content .popup-content .suggest-help * {
  pointer-events: auto;
}

@media screen and (max-width: 768px) {
  .suggest-help {
    width: 18px;
    height: 18px;
    top: 0;
    right: 0;
    transform: translate(45%, -45%);
    font-size: 11px;
  }
}

/* Style pour l'affichage des photos côte à côte */
.photos-container {
  display: flex !important;
  gap: 8px !important;
  margin: 10px 0;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center;
}

.photos-container.single-photo {
  display: flex !important; /* Garde flex pour le centrage */
  justify-content: center !important; /* Centre horizontalement */
  align-items: center !important; /* Centre verticalement */
}

.photos-container img {
  flex: 1;
  width: 100%;
  height: auto;
  border-radius: 8px;
  cursor: pointer;
}

.photos-container video,
.impact-photos video {
  flex: 1 !important;
  width: auto !important;
  height: auto;
  object-fit: contain !important;
  border-radius: 8px;
  display: block;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.photos-container .media-preview,
.impact-photos .media-preview {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  flex: 1 !important;
  width: auto !important;
  height: auto;
  display: block;
  cursor: pointer;
}

.photos-container .media-preview.media-preview-animated,
.impact-photos .media-preview.media-preview-animated {
  aspect-ratio: 1 / 1;
  line-height: 0;
}

.photos-container .media-preview img,
.impact-photos .media-preview img {
  width: 100% !important;
  height: auto;
  object-fit: contain !important;
  display: block;
}

.photos-container .media-preview.media-preview-animated img,
.impact-photos .media-preview.media-preview-animated img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  display: block;
  object-fit: cover !important;
}

.media-preview .media-play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-left: 3px;
  pointer-events: none;
}

.photos-container.single-photo img {
  max-width: 100% !important;
  flex: none !important;
}

.photos-container.single-photo .media-preview {
  max-width: 100% !important;
  flex: none !important;
  align-self: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Traces: apercus en containers carres (1 a 3 images) */
.trace-square-grid {
  display: grid !important;
  gap: 8px;
  width: 100%;
}

.trace-square-grid.trace-count-1 {
  grid-template-columns: minmax(0, 1fr);
}

.trace-square-grid.trace-count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trace-square-grid.trace-count-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.trace-square-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(18, 33, 44, 0.92);
}

.trace-square-cell > img,
.trace-square-cell > .media-preview {
  width: 100% !important;
  height: 100% !important;
  border-radius: inherit;
}

.trace-square-cell > img {
  object-fit: cover !important;
  object-position: center center !important;
  display: block;
}

.trace-square-cell > .media-preview {
  position: relative;
  overflow: hidden;
}

.trace-square-cell > .media-preview img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
}

.trace-square-cell > video,
.trace-square-cell > .media-preview video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
}

/* Traces popup galerie: 3 images sur la meme ligne */
.gallery-trace-popup-grid.trace-count-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

/* Traces leaflet + mobile: 2 en haut, 1 centree en dessous */
.leaflet-trace-popup-grid.trace-count-3,
.mobile-trace-popup-grid.trace-count-3 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.leaflet-trace-popup-grid.trace-count-3 .trace-square-cell:nth-child(3),
.mobile-trace-popup-grid.trace-count-3 .trace-square-cell:nth-child(3) {
  grid-column: 1 / span 2;
  width: calc(50% - 4px);
  justify-self: center;
}

/* Leaflet: s'assurer que la grille est visible */
.leaflet-popup-content .leaflet-trace-popup-grid {
  display: grid !important;
  width: 100% !important;
}

.photo-label {
  font-size: 10px;
  color: #b0cfe0;
  text-align: center;
  margin-top: 2px;
  font-style: italic;
}

/* Liste des impacts */
.impacts-list {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 1400;
  display: none;
  overflow-y: auto;
  padding: 20px;
}

.impacts-list.active {
  display: block;
}

.impacts-container {
  max-width: 1000px;
  margin: auto;
  background: #1c2b36;
  border-radius: 15px;
  padding: 20px;
  padding-top: 120px;
  position: relative;
}

/* Infobulles pour les curseurs de timeline */
.timeline-slider {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #4fc3f7;
  border-radius: 50%;
  top: 5px;
  cursor: grab;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
}

.timeline-slider:active {
  cursor: grabbing;
  transform: scale(1.1);
}

.timeline-slider::after {
  content: "";
  width: 12px;
  height: 12px;
  display: block;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Infobulle des curseurs */
.timeline-slider::before {
  content: attr(data-date);
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 1001;
  pointer-events: none;
}

.timeline-slider.is-dragging::before {
  opacity: 1;
  visibility: visible;
}

/* Positionner les curseurs pour que leur centre soit sur les extrémités */
.timeline-slider:first-child {
  left: 5% !important;
  transform: translateX(-50%) translateY(-50%) !important; 
}
.timeline-slider:last-child {
  left: 95% !important;
  transform: translateX(-50%) translateY(-50%) !important; 
}

/* Curseurs normaux centrés */
.timeline-slider {
  transform: translateX(-50%) translateY(-50%);
}

/* Info-bulles ajustées pour rester lisibles */
.timeline-slider:first-child::before {
  left: 50% !important;
  transform: translateX(-50%) !important;
}

.timeline-slider:last-child::before {
  left: 50% !important;
  transform: translateX(-50%) !important;
}

/* Evite que les pseudo-elements des sliders masquent les marqueurs aux extremites */
.timeline-slider:first-child::before,
.timeline-slider:last-child::before,
.timeline-slider:first-child::after,
.timeline-slider:last-child::after {
  display: none !important;
}

.timeline-slider {
  position: absolute;
  z-index: 1500;
  transform: translateX(-50%) translateY(-50%);
}

/* Mode sélection de zoom */
.timeline-container.zoom-selection-mode {
  background: linear-gradient(135deg, #1a4d5c, #26343f) !important;
  border-top: 2px solid #ffeb3b !important;
}

.timeline-container.zoom-selection-mode .timeline-header::after {
  content: "\1F4C5";
  color: #ffeb3b;
  font-weight: normal;
}

/* Conteneur header avec bouton */
.timeline-header-container {
  display: none;
}

.timeline-side-controls {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: var(--timeline-side-w);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  z-index: 1001;
}

.timeline-side-controls .timeline-header {
  display: none !important;
}

.timeline-header {
  margin-bottom: 0 !important;
}

.timeline-reset-btn {
  background: #607d8b;
  color: white;
  border: none;
  padding: 0;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  font-weight: normal;
}

.timeline-reset-btn svg {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
}

.timeline-reset-btn:hover {
  background: #546e7a;
  transform: scale(1.1);
}

.timeline-reset-btn:active {
  transform: scale(0.95);
}

/* Masquer le bouton quand timeline collapsed */
.timeline-container.collapsed .timeline-header-container,
.timeline-container.collapsed .timeline-side-controls {
  display: none;
}

/* Curseurs en mode sélection */
.zoom-selection-mode .timeline-slider {
  background: #ffeb3b !important;
  border-color: #f57f17 !important;
  box-shadow: 0 0 10px rgba(255, 235, 59, 0.6) !important;
}

/* Ajuster la position de l'en-tête pour qu'elle reste en haut */
.impacts-header {
  position: absolute;
  top: 10px;
  left: 20px;
  right: 20px;
  color: #4fc3f7;
  height: 60px;
  text-align: center;
}

/* S'assurer que le contenu des impacts commence après l'en-tête */
#impacts-content {
  margin-top: 40px;
}

.impacts-header h2 {
  font-size: 16px;
  margin: 0;
  text-align: center;
}

.impacts-close {
  position: absolute;
  top: 10px;
  right: 15px;
  width: 30px;
  height: 30px;
  background: #607d8b;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.impacts-close:hover {
  background: #546e7a;
}

.impact-item {
  background: #26343f;
  border-radius: 8px;
  padding: 15px;
  margin: 10px 0;
  display: flex;
  gap: 15px;
  align-items: flex-start; /* ← CHANGEMENT: flex-start au lieu de center */
  cursor: pointer;
  min-height: auto; /* ← AJOUT: Hauteur automatique */
  position: relative;
}

.impact-item:hover {
  background: #34495e;
}

/* LISERÉ JAUNE POUR LES IMPACTS MIS EN AVANT DANS LA LISTE */
.impact-item.featured {
  background: #26343f !important;
  border: 2px solid #FFD700 !important;
  color: #eee !important;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3) !important;
}

.impact-item .impact-photos {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  flex-direction: row;
  min-width: 160px;
  align-items: flex-end;
  flex-shrink: 0; /* ← AJOUT: Empêche la compression des photos */
}

.impact-item .impact-photos img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

.impact-item .impact-photos.trace-square-grid {
  display: grid !important;
  gap: 6px;
  width: auto;
  min-width: auto;
}

.impact-item .impact-photos.trace-square-grid.trace-count-1 {
  grid-template-columns: 72px;
}

.impact-item .impact-photos.trace-square-grid.trace-count-2 {
  grid-template-columns: repeat(2, 72px);
}

.impact-item .impact-photos.trace-square-grid.trace-count-3 {
  grid-template-columns: repeat(3, 72px);
}

.impact-item .impact-photos.trace-square-grid .trace-square-cell > .media-preview {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
}

.impact-item .impact-photos video,
.impact-item .impact-photos .media-preview {
  width: 80px !important;
  height: 60px !important;
  flex: none !important;
  max-width: 80px !important;
  border-radius: 6px;
}

.impact-item .impact-photos .media-preview img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.impact-item .impact-photos.single-photo img {
  width: 80px;
}

.impact-item .impact-photos.single-photo video,
.impact-item .impact-photos.single-photo .media-preview {
  width: 80px !important;
  max-width: 80px !important;
}

.impact-info {
  flex: 1;
  color: #eee;
  word-wrap: normal; /* ← AJUSTÉ: Pas de coupure de mots */
  overflow-wrap: normal; /* ← AJUSTÉ: Pas de coupure de mots */
  word-break: normal; /* ← AJOUT: Pas de coupure de mots */
  hyphens: none; /* ← AJUSTÉ: Pas de césure automatique */
  line-height: 1.4; /* ← AJOUT: Espacement des lignes */
}

.impact-date {
  color: #4fc3f7;
  font-weight: bold;
}

.impact-date-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.impact-contribution-type {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  background: rgba(79, 195, 247, 0.16);
  color: #9ddfff;
}

.impact-contribution-type--reference {
  padding: 2px 7px;
  font-size: 12px;
}

.impact-contribution-type--traces {
  padding: 2px 7px;
  font-size: 12px;
}

.impact-contribution-type--complement {
  padding: 1px 5px;
  font-size: 10px;
}

/* Mobile card: garder exactement la meme taille de badge qu'en version PC */
.mobile-card .impact-contribution-type,
.mobile-card-content .impact-contribution-type {
  font-size: 11px !important;
  padding: 1px 6px !important;
  border-radius: 4px !important;
}

.mobile-card .impact-contribution-type--reference,
.mobile-card .impact-contribution-type--traces,
.mobile-card-content .impact-contribution-type--reference,
.mobile-card-content .impact-contribution-type--traces {
  font-size: 12px !important;
  padding: 2px 7px !important;
}

.mobile-card .impact-contribution-type--complement,
.mobile-card-content .impact-contribution-type--complement {
  font-size: 10px !important;
  padding: 1px 5px !important;
}

.trace-category-object-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trace-category-object-sep {
  color: #7aa0b3;
  font-weight: 600;
}

.impact-author-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 5px 0;
}

.impact-author-line .author-slot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
}

.impact-author-line .author-button {
  flex: 0 0 auto;
}

.impact-author-line .favorite-btn {
  flex: 0 0 auto;
  width: auto;
}

/* ← AJOUT: Styles pour les descriptions longues */
.impact-info > div {
  margin-bottom: 6px;
}

.impact-info > div:last-child {
  margin-bottom: 0;
}

/* ← AJOUT: Style spécial pour la description */
.impact-info > div:has(strong:contains("Description")) {
  white-space: pre-wrap; /* Respecte les retours à la ligne */
  max-width: 100%;
}

/* POPUP RAISON DE MISE EN AVANT */
.featured-reason-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 2700;
  display: none;
}

.featured-reason-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1c2b36;
  padding: 25px;
  border-radius: 12px;
  color: #eee;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.featured-reason-popup h3 {
  color: #ffd700;
  text-align: center;
  margin-top: 0;
  margin-bottom: 15px;
}

.featured-reason-popup textarea {
  width: 100%;
  background: #26343f;
  color: white;
  border: 1px solid #4fc3f7;
  padding: 10px;
  border-radius: 6px;
  resize: vertical;
  min-height: 80px;
  box-sizing: border-box;
  font-size: 14px;
}

.featured-reason-buttons {
  text-align: center;
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

.featured-reason-buttons button {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
}

.confirm-featured-reason {
  background: #ffd700;
  color: #000;
}

.confirm-featured-reason:hover {
  background: #ffed4e;
}

.cancel-featured-reason {
  background: #607d8b;
  color: white;
}

.cancel-featured-reason:hover {
  background: #546e7a;
}

.leaflet-control-zoom {
  display: none !important;
}

@media screen and (max-width: 768px) {
    .filter-panel {
        position: fixed !important;
        width: 0;
        padding: 0;
        background: transparent !important;
        
        /* Centrage horizontal */
        left: 50% !important;
        transform: translateX(-50%) !important;
        right: auto !important;
        
        /* Hauteur adaptative, ancrée vers le bas */
        top: auto !important;
        bottom: 15px !important;
        height: auto !important;
        max-height: calc((100dvh - 15px) * 0.9) !important;
        transform-origin: bottom center !important;
        
        font-size: 15px;
        z-index: 1500 !important;
        overflow-y: auto !important;
        overscroll-behavior: contain !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        
        /* Style responsive */
        max-width: 500px !important;
    }
    
    /* CONTOUR BLEU renforcé quand le panneau est ouvert */
    .filter-panel[style*="width: 290px"],
    .filter-panel[style*="width: 300px"],
    .filter-panel[style*="width: 320px"],
    .filter-panel[style*="width: 335px"],
    .filter-panel[style*="width: 352px"] {
        background: rgba(28, 43, 54, 0.85) !important;
        backdrop-filter: blur(18px) saturate(115%) !important;
        -webkit-backdrop-filter: blur(18px) saturate(115%) !important;
        border: 2px solid #98dbfaff !important;
        box-shadow: 0 0 15px rgba(79, 195, 247, 0.3) !important; /* ← LUEUR BLEUE */
    }
    
    .filter-panel h2 { 
        font-size: 18px; 
    }
}
  
  /* FORCER L'AFFICHAGE MOBILE DU FORMULAIRE */
  #form-popup .row-three {
    display: block !important;
  }
  
  #form-popup .row-three .col:nth-child(1),
  #form-popup .row-three .col:nth-child(2) {
    display: inline-block !important;
    width: 48% !important;
    vertical-align: top !important;
    margin-right: 2% !important;
  }
  
  #form-popup .row-three .col:nth-child(2) {
    margin-right: 0 !important;
  }

  #form-popup .row-three .col:nth-child(3) {
    display: block !important;
    width: 100% !important;    
    clear: both !important;
  }
  
  .timeline {
    margin: 0 20px -15px calc(var(--timeline-side-w) + 8px);
  }
  .timeline-labels {
    margin: 6px 20px 0 calc(var(--timeline-side-w) + 8px);
    --timeline-label-right-gap: 20px;
  }
  
  .impact-item {
    flex-direction: row !important;
    align-items: center !important;
    padding: 10px !important;
    margin: 10px 0 !important;
}
.impact-item .impact-photos {
    min-width: 140px !important;
    max-width: 300px !important;
    width: auto !important;
    justify-content: flex-end !important;
    order: 2 !important;
}

#gallery-popup-content {
  position: relative !important;
}

/* RÈGLE D'ACTIVATION pour le popup gallery */
.gallery-popup.active .gallery-close-float {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Z-index correct - niveau de base */
.gallery-close-float {
  z-index: 2700 !important; /* Plus haut que gallery-popup (2600) */
}

/* Mobile uniquement - UNE SEULE RÈGLE */
@media screen and (min-width: 769px) {
  .gallery-close-float {
    display: none !important;
  }
}

/* Désactiver le bouton croix en haut sur mobile */
@media screen and (max-width: 768px) {
  .gallery-popup-close {
    display: none !important;
    visibility: hidden !important;
  }

  .gallery-popup-sort-bar {
    display: none !important;
  }
}


/* Réutiliser les styles image-popup-nav pour la galerie */
#gallery-popup-content .image-popup-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2800;
}

  .mobile-filter-toggle {
      position: fixed !important;
      bottom: 130px !important;
      right: 10px !important;
      width: 50px !important;
      height: 50px !important;
      background: linear-gradient(135deg, #4fc3f7, #26a69a) !important;
      border: none !important;
      border-radius: 50% !important;
      cursor: pointer !important;
      z-index: 12998 !important;
      transition: all 0.3s ease !important;
      display: none !important;
      padding: 12px !important;
      box-shadow: 0 4px 15px rgba(79, 195, 247, 0.3) !important;
  }

  .mobile-filter-toggle svg {
      width: 18px;
      height: 18px;
      display: block;
  }

.mobile-filter-toggle::before {
      content: none;
      display: none;
  }

/* NOUVEAU: Bouton quand panneau ouvert - devient gris et descend */
.mobile-filter-toggle.panel-open {
    bottom: 42px !important;
    right: 20px !important;
    background: rgba(96, 125, 139, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    z-index: 12998 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
}

.mobile-filter-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: 22px;
    line-height: 1;
}

.hamburger-filter {
    display: none !important;
    flex-direction: column !important;
    gap: 4px !important;
    width: 20px !important;
}

.mobile-filter-toggle.active::before {
    content: "";
    display: none !important;
}

.mobile-filter-toggle.panel-open::before {
    content: "";
    background-image: none !important;
    display: none !important;
}

.mobile-filter-toggle.active .hamburger-filter {
    display: flex !important;
}

.mobile-filter-toggle.panel-open .hamburger-filter {
    display: flex !important;
    margin: 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
}

.hamburger-filter span {
    height: 2px !important;
    background: white !important;
    border-radius: 1px !important;
    transition: all 0.3s ease !important;
    transform-origin: center !important;
}

.hamburger-filter span:nth-child(1) { width: 100% !important; }
.hamburger-filter span:nth-child(2) { width: 80% !important; }
.hamburger-filter span:nth-child(3) { width: 100% !important; }

.mobile-filter-toggle.active .hamburger-filter span:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px) !important;
}

.mobile-filter-toggle.panel-open .hamburger-filter span:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px) !important;
}

.mobile-filter-toggle.active .hamburger-filter span:nth-child(2) {
    opacity: 0 !important;
}

.mobile-filter-toggle.panel-open .hamburger-filter span:nth-child(2) {
    opacity: 0 !important;
}

.mobile-filter-toggle.active .hamburger-filter span:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px) !important;
}

.mobile-filter-toggle.panel-open .hamburger-filter span:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px) !important;
}

@media screen and (max-width: 768px) {
    .map-view-shortcuts .mobile-filter-toggle {
        position: relative !important;
        bottom: auto !important;
        right: auto !important;
        top: auto !important;
        left: auto !important;
        z-index: auto !important;
        margin: 0 !important;
    }

    .map-view-shortcuts .mobile-filter-toggle.panel-open {
        bottom: auto !important;
        right: auto !important;
    }

    .mobile-filter-toggle,
    .map-view-shortcuts {
        transition: bottom 0.3s ease, right 0.3s ease !important;
    }

    .filter-panel {
        width: min(92vw, 352px) !important;
        padding: 0 !important;
        overflow: hidden;
        left: 50% !important;
        right: auto !important;
        top: auto !important;
        bottom: 15px !important;
        transform: translate(-50%, calc(100% + 120px));
        transform-origin: bottom center;
        opacity: 0;
        pointer-events: none;
        transition: transform 0.34s cubic-bezier(0.22, 0.8, 0.24, 1), opacity 0.2s ease !important;
    }

    .filter-panel.mobile-panel-open {
        transform: translate(-50%, 0);
        opacity: 1;
        pointer-events: auto;
        background: rgba(28, 43, 54, 0.85) !important;
        backdrop-filter: blur(18px) saturate(115%) !important;
        -webkit-backdrop-filter: blur(18px) saturate(115%) !important;
        border: 2px solid #98dbfaff !important;
        box-shadow: 0 0 15px rgba(79, 195, 247, 0.3) !important;
    }

    .filter-panel-head {
        position: sticky;
        top: 0;
        z-index: 1801 !important;
    }

    .filter-panel-close {
        display: none !important;
    }

    .mobile-filter-toggle {
        /* Aligner sur le style Fulgurpedia (fp-mobile-filter-toggle) en mobile */
        position: fixed !important;
        bottom: 80px !important;
        right: 10px !important;
        width: 50px !important;
        height: 50px !important;
        background: linear-gradient(135deg, #4fc3f7, #26a69a) !important;
        border: none !important;
        border-radius: 50% !important;
        cursor: pointer !important;
        z-index: 12998 !important;
        transition: all 0.3s ease !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        color: #fff !important;
        box-shadow: 0 4px 15px rgba(79, 195, 247, 0.3) !important;
    }

    .mobile-filter-toggle svg {
        width: 18px !important;
        height: 18px !important;
        display: block !important;
    }

    .mobile-filter-toggle.panel-open {
        background: rgba(96, 125, 139, 0.92) !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
    }
    
    #toggle-panel {
        display: none !important;
    }

    .mobile-filter-toggle:focus-visible {
        outline-offset: 3px;
    }

    #map-add-impact-wrap {
        position: relative !important;
        width: 50px !important;
        height: 50px !important;
    }

    #map-add-impact {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        width: 50px !important;
        height: 50px !important;
        border-radius: 50% !important;
        z-index: auto !important;
        box-shadow: 0 4px 15px rgba(79, 195, 247, 0.3) !important;
    }
    #map-add-impact::after {
        display: none !important;
    }

    .map-add-impact-actions {
        top: auto !important;
        bottom: -30 !important;
        transform: translateX(8px) !important;
        right: calc(100% + 8px) !important;
        gap: 0px !important;
    }

    .map-add-impact-wrap.is-open .map-add-impact-actions {
        transform: translateX(0) !important;
    }

    .map-add-impact-action {
        min-width: 128px;
        height: 40px;
        padding: 7px 9px;
        border-radius: 999px;
    }

    .map-add-impact-action span {
        font-size: 11px;
    }

    .map-view-shortcuts {
        position: fixed !important;
        bottom: calc(130px + 5px) !important;
        top: auto !important;
        right: 10px !important;
        width: 50px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        z-index: 1300 !important;
    }

    .map-view-btn {
        width: 50px;
        height: 50px;
        min-width: 50px;
        font-size: 20px;
    }

    .map-view-shortcuts.panel-open {
        bottom: calc(130px + 5px) !important;
        right: 20px !important;
        z-index: 1300 !important;
    }

    body.mobile-filter-panel-open .map-view-shortcuts.panel-open {
        opacity: 0 !important;
        pointer-events: none !important;
        z-index: 1000 !important;
    }

    body.timeline-collapsed .mobile-filter-toggle {
        bottom: 40px !important;
    }

    body.timeline-collapsed .map-view-shortcuts {
        bottom: calc(30px + 5px) !important;
    }

    body.timeline-collapsed .mobile-filter-toggle.panel-open {
        bottom: 10px !important;
    }

    body.timeline-collapsed .map-view-shortcuts.panel-open {
        bottom: calc(30px + 5px) !important;
    }

    .map-view-shortcuts .mobile-filter-toggle,
    .map-view-shortcuts .mobile-filter-toggle.panel-open,
    body.timeline-collapsed .map-view-shortcuts .mobile-filter-toggle,
    body.timeline-collapsed .map-view-shortcuts .mobile-filter-toggle.panel-open {
        bottom: auto !important;
        right: auto !important;
    }

}
  
  .button-row {
    display: flex;
    gap: 5px;
  }
    
  .map-title {
    font-size: 18px;
    padding: 8px 16px;    
  }
  
  .map-copyright {
    font-size: 11px;
    bottom: 8px;
    right: 8px;
  }

/* Réduire la taille du texte dans la liste des impacts */
.impact-item .impact-info {
  font-size: 13px !important;
  line-height: 1.4;
}

.impact-item .impact-info .impact-date {
  font-size: 14px !important; /* Date un peu plus grande */
  font-weight: bold;
}

.impact-item .impact-info strong {
  font-size: 14px !important; /* Labels plus petits */
}

.impact-item .author-button {
  font-size: 10px !important; /* Boutons plus petits */
  padding: 4px 8px !important;
}

/* MOBILE : Photos au-dessus des infos + retours à la ligne forcés */
@media screen and (max-width: 768px) {
  /* Structure verticale */
  .impact-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 15px !important;
    margin: 8px 0 !important;
    gap: 12px !important;
  }
  
  /* Photos AU-DESSUS (order: 1) */
  .impact-item .impact-photos {
    order: 1 !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: auto !important;
    max-width: 100% !important;
    justify-content: flex-start !important;
    margin-bottom: 8px !important;
  }
  
  /* Infos EN-DESSOUS (order: 2) avec retours à la ligne */
  .impact-item .impact-info {
    order: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    white-space: normal !important;
    word-wrap: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    line-height: 1.3 !important;
    font-size: 12px !important;
  }
  
  /* Forcer aussi sur chaque div de description */
  .impact-item .impact-info div {
    word-break: normal !important;
    overflow-wrap: normal !important;
    max-width: 100% !important;
  }
  
  /* Taille des photos sur mobile */
  .impact-item .impact-photos img {
    width: 90px !important;
    height: 75px !important;
  }
  .impact-item .impact-photos video,
  .impact-item .impact-photos .media-preview {
    width: 90px !important;
    height: 75px !important;
    max-width: 90px !important;
    flex: none !important;
  }
}

/* Photos côte à côte - RÈGLE GLOBALE HORS MEDIA QUERY */
.photos-container {
  display: flex !important;
  gap: 8px !important;
  margin: 10px 0;
  flex-direction: row !important;
  flex-wrap: wrap !important; /* ✅ AJOUTÉ pour gérer 3+ photos */
  align-items: center;
}

.photos-container img {
  flex: 1 !important;
  width: auto !important;
  height: auto;
  object-fit: contain !important;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.photos-container img:hover,
.photos-container video:hover {
  opacity: 0.8;
}

.photos-container .media-preview:hover,
.impact-photos .media-preview:hover {
  opacity: 0.8;
}

/* ✅ NOUVEAU : Gestion spécifique pour 1, 2 ou 3 photos */

/* 1 photo : pleine largeur */
.photos-container.single-photo {
  display: block !important;
  text-align: center !important;
}

.photos-container.single-photo img {
  max-width: 100% !important;
  flex: none !important;
}

/* 2 photos : 50% chacune */
.photos-container img:nth-child(1):nth-last-child(2),
.photos-container img:nth-child(2):nth-last-child(1),
.photos-container video:nth-child(1):nth-last-child(2),
.photos-container video:nth-child(2):nth-last-child(1),
.photos-container .media-preview:nth-child(1):nth-last-child(2),
.photos-container .media-preview:nth-child(2):nth-last-child(1) {
  max-width: calc(50% - 4px) !important; /* 50% moins la moitié du gap */
}

/* ✅ 3 photos : disposition optimisée */
.photos-container img:nth-child(1):nth-last-child(3),
.photos-container img:nth-child(2):nth-last-child(2),
.photos-container img:nth-child(3):nth-last-child(1),
.photos-container video:nth-child(1):nth-last-child(3),
.photos-container video:nth-child(2):nth-last-child(2),
.photos-container video:nth-child(3):nth-last-child(1),
.photos-container .media-preview:nth-child(1):nth-last-child(3),
.photos-container .media-preview:nth-child(2):nth-last-child(2),
.photos-container .media-preview:nth-child(3):nth-last-child(1) {
  max-width: calc(33.333% - 6px) !important; /* 33% moins le gap */
}

/* Sur écrans moyens : 3 photos deviennent 2+1 */
@media screen and (max-width: 768px) {
  .photos-container img:nth-child(1):nth-last-child(3),
  .photos-container img:nth-child(2):nth-last-child(2),
  .photos-container video:nth-child(1):nth-last-child(3),
  .photos-container video:nth-child(2):nth-last-child(2),
  .photos-container .media-preview:nth-child(1):nth-last-child(3),
  .photos-container .media-preview:nth-child(2):nth-last-child(2) {
    max-width: calc(50% - 4px) !important;
  }
  
  .photos-container img:nth-child(3):nth-last-child(1),
  .photos-container video:nth-child(3):nth-last-child(1),
  .photos-container .media-preview:nth-child(3):nth-last-child(1) {
    max-width: 100% !important;
    margin-top: 8px;
  }
}

/* Seulement sur très petits écrans (mobile) */
@media screen and (max-width: 480px) {
   
  .photos-container img,
  .photos-container video,
  .photos-container .media-preview {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
  }
}

/* Version 1 photo par ligne sur mobile */
@media screen and (max-width: 768px) {
  .photos-container {
    flex-direction: column; /* ✅ Une photo par ligne */
    gap: 10px;
  }
  
  .photos-container img {
    flex: none;
    width: 100%; /* ✅ Toute la largeur */
    max-width: 100%;
    height: 160px; /* ✅ Plus de hauteur */
  }
}

/* STYLES DU POPUP FORMULAIRE MODERNISÉ */
#form-popup {
  position: fixed;
  top: calc(var(--top-bar-offset, 56px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #1c2b36, #26343f);
  color: #eee;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  z-index: 13000;
  display: none;
  max-width: 95%;
  max-height: calc(100dvh - var(--top-bar-offset, 56px) - 16px);
  overflow-y: auto;
  width: 800px;
  min-height: 500px;
  scrollbar-width: thin;
  scrollbar-color: rgba(79, 195, 247, 0.65) rgba(18, 34, 45, 0.6);
}

#form-popup::-webkit-scrollbar {
  width: 6px;
}

#form-popup::-webkit-scrollbar-track {
  background: rgba(18, 34, 45, 0.6);
  border-radius: 999px;
}

#form-popup::-webkit-scrollbar-thumb {
  background: rgba(79, 195, 247, 0.65);
  border-radius: 999px;
}

#form-popup::-webkit-scrollbar-thumb:hover {
  background: rgba(79, 195, 247, 0.85);
}

#form-popup.active { display: block; }
#form-popup h2 { color: #4fc3f7; text-align: center; margin-bottom: 15px; margin-top: 0; }

#form-popup .photo-help {
    color: #b0cfe0;
    font-size: 11px;
    margin-top: 4px;
    font-weight: normal;
}

#form-popup input[type="file"] {
    background: rgba(28, 43, 54, 0.9);
    color: #e0e8f0;
    border: 2px solid #4fc3f7;
    border-radius: 8px;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    margin-bottom: 5px;
}

#form-popup input[type="file"]:focus {
    outline: none;
    border-color: #03a9f4;
    box-shadow: 0 0 8px rgba(3, 169, 244, 0.6);
}

#photo-preview {
    text-align: center;
    padding: 10px;
    background: rgba(79, 195, 247, 0.1);
    border-radius: 8px;
    border: 1px dashed #4fc3f7;
}

.form-description {
  text-align: left !important;
  font-size: 0.75em;
  color: #b0cfe0;
  margin-bottom: 20px;
  font-weight: bold;
  line-height: 1.4;
}

#form-popup input[type="date"]::-webkit-calendar-picker-indicator {
  filter: brightness(0) invert(1);
}

#form-popup .close-btn {
  position: static;
  background: #607d8b;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  width: 100%;
  margin-top: 20px;
  font-size: 16px;
}
#form-popup .close-btn:hover { background: #546e7a; }
#form-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 12999;
  display: none;
}
#form-overlay.active { display: block; }

#form-popup label { display: block; margin-top: 15px; font-weight: bold; color: #b0cfe0; }
#form-popup input[type=text], #form-popup input[type=url], #form-popup input[type=date], #form-popup select, #form-popup textarea, #form-popup input[type=file] {
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  border-radius: 6px;
  border: 1px solid #4fc3f7;
  background: #15232b;
  color: #eee;
  box-sizing: border-box;
  font-size: 14px;
}
#form-popup textarea { 
  resize: vertical; 
  height: 100px; 
}

#form-popup textarea::placeholder {
  color: #7f8c8d;
  font-style: italic;
  font-size: 12px;
}

#form-popup .radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
#form-popup .radio-group label {
  font-weight: normal;
  color: #b0cfe0;
  display: flex;
  align-items: center;
  margin-top: 0;
  margin-bottom: 0;
}
#form-popup .radio-group input[type=radio] {
  width: auto;
  margin-right: 10px;
  margin-top: 0;
}

#form-popup .specialty-checkboxes {
    margin-top: 15px;
    padding: 12px;
    background: #26343f;
    border-radius: 8px;
    border-left: 4px solid #f39c12;
}

#form-popup .specialty-checkboxes .section-title {
    color: #f39c12;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 8px;
    display: block;
}

#form-popup .specialty-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#form-popup .specialty-options label {
    font-weight: normal;
    color: #b0cfe0;
    display: flex;
    align-items: center;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 14px;
}

#form-popup .specialty-options input[type=checkbox] {
    width: auto;
    margin-right: 8px;
    margin-top: 0;
}

#form-popup input[type=checkbox] { 
  width: auto;
  margin-right: 10px; 
  margin-top: 0;
}
#form-popup .submit-btn {
  padding: 12px 25px;
  background: #4fc3f7;
  color: #1c2b36;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  margin-top: 20px;
  width: 100%;
  transition: 0.3s;
}
#form-popup .submit-btn:hover { background: #29b6f6; }
#form-popup .submit-btn:disabled {
  background: #607d8b;
  cursor: not-allowed;
}

#form-popup .row { 
  display: flex; 
  gap: 20px; 
  align-items: flex-start;
}
#form-popup .row .col { 
  flex: 1; 
  display: flex;
  flex-direction: column;
}
#form-popup .row-three { 
  display: flex; 
  gap: 20px; 
  align-items: flex-start;
}
#form-popup .row-three .col { 
  flex: 1;
  display: flex;
  flex-direction: column;
}
#form-popup .time-select {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
#form-popup .time-select select { 
  width: 90px; 
  margin-top: 0;
}
#form-popup .time-select span {
  color: #b0cfe0;
  font-weight: bold;
}

#form-popup .meteologix-help, #form-popup .gps-help {
    color: #b0cfe0; 
    font-size: 11px; 
    margin-top: 4px; 
    font-weight: normal;
}

/* Toast notification pour formulaire */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(46, 204, 113, 0.3);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10000;
    max-width: 350px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toast-icon {
    font-size: 24px;
    animation: checkmark 0.6s ease-in-out 0.2s both;
}

.toast-text {
    flex: 1;
}

.toast-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 14px;
    opacity: 0.9;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(45deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(45deg);
        opacity: 1;
    }
}

.toast-notification.hide {
    transform: translateX(400px);
    opacity: 0;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 12px 12px;
    animation: progress 2s linear forwards;
}

@keyframes progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Style des popups PC identique au mobile */
.leaflet-popup-content {
    font-size: 14px !important;
    line-height: 1.3;
    background: #1c2b36 !important;
    color: #eee !important;
    border-radius: 8px !important;
    border: none !important;
}

.leaflet-popup-content-wrapper {
    background: #1c2b36 !important;
    color: #eee !important;
    border-radius: 8px !important;
    border: 2px solid #4fc3f7 !important;
    box-shadow: 0 15px 30px rgba(0,0,0,0.4) !important;
}

.leaflet-popup-tip {
    background: #1c2b36 !important;
    border: 2px solid #4fc3f7 !important;
    box-shadow: none !important;
}

.leaflet-popup {
  --point-tier-accent: #4fc3f7;
  --point-tier-shadow: rgba(79, 195, 247, 0.45);
}

/* Keep Leaflet popups above fixed map header layers */
.leaflet-popup-pane {
  z-index: 5000 !important;
}

.leaflet-popup.point-tier-reference {
  --point-tier-accent: #4fc3f7;
  --point-tier-shadow: rgba(79, 195, 247, 0.45);
}

.leaflet-popup.point-tier-complement {
  --point-tier-accent: #26a69a;
  --point-tier-shadow: rgba(38, 166, 154, 0.45);
}

.leaflet-popup.point-tier-traces {
  --point-tier-accent: #ff8a26;
  --point-tier-shadow: rgba(255, 138, 38, 0.45);
}

.leaflet-popup.point-tier-owned {
  --point-tier-accent: #37ff14af;
  --point-tier-shadow: rgba(57, 255, 20, 0.55);
}

.leaflet-popup.point-tier-reference .leaflet-popup-content-wrapper,
.leaflet-popup.point-tier-complement .leaflet-popup-content-wrapper,
.leaflet-popup.point-tier-traces .leaflet-popup-content-wrapper,
.leaflet-popup.point-tier-owned .leaflet-popup-content-wrapper {
  border-color: var(--point-tier-accent) !important;
  box-shadow: 0 15px 30px rgba(0,0,0,0.4), 0 0 0 2px var(--point-tier-shadow) !important;
}

.leaflet-popup.point-tier-reference .leaflet-popup-tip,
.leaflet-popup.point-tier-complement .leaflet-popup-tip,
.leaflet-popup.point-tier-traces .leaflet-popup-tip,
.leaflet-popup.point-tier-owned .leaflet-popup-tip {
  border-color: var(--point-tier-accent) !important;
}

/* TOUS LES TITRES en bleu sans soulignement - CLASSES RÉELLES */
.mobile-card-content strong,
.impact-item strong, 
.gallery-popup strong,
.popup-content strong,
.leaflet-popup-content strong {
    text-decoration: none !important;
    color: #4fc3f7 !important;
    font-weight: 600 !important;
}

/* Suppression de tous les soulignements existants */
.popup-content div strong,
.mobile-card div strong {
    text-decoration: none !important;
    color: #4fc3f7 !important;
}

.popup-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 340px;
  word-wrap: break-word;
  align-items: flex-start;
  font-size: 14px;
  position: relative;
}

.popup-content div {
  text-align: left;
  width: 100%;
  font-size: 14px;
}

.popup-content .author-line {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  width: 100%;
  margin: 3px 0;
}

.author-line-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  width: 100%;
}

.author-button {
  background: linear-gradient(135deg, #6cc7ff, #4aaef0);
  color: #0b1c24 !important;
  border: 1px solid rgba(79, 195, 247, 0.85);
  padding: 4px 8px !important;
  border-radius: 10px;
  font-size: 11px !important;
  font-weight: 600 !important;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, border-color 0.2s ease;
  margin-left: 0 !important;
  white-space: nowrap;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.leaflet-popup-content .author-profile-btn {
  width: auto;
  min-width: 0;
  background: linear-gradient(135deg, #ffd36b, #ffb347) !important;
  color: #3b2a00 !important;
  border-color: rgba(255, 191, 64, 0.95) !important;
}

.popup-content img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  cursor: pointer;
}

.popup-content .copyright {
  font-size: 10px;
  color: #607d8b;
  text-align: center !important;
}

.popup-content .author-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: 100%;
}

.mobile-card div {
  text-align: left;
}

.popup-quality-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  width: auto;
  height: auto;
  min-width: 0;
  color: #49d685;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 12;
}

.popup-quality-badge svg {
  width: 22px;
  height: 22px;
}

.leaflet-popup-content .popup-content > .popup-quality-badge {
  top: 2px;
  left: 2px;
}

.mobile-card-content > .popup-quality-badge {
  top: 6px;
  left: 6px;
}

.gallery-popup-content > .popup-quality-badge {
  top: 8px;
  left: 8px;
}

.mobile-card-content {
  position: relative;
}

/* Cacher seulement le texte du titre sur mobile */
#mobile-card-title {
  display: none !important;
}

.mobile-card .author-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  width: 100%;
  font-size: 14px !important;
}

.mobile-card .copyright {
  font-size: 10px;
  color: #607d8b;
  text-align: center !important;
  margin-top: 40px;
}

.leaflet-control-container .leaflet-top.leaflet-left {
  z-index: 1100 !important;
}
.sort-controls {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-controls label {
  color: #b0cfe0;
  font-size: 14px;
  font-weight: normal;
}

.sort-controls select {
  background: #26343f;
  color: #eee;
  border: 1px solid #4fc3f7;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 12px;
  min-width: 200px;
}

@media screen and (max-width: 768px) {
  .sort-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  .sort-controls select {
    width: 100%;
    min-width: auto;
  }
}
/* Style pour la section suggestion visiteurs */
.suggestion-controls {
  margin-top: 15px;
  padding: 12px;
  background: rgba(79, 195, 247, 0.1);
  border-radius: 8px;
  border-left: 4px solid #4fc3f7;
}

.suggestion-controls strong {
  color: #4fc3f7;
  font-size: 13px;
}

.suggestion-controls p {
  font-size: 11px;
  margin: 5px 0;
  color: #b0cfe0;
  line-height: 1.4;
}

/* Bouton de fermeture flottant pour la liste des impacts ROUGE */
.impacts-close-float {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: #d32f2f;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.4);
  z-index: 2605; /* Plus haut que la liste */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
  width: auto;
  max-width: 120px;
  white-space: nowrap;
  text-align: center;
}

.impacts-close-float:hover {
  opacity: 1;
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 20px rgba(211, 47, 47, 0.6);
}

/* Afficher le bouton seulement quand la liste est active */
.impacts-list.active .impacts-close-float {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Version mobile du bouton flottant */
@media screen and (max-width: 768px) {
  .impacts-close-float {
    bottom: 15px;
    padding: 6px 14px;
    font-size: 13px;
    max-width: 100px;
  }
}

/* Zone titre et bouton agrandie UNIQUEMENT pour PC (version compacte sans fond) */
@media screen and (min-width: 769px) {
  .map-header {
    position: absolute;
    top: 6px !important;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px !important;
    z-index: 1100;
    max-width: 90vw;
    padding: 6px 12px !important;
    border-radius: 10px;
    background: rgba(28, 43, 54, 0.8) !important;
  }

  .map-title {
    background: transparent !important;
    color: #4fc3f7 !important;
    padding: 4px 8px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    border-radius: 0 !important;
    text-align: center;
    box-shadow: none !important;
    border: none !important;
    flex-grow: 1;
    max-width: 500px !important;
  }

  .map-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
    border-radius: 50% !important;
    border: 1px solid #4fc3f7 !important;
    color: #4fc3f7 !important;
    background: rgba(28, 43, 54, 1) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .map-btn:hover {
    background: rgba(79, 195, 247, 0.2) !important;
    transform: scale(1.1) !important;
  }
}
/* Réduire la taille du texte du popup info sur mobile */
@media screen and (max-width: 768px) {
  .info-popup-content {
    font-size: 13px !important;
    line-height: 1.3 !important;
  }

  .info-popup-body {
    font-size: 13px !important;
    line-height: 1.4 !important;
  }

  .info-popup-header h3 {
    font-size: 16px !important;
  }

  .info-section h4 {
    font-size: 14px !important;
    text-align: center;
  }

  .rule-text {
    font-size: 12px !important;
    line-height: 1.3 !important;
  }

  .rule-number {
    font-size: 12px !important;
  }

  .info-contact {
    font-size: 12px !important;
  }

  .info-footer {
    font-size: 10px !important;
  }
}

/* Réduire la taille des labels de formulaire sur mobile */
@media screen and (max-width: 768px) {
  #form-popup label {
    font-size: 12px !important;
    font-weight: 600; /* Garde le gras pour la lisibilité */
    line-height: 1.3; /* Améliore l'espacement */
  }
  
  /* Optionnel : ajuster aussi les placeholders */
  #form-popup input::placeholder,
  #form-popup textarea::placeholder {
    font-size: 11px;
  }
  
  /* Réduire la description du formulaire */
  .form-description {
    font-size: 0.65em !important;
    line-height: 1.3;
  }
  
  /* Ajuster les titres de section */
  .specialty-checkboxes .section-title {
    font-size: 11px !important;
  }
}

/* FORCER L'AFFICHAGE DES BOUTONS ADMIN CÔTE À CÔTE */
#admin-buttons-container[style*="flex"] {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    width: 100% !important;
}

#admin-buttons-container[style*="flex"] #admin-access {
    display: inline-flex !important;
    margin: 0 !important;
}

/* Styles pour les boutons admin dans les popups */
.admin-popup-buttons {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.admin-popup-btn {
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  flex: 1;
  min-width: 80px;
}

.edit-btn {
  background: #f39c12;
  color: white;
}

.edit-btn:hover {
  background: #e67e22;
}

.delete-btn {
  background: #e74c3c;
  color: white;
}

.delete-btn:hover {
  background: #c0392b;
}

/* Popup d'édition */
.edit-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1700;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.edit-popup.active {
  display: flex;
}

.edit-popup-content {
  background: #1c2b36;
  border-radius: 15px;
  padding: 25px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  color: #eee;
}

.edit-popup h3 {
  color: #4fc3f7;
  text-align: center;
  margin-top: 0;
}

.edit-popup input, .edit-popup textarea, .edit-popup select {
  width: 100%;
  padding: 8px;
  margin: 5px 0 10px;
  border: 1px solid #4fc3f7;
  border-radius: 4px;
  background: #26343f;
  color: white;
  box-sizing: border-box;
}

.edit-popup label {
  color: #b0cfe0;
  font-weight: bold;
  display: block;
  margin-top: 10px;
}

.edit-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.edit-buttons button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.save-edit {
  background: #27ae60;
  color: white;
}

.save-edit:hover {
  background: #2ecc71;
}

.cancel-edit {
  background: #95a5a6;
  color: white;
}

.cancel-edit:hover {
  background: #7f8c8d;
}

/* GALERIE D'IMAGES - STYLES */
.gallery-view {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 1400;
  display: none;
  overflow-y: auto;
  padding: 20px;
}

.gallery-view.active {
  display: block;
}

.gallery-container {
  max-width: 1400px;
  margin: auto;
  background: #1c2b36;
  border-radius: 15px;
  padding: 20px;
  padding-top: 150px; 
  position: relative;
}

@media screen and (max-width: 768px) {
  .gallery-header {
    width: calc(100% - 80px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
  
  .gallery-controls {
    justify-content: center !important;
  }
}
.gallery-header {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: #4fc3f7;
  height: calc(var(--thumb-size, 200px) * 0.75);
  z-index: 10;
  width: calc(100% - 120px);
  text-align: center;
}

.gallery-header h2 {
  font-size: 16px;
  margin: 0;
  margin-left: 20px;
  margin-bottom: 15px;
}

.gallery-close {
  position: absolute;
  top: 10px;
  right: 15px;
  width: 30px;
  height: 30px;
  background: #607d8b;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-close:hover {
  background: #546e7a;
}

.gallery-controls {
  margin-bottom: 20px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important; /* Centrer au lieu de flex-start */
  gap: 10px !important;
  flex-wrap: nowrap !important;
}

.gallery-size-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(38, 52, 63, 0.6);
  border: 1px solid rgba(79, 195, 247, 0.4);
  padding: 4px 8px;
  border-radius: 6px;
  justify-content: center;
}

.gallery-size-control label {
  font-size: 12px;
  color: #b0cfe0;
  white-space: nowrap;
}

.gallery-size-control input[type="range"] {
  width: 160px;
}

.gallery-controls label {
  color: #b0cfe0 !important;
  font-size: 14px !important;
  font-weight: normal !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.gallery-controls select {
  background: #26343f !important;
  color: #eee !important;
  border: 1px solid #4fc3f7 !important;
  border-radius: 4px !important;
  padding: 5px 10px !important;
  font-size: 12px !important;
  flex: 1 !important;
  min-width: 0 !important;
}

#gallery-filters-reset.timeline-reset-btn {
  flex-shrink: 0 !important;
}

@media (hover: hover) and (pointer: fine) {
  .mobile-filter-toggle:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(79, 195, 247, 0.4) !important;
    background: linear-gradient(135deg, #26a69a, #4fc3f7) !important;
  }

  .mobile-filter-toggle.panel-open:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6) !important;
    background: rgba(84, 110, 122, 0.95) !important;
  }
}

/* Version mobile spécifique */
@media screen and (max-width: 768px) {
  .gallery-controls {
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }
  
  .gallery-controls label {
    font-size: 11px !important;
    white-space: nowrap !important;
  }
  
    .gallery-size-control {
    grid-column: 1 / -1;
    width: 100%;
  }

  .gallery-size-control input[type="range"] {
    width: 100%;
  }.gallery-controls select {
    flex: 1 !important;
    width: auto !important;
    min-width: 0 !important;
    font-size: 11px !important;
  }
  
  #gallery-filters-reset.timeline-reset-btn {
    flex-shrink: 0 !important;
  }
  
  .gallery-close-float {
    bottom: 15px;
    padding: 6px 14px;
    font-size: 13px;
    max-width: 100px;
  }
}


.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--thumb-size, 200px), 1fr));
  gap: 15px;
  margin-top: 0;
}

.gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
  background: #26343f;
}

.gallery-item:hover {
  transform: scale(1.05);
}

.gallery-item.featured {
  border: 2px solid #FFD700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.gallery-item img {
  width: 100%;
  height: calc(var(--thumb-size, 200px) * 0.75);
  object-fit: cover;
  display: block;
}

.gallery-item .gallery-favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  margin: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  padding-top: 1px;
  border-radius: 50%;
  background: rgba(16, 24, 32, 0.7);
  border: 1px solid rgba(79, 195, 247, 0.85);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  z-index: 6;
}

.gallery-item .gallery-favorite-btn.favorite-active {
  background: linear-gradient(135deg, #ffd766, #f4b400) !important;
  border-color: #e3a700 !important;
  color: #3a2a00 !important;
  box-shadow: 0 2px 10px rgba(227, 167, 0, 0.45);
}

.gallery-item .gallery-favorite-btn:not(.favorite-active):hover {
  background: linear-gradient(135deg, #ffe38a, #f4b400) !important;
  border-color: #e3a700 !important;
  color: #3a2a00 !important;
  box-shadow: 0 2px 10px rgba(227, 167, 0, 0.35);
}

.quality-badge,
.quality-badge-inline,
.popup-quality-badge {
  color: #49d685 !important;
}

.quality-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  min-width: 0;
  color: #49d685;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
}

.quality-badge svg {
  width: 19px;
  height: 19px;
}

.quality-badge-inline {
  position: static;
  width: auto;
  height: auto;
  min-width: 0;
  padding: 0;
  line-height: 0;
  box-sizing: border-box;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.impact-date-row .quality-badge-inline {
  margin-left: -12px;
  margin-top: -17px;
}

.leaflet-popup-content .popup-content .impact-contribution-type.impact-contribution-type--reference + .quality-badge-inline,
.mobile-card-content .impact-contribution-type.impact-contribution-type--reference + .quality-badge-inline,
.gallery-popup-content .impact-contribution-type.impact-contribution-type--reference + .quality-badge-inline {
  position: relative;
  margin-left: -18px;
  top: -5px;
}

.mobile-card-content .impact-contribution-type.impact-contribution-type--reference + .quality-badge-inline {
  position: relative;
  margin-left: -18px;
  top: -5px;
}

/* Leaflet popup: decaler legerement le badge "Traces" au-dessus de "Type d'objet" */
.leaflet-popup-content .popup-content .impact-contribution-type.impact-contribution-type--traces {
  margin-top: 4px;
}

.quality-badge-inline svg {
  width: 16px;
  height: 16px;
  display: block;
}

@media (max-width: 768px) {
  .mobile-card-content .impact-contribution-type.impact-contribution-type--reference + .quality-badge-inline {
    position: relative;
    margin-left: -18px;
    top: -5px;
  }
}

.quality-badge.quality-badge-inline {
  color: #49d685;
}

/* Forcer la couleur du badge qualite partout (hors panneau filtre) */
.quality-badge svg,
.quality-badge-inline svg,
.popup-quality-badge svg {
  fill: #49d685 !important;
  stroke: #ffffff !important;
}

.popup-quality-badge.quality-badge-inline {
  position: absolute !important;
  display: inline-flex !important;
  margin: 0 !important;
  flex: 0 0 auto;
  pointer-events: none;
}

.leaflet-popup-content .popup-content > .popup-quality-badge.quality-badge-inline {
  top: -4px;
  left: -4px;
}

.mobile-card-content > .popup-quality-badge.quality-badge-inline {
  top: -3px;
  left: -3px;
}

.gallery-popup-content > .popup-quality-badge.quality-badge-inline {
  top: 4px;
  left: 4px;
}

/* +20% uniquement pour le badge inline dans les popups (pas la galerie en grille) */
.leaflet-popup-content .popup-content > .popup-quality-badge.quality-badge-inline svg,
.mobile-card-content > .popup-quality-badge.quality-badge-inline svg,
.gallery-popup-content > .popup-quality-badge.quality-badge-inline svg {
  width: 19.2px;
  height: 19.2px;
}

/* Galerie: icone qualite sans fond plein */
.gallery-item .quality-badge svg,
.gallery-popup-content > .popup-quality-badge svg {
  fill: none !important;
  stroke: currentColor !important;
}

.gallery-item-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: white;
  padding: 10px 8px 8px;
  font-size: 11px;
  line-height: 1.2;
}

.gallery-item-author { 
  font-weight: bold;
  margin-bottom: 2px;
}

.gallery-item-date {
  color: #ffffffff;
  font-size: 10px;
}

/* Bouton flottant galerie (rouge) */
.gallery-close-float {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: #d32f2f;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.4);
  z-index: 2605;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
  width: auto;
  max-width: 120px;
  white-space: nowrap;
  text-align: center;
}

.gallery-close-float:hover {
  opacity: 1;
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 20px rgba(211, 47, 47, 0.6);
}

.gallery-view.active .gallery-close-float {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gallery-view.active .gallery-close-float,.gallery-container .gallery-close-float {  display: block;  opacity: 1;  visibility: visible;  pointer-events: auto;  z-index: 3000;}/* Mobile responsive pour galerie */
@media screen and (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(var(--thumb-size, 200px), 1fr));
	margin-top: 7px !important;
    gap: 10px;
  }
  
  .gallery-item img {
    height: calc(var(--thumb-size, 200px) * 0.75);
  }
  
  .gallery-controls {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
  }
  
  .gallery-size-control {
    width: 100%;
    order: 3;
    grid-column: 1 / -1;
  }
  
  .gallery-size-control input[type="range"] {
    width: 100%;
  }
  
  .gallery-controls select {
    width: 100%;
    min-width: auto;
  }
  
  .gallery-close-float {
    bottom: 15px;
    padding: 6px 14px;
    font-size: 13px;
    max-width: 100px;
  }
}

/* Popup pour images de la galerie */
.gallery-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.95);
  z-index: 7000;
  display: none;
  padding: 5px;
}

.gallery-popup.active,
.gallery-popup.closing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gallery-popup-sort-host {
  width: min(90%, 960px);
  margin-bottom: 12px;
}

.gallery-popup-sort-host:empty {
  display: none;
}

.gallery-popup.active .gallery-popup-sort-host,
.gallery-popup.closing .gallery-popup-sort-host {
  display: none;
}

/* Navigation galerie avec styles existants */
.gallery-popup-content .image-popup-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2800;
}

.gallery-popup-content {
    background: linear-gradient(135deg, #1c2b36, #26343f);
    border-radius: 15px;
    max-width: 90%;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    border: 2px solid #4fc3f7;
    position: relative;
    z-index: 7001;
}

@media screen and (max-width: 768px) {
  .gallery-popup.active,
  .gallery-popup.closing {
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
  }

  .gallery-popup {
    background: #000;
  }

  .gallery-popup-content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 88vh !important;
    border-radius: 20px 20px 0 0;
    transform: translate3d(0, 100%, 0);
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
    margin-bottom: 0;
  }

  .gallery-popup-sort-host {
    display: none !important;
  }

  .gallery-popup.active .gallery-popup-content {
    transform: translate3d(0, 0, 0);
  }

  .gallery-popup.closing .gallery-popup-content {
    transform: translate3d(0, 100%, 0);
  }

  .gallery-popup-content::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 38px;
    height: 4px;
    background: rgba(79, 195, 247, 0.35);
    border-radius: 2px;
    pointer-events: none;
  }

  .gallery-popup-content .point-info-line,
  .gallery-popup-content .impact-author-line,
  .gallery-popup-content .author-line-inline {
    position: relative;
    z-index: 220 !important;
  }

  .gallery-popup-content .author-button,
  .gallery-popup-content .video-button {
    position: relative;
    z-index: 230 !important;
  }

  .gallery-popup-close {
    display: none;
  }
}

/* Mode "popup max" mobile - gallery + leaflet */
@media screen and (max-width: 768px) {
    .gallery-popup-content.popup-maximized {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh !important;
    }

    .leaflet-popup-content-wrapper.popup-maximized {
        width: 96vw !important;
        max-width: 96vw !important;
        max-height: 88vh !important;
    }

    .leaflet-popup-content-wrapper.popup-maximized .leaflet-popup-content {
        max-height: 80vh !important;
        overflow-y: auto !important;
        width: 100% !important;
    }
}

.gallery-popup-close {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(79, 195, 247, 0.55);
  border-radius: 8px;
  background: rgba(15, 34, 46, 0.9);
  color: #dff3ff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.gallery-popup-close:hover {
  border-color: #ff8a8a;
  background: rgba(70, 28, 28, 0.95);
  transform: translateY(-1px);
}

.gallery-popup-close svg {
  width: 16px;
  height: 16px;
  display: block;
}

.gallery-share-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(79, 195, 247, 0.55);
  background: linear-gradient(135deg, rgba(30, 44, 55, 0.98), rgba(40, 64, 82, 0.98));
  color: #eaf6ff;
  cursor: pointer;
  font-size: 16px;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.gallery-share-btn:hover {
  border-color: #4fc3f7;
  background: linear-gradient(135deg, rgba(46, 70, 88, 0.98), rgba(56, 90, 112, 0.98));
  transform: translateY(-1px);
}

.gallery-zoom-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(79, 195, 247, 0.55);
  background: linear-gradient(135deg, rgba(30, 44, 55, 0.98), rgba(40, 64, 82, 0.98));
  color: #eaf6ff;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.gallery-zoom-btn:hover {
  border-color: #4fc3f7;
  background: linear-gradient(135deg, rgba(46, 70, 88, 0.98), rgba(56, 90, 112, 0.98));
  transform: translateY(-1px);
}

.gallery-popup-body {
  padding: 20px 25px;
  color: #eee;
  line-height: 1.6;
  position: relative;
}

.gallery-popup-sort-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
}

.gallery-popup-sort-bar label {
  color: #b0cfe0;
  font-size: 12px;
  white-space: nowrap;
}

.gallery-popup-sort-bar select {
  background: rgba(28, 43, 54, 0.92);
  color: #eee;
  border: 1px solid #4fc3f7;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  min-width: 0;
  max-width: min(92vw, 420px);
}

.gallery-popup img {
    width: 90%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* Gallery popup: les miniatures (photo + radar) doivent rester alignees */
.gallery-popup .photos-container {
  align-items: flex-start !important;
}

.gallery-popup .photos-container img,
.gallery-popup .photos-container .media-preview {
  margin-bottom: 0 !important;
}

.gallery-popup .photos-container.single-photo {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.gallery-popup .photos-container.single-photo > .media-preview {
  width: min(420px, 100%) !important;
  max-width: 100% !important;
  flex: none !important;
  margin: 0 auto !important;
}

.gallery-popup .photos-container.single-photo > .media-preview.media-preview-animated {
  aspect-ratio: 1 / 1 !important;
}

.gallery-popup .photos-container.single-photo > .media-preview.media-preview-animated img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

@media screen and (min-width: 769px) {
  .gallery-popup .photos-container img,
  .gallery-popup .photos-container .media-preview {
    width: auto !important;
  }
}

@media screen and (max-width: 768px) {
  .gallery-popup .photos-container {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .gallery-popup .photos-container > img,
  .gallery-popup .photos-container > video,
  .gallery-popup .photos-container > .media-preview {
    width: calc(50% - 4px) !important;
    max-width: calc(50% - 4px) !important;
    flex: none !important;
    height: 160px !important;
    margin: 0 !important;
  }

  .gallery-popup .photos-container .media-preview.media-preview-animated {
    min-height: 0 !important;
    aspect-ratio: auto !important;
    height: 160px !important;
  }

  .gallery-popup .photos-container > img,
  .gallery-popup .photos-container > video {
    object-fit: cover !important;
  }

  .gallery-popup .photos-container .media-preview.media-preview-animated img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
  }
}

/* Mobile card: harmoniser la taille du thumb radar avec la photo impact */
@media screen and (max-width: 768px) {
  .mobile-card .photos-container {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .mobile-card .photos-container > img,
  .mobile-card .photos-container > video,
  .mobile-card .photos-container > .media-preview {
    width: calc(50% - 4px) !important;
    max-width: calc(50% - 4px) !important;
    flex: none !important;
    margin-top: 0 !important;
  }

  .mobile-card .photos-container .media-preview,
  .mobile-card .photos-container .media-preview.media-preview-animated {
    width: calc(50% - 4px) !important;
    max-width: calc(50% - 4px) !important;
    height: 160px !important;
    aspect-ratio: auto !important;
    flex: none !important;
  }

  .mobile-card .photos-container .media-preview img,
  .mobile-card .photos-container .media-preview.media-preview-animated img {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
  }
}

/* 1080p (Full HD) - Écrans standards */
@media screen and (min-width: 1920px) {
    .gallery-popup-content {
        max-width: 1000px;
        width: 80%;
    }
    
    .gallery-popup img {
        max-height: 400px;
    }
}

/* 2K - Écrans haute définition */
@media screen and (min-width: 2048px) {
    .gallery-popup-content {
        max-width: 1200px;
        width: 75%;
    }
    
    .gallery-popup img {
        max-height: 600px;
    }
}

/* Breakpoints intermédiaires pour une meilleure adaptation */
@media screen and (min-width: 768px) and (max-width: 1919px) {
    .gallery-popup-content {
        max-width: 900px;
        width: 85%;
    }
    
    .gallery-popup img {
        max-height: 450px;
    }
}


/* Cacher la croix en haut à droite de la galerie */
.gallery-close {
  display: none !important;
}

/* Version mobile - ajuster la largeur pour le bouton reset */
@media screen and (max-width: 768px) {
  #video-popup {
    padding: 0 !important;
  }

  #video-popup .video-popup-content {
    width: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
  }

  #video-popup-container {
    width: 96vw !important;
    max-width: none !important;
  }

  .gallery-controls {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    align-items: center !important;
    gap: 8px !important;
    justify-content: flex-start !important; /* Aligner   gauche */
    width: 100% !important;
  }
  
  .gallery-controls label {
    width: auto !important;
    margin-bottom: 0 !important;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .gallery-controls select {
    flex: 1 !important;
    min-width: 0 !important;
    font-size: 12px;
    margin-right: 8px; /* Espace entre le select et le bouton */
  }
  .gallery-size-control {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  .gallery-size-control input[type="range"] {
    width: 80%;
    max-width: 260px;
    margin: 0 auto;
  }
  
  #gallery-filters-reset.timeline-reset-btn {
    flex-shrink: 0 !important;
    margin-left: 0 !important; /* Supprimer tout margin-left */
    align-self: center;
  }
}

/* Styles pour les boutons info des catégories */
.category-with-info {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: -9px;
}

.category-info-btn {
  background: #4fc3f7;
  color: #000;
  border: none;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.category-info-btn:hover {
  background: #03a9f4;
  transform: scale(1.1);
}

/* Alignement et largeur "texte max" des selects liste + galerie */
.impacts-header .sort-controls {
  justify-content: center !important;
  flex-wrap: nowrap !important;
}

.impacts-header .sort-controls select {
  flex: 0 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: min(92vw, 560px) !important;
}

.gallery-header .gallery-controls {
  justify-content: center !important;
  flex-wrap: nowrap !important;
}

.gallery-header .gallery-controls select {
  flex: 0 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: min(92vw, 560px) !important;
}

@media screen and (max-width: 768px) {
  .impacts-header .sort-controls {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
  }

  .impacts-header .sort-controls label {
    font-size: 11px !important;
    white-space: nowrap !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
  }

  .impacts-header .sort-controls select {
    max-width: 56vw !important;
    width: auto !important;
    min-width: 0 !important;
  }

  #list-filters-reset.timeline-reset-btn {
    flex-shrink: 0 !important;
    margin-left: 0 !important;
  }

  #gallery-view #gallery-sort-select {
    width: min(52vw, 260px) !important;
    max-width: min(52vw, 260px) !important;
    flex: 0 1 auto !important;
  }
}

/* Info-bulles pour les catégories */
.category-tooltip {
  position: absolute;
  bottom: 25px;
  left: 0%;
  transform: translateX(-50%);
  background: #1c2b36;
  color: #eee;
  padding: 5px 5px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.4;
  white-space: normal;
  width: 90px;
  z-index: 9000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  border: 1px solid #4fc3f7;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  pointer-events: none;
  font-weight: normal !important; 
}

.category-tooltip::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);  
  border-top-color: #4fc3f7;
}

.category-info-btn:hover .category-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Version mobile */
@media screen and (max-width: 768px) {
  .category-tooltip {
    font-size: 10px;
    padding: 6px 10px;
    max-width: 200px;
    bottom: 30px;
  }
  
  .category-info-btn {
    width: 14px;
    height: 14px;
    font-size: 8px;
  }
}

/* Styles spécifiques pour les boutons info du formulaire */
.form-category-with-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -15px;
}

.form-category-info-btn {
  background: #4fc3f7;
  color: #000; /* Point-virgule manquant ajouté */
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  margin-left: 5px;
  font-weight: bold !important; /* Changé de "normal" à "bold" */
}


.form-category-info-btn:hover {
  background: #03a9f4;
  transform: scale(1.1);
}

/* Info-bulles pour le formulaire */
.form-category-tooltip {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #1c2b36;
  color: #eee;
  padding: 5px 5px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  width: 200px;
  z-index: 2500;
  box-shadow: 0 6px 20px rgba(0,0,0,0.7);
  border: 2px solid #4fc3f7;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  pointer-events: none;
}

.form-category-tooltip::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: #4fc3f7;
}

.form-category-info-btn:hover .form-category-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Version mobile pour le formulaire */
@media screen and (max-width: 768px) {
  .form-category-tooltip {
    font-size: 11px;
    padding: 5px 5px;
    width: 200px;
    bottom: 30px;
    left: -50px;
    transform: none;
  }
  
  .form-category-info-btn {
    width: 16px;
    height: 16px;
    font-size: 12px;
  }
}

/* 📱 AMÉLIORATION ZOOM MOBILE */
@media screen and (min-width: 769px) {
  .desktop-timeline .timeline-slider {
    display: none !important;
    pointer-events: none !important;
  }
}

@media screen and (max-width: 768px) {
  
  /* Curseurs plus larges et plus faciles à manipuler */
  .timeline-slider {
    width: 28px !important;
    height: 28px !important;
    border: 3px solid #fff !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.4) !important;
    z-index: 1600 !important;
  }
  
  /* Zone de touch élargie invisible */
  .timeline-slider::after {
    content: "";
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    background: transparent;
    z-index: 1;
  }
  
  /* Timeline plus haute pour faciliter la manipulation */
  .timeline {
    height: 35px !important;
    margin: 0 30px 0 calc(var(--timeline-side-w) + 8px) !important;
  }
  .timeline-labels {
    margin: 6px 30px 0 calc(var(--timeline-side-w) + 8px) !important;
    --timeline-label-right-gap: 30px;
  }
  
  .timeline-track {
    height: 6px !important;
    top: 14px !important;
  }
  
  .timeline-range {
    height: 6px !important;
    top: 14px !important;
  }
  
  /* Mode sélection plus visible sur mobile */
  .timeline-container.zoom-selection-mode {
    background: linear-gradient(135deg, #ff6b35, #f7931e) !important;
    border-top: 3px solid #ffeb3b !important;
  }
  
  /* Header plus gros sur mobile en mode sélection */
  .timeline-container.zoom-selection-mode .timeline-header {
    font-size: 16px !important;
    font-weight: bold !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5) !important;
  }  
}

/* Style pour le bouton BETA sous le titre */
.beta-feedback-section {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  width: auto;
  max-width: 90vw;
}

/* Bouton Beta - Position fixe pour éviter l'espace blanc */
.beta-button {
  position: fixed;
  top: 10px;
  right: 15px;
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  color: white;
  border: 2px solid #ff4500;
  border-radius: 12px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(255, 107, 53, 0.5);
  z-index: 1200;
  transition: all 0.3s ease;
  animation: betaPulse 4s infinite;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  width: auto;
  min-width: auto;
}

/* Hover effect */
.beta-button:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(255, 107, 53, 0.8);
  background: linear-gradient(135deg, #f7931e, #ff6b35);
}

/* Animation pulsation */
@keyframes betaPulse {
  0% {
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.5);
  }
  50% {
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.8);
  }
  100% {
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.5);
  }
}

/* Responsive Mobile */
@media screen and (max-width: 768px) {
  .beta-button {
    top: 8px !important;
    right: 12px !important;
    padding: 3px 6px !important;
    font-size: 8px !important;
    border-radius: 8px !important;
  }
}

/* Très petits écrans */
@media screen and (max-width: 480px) {
  .beta-button {
    top: 6px !important;
    right: 10px !important;
    padding: 2px 5px !important;
    font-size: 7px !important;
    border-radius: 6px !important;
  }
}

/* Active/Click effect */
.beta-button:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.6);
}

/* Mobile responsive pour popup d'images */
@media screen and (max-width: 768px) {
  .image-popup {
    padding: 10px;
  }
  
  .image-popup img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transform-origin: center center;
}
  
  .image-popup-close {
    top: -40px;
    width: 35px;
    height: 35px;
    font-size: 18px;
  }
  
  .image-popup-title {
    font-size: 14px;
    padding: 6px 12px;
  }
}
/* Flèches de navigation pour popup d'images */
.image-popup-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgb(77 77 77 / 54%);
  color: white;
  border: 2px solid #4fc3f7;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2800;
  transition: all 0.3s ease;
  user-select: none;
}

.image-popup-nav:hover {
  background: rgba(79, 195, 247, 0.8);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 15px rgba(79, 195, 247, 0.5);
}

.image-popup-prev {
  left: 15px;
}

.image-popup-next {
  right: 15px;
}

.image-popup-counter {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  border: 1px solid #4fc3f7;
}

/* Mobile responsive pour les flèches */
@media screen and (max-width: 768px) {
  .image-popup-nav {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .image-popup-prev {
    left: 10px;
  }
  
  .image-popup-next {
    right: 10px;
  }
  
  .image-popup-counter {
    bottom: -50px;
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* Masquer les flèches quand il n'y a qu'une image */
.image-popup-nav.hidden {
  display: none !important;
}

/* ✅ TIMELINE MOBILE EXPERTE - STYLES COMPLETS AVEC DATES CORRIGÉS */
@media screen and (max-width: 768px) {
  .mobile-timeline-canvas {
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    height: 95px;
    background: #192937;
    border-radius: 10px;
    position: relative;
    border: 2px solid #4fc3f7;
    overflow: hidden;
    
    /* CSS EXPERT ANTI-INTERFÉRENCE */
    touch-action: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
    
    /* Optimisations GPU */
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    transition: none;
  }

  .timeline-labels {
    width: 100% !important;
    max-width: 100% !important;
    margin: 6px 0 2px 0 !important;
    align-self: stretch;
    box-sizing: border-box;
  }
  
  .mobile-timeline-track {
    position: absolute;
    top: 40%;
    left: -5px;
    right: 0px;
    height: 3px;
    background: #4fc3f7;
    border-radius: 4px;
    transform: translateY(-50%);
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.4);
    transform-origin: left center;
    transition: none;
  }
  
  .mobile-timeline-markers {
    position: absolute;
    width: calc(100% - 30px); /* CORRIGÉ : largeur complète au lieu de 30px */
    height: 50px; /* CORRIGÉ : hauteur augmentée */
    left: 15px;
    top: -17%;
    transform-origin: left center;
  }
  
  /* ✅ STYLES POUR LES DATES DYNAMIQUES */
  .mobile-timeline-dates {
    position: absolute;
    width: calc(100% - 30px);
    height: auto;
    left: 15px;
    bottom: 8px;
    pointer-events: none;
    z-index: 50;
  }
  
  .timeline-date-tick {
    position: absolute;
    bottom: 25px;
    width: 1px;
    height: 15px;
    background: rgba(79, 195, 247, 0.6);
    z-index: 49;
  }
  
  .timeline-date-tick.extremity {
    background: #4fc3f7;
    height: 20px;
    width: 2px;
  }
  
  .timeline-date-label {
    position: absolute;
    bottom: 0;
    font-size: 9px;
    color: #b0cfe0;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    z-index: 50;
  }
  
  .timeline-date-label.extremity {
    font-size: 10px;
    font-weight: bold;
    color: #4fc3f7;
  }
  
  .timeline-date-label.intermediate {
    font-size: 8px;
    color: #8bb5cc;
    opacity: 0.8;
  }
  
  /* ✅ STYLES POUR LES MARQUEURS ET CLUSTERS - CORRIGÉS */
  .timeline-cluster {
    position: absolute;
    bottom: 0;
    transform: translateX(-50%); /* CORRIGÉ : seulement translation horizontale */
    background: linear-gradient(135deg, #4fc3f7, #26a69a);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(79, 195, 247, 0.6);
    z-index: 1000;
    transition: all 0.3s ease;
    touch-action: manipulation;
    pointer-events: auto;
    transform-origin: center center;
  }
  
  .timeline-cluster:hover {
    transform: translateX(-50%) scale(1.2); /* CORRIGÉ : maintenir l'alignement vertical */
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.8);
  }
    
  .timeline-cluster.featured {
    border-color: #ffd700;
    animation: clusterPulse 2s infinite;
  }
  
  .timeline-cluster.focusing {
    animation: mobileFocus 1.2s ease-out;
    border-color: #00ff00 !important;
    background: linear-gradient(135deg, #00ff00, #32cd32) !important;
  }
  
  /* ✅ STYLES POUR LES MARQUEURS INDIVIDUELS - CORRIGÉS */
  .timeline-marker {
    position: absolute;
    top: auto;
    bottom: -5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-50%); /* CORRIGÉ : seulement translation horizontale */
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    touch-action: manipulation;
    pointer-events: auto;
  }

  .timeline-marker svg {
    width: 24px;
    height: 24px;
    display: block;
    pointer-events: none;
  }

  .timeline-marker.timeline-marker-complement {
    width: 26px;
    height: 26px;
    bottom: -8px;
    opacity: 60%;
  }

  .timeline-marker.timeline-marker-complement svg {
    width: 21px;
    height: 21px;
  }
  
  .timeline-marker:hover {
    transform: translateX(-50%) scale(1.3); /* CORRIGÉ : maintenir l'alignement vertical */
  }
  
  .timeline-marker.featured {
    animation: clusterPulse 2s infinite;
  }
  
  /* ✅ ANIMATIONS CORRIGÉES */
  @keyframes mobileFocus {
    0% { 
      transform: translateX(-50%) scale(1); /* CORRIGÉ */
      box-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
    }
    50% { 
      transform: translateX(-50%) scale(2.5); /* CORRIGÉ */
      box-shadow: 0 0 25px rgba(0, 255, 0, 1);
    }
    100% { 
      transform: translateX(-50%) scale(1); /* CORRIGÉ */
      box-shadow: 0 0 15px rgba(0, 255, 0, 0.6);
    }
  }
  
  @keyframes clusterPulse {
    0%, 100% { 
      transform: translateX(-50%); /* CORRIGÉ */
      filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.8));
    }
    50% { 
      transform: translateX(-50%) scale(1.08); /* CORRIGÉ */
      filter: drop-shadow(0 0 8px rgba(255, 215, 0, 1)) 
              drop-shadow(0 0 12px rgba(255, 215, 0, 0.4));
    }
  }
  
  @keyframes fadeInOut {
    0%, 15%, 85%, 100% { opacity: 0; }
    30%, 70% { opacity: 1; }
  }
  
  .mobile-gesture-hint {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-block;
    width: max-content;
    max-width: calc(100% - 12px);
    white-space: nowrap;
    text-align: center;
    font-size: clamp(8px, 2.2vw, 10px);
    color: rgba(79, 195, 247, 0.7);
    opacity: 0;
    animation: fadeInOut 8s ease-in-out infinite;
    pointer-events: none;
  }
}

.leaflet-bottom.leaflet-right {
  display: none !important;
}

.mobile-scroll-hint {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: rgba(255, 255, 255, 0.9);
  opacity: 0;
  animation: scrollHintFadeInOut 8s ease-in-out infinite;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid rgba(79, 195, 247, 0.4);
  white-space: nowrap;
}

.mobile-scroll-hint-icons {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  animation: handMove 2s ease-in-out infinite;
}

.mobile-scroll-chevron {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.mobile-scroll-finger {
  font-size: 12px;
  line-height: 1;
}

.mobile-scroll-hint-text {
  line-height: 1.2;
}

.desktop-reset-hint {
  display: none;
}

@media screen and (min-width: 769px) {
  .desktop-reset-hint {
    display: inline-flex;
    position: absolute;
    left: 50%;
    top: 15px;
    transform: translate(-50%, -15%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.4);
    padding: 3px 8px;
    border-radius: 10px;
    border: 1px solid rgba(79, 195, 247, 0.4);
    pointer-events: none;
    animation: desktopHintFadeInOut 8s ease-in-out infinite;
    white-space: nowrap;
    max-width: min(88vw, 760px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .timeline-container.collapsed .desktop-reset-hint {
    display: none;
  }

}

@media screen and (max-width: 768px) {
  body.dedicated-view-list .grecaptcha-badge,
  body.dedicated-view-gallery .grecaptcha-badge {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

body.dedicated-view-list .grecaptcha-badge,
body.dedicated-view-gallery .grecaptcha-badge {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media screen and (max-width: 768px) {
  .leaflet-popup-content-wrapper {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 74vh !important;
    overflow: hidden !important;
  }

  .leaflet-popup-content-wrapper .leaflet-popup-content {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 68vh !important;
    overflow-y: auto !important;
  }
}

@keyframes desktopHintFadeInOut {
  0%, 15%, 85%, 100% { opacity: 0; }
  30%, 70% { opacity: 1; }
}

@keyframes scrollHintFadeInOut {
  0%, 15%, 85%, 100% { opacity: 0; }
  30%, 70% { opacity: 1; }
}

@keyframes handMove {
  0%, 100% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
}

@keyframes arrowsPulse {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Classe utilitaire pour désactiver les transitions temporairement */
.no-transitions,
.no-transitions *,
.no-transitions *::before,
.no-transitions *::after {
  transition: none !important;
  animation: none !important;
}

@media screen and (max-width: 768px) {
  .impacts-list.list-gallery-panel-animating.from-forward,
  .gallery-view.list-gallery-panel-animating.from-forward {
    animation: listGallerySlideFromRight 0.24s cubic-bezier(0.22, 0.9, 0.3, 1);
  }

  .impacts-list.list-gallery-panel-animating.from-backward,
  .gallery-view.list-gallery-panel-animating.from-backward {
    animation: listGallerySlideFromLeft 0.24s cubic-bezier(0.22, 0.9, 0.3, 1);
  }
}

@keyframes listGallerySlideFromRight {
  from {
    opacity: 0;
    transform: translate3d(18px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes listGallerySlideFromLeft {
  from {
    opacity: 0;
    transform: translate3d(-18px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* 3 photos : disposition optimisée */
.impact-photos img:nth-child(1):nth-last-child(2),
.impact-photos img:nth-child(2):nth-last-child(1),
.impact-photos video:nth-child(1):nth-last-child(2),
.impact-photos video:nth-child(2):nth-last-child(1),
.impact-photos .media-preview:nth-child(1):nth-last-child(2),
.impact-photos .media-preview:nth-child(2):nth-last-child(1) {
  max-width: calc(50% - 4px) !important;
}

.impact-photos img:nth-child(1):nth-last-child(3),
.impact-photos img:nth-child(2):nth-last-child(2),
.impact-photos img:nth-child(3):nth-last-child(1),
.impact-photos video:nth-child(1):nth-last-child(3),
.impact-photos video:nth-child(2):nth-last-child(2),
.impact-photos video:nth-child(3):nth-last-child(1),
.impact-photos .media-preview:nth-child(1):nth-last-child(3),
.impact-photos .media-preview:nth-child(2):nth-last-child(2),
.impact-photos .media-preview:nth-child(3):nth-last-child(1) {
  max-width: calc(33.333% - 6px) !important; /* 33% moins le gap */
}

/* Sur écrans moyens : 3 photos deviennent 2+1 */
@media screen and (max-width: 768px) {
  .impact-photos img:nth-child(1):nth-last-child(2),
  .impact-photos img:nth-child(2):nth-last-child(1),
  .impact-photos video:nth-child(1):nth-last-child(2),
  .impact-photos video:nth-child(2):nth-last-child(1),
  .impact-photos .media-preview:nth-child(1):nth-last-child(2),
  .impact-photos .media-preview:nth-child(2):nth-last-child(1) {
    max-width: calc(50% - 4px) !important;
  }

  .impact-photos img:nth-child(1):nth-last-child(3),
  .impact-photos img:nth-child(2):nth-last-child(2),
  .impact-photos video:nth-child(1):nth-last-child(3),
  .impact-photos video:nth-child(2):nth-last-child(2),
  .impact-photos .media-preview:nth-child(1):nth-last-child(3),
  .impact-photos .media-preview:nth-child(2):nth-last-child(2) {
    max-width: calc(50% - 4px) !important;
  }
  
  .impact-photos img:nth-child(3):nth-last-child(1),
  .impact-photos video:nth-child(3):nth-last-child(1),
  .impact-photos .media-preview:nth-child(3):nth-last-child(1) {
    max-width: 100% !important;
    margin-top: 8px;
  }
}

/* Masquer la croix de fermeture de la liste sur mobile */
@media screen and (max-width: 768px) {
  .impacts-close {
    display: none !important;
    visibility: hidden !important;
  }  

  .impacts-container {
    padding-top: 96px !important;
  }

  #impacts-content {
    margin-top: 24px !important;
  }

  .impacts-header h2 {
    text-align: center !important;
    width: 100% !important;
  }
}

/* Indicateur de swipe pour fiche mobile minimisée */
.swipe-indicator {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  z-index: 1350;
  animation: swipePulse 2s infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  display: none !important; /* MASQUÉ PAR DÉFAUT */
}

/* Animation de pulsation */
@keyframes swipePulse {
  0%, 100% { 
    opacity: 0.6; 
    transform: translateX(-50%) translateY(0px); 
  }
  50% { 
    opacity: 1; 
    transform: translateX(-50%) translateY(-3px); 
  }
}

/* NOUVEAU : Afficher seulement après clic sur zoomer */
.mobile-card.minimized.show-swipe-hint .swipe-indicator {
  opacity: 1 !important;
  display: block !important;
}

/* Masquer quand la fiche est normale */
.mobile-card:not(.minimized) .swipe-indicator {
  opacity: 0;
  display: none !important;
}

/* Préserver les retours à la ligne SEULEMENT dans les popups et fiches mobiles */
.mobile-card-content,
.description-content {
    white-space: pre-line !important;
    line-height: 1.4 !important;
}

/* Harmoniser position du bouton fermer galerie avec liste d'impact et fiche mobile */
.gallery-close-float {
  bottom: 20px !important;
  max-width: 120px !important;
}

@media screen and (max-width: 768px) {
  .gallery-close-float {
    bottom: 15px !important;
    padding: 6px 14px !important;
    font-size: 13px !important;
    max-width: 100px !important;
  }
}

/* Forcer gallery-close-float sur PC aussi (désactiver la croix en haut) */
.gallery-popup-close,
.gallery-close {
  display: none !important;
  visibility: hidden !important;
}
.gallery-close-float {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Popup galerie (desktop): afficher le bouton close dans le contenu, à côté de Partager */
@media screen and (min-width: 769px) {
  #gallery-popup .gallery-popup-close {
    display: inline-flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  #gallery-popup .gallery-popup-content > .gallery-close-float {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* PC ET MOBILE - Descriptions multi-lignes */
@media screen and (min-width: 769px) {
  .impacts-list .impact-info {
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}

/* MOBILE SEULEMENT : Retours à la ligne autorisés */
@media screen and (max-width: 768px) {
  .impacts-list .impact-info {
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}

/* Préserver seulement les descriptions dans les popups */
.leaflet-popup-content .description-content {
    white-space: pre-line !important;
    line-height: 1.4 !important;
}

/* NE PAS appliquer white-space: pre-line au popup entier */
.leaflet-popup-content {
    white-space: normal !important;    
    width: 100% !important;
    box-sizing: border-box;
    max-width: 100% !important;
    overflow: hidden;
    margin: 0 !important;
    padding: 12px 14px;
}

.popup-content {
    white-space: normal !important;
    min-width: 300px !important;
    width: 100% !important;
    box-sizing: border-box;
    max-width: 100% !important;
    word-wrap: break-word !important;
}

/* Appliquer white-space: pre-line SEULEMENT aux descriptions */
.popup-content div:nth-child(5) {
    white-space: pre-line !important;
    line-height: 1.4 !important;
}

/* S'assurer que les <br> s'affichent correctement */
.description-text br {
    display: block !important;
    margin: 0.2em 0 !important;
}

/* Forcer une largeur minimale pour les popups */
.leaflet-popup-content-wrapper {
    min-width: 390px !important;
}

@media screen and (max-width: 768px) {
  .leaflet-popup-content-wrapper {
    min-width: 0 !important;
  }
}

/* Bouton carré de partage */
- width: 40px; height: 40px; (carré)
- padding: 8px; (espacement interne)
- font-size: 16px; (taille emoji)
- border-radius: 4px; (coins arrondis)
- background: #919191; (gris)
- position: absolute; top: 5px; right: 5px; (position fixe)
- title="Partager cet impact" (tooltip au survol)

/* Effet bouton pour le lien article détaillé */
.article-link {
    display: inline-block;
    padding: 6px 12px;
    background: #d14c4c;
    border: 1px solid #2196F3;
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 0 3px;
}

.article-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(33, 150, 243, 0.3);
    background: linear-gradient(135deg, #e3f2fd 0%, #e8f5e8 100%);
    border-color: #1565c0;
    color: #000000 !important;
}

.article-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
}

/* ✅ 4 photos : disposition en grille 2x2 */
.photos-container img:nth-child(1):nth-last-child(4),
.photos-container img:nth-child(2):nth-last-child(3),
.photos-container img:nth-child(3):nth-last-child(2),
.photos-container img:nth-child(4):nth-last-child(1) {
  max-width: calc(50% - 4px) !important; /* 2 colonnes */
}

/* Version mobile : 4 photos en colonne */
@media screen and (max-width: 768px) {
  .photos-container img:nth-child(1):nth-last-child(4),
  .photos-container img:nth-child(2):nth-last-child(3),
  .photos-container img:nth-child(3):nth-last-child(2),
  .photos-container img:nth-child(4):nth-last-child(1) {
    max-width: 100% !important;
    margin-bottom: 8px;
  }
}
.map-title-logo {    
    width: auto !important;
    position: relative;
    z-index: 0 !important;
    display: inline-block;
    vertical-align: middle;
    max-height: 54px !important;
    max-width: 100% !important;
    filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 1));
}

@media screen and (max-width: 768px) {
    .map-title-logo {
        height: 22px !important;
        width: auto !important;
        max-height: 24px !important;
        max-width: 180px !important;
    }
}

/* Protection complète des images */
img {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-drag: none !important;
  /* pointer-events: none !important; <-- SUPPRIMÉ */
}

/* Permettre les clics sur les images sauf dans les popups ouverts */
img {
  pointer-events: auto !important;
  cursor: default;
}

/* Galerie: curseur main sur les visuels cliquables */
#gallery-view .gallery-item img,
#gallery-view .gallery-item .media-preview,
#gallery-popup .photos-container img,
#gallery-popup .photos-container .media-preview {
  cursor: pointer !important;
}

/* Désactiver seulement le menu contextuel sans bloquer les clics */
img {
  -webkit-touch-callout: none !important;
}

/* Réactiver pointer-events pour les images du popup (pour permettre le zoom) */
#image-popup img,
#image-popup-img {
  pointer-events: auto !important;
  -webkit-touch-callout: none !important; /* Garder cette protection */
}

/* Désactiver la sélection sur tout le site */
* {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

/* Réactiver la sélection pour les inputs et textarea */
input, textarea, [contenteditable] {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

/* Réactiver explicitement la sélection dans les popups d'auth malgré le reset global */
#user-auth-popup,
#user-auth-popup *,
#admin-auth-popup,
#admin-auth-popup * {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

/* Cacher le curseur de sélection */
::selection {
  background: transparent !important;
}

::-moz-selection {
  background: transparent !important;
}

/* Placeholder pendant le chargement */
img.lazy {
    background: linear-gradient(135deg, #26343f, #1c2b36);
    min-height: 200px;
    transition: opacity 0.3s ease;
}

/* Animation fade-in lors du chargement */
img.lazy[src*="data:image"] {
    opacity: 0.3;
}

img.lazy:not([src*="data:image"]) {
    opacity: 1;
}

/* Skeleton loader optionnel */
.image-skeleton {
    background: linear-gradient(90deg, #26343f 25%, #4fc3f7 50%, #26343f 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Masquer le bouton rouge quand popup vidéo ouvert */
#video-popup.active ~ .mobile-card-close-float,
body:has(#video-popup[style*="display: flex"]) .mobile-card-close-float {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Alternative plus simple */
.video-popup-open .mobile-card-close-float {
    display: none !important;
}

body.video-popup-open {
    overflow: hidden !important;
    touch-action: none;
}

#video-popup,
#video-popup .video-popup-content,
#video-popup-container {
    overflow: hidden !important;
}

/* Force affichage bouton fermer galerie */.gallery-view.active .gallery-close-float {  display: block !important;  opacity: 1 !important;  visibility: visible !important;  pointer-events: auto !important;  z-index: 3000 !important;}
/* Forcer le bouton fermer galerie au-dessus de tout */
#gallery-view.active .gallery-close-float,
.gallery-view.active .gallery-close-float {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 99999 !important;
}

/* Keep full-screen image popup above all other popups including info/examples (z-index: 400001). */
#image-popup,
#image-popup.active {
  z-index: 500000 !important;
}

#image-popup .image-popup-close,
#image-popup .image-popup-nav {
  z-index: 500010 !important;
}

/* Keep the video overlay above gallery popups and floating controls on mobile. */
#video-popup,
#video-popup.active {
  z-index: 130070 !important;
}

#video-popup .video-popup-content,
#video-popup .video-popup-close,
#video-popup-title {
  position: relative;
  z-index: 130080 !important;
}



.filter-section {
  margin-bottom: 8px;
  position: relative;
}

#filter-master-section {
  z-index: 60;
}

/* User-owned markers and favorite buttons */
.marker-icon.user-owned {
  box-shadow: 0 0 0 4px rgba(57,255,20,0.65), 0 0 14px rgba(57,255,20,0.6);
  border-radius: 50%;
}

.marker-icon.featured.user-owned {
  box-shadow: 0 0 0 4px rgba(57,255,20,0.65), 0 0 14px rgba(57,255,20,0.6), 0 0 0 11px rgba(255,215,0,0.65);
}

.impact-author-line .favorite-btn,
.gallery-item-actions .favorite-btn {
  margin-left: 6px;
}

.impact-item .impact-favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0 !important;
  width: auto !important;
  z-index: 2;
}

.impact-item .impact-favorite-btn:not(.favorite-active):hover {
  background: linear-gradient(135deg, #ffe38a, #f4b400) !important;
  border-color: #e3a700 !important;
  color: #3a2a00 !important;
  box-shadow: 0 2px 10px rgba(227, 167, 0, 0.35);
}

.impact-item .impact-favorite-btn.favorite-active {
  background: linear-gradient(135deg, #ffd766, #f4b400) !important;
  border-color: #e3a700 !important;
  color: #3a2a00 !important;
  box-shadow: 0 2px 10px rgba(227, 167, 0, 0.45);
}

.leaflet-popup-content .favorite-btn.favorite-active,
.mobile-card .favorite-btn.favorite-active,
.gallery-popup-content .favorite-btn.favorite-active {
  background: linear-gradient(135deg, #ffd766, #f4b400) !important;
  border-color: #e3a700 !important;
  color: #3a2a00 !important;
  box-shadow: 0 2px 10px rgba(227, 167, 0, 0.45);
}

.leaflet-popup-content .favorite-btn:not(.favorite-active):hover,
.gallery-popup-content .favorite-btn:not(.favorite-active):hover {
  background: linear-gradient(135deg, #ffe38a, #f4b400) !important;
  border-color: #e3a700 !important;
  color: #3a2a00 !important;
  box-shadow: 0 2px 10px rgba(227, 167, 0, 0.35);
}

.impact-item.user-owned {
  box-shadow: 0 0 0 2px rgba(57,255,20,0.45), 0 0 0 4px rgba(57,255,20,0.2);
}

.gallery-item.user-owned {
  box-shadow: 0 0 0 2px rgba(57,255,20,0.45), 0 0 0 4px rgba(57,255,20,0.2);
}

.gallery-item.featured.user-owned {
  box-shadow: 0 0 0 2px rgba(57,255,20,0.45), 0 0 0 4px rgba(57,255,20,0.2), 0 0 0 6px rgba(255,215,0,0.35);
}

/* Top bar fixed layout */
.map-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
  z-index: 5000 !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 52px;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 8px 12px !important;
  box-sizing: border-box;
  border-radius: 0 !important;
  background: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none;
}

.map-header-left {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 10px;
  min-width: 0;
  z-index: 2;
}

.map-header-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}

.map-site-name {
  color: #4fc3f7;
  text-decoration: none;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.4px;
}

.map-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 6px;
  margin-left: auto;
  z-index: 2;
}

.map-header-right-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Ne pas bloquer les clics sur la carte via la barre transparente */
.map-header .map-btn,
.map-header .lang-switcher,
.map-header .top-auth-btn,
.map-header .header-dropdown,
.map-header .header-dropdown-menu,
.map-header .header-dropdown-item,
.map-header .pwa-install-top-btn,
.map-header a,
.map-header select,
.map-header input,
.map-header .map-title-logo {
  pointer-events: auto;
}

.map-header .map-btn,
.map-header .top-auth-btn,
#pwa-install-btn.pwa-install-icon-btn {
  min-width: 35px !important;
  flex: 0 0 35px !important;
}

.map-header .map-btn {
  width: 35px !important;
  height: 35px !important;
  font-size: 15px !important;
  background: rgba(24, 45, 58, 0.92) !important;
  border-color: rgba(111, 203, 255, 0.85) !important;
}

.map-header .map-btn.info-btn,
.map-header .map-btn.tour-btn {
  border: 1px solid #ff6b6b !important;
  color: #ff8b8b !important;
  border-radius: 50% !important;
}

.map-header .map-btn.info-btn {
  position: relative;
}

.map-header .map-btn.info-btn::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(14, 27, 36, 0.92);
  border: 1px solid rgba(79, 195, 247, 0.45);
  color: #f2f8ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  z-index: 1600;
}

.map-header .map-btn.info-btn:hover::after,
.map-header .map-btn.info-btn:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.map-header .map-btn.alt-menu-btn {
  border: 1px solid rgba(111, 203, 255, 0.9) !important;
  color: #a8dbff !important;
  border-radius: 50% !important;
}

.map-header .map-btn.alt-menu-btn .alt-menu-icon {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.alt-menu-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 10%, rgba(79, 195, 247, 0.12), rgba(0, 0, 0, 0.45));
  z-index: 1205;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.alt-menu-panel {
  position: fixed;
  top: 52px;
  left: 10px;
  display: flex;
  flex-direction: column;
  width: 300px;
  max-width: 86vw;
  height: auto;
  max-height: calc(100dvh - 68px);
  background: linear-gradient(165deg, rgba(23, 39, 51, 0.94), rgba(14, 27, 37, 0.94));
  border: 1px solid rgba(121, 211, 255, 0.35);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(200, 236, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1210;
  transform: translateX(calc(-100% - 24px));
  transition: transform 0.22s ease;
  padding: 14px 12px 12px;
  box-sizing: border-box;
  overflow-y: auto;
}

.alt-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.alt-menu-head strong {
  color: #ccecff;
  font-size: 16px;
}

#alt-menu-close {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid rgba(79, 195, 247, 0.6);
  background: rgba(28, 43, 54, 0.9);
  color: #d8efff;
  cursor: pointer;
}

.alt-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.alt-menu-legal-links {
  margin-top: auto;
  padding-top: 8px;
  text-align: center;
  font-size: 9px;
}

.alt-menu-legal-links .donation-box {
  margin-top: 2px;
  margin-bottom: 10px;
  padding: 0;
}

.alt-menu-legal-links .donation-buttons {
  gap: 6px;
}

.alt-menu-legal-links .donation-buttons button {
  font-size: 10px;
  padding: 5px 8px;
}

.alt-menu-basemap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 10px;
  text-align: left;
}

.alt-menu-basemap label {
  color: #ccecff;
  font-size: 11px;
  font-weight: 600;
}

.alt-menu-basemap-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alt-menu-basemap select[name="basemap-select"] {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 32px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(79, 195, 247, 0.6);
  background: rgba(20, 35, 46, 0.9);
  color: #eaf6ff;
  font-size: 12px;
}

.alt-menu-social-btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(121, 211, 255, 0.4);
  background: linear-gradient(160deg, rgba(38, 66, 86, 0.88), rgba(26, 48, 64, 0.86));
  color: #dff2ff;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.alt-menu-social-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(121, 211, 255, 0.72);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.alt-menu-social-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.alt-menu-social-btn-discord {
  color: #b8c6ff;
}

.alt-menu-social-btn-x {
  color: #f2f7ff;
}

.alt-menu-social-btn-instagram {
  color: #ffd0df;
}

.alt-menu-legal-links a {
  color: #95a5a6;
  text-decoration: none;
  margin: 0 3px;
}

.alt-menu-legal-links span {
  color: #666;
}

.alt-menu-item {
  --menu-accent-rgb: 121, 211, 255;
  --menu-icon: #9adfff;
  border: 1px solid rgba(121, 211, 255, 0.25);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(38, 66, 86, 0.88), rgba(26, 48, 64, 0.86));
  color: #eaf7ff;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(226, 246, 255, 0.08);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.alt-menu-item:hover {
  transform: translateY(-2px);
  border-color: rgba(121, 211, 255, 0.55);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.3),
    0 0 0 2px rgba(121, 211, 255, 0.22),
    inset 0 1px 0 rgba(226, 246, 255, 0.14);
}

.alt-menu-emoji {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--menu-icon);
}

.alt-menu-emoji svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.alt-menu-emoji img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

.alt-menu-label {
  font-size: 12px;
  color: #d9eefb;
  text-align: center;
}

.alt-menu-grid .alt-menu-item:nth-child(1) {
  --menu-icon: #ffd978;
}

.alt-menu-grid .alt-menu-item:nth-child(2) {
  --menu-icon: #ffc56f;
}

.alt-menu-grid .alt-menu-item:nth-child(2) .alt-menu-emoji img {
  transform: scale(1.2);
  transform-origin: center;
}

.alt-menu-grid .alt-menu-item:nth-child(3) {
  --menu-icon: #9be6ff;
}

.alt-menu-grid .alt-menu-item:nth-child(4) {
  --menu-icon: #95f2d5;
}

.alt-menu-grid .alt-menu-item:nth-child(5) {
  --menu-icon: #dfdfdf;
}

.alt-menu-grid .alt-menu-item:nth-child(6) {
  --menu-icon: #ffadad;
}

.alt-menu-grid .alt-menu-item:nth-child(7) {
  --menu-icon: #ffd978;
}

.alt-menu-grid .alt-menu-item:nth-child(8) {
  --menu-icon: #dfdfdf;
}

body.alt-menu-open .alt-menu-overlay {
  opacity: 1;
  visibility: visible;
}

body.alt-menu-open .alt-menu-panel {
  transform: translateX(0);
}

.top-account-buttons {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
}

.header-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 1;
}

.header-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(111, 203, 255, 0.5);
  background: rgba(14, 27, 36, 0.97);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  z-index: 5200;
}

.header-dropdown-menu[hidden] {
  display: none !important;
}

.header-dropdown-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #eaf6ff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  padding: 9px 10px;
  cursor: pointer;
}

.header-dropdown-item:hover {
  background: rgba(79, 195, 247, 0.18);
}

.top-auth-btn {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #77c9ff;
  border-radius: 999px;
  background: #192937b3;
  color: #dff3ff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.top-auth-btn:hover {
  background: rgba(79, 195, 247, 0.2);
}

#pwa-install-btn.pwa-install-icon-btn {
  width: 35px;
  min-width: 35px;
  height: 35px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#pwa-install-btn.pwa-install-icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

#pwa-install-btn .pwa-icon-desktop {
  display: none;
}

#pwa-install-btn .pwa-icon-mobile {
  display: block;
}

@media screen and (min-width: 769px) {
  #pwa-install-btn .pwa-icon-desktop {
    display: block;
  }

  #pwa-install-btn .pwa-icon-mobile {
    display: none;
  }
}

#pwa-install-btn.pwa-install-floating {
  position: fixed;
  right: 10px;
  top: 56px;
  z-index: 1100;
}

#map-fulgurpedia-btn.map-fulgurpedia-floating {
  position: fixed;
  left: 10px;
  top: 56px;
  z-index: 1250;
  width: 35px;
  min-width: 35px;
  height: 35px;
  border-radius: 999px;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(111, 203, 255, 0.9);
  background: rgba(22, 64, 92, 0.92);
  color: #a8dbff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#map-fulgurpedia-btn.map-fulgurpedia-floating svg,
#map-fulgurpedia-btn.map-fulgurpedia-floating img {
  width: 30px;
  height: 30px;
}

#map-fulgurpedia-btn.map-fulgurpedia-floating img {
  object-fit: contain;
  display: block;
  cursor: pointer;
}

.map-view-shortcuts #map-fulgurpedia-btn.map-fulgurpedia-floating {
  position: relative !important;
  inset: auto !important;
  width: 46px;
  min-width: 46px;
  height: 46px;
  margin: 0;
  border: 1px solid #4fc3f7;
  background: rgba(22, 64, 92, 0.92);
  color: #dff3ff;
}

@media screen and (min-width: 769px) {
  #map-fulgurpedia-btn.map-fulgurpedia-floating {
    width: 42px;
    min-width: 42px;
    height: 42px;
  }

  #map-fulgurpedia-btn.map-fulgurpedia-floating svg,
  #map-fulgurpedia-btn.map-fulgurpedia-floating img {
    width: 30px;
    height: 30px;
  }
}

@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui), (display-mode: window-controls-overlay) {
  #pwa-install-btn {
    display: none !important;
  }
}

#admin-buttons-container .admin-auth-btn {
  flex: 1;
  border-color: #f87171;
  background: rgba(122, 27, 27, 0.92);
  color: #ffe8e8;
}

#admin-buttons-container .admin-auth-btn:hover {
  background: rgba(220, 38, 38, 0.22);
  border-color: #fca5a5;
}

#admin-buttons-container .admin-icon-btn {
  flex: 0 0 35px !important;
  width: 35px;
  min-width: 35px;
  height: 35px;
  padding: 0;
  font-size: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 999px;
}

#admin-buttons-container .admin-icon-btn i {
  font-size: 16px;
  line-height: 1;
  color: #ffffff;
}

#admin-buttons-container {
  align-items: center !important;
}

#user-login-btn.user-login-emoji {
  width: 35px;
  min-width: 35px;
  padding: 0;
  font-size: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#user-login-btn.user-login-emoji svg {
  width: 16px;
  height: 16px;
  line-height: 1;
  color: #60b4f7;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#user-dashboard-btn.user-dashboard-emoji {
  width: 35px;
  min-width: 35px;
  padding: 0;
  font-size: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#user-dashboard-btn.user-dashboard-emoji {
  width: 35px;
  min-width: 35px;
  flex: 0 0 35px;
  height: 35px;
  padding: 0 !important;
  border-width: 2px;
  border-color: #22c55e;
  background: rgba(22, 64, 92, 0.92);
  text-decoration: none;
  position: relative;
}

#user-dashboard-btn.user-dashboard-emoji svg {
  width: 19px;
  height: 19px;
  display: block;
  margin: 0;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.user-dashboard-notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff4d4f;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-sizing: border-box;
  pointer-events: none;
}
.user-dashboard-notif-badge[hidden] {
  display: none !important;
}

.user-dashboard-notif-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


#user-dashboard-btn.user-dashboard-emoji:hover {
  border-color: #16a34a;
  background: rgba(22, 64, 92, 0.98);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.35), 0 6px 14px rgba(22, 163, 74, 0.35);
  transform: scale(1.06);
}

.user-logout-item {
  color: #ffdada;
}

.map-header .lang-switcher {
  position: static !important;
  transform: none !important;
  right: auto !important;
  top: auto !important;
  width: auto !important;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(79, 195, 247, 0.8);
  background: transparent !important;
  color: #d8ecf8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.map-header .lang-switcher option {
  background: #1c2b36;
  color: #eaf6ff;
}

.pwa-install-top-btn {
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(79, 195, 247, 0.85);
  border-radius: 999px;
  background: rgba(22, 64, 92, 0.92);
  color: #dff3ff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.pwa-install-top-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
}

.pwa-install-top-btn:hover {
  background: rgba(79, 195, 247, 0.2);
}

.pwa-install-top-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.map-subtitle-section {
  top: 58px !important;
}

@media screen and (max-width: 768px) {
  .alt-menu-panel {
    top: 46px;
    width: 82vw;
    max-width: 340px;
    height: auto;
    max-height: calc(100dvh - 62px);
    padding: 12px 10px;
    border-radius: 16px;
  }

  .alt-menu-item {
    min-height: 84px;
  }

  .alt-menu-emoji {
    width: 28px;
    height: 28px;
  }

  .alt-menu-emoji svg {
    width: 25px;
    height: 25px;
  }

  .alt-menu-emoji img {
    width: 25px;
    height: 25px;
  }

  .alt-menu-label {
    font-size: 11px;
  }

  .map-header {
    min-height: 46px;
    padding: 6px 8px !important;
  }

  .map-header-left,
  .map-header-right {
    gap: 6px;
  }

  .map-header-right-top {
    gap: 6px;
  }

  .map-header .map-btn {
    width: 35px !important;
    height: 35px !important;
    font-size: 14px !important;
    margin: 0 !important;
  }

  .top-auth-btn {
    height: 35px;
    padding: 0;
    font-size: 12px;
    border-radius: 50%;
  }

  #user-login-btn.user-login-emoji {
    width: 35px;
    min-width: 35px;
    padding: 0;
  }

  #pwa-install-btn.pwa-install-icon-btn {
    width: 35px;
    min-width: 35px;
    height: 35px;
  }

  #pwa-install-btn.pwa-install-floating {
    top: 50px;
    right: 8px;
  }

  #map-fulgurpedia-btn.map-fulgurpedia-floating {
    left: 8px;
    top: 50px;
  }

  .map-view-shortcuts #map-fulgurpedia-btn.map-fulgurpedia-floating {
    width: 50px;
    min-width: 50px;
    height: 50px;
  }

  #user-login-btn.user-login-emoji svg {
    width: 14px;
    height: 14px;
  }

  #user-dashboard-btn.user-dashboard-emoji {
    width: 35px;
    min-width: 35px;
    padding: 0;
  }

  #user-dashboard-btn.user-dashboard-emoji {
    width: 35px;
    min-width: 35px;
    flex: 0 0 35px;
    height: 35px;
    padding: 0 !important;
    border-width: 2px;
  }

  #user-dashboard-btn.user-dashboard-emoji svg {
    width: 16px;
    height: 16px;
  }

  #admin-buttons-container .admin-icon-btn {
    flex: 0 0 35px !important;
    width: 35px;
    min-width: 35px;
    height: 35px;
  }

  #admin-buttons-container .admin-icon-btn i {
    font-size: 14px;
  }

  .map-header .lang-switcher {
    width: auto !important;
    min-width: 0;
    height: 32px;
    padding: 0 4px;
    font-size: 11px;
  }

  .pwa-install-top-btn {
    height: 28px;
    padding: 0 8px;
    font-size: 10px;
  }

  .map-header .map-btn.panel-grid-btn {
    font-size: 15px !important;
  }

  .map-subtitle-section {
    top: 50px !important;
  }
}

@media (display-mode: standalone) {
  .map-header {
    padding-top: calc(env(safe-area-inset-top, 0px) + 6px) !important;
    min-height: calc(46px + env(safe-area-inset-top, 0px));
  }

  .map-header-center {
    top: calc(50% + (env(safe-area-inset-top, 0px) / 2));
  }
}

/* Overlays sous la barre fixe */
:root {
  --top-bar-offset: 56px;
}

.impacts-list,
.gallery-view {
  top: 0 !important;
  bottom: 0 !important;
  height: 100dvh !important;
  z-index: 1300 !important;
  padding: 12px 20px 20px !important;
  box-sizing: border-box;
}

@media screen and (max-width: 768px) {
  :root {
    --top-bar-offset: 50px;
  }

  .map-header {
    z-index: 1600 !important;
  }

  .impacts-list,
  .gallery-view {
    z-index: 1700 !important;
    padding: 0 !important;
  }

  /* Toujours sous la fiche mobile */
  .mobile-filter-toggle,
  #toggle-panel {
    z-index: 1804 !important;
  }

  /* Visible au-dessus du panneau filtre ouvert */
  .mobile-filter-toggle.panel-open {
    z-index: 1805 !important;
  }

  .mobile-filter-toggle.active.panel-open {
    z-index: 1806 !important;
  }

  .mobile-card {
    z-index: 2500 !important;
  }
}

/* Override: tooltip ? suggérer au-dessus des popups Leaflet */
.leaflet-popup-content-wrapper,
.leaflet-popup-content {
  overflow: visible !important;
}

/* Desktop: cacher le logo central quand un popup est ouvert (popup sinon masqué derrière) */
@media screen and (min-width: 769px) {
  body.leaflet-popup-open .map-header-center {
    visibility: hidden;
  }
}

.suggest-help-tooltip {
  z-index: 99999 !important;
}

/* Desktop: boutons flottants juste au-dessus de la timeline */
@media screen and (min-width: 769px) {
  #map-add-impact {
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
  }

  .map-add-impact-wrap {
    width: 46px;
    height: 46px;
  }

  .map-add-impact-actions {
    top: auto;
    right: 0;
    bottom: 0;
    width: 0;
    height: 0;
    transform: none;
    gap: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: none;
  }

  .map-add-impact-action {
    position: absolute;
    right: 0;
    bottom: 0;
    min-width: 146px;
    height: 40px;
    opacity: 0;
    pointer-events: none;
    transform: translate(0, 0) scale(0.82);
    transition: transform 0.24s cubic-bezier(0.22, 0.9, 0.3, 1), opacity 0.18s ease;
    animation: none;
    will-change: transform, opacity;
  }

  .map-add-impact-wrap.is-open .map-add-impact-actions {
    pointer-events: auto;
  }

  .map-add-impact-wrap.is-open .map-add-impact-action {
    opacity: 1;
    pointer-events: auto;
    animation: map-add-action-arc 0.24s cubic-bezier(0.22, 0.9, 0.3, 1) both;
  }

  /* 2 boutons (impact + trace) centrés verticalement sur .rp-c-contribute */
  .map-add-impact-action:nth-child(1) { --arc-x: -75px; --arc-y: -2px; }
  .map-add-impact-action:nth-child(2) { --arc-x: -75px; --arc-y: 60px; }

  .map-add-impact-wrap.is-open .map-add-impact-action:nth-child(2) { animation-delay: 0.03s; }

  .map-view-shortcuts {
    top: auto !important;
    bottom: 146px !important;
  }
}

/* Galerie: laisser sortir l'infobulle du bouton suggérer */
.gallery-popup-content {
  overflow: visible !important;
}

.gallery-popup-body {
  max-height: 75vh;
  overflow-y: auto;
  overflow-x: visible;
}

/* Galerie: placer la bulle sous le ? pour éviter la découpe en haut */
.gallery-popup .suggest-help-tooltip {
  top: 18px;
  bottom: auto;
  right: 0;
}

/* FINAL OVERRIDE traces layout (eviter ecrasement par .photos-container flex) */
.photos-container.trace-square-grid {
  display: grid !important;
  align-items: stretch !important;
}

/* Galerie content popup: 3 carres sur une seule ligne */
.gallery-popup .photos-container.gallery-trace-popup-grid.trace-count-3 {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

/* Galerie content popup: une seule image trace doit rester compacte */
.gallery-popup .photos-container.gallery-trace-popup-grid.trace-count-1 {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  width: min(420px, 100%) !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Leaflet popup + mobile card: 2 en haut, 1 centre en dessous */
.leaflet-popup-content .photos-container.leaflet-trace-popup-grid.trace-count-3,
.mobile-card .photos-container.mobile-trace-popup-grid.trace-count-3 {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.leaflet-popup-content .photos-container.leaflet-trace-popup-grid.trace-count-3 .trace-square-cell:nth-child(3),
.mobile-card .photos-container.mobile-trace-popup-grid.trace-count-3 .trace-square-cell:nth-child(3) {
  grid-column: 1 / span 2;
  width: calc(50% - 4px);
  justify-self: center;
}

/* FINAL FINAL: forcer cover+center pour traces (eviter les overrides globaux photos-container) */
.gallery-popup .photos-container.trace-square-grid .trace-square-cell > img,
.leaflet-popup-content .photos-container.trace-square-grid .trace-square-cell > img,
.mobile-card .photos-container.trace-square-grid .trace-square-cell > img {
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
}

.gallery-popup .photos-container.trace-square-grid .trace-square-cell > .media-preview,
.leaflet-popup-content .photos-container.trace-square-grid .trace-square-cell > .media-preview,
.mobile-card .photos-container.trace-square-grid .trace-square-cell > .media-preview {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
}

.gallery-popup .photos-container.trace-square-grid .trace-square-cell > .media-preview img,
.leaflet-popup-content .photos-container.trace-square-grid .trace-square-cell > .media-preview img,
.mobile-card .photos-container.trace-square-grid .trace-square-cell > .media-preview img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
}

/* Suggest-help: toujours au-dessus des boutons voisins (galerie + leaflet) */
.gallery-popup-content .suggest-btn,
.leaflet-popup-content .suggest-btn {
  position: relative;
  z-index: 120 !important;
}

.mobile-card .suggest-btn,
.mobile-card-content .suggest-btn {
  position: relative;
  z-index: 120 !important;
}

.gallery-popup-content .suggest-help,
.leaflet-popup-content .suggest-help {
  z-index: 130 !important;
}

.mobile-card .suggest-help,
.mobile-card-content .suggest-help {
  z-index: 130 !important;
}

.gallery-popup-content .suggest-help-tooltip,
.leaflet-popup-content .suggest-help-tooltip {
  z-index: 140 !important;
  background: rgba(20, 30, 38, 0.98) !important;
  border: 1px solid rgba(79, 195, 247, 0.45) !important;
}

.mobile-card .suggest-help-tooltip,
.mobile-card-content .suggest-help-tooltip {
  z-index: 140 !important;
  background: rgba(20, 30, 38, 0.98) !important;
  border: 1px solid rgba(79, 195, 247, 0.45) !important;
}

.gallery-popup-content .favorite-btn,
.leaflet-popup-content .popup-content .favorite-btn,
.mobile-card .favorite-btn,
.mobile-card-content .favorite-btn {
  position: relative;
  z-index: 1 !important;
}















/* Dedicated view open-in-new-tab button (list + gallery) */
.view-dedicated-open-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(79, 195, 247, 0.55);
  border-radius: 8px;
  background: rgba(15, 34, 46, 0.9);
  color: #dff3ff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.view-dedicated-open-btn:hover {
  border-color: #79d3ff;
  background: rgba(22, 45, 60, 0.95);
  transform: translateY(-1px);
}

.view-dedicated-open-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

@media screen and (max-width: 768px) {
  .view-dedicated-open-btn {
    width: 30px;
    height: 30px;
    top: 4px;
    right: 4px;
  }
}

/* Dedicated views (?view=list | ?view=gallery): render as real pages, not overlays */
body.dedicated-view .map-header,
body.dedicated-view #map,
body.dedicated-view #pwa-install-btn,
body.dedicated-view .map-view-shortcuts,
body.dedicated-view #map-add-impact,
body.dedicated-view #map-fulgurpedia-btn,
body.dedicated-view #timeline-container,
body.dedicated-view #mobile-card,
body.dedicated-view .mobile-card-close-float {
  display: none !important;
}

body.dedicated-view #panel {
  display: block !important;
}

@media (min-width: 769px) {
  body.dedicated-view #toggle-panel {
    display: none !important;
  }
}

body.dedicated-view {
  background: radial-gradient(circle at 20% 0%, #1c3344 0%, #101c26 58%) !important;
  color: #e8f4ff;
  min-height: 100vh;
}

body.dedicated-view #impacts-list,
body.dedicated-view #gallery-view {
    position: static !important;
    inset: auto !important;
    width: auto !important;
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
    background: transparent !important;
    padding: 12px !important;
    z-index: 1 !important;
}

@media (max-width: 980px) {
    body.dedicated-view #impacts-list,
    body.dedicated-view #gallery-view {
        padding: 0 !important;
    }
}

body.dedicated-view #impacts-list {
  display: block !important;
}

body.dedicated-view #gallery-view {
  display: block !important;
}

body.dedicated-view #impacts-list .impacts-close-float,
body.dedicated-view #gallery-view .gallery-close,
body.dedicated-view #gallery-view .gallery-close-float {
  display: none !important;
}

body.dedicated-view #impacts-list .impacts-container,
body.dedicated-view #gallery-view .gallery-container {
  margin: 0 auto !important;
  max-width: 1280px;
}

body.dedicated-view-list #gallery-view {
  display: none !important;
}

body.dedicated-view-gallery #impacts-list {
  display: none !important;
}

/* Dedicated page top header: strictement identique a la page auteurs */
.dedicated-view-wrap {
  max-width: 1220px;
  margin: 0 auto;
  padding: 18px 14px 0;
}

.dedicated-view-wrap .top,
.dedicated-view-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(79, 195, 247, .32);
  border-radius: 12px;
  background: rgba(28, 43, 54, 0.85);
  box-shadow: 0 8px 18px rgba(0,0,0,.24);
  position: relative;
  min-height: 56px;
}

.dedicated-view-wrap .back,
.dedicated-view-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #dff3ff;
  text-decoration: none;
  border: 1px solid rgba(79, 195, 247, .32);
  border-radius: 10px;
  padding: 0 12px;
  height: 36px;
  background: rgba(28, 43, 54, 0.8);
  font-weight: 600;
  font-size: 12px;
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  transition: 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.dedicated-view-wrap .back:hover,
.dedicated-view-back:hover {
  border-color: rgba(79, 195, 247, .55);
  background: rgba(20, 37, 49, 0.95);
  transform: translateY(-50%) translateY(-1px);
}

.dedicated-view-wrap .back svg,
.dedicated-view-back svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.dedicated-view-wrap .back .fp-back-map-return,
.dedicated-view-back .fp-back-map-return {
  width: 18px;
  height: 18px;
}

.dedicated-view-wrap .back .fp-back-map-map,
.dedicated-view-back .fp-back-map-map {
  width: 17px;
  height: 17px;
}

.dedicated-view-wrap .back .fp-back-map-label,
.dedicated-view-back .fp-back-map-label {
  display: none;
}

.dedicated-view-wrap h1,
.dedicated-view-title {
  margin: 0;
  font-size: clamp(20px, 3vw, 30px);
  letter-spacing: .3px;
  color: #eaf6ff;
  text-align: center;
  padding: 0 130px;
  width: 100%;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .dedicated-view-wrap {
    padding: 12px 10px 0;
  }

  .dedicated-view-wrap .top,
  .dedicated-view-top {
    min-height: 0;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px;
    margin: 0 0 6px;
    position: relative;
  }

  .dedicated-view-wrap .back,
  .dedicated-view-back {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 10px;
    height: 34px;
    flex: 0 0 auto;
    gap: 4px;
  }

  .dedicated-view-wrap .back .fp-back-map-return,
  .dedicated-view-back .fp-back-map-return {
    display: none;
  }

  .dedicated-view-wrap .back .fp-back-map-map,
  .dedicated-view-back .fp-back-map-map {
    width: 16px;
    height: 16px;
  }

  .dedicated-view-wrap .back .fp-back-map-label,
  .dedicated-view-back .fp-back-map-label {
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
  }

  .dedicated-view-wrap .back:hover,
  .dedicated-view-back:hover {
    transform: translateY(-1px);
  }

  .dedicated-view-wrap h1,
  .dedicated-view-title {
    padding: 0 92px;
    width: 100%;
    flex: 0 0 100%;
    text-align: center;
    font-size: clamp(20px, 5vw, 24px);
  }
}

/* Sticky headers + desktop floating close buttons for impacts/gallery */
.impacts-container,
.gallery-container {
    padding-top: 20px;
}

@media (max-width: 980px) {
    .impacts-container,
    .gallery-container {
        padding-top: 0;
    }
}

.impacts-header,
.gallery-header {
  position: sticky !important;
  top: 12px;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  height: auto !important;
  width: 100% !important;
  margin: 0 0 14px;
  padding: 10px 12px 12px;
  border-radius: 10px;
  background: rgba(28, 43, 54, 0.96);
  z-index: 200 !important;
  isolation: isolate;
}

#impacts-content,
#gallery-content {
  position: relative;
  z-index: 1;
}

.impacts-header .sort-controls {
  margin-bottom: 0 !important;
}

.list-gallery-mode-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 auto 12px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(79, 195, 247, 0.45);
  background: rgba(16, 33, 45, 0.9);
}

.impacts-header .list-gallery-mode-toggle,
.gallery-header .list-gallery-mode-toggle {
  max-width: calc(100% - 120px);
}

.list-gallery-mode-btn {
  margin: 0;
  width: auto;
  min-width: 108px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #bcd8ea;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.list-gallery-mode-btn:hover {
  background: rgba(79, 195, 247, 0.16);
  color: #e7f6ff;
  border-color: rgba(79, 195, 247, 0.45);
}

.list-gallery-mode-btn.active {
  background: linear-gradient(135deg, rgba(79, 195, 247, 0.28), rgba(56, 142, 186, 0.34));
  border-color: rgba(79, 195, 247, 0.78);
  color: #eff9ff;
}

.list-gallery-mode-btn:active {
  transform: scale(0.98);
}

/* Liste impacts: corriger l'espace vide au-dessus du header sticky */
#impacts-list .impacts-header {
  top: 0 !important;
  margin-top: 0 !important;
}

#impacts-list #impacts-content {
  margin-top: 0 !important;
}

@media screen and (min-width: 769px) {
  #impacts-list > .impacts-close-float {
    position: fixed !important;
    top: 24px !important;
    right: max(20px, calc((100vw - 1000px) / 2 + 20px)) !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    z-index: 3200 !important;
  }

  #gallery-view > .gallery-close-float {
    position: fixed !important;
    top: 24px !important;
    right: max(20px, calc((100vw - 1400px) / 2 + 20px)) !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    z-index: 3200 !important;
  }

  #gallery-popup .gallery-popup-content > .gallery-close-float {
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    z-index: 3200 !important;
  }
}


/* Header square close buttons + popup non-floating close */
.impacts-header .panel-info-banner,
.gallery-header .panel-info-banner {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding-right: 94px !important;
  text-align: center;
}

.impacts-header .panel-info-banner .panel-info-banner-copy,
.gallery-header .panel-info-banner .panel-info-banner-copy {
  display: block;
  width: 100%;
  margin: 0 auto 5px;
  text-align: center;
}

.impacts-header .panel-info-banner .panel-info-banner-sort {
  justify-content: center;
}

@media screen and (min-width: 769px) {
  .impacts-header .list-gallery-mode-toggle,
  .gallery-header .list-gallery-mode-toggle {
    height: 34px;
    padding: 3px;
    box-sizing: border-box;
  }

  .impacts-header .list-gallery-mode-toggle .list-gallery-mode-btn,
  .gallery-header .list-gallery-mode-toggle .list-gallery-mode-btn {
    height: 100%;
    padding-top: 0;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
  }

  .impacts-header .panel-info-banner,
  .gallery-header .panel-info-banner {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .impacts-header .panel-info-banner .panel-info-banner-copy,
  .gallery-header .panel-info-banner .panel-info-banner-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    min-width: 0;
    max-width: calc(100% - 360px);
  }

  .impacts-header .panel-info-banner .panel-info-banner-sort {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0 !important;
    width: max-content;
    max-width: calc(100% - 170px);
  }

  #gallery-view .gallery-header .panel-info-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }

  #gallery-view .gallery-header .panel-info-banner .panel-info-banner-copy {
    max-width: none;
  }

  #gallery-view .gallery-header .panel-info-banner .gallery-controls {
    margin: 0;
    flex: 0 1 auto;
    width: auto;
    justify-content: center !important;
  }

  #impacts-list .impacts-header .panel-info-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }

  #impacts-list .impacts-header .panel-info-banner .panel-info-banner-copy {
    max-width: none;
  }

  #impacts-list .impacts-header .panel-info-banner .panel-info-banner-sort {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    margin: 0 !important;
    width: auto;
    max-width: none;
    justify-content: center;
  }
}

.impacts-header .panel-header-actions,
.gallery-header .panel-header-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 24;
}

.impacts-header .panel-header-actions .view-dedicated-open-btn,
.gallery-header .panel-header-actions .view-dedicated-open-btn,
.impacts-header .panel-header-actions .panel-close-square-btn,
.gallery-header .panel-header-actions .panel-close-square-btn {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  transform: none !important;
}

.panel-close-square-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(79, 195, 247, 0.55);
  border-radius: 8px;
  background: rgba(15, 34, 46, 0.9);
  color: #dff3ff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.panel-close-square-btn:hover {
  border-color: #ff8a8a;
  background: rgba(70, 28, 28, 0.95);
  transform: translateY(-1px);
}

.panel-close-square-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Popup galerie: forcer 42x42 pour le bouton close */
#gallery-popup .gallery-popup-close {
  width: 42px !important;
  height: 42px !important;
}

@media screen and (max-width: 768px) {
  .impacts-header .panel-info-banner,
  .gallery-header .panel-info-banner {
    padding-right: 15px !important;
  }

  .impacts-header .panel-header-actions,
  .gallery-header .panel-header-actions {
    top: 0;
    right: 4px;
    gap: 4px;
  }

  #impacts-list .panel-close-square-btn,
  #gallery-view .panel-close-square-btn {
    display: none !important;
  }
}

/* Popup galerie: bouton close dans la rangée d'actions (desktop) */
@media screen and (min-width: 769px) {
  #gallery-popup .gallery-popup-close {
    position: static;
    margin: 0;
  }
}

@media screen and (min-width: 769px) {
  #impacts-list > .impacts-close-float,
  #gallery-view > .gallery-close-float,
  #gallery-view.active > .gallery-close-float,
  #gallery-popup .gallery-popup-content > .gallery-close-float {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* Galerie desktop: garder l'entete centree dans le conteneur */
@media screen and (min-width: 769px) {
  #impacts-list .impacts-header {
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
    padding-left: 52px !important;
    padding-right: 52px !important;
  }

  #gallery-view .gallery-header {
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
    padding-left: 52px !important;
    padding-right: 52px !important;
  }
}

@media screen and (max-width: 768px) {
  /* Mobile: meme retrait ecran pour liste et galerie (partie haute) */
  #impacts-list,
  #gallery-view {
    padding: 8px !important;
  }

  #impacts-list .impacts-container,
  #gallery-view .gallery-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
  }

  /* Mobile: pas de bouton close carre dans le popup galerie */
  #gallery-popup .gallery-popup-close {
    display: none !important;
  }

  /* Mobile: liste impacts alignée sur la galerie (pas de grand espace en haut) */
  #impacts-list .impacts-container {
    padding-top: 0px !important;
  }

  #impacts-list #impacts-content {
    margin-top: 0 !important;
  }

  /* Mobile: eviter le depassement horizontal du header liste impacts */
  #impacts-list .impacts-header {
    top: 0 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    margin: 0 !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  /* Mobile: eviter le depassement horizontal du header galerie */
  #gallery-view .gallery-header {
    top: 0 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    margin: 0 !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .list-gallery-mode-toggle {
    width: calc(100% - 42px);
    height: 30px;
    box-sizing: border-box;
    gap: 4px;
    margin: 0 auto 10px 0;
    padding: 2px;
  }

  .list-gallery-mode-btn {
    flex: 1 1 50%;
    min-width: 0;
    height: 100%;
    padding: 0 8px;
    font-size: 11px;
  }

  #gallery-view .gallery-controls {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
    margin-bottom: 5px !important;
  }

  #gallery-view .gallery-controls > label {
    flex: 0 0 auto !important;
    margin: 0 !important;
    font-size: 11px !important;
    white-space: nowrap !important;
  }

  #gallery-view .gallery-controls > select {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin-right: 0 !important;
  }

  #gallery-view #gallery-sort-select {
    flex: 0 1 44vw !important;
    width: 44vw !important;
    max-width: 44vw !important;
  }

  #impacts-list #sort-select {
    flex: 0 1 44vw !important;
    width: 44vw !important;
    max-width: 44vw !important;
  }

  #gallery-view #gallery-sort-select,
  #impacts-list #sort-select {
    height: 30px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    padding: 4px 8px !important;
  }

  #gallery-filters-reset.timeline-reset-btn {
    order: 3;
    flex: 0 0 auto !important;
  }

  #gallery-view .gallery-size-control {
    order: 4;
    flex: 0 0 auto !important;
    width: 118px !important;
    grid-column: auto !important;
    padding: 2px 8px;
  }

  #gallery-view .gallery-size-control label {
    display: none;
  }

  #gallery-view .gallery-size-control input[type="range"] {
    width: 102px;
    max-width: 102px;
    margin: 0;
  }

}

@media screen and (max-width: 768px) {
  .list-gallery-mode-toggle {
    display: none !important;
  }

  #gallery-view .gallery-size-control {
    display: none !important;
  }

  .impacts-list,
  .gallery-view {
    position: fixed !important;
    inset: 0 !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: 0 !important;
    background: #0f1f2a !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }

  .impacts-container,
  .gallery-container {
    min-height: 100%;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    padding: 10px 10px 82px !important;
    background: transparent !important;
  }

  #impacts-list #impacts-content,
  #gallery-view #gallery-content {
    padding-bottom: 84px;
    padding: 5px;
  }

  #impacts-list .impacts-close-float,
  #gallery-view .gallery-close-float {
    display: none !important;
  }

  .mobile-list-gallery-bottom-nav.user-tabs {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: 0;
    transform: translateX(-50%);
    width: calc((64px * 2 + 6px) * 1.2);
    z-index: 2800;
    margin: 0;
    padding: 0px;
    gap: 6px;
    display: none;
    grid-template-columns: repeat(2, 64px);
    justify-content: center;
    border-radius: 12px 12px 0 0;
    border: 1px solid rgba(79, 195, 247, 0.45);
    border-bottom: 0;
    background: rgba(11, 22, 30, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.82s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.82s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: opacity, transform;
  }

  .mobile-list-gallery-bottom-nav.user-tabs.active {
    display: grid;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-list-gallery-bottom-nav.user-tabs.active.is-scrolling {
    opacity: 0;
    transform: translate(-50%, 14px);
    pointer-events: none;
  }

  .mobile-list-gallery-bottom-nav.user-tabs .mobile-list-gallery-bottom-btn.user-tab {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    padding: 6px 4px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: #dff3ff;
    font-size: 10px;
    font-weight: 600;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
  }

  .mobile-list-gallery-bottom-nav.user-tabs .mobile-list-gallery-bottom-btn.user-tab.active {
    background: rgba(79, 195, 247, 0.18);
    border-color: rgba(79, 195, 247, 0.45);
    color: #dff3ff;
  }

  .mobile-list-gallery-bottom-nav.user-tabs .mobile-list-gallery-bottom-btn-icon.user-tab-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  .mobile-list-gallery-bottom-nav.user-tabs .mobile-list-gallery-bottom-btn-icon.user-tab-icon svg {
    width: 20px;
    height: 20px;
    display: block;
  }

  .mobile-list-gallery-bottom-nav.user-tabs .user-tab-label {
    font-size: 10px;
    line-height: 1.1;
    white-space: nowrap;
  }

  #gallery-view {
    padding-top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  #gallery-view .gallery-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 2100 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 10px !important;
    background: rgba(11, 22, 30, 0.96) !important;
    border-bottom: 1px solid rgba(79, 195, 247, 0.35);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
    overflow-x: hidden;
  }

  #gallery-view .gallery-container {
    width: 100% !important;
    max-width: 100% !important;
    padding-top: calc(100px + env(safe-area-inset-top, 0px)) !important;
    overflow-x: hidden !important;
  }

  #gallery-view .gallery-header .panel-info-banner {
    position: relative;
    margin: 0 !important;
    padding: 8px 10px 46px !important;
    overflow-x: hidden;
  }

  #gallery-view .gallery-header .panel-info-banner .gallery-controls {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    width: calc(100% - 16px) !important;
    max-width: calc(100% - 16px);
    margin: 0 !important;
    justify-content: center !important;
    overflow-x: hidden;
  }

  #gallery-view .gallery-header .panel-info-banner .gallery-controls > select {
    width: min(56vw, 260px) !important;
    max-width: min(56vw, 260px) !important;
    flex: 0 1 auto !important;
  }

  #gallery-view #gallery-content,
  #gallery-view .gallery-grid {
    overflow-x: hidden !important;
    padding: 2px !important;
  }

  #gallery-view .gallery-grid {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--thumb-size, 200px)), 1fr)) !important;
    justify-content: stretch !important;
  }

  #gallery-view,
  #gallery-view .gallery-container,
  #gallery-view .gallery-header,
  #gallery-view .gallery-header .panel-info-banner,
  #gallery-view .gallery-header .panel-info-banner .gallery-controls,
  #gallery-view #gallery-content,
  #gallery-view .gallery-grid,
  #gallery-view .gallery-item {
    box-sizing: border-box !important;
    max-width: 100% !important;
  }

  body.dedicated-view-gallery {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  html,
  body.dedicated-view-gallery {
    overflow-x: hidden !important;
  }

  #impacts-list .impacts-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 2100 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 10px !important;
    background: rgba(11, 22, 30, 0.96) !important;
    border-bottom: 1px solid rgba(79, 195, 247, 0.35);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  }

  #impacts-list .impacts-container {
    padding-top: calc(100px + env(safe-area-inset-top, 0px)) !important;
  }

  #impacts-list .impacts-header .panel-info-banner {
    position: relative;
    margin: 0 !important;
    padding: 8px 10px 46px !important;
  }

  #impacts-list .impacts-header .panel-info-banner .panel-info-banner-sort {
    position: absolute !important;
    left: 50% !important;
    bottom: 8px !important;
    transform: translateX(-50%) !important;
    width: max-content !important;
    max-width: calc(100% - 16px) !important;
    margin: 0 !important;
    justify-content: center !important;
  }

  #impacts-list #sort-select,
  #gallery-view #gallery-sort-select {
    width: min(56vw, 260px) !important;
    max-width: min(56vw, 260px) !important;
    flex: 0 1 auto !important;
  }

  body.mobile-list-gallery-page-open #map,
  body.mobile-list-gallery-page-open .map-header,
  body.mobile-list-gallery-page-open .map-subtitle-section,
  body.mobile-list-gallery-page-open .timeline-container,
  body.mobile-list-gallery-page-open .map-view-shortcuts,
  body.mobile-list-gallery-page-open #toggle-panel,
  body.mobile-list-gallery-page-open .mobile-card,
  body.mobile-list-gallery-page-open .mobile-card-close-float {
    display: none !important;
  }

  body.mobile-list-gallery-page-open.mobile-dedicated-page .mobile-filter-toggle {
    display: flex !important;
  }

  body.mobile-list-gallery-page-open.mobile-dedicated-page #panel {
    display: block !important;
  }

  body.mobile-list-gallery-page-open {
    overflow: hidden;
    height: 100dvh;
  }

  body.mobile-list-gallery-page-open.mobile-dedicated-page {
    overflow: auto !important;
    height: auto !important;
  }

  body.mobile-list-gallery-page-open .impacts-list.active,
  body.mobile-list-gallery-page-open .gallery-view.active {
    z-index: 3200 !important;
    background: #0f1f2a !important;
  }

  body.mobile-list-gallery-page-open .mobile-list-gallery-bottom-nav.active {
    display: grid !important;
    z-index: 3400 !important;
  }

  body.mobile-dedicated-page .alt-menu-panel,
  body.mobile-dedicated-page .alt-menu-overlay {
    display: none !important;
  }

  body.mobile-dedicated-page .dedicated-view-wrap {
    display: none !important;
  }

  body.dedicated-view-gallery:not(.mobile-dedicated-page) #gallery-view .gallery-container {
    padding-top: calc(20px + env(safe-area-inset-top, 0px)) !important;
  }

  body.dedicated-view-gallery,
  body.dedicated-view-gallery #gallery-view,
  body.dedicated-view-gallery #gallery-view .gallery-container,
  body.dedicated-view-gallery #gallery-view #gallery-content,
  body.dedicated-view-gallery #gallery-view .gallery-grid {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow-x: clip !important;
  }

  body.dedicated-view-gallery #gallery-view {
    padding: 0 !important;
  }

  body.dedicated-view-gallery #gallery-view .gallery-container {
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box !important;
  }
}

/* ============================================================
   FZ GLOBAL MOBILE NAV — ajustements index.php (mobile only)
   ============================================================ */
@media (max-width: 768px) {

  /* Hauteur de la barre globale en variable CSS */
  /* La barre est à bottom: env(safe-area-inset-bottom) + height: 64px.
     --fz-nav-bottom-offset = position du haut de la barre depuis le bas de l'écran. */
  :root {
    --fz-global-nav-h: 64px;
    --fz-nav-bottom-offset: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  /* ── Masquer les éléments remplacés par la barre globale ── */
  #alt-menu-btn            { display: none !important; }
  #user-login-btn          { display: none !important; }
  #user-dashboard-btn      { display: none !important; }
  #list-impacts            { display: none !important; }
  #map-fulgurpedia-btn     { display: none !important; }

  /* ── Timeline : juste au-dessus de la barre globale ── */
  .timeline-container {
    bottom: var(--fz-nav-bottom-offset) !important;
  }
  .timeline-container.collapsed {
    bottom: var(--fz-nav-bottom-offset) !important;
  }

  /* ── map-view-shortcuts : au-dessus de timeline + barre globale ── */
  .map-view-shortcuts {
    bottom: calc(130px + var(--fz-nav-bottom-offset) + 5px) !important;
  }
  .map-view-shortcuts.panel-open {
    bottom: calc(130px + var(--fz-nav-bottom-offset) + 5px) !important;
  }
  body.timeline-collapsed .map-view-shortcuts {
    bottom: calc(30px + var(--fz-nav-bottom-offset) + 5px) !important;
  }
  body.timeline-collapsed .map-view-shortcuts.panel-open {
    bottom: calc(30px + var(--fz-nav-bottom-offset) + 5px) !important;
  }

  /* ── Panneau filtres : au-dessus de la barre globale ── */
  .filter-panel {
    bottom: calc(15px + var(--fz-nav-bottom-offset)) !important;
  }

  /* ── mobile-card (fiche point) : au-dessus de la barre globale ── */
  .mobile-card {
    bottom: var(--fz-nav-bottom-offset) !important;
  }

  /* ── PWA install : coin supérieur gauche sur mobile ── */
  #pwa-install-btn.pwa-install-floating {
    top: 6px !important;
    right: auto !important;
    left: 6px !important;
  }

  /* ── Galerie/Liste toggle nav : apparence d'origine, juste au-dessus de la barre globale ── */
  .mobile-list-gallery-bottom-nav.user-tabs {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    bottom: var(--fz-nav-bottom-offset) !important;
    transform: translateX(-50%) !important;
    width: calc((64px * 2 + 6px) * 1.2) !important;
    z-index: 2900 !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 6px !important;
    display: none !important;
    grid-template-columns: repeat(2, 64px) !important;
    justify-content: center !important;
    border-radius: 12px 12px 0 0 !important;
    border: 1px solid rgba(79, 195, 247, 0.45) !important;
    border-bottom: 0 !important;
    background: rgba(11, 22, 30, 0.95) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.82s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.82s cubic-bezier(0.22, 0.61, 0.36, 1) !important;
    will-change: opacity, transform !important;
  }

  .mobile-list-gallery-bottom-nav.user-tabs.active {
    display: grid !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .mobile-list-gallery-bottom-nav.user-tabs.active.is-scrolling {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* ── Page dédiée : padding-bottom pour la barre globale ── */
  body.mobile-dedicated-page #gallery-view,
  body.mobile-dedicated-page #impacts-list {
    padding-bottom: calc(var(--fz-global-nav-h, 64px) + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ── Contribution FulgurPedia : masquée sur mobile (accessible via FulgurPedia) ── */
  .map-add-impact-action[data-contribution-action="fulgurpedia"] {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Map Report Modal — styles PC + mobile (slide-up)
   ═══════════════════════════════════════════════════════════════ */
#map-report-modal {
  border: none;
  border-radius: 8px;
  background: #ffffff;
  color: #2c3e50;
  width: min(400px, 92vw);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
  padding: 0;
  z-index: 200850;
}

#map-report-modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

#map-report-overlay {
  position: fixed;
  inset: 0;
  z-index: 200820;
  background: rgba(0, 0, 0, 0.6);
  display: none;
}

#map-report-overlay.visible {
  display: block;
}

#map-report-form {
  display: grid;
  gap: 10px;
  padding: 20px;
}

.map-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 2px;
}

.map-report-head h2 {
  margin: 0;
  color: #e74c3c;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}

#map-report-close {
  background: #95a5a6;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  width: fit-content;
  align-self: center;
}

#map-report-close:hover {
  background: #7f8c8d;
}

.map-report-target {
  margin: 0;
  color: #2c3e50;
  font-size: 14px;
}

#map-report-auth-required {
  border: 1px solid rgba(231, 76, 60, 0.4);
  background: rgba(231, 76, 60, 0.07);
  color: #c0392b;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
}

#map-report-fields {
  display: grid;
  gap: 8px;
}

#map-report-fields label {
  display: block;
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

#map-report-fields label > span {
  display: block;
  margin-bottom: 6px;
  color: #2c3e50;
  font-size: 14px;
  font-weight: 600;
}

#map-report-reason {
  width: 100%;
  border-radius: 4px;
  border: 1px solid #cccccc;
  background: #ffffff;
  color: #2c3e50;
  padding: 8px;
  font-size: 14px;
  box-sizing: border-box;
}

#map-report-reason:focus {
  outline: 2px solid rgba(231, 76, 60, 0.25);
  outline-offset: 0;
  border-color: #e74c3c;
}

#map-report-comment,
#map-report-email {
  width: 100%;
  border: 1px solid #cccccc;
  border-radius: 4px;
  background: #ffffff;
  color: #2c3e50;
  padding: 8px;
  font-size: 14px;
  box-sizing: border-box;
}

#map-report-comment {
  min-height: 80px;
  resize: vertical;
}

#map-report-comment:focus,
#map-report-email:focus {
  outline: 2px solid rgba(231, 76, 60, 0.25);
  outline-offset: 0;
  border-color: #e74c3c;
}

.map-report-email-note {
  font-size: 11px;
  color: #7f8c8d;
  margin: 0;
}

.map-report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}


#map-report-login {
  background: #95a5a6;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

#map-report-login:hover {
  background: #7f8c8d;
}

#map-report-submit {
  background: #e74c3c;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#map-report-submit:hover {
  background: #d84333;
}

#map-report-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

@media (max-width: 768px) {
  #map-report-modal {
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 88vh !important;
    border-radius: 20px 20px 0 0 !important;
    margin: 0 !important;
    transform: translate3d(0, 100%, 0);
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1) !important;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  #map-report-modal[open],
  #map-report-modal.map-report-modal-open {
    transform: translate3d(0, 0, 0);
    animation: none !important;
  }

  #map-report-modal::before {
    content: '';
    display: block;
    width: 38px;
    height: 4px;
    background: rgba(44, 62, 80, 0.2);
    border-radius: 2px;
    margin: 10px auto 4px;
  }

  #map-report-form {
    padding: 16px;
  }

  .map-report-head h2 {
    font-size: 17px;
  }

  #map-report-close {
    display: none;
  }

  .map-report-actions {
    flex-wrap: nowrap;
    justify-content: stretch;
  }

  .map-report-actions > * {
    flex: 1;
    text-align: center;
    justify-content: center;
  }
}
