/* Base styles */
body {
  background-color: #4C4E52;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

/* Hide scrollbars */
::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}
html {
  scrollbar-width: none;
}
body {
  -ms-overflow-style: none;
}

.has-emoji {
  /* 1) Windows color emoji  2) macOS color emoji 3) Android/Linux color emoji 4) finally your normal text font 5) or an icon font */
  font-family:
    "Segoe UI Emoji",        /* Windows 10+ color emoji */
    "Apple Color Emoji",     /* macOS/iOS color emoji */
    "Noto Color Emoji",      /* Android, many Linux distros */
    "EmojiSymbols",          /* fallback monochrome symbol set */
    "FontAwesome",           /* your icon-font of choice */
    sans-serif;
}
.fa-fallback:before {
  font-family:
    "Segoe UI Emoji",
    "Apple Color Emoji",
    "Noto Color Emoji",
    "FontAwesome";
  content: "\1F6E0";   /* if FA has no glyph at U+1F6E0, put its \f… code here instead */
}



/* Touch & Image Settings */
#modalImage {
  touch-action: none;
  -webkit-touch-callout: none;
}
#imageGallery img {
  min-width: 80px; /* Matches MIN_IMAGE_SIZE */
  min-height: auto;
}

/* Hidden and Fade Classes */
.hidden-on-load {
  opacity: 0;
  visibility: hidden;
}
.fade-in {
  opacity: 1;
  visibility: visible;
  transition: opacity 1s ease;
}
.fade-out {
  opacity: 0;
  transition: opacity 1s ease-out;
}

/* Splash Screen Keyframes & Styles */
@keyframes splashFade {
  from { opacity: 1; }
  to { opacity: 0; }
}
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: calc(var(--vh, 1vh) * 100);
  z-index: 9999;
  overflow: hidden;
  opacity: 1;
}
.splash-screen.fade-out {
  animation: splashFade 1s forwards;
}

/* Desktop Splash Video */
.splash-screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.desktop-video { display: none; }
@media (min-width: 768px) {
  .desktop-video { display: block; }
  .mobile-splash-image { display: none; }
}

/* Mobile Splash Image */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Splash screen container uses the calculated viewport height */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: calc(var(--vh, 1vh) * 100);
  overflow: hidden;
  z-index: 9999;
}

/* Mobile splash image fills the container and aligns its top */
.splash-image.mobile-splash-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top; /* force alignment of the top edge */
  animation: fadeIn 1s ease-in forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}


/* Selected Filters Container */
.selected-filters {
  background-color: #04AA6D;
  color: white;
  padding: 6px 10px;
  font-size: 14px;
  border: 3px solid white;
  border-radius: 8px;
  box-shadow: 0 6px #999;
  margin-bottom: 5px;
  display: none;
  transition: opacity 0.3s ease;
  white-space: pre-line;
  font-weight: bold;
  max-width: 500px;
  margin: 5px auto;
  box-sizing: border-box;
}

/* Filter Items and Action Buttons */
.selected-filters .badges {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.selected-filters .filter-item {
  color: white;
  font-weight: bold;
  background: none;
  border: none;
  display: flex;
  align-items: center;
}
.selected-filters .filter-item i {
  margin-right: 15px;
}
.selected-filters .action-buttons {
  margin-left: auto;
  display: flex;
  gap: 5px;
  align-items: center;
  height: 40px;
}
.reset-button {
  background-color: #04AA6D;
  border: 3px solid white;
  border-radius: 8px;
  color: white;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s;
}
.reset-button:hover {
  background-color: #3e8e41;
}

/* Header Controls */
.header-controls {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #4C4E52;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 10px 2px;
  gap: 5px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
}

.header-controls .button {
  max-width: none;
  min-width: 40px;
  height: 30px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  will-change: transform;
  backface-visibility: hidden;
}

/* General Button Styling */
.button {
  padding: 6px 10px;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  outline: none;
  color: #fff;
  background-color: #04AA6D;
  border: 3px solid white;
  border-radius: 8px;
  box-shadow: 0 6px #999;
  transition: background-color 0.3s, box-shadow 0.3s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.button:hover { 
  background-color: #3e8e41; 
  transform: scale(1.1);
  
}
.button:active {
  background-color: #3e8e41;
  box-shadow: 0 5px #666;
  transform: translateY(4px);
  
}
.button.off {
  background-color: #888 !important;
  color: #fff !important;
  opacity: 0.7;
  box-shadow: 0 2px #666;
  transition: background-color 0.3s, opacity 0.3s;
}
.button.off:hover {
  background-color: #666 !important;
  opacity: 1;
}

/* Modal carousel layout */
.modal-body-flex {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}

.modal-carousel-wrapper {
  flex: 2;
  min-width: 280px;
  padding: clamp(8px, 1vh, 12px) clamp(16px, 2vw, 24px);
  max-width: 100%;
}

.carousel-3d {
  position: relative;
  width: 100%;
  perspective: 1400px;
}

.carousel-3d-track {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  transform-style: preserve-3d;
}

.carousel-card {
  position: relative;
  width: auto;
  height: auto;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 3px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  transform-style: preserve-3d;
  transition: transform 0.68s cubic-bezier(0.25, 0.8, 0.35, 1), box-shadow 0.35s ease, opacity 0.45s ease, border-color 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-card img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.carousel-card--center img {
  height: 100%;
  max-height: 100%;
}

.carousel-card--center {
  flex: 1 1 44%;
  min-width: 320px;
  max-width: 720px;
  max-height: clamp(360px, 58vh, 70vh);
  height: auto;
  transform: translateZ(42px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55),
              0 0 10px rgba(255, 215, 0, 0.4),
              0 0 20px rgba(255, 215, 0, 0.2);
  z-index: 2;
  /* Yellow border - center/current */
  border-color: #FFD700;
}

.carousel-card--left {
  flex: 0 0 clamp(260px, 30vw, 480px);
  min-width: 260px;
  max-width: 480px;
  max-height: clamp(220px, 30vw, 420px);
  transform: rotateY(35deg) translateX(10px) translateZ(10px) scale(0.95);
  opacity: 0.95;
  z-index: 1;
  /* Green border - left/behind/NEG */
  border-color: #00FF88;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4),
              0 0 8px rgba(0, 255, 136, 0.3),
              0 0 15px rgba(0, 255, 136, 0.15);
}

.carousel-card--right {
  flex: 0 0 clamp(260px, 30vw, 480px);
  min-width: 260px;
  max-width: 480px;
  max-height: clamp(220px, 30vw, 420px);
  transform: rotateY(-35deg) translateX(-10px) translateZ(10px) scale(0.95);
  opacity: 0.95;
  z-index: 1;
  /* Red border - right/ahead/POS */
  border-color: #FF4444;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4),
              0 0 8px rgba(255, 68, 68, 0.3),
              0 0 15px rgba(255, 68, 68, 0.15);
}

.carousel-card:hover {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.carousel-card--left:not(.is-empty),
.carousel-card--right:not(.is-empty) {
  cursor: pointer;
}

.carousel-card.is-empty {
  opacity: 0.35;
  filter: grayscale(1);
  cursor: default;
}

.carousel-caption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 6px 10px;
  font-size: 0.75rem;
  color: #fff;
  background: linear-gradient(135deg, rgba(4, 170, 109, 0.85), rgba(4, 170, 109, 0.55));
  border-radius: 10px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
}

.carousel-controls {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.carousel-controls .button.ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  height: 34px;
  width: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E6C200, #FFD700);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.9);
}

.carousel-card--center img {
  backface-visibility: hidden;
  transform-origin: center center;
}

.carousel-3d-track.is-flipping-left .carousel-card--center img {
  animation: flipPageLeft 0.6s ease;
}

.carousel-3d-track.is-flipping-right .carousel-card--center img {
  animation: flipPageRight 0.6s ease;
}

@keyframes flipPageLeft {
  0%   { transform: rotateY(0deg) translateZ(0); }
  40%  { transform: rotateY(-18deg) translateZ(24px); }
  100% { transform: rotateY(0deg) translateZ(0); }
}

@keyframes flipPageRight {
  0%   { transform: rotateY(0deg) translateZ(0); }
  40%  { transform: rotateY(18deg) translateZ(24px); }
  100% { transform: rotateY(0deg) translateZ(0); }
}

:root {
  --carousel-anim: 0.75s;
}

.carousel-3d-track.is-sliding-left .carousel-card--left {
  animation: carouselLeftExit var(--carousel-anim) ease both;
}
.carousel-3d-track.is-sliding-left .carousel-card--center {
  animation: carouselCenterShiftLeft var(--carousel-anim) ease both;
}
.carousel-3d-track.is-sliding-left .carousel-card--right {
  animation: carouselRightToCenter var(--carousel-anim) ease both;
}

.carousel-3d-track.is-sliding-right .carousel-card--right {
  animation: carouselRightExit var(--carousel-anim) ease both;
}
.carousel-3d-track.is-sliding-right .carousel-card--center {
  animation: carouselCenterShiftRight var(--carousel-anim) ease both;
}
.carousel-3d-track.is-sliding-right .carousel-card--left {
  animation: carouselLeftToCenter var(--carousel-anim) ease both;
}

@keyframes carouselRightToCenter {
  0%   { transform: rotateY(-35deg) translateX(-10px) translateZ(10px) scale(0.95); opacity: 0.95; }
  55%  { transform: translateX(-36%) translateZ(70px) rotateY(0deg) scale(1.05); opacity: 1; }
  100% { transform: rotateY(-35deg) translateX(-10px) translateZ(10px) scale(0.95); opacity: 0.95; }
}

@keyframes carouselCenterShiftLeft {
  0%   { transform: translateZ(42px); opacity: 1; }
  55%  { transform: rotateY(24deg) translateX(30%) translateZ(0) scale(0.9); opacity: 0.9; }
  100% { transform: translateZ(42px); opacity: 1; }
}

@keyframes carouselLeftExit {
  0%   { transform: rotateY(35deg) translateX(10px) translateZ(10px) scale(0.95); opacity: 0.95; }
  55%  { transform: rotateY(55deg) translateX(90%) translateZ(-140px) scale(0.7); opacity: 0; }
  100% { transform: rotateY(35deg) translateX(10px) translateZ(10px) scale(0.95); opacity: 0.95; }
}

@keyframes carouselLeftToCenter {
  0%   { transform: rotateY(35deg) translateX(10px) translateZ(10px) scale(0.95); opacity: 0.95; }
  55%  { transform: translateX(36%) translateZ(70px) rotateY(0deg) scale(1.05); opacity: 1; }
  100% { transform: rotateY(35deg) translateX(10px) translateZ(10px) scale(0.95); opacity: 0.95; }
}

@keyframes carouselCenterShiftRight {
  0%   { transform: translateZ(42px); opacity: 1; }
  55%  { transform: rotateY(-24deg) translateX(-30%) translateZ(0) scale(0.9); opacity: 0.9; }
  100% { transform: translateZ(42px); opacity: 1; }
}

@keyframes carouselRightExit {
  0%   { transform: rotateY(-35deg) translateX(-10px) translateZ(10px) scale(0.95); opacity: 0.95; }
  55%  { transform: rotateY(-55deg) translateX(-90%) translateZ(-140px) scale(0.7); opacity: 0; }
  100% { transform: rotateY(-35deg) translateX(-10px) translateZ(10px) scale(0.95); opacity: 0.95; }
}

@media (max-width: 768px) {
  .carousel-card--center {
    max-width: 100%;
    min-width: 0;
    height: auto;
  }
  .carousel-card--left,
  .carousel-card--right {
    display: none;
  }
  .carousel-controls {
    width: 100%;
  }
  
  /* Hide desktop carousel on mobile */
  .modal-carousel-wrapper {
    display: none !important;
  }
}

/* ========================================
   MOBILE VERTICAL CAROUSEL
   ======================================== */

.mobile-carousel-scene {
  perspective: 1200px;
  width: 95vw;
  max-width: 95vw;
  height: 45vh;
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  overflow: visible;
  display: none;
  touch-action: none;
}

@media (max-width: 768px) {
  .mobile-carousel-scene {
    display: block;
    height: clamp(180px, 28svh, 320px);
    bottom: clamp(60px, 12svh, 110px);
  }
}

@media (max-width: 768px) and (max-height: 700px) {
  .mobile-carousel-scene {
    height: clamp(160px, 24svh, 280px);
    bottom: clamp(50px, 10svh, 90px);
  }
}

@media (max-width: 768px) and (max-height: 600px) {
  .mobile-carousel-scene {
    height: clamp(140px, 22svh, 240px);
    bottom: clamp(45px, 8svh, 80px);
  }
}

.mobile-gallery {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
  -webkit-transform-style: preserve-3d;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.mobile-slide {
  position: absolute;
  width: 75%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  top: 50%;
  left: 50%;
  margin-left: -37.5%;
  margin-top: -21.09375%;
  z-index: 1;
  overflow: hidden;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  /* Default - no border for back cards */
  border: 3px solid transparent;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Traffic light themed borders for visible cards */
.mobile-slide.visible-center {
  /* Center card - Yellow (caution/current) */
  border-color: #FFD700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 
              0 0 40px rgba(255, 215, 0, 0.4),
              0 8px 20px rgba(0, 0, 0, 0.5);
}

.mobile-slide.visible-top {
  /* Top card - Red (stop/ahead) */
  border-color: #FF4444;
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.6), 
              0 0 40px rgba(255, 68, 68, 0.4),
              0 8px 20px rgba(0, 0, 0, 0.5);
}

.mobile-slide.visible-bottom {
  /* Bottom card - Green (go/behind) */
  border-color: #00FF88;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.6), 
              0 0 40px rgba(0, 255, 136, 0.4),
              0 8px 20px rgba(0, 0, 0, 0.5);
}

.mobile-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  image-rendering: auto;
}

.mobile-carousel-controls {
  display: none !important;
}

.mobile-carousel-controls .button.ghost {
  display: none !important;
}



/* Glassmorphic Modal Style */
.glass-modal {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  animation: modalFadeIn 0.9s ease-out;
  width: 99vw;
  max-width: 1700px;
  max-height: 97vh;
}
@media (max-width: 768px) {
  .glass-modal {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh; /* Use dynamic viewport height for mobile browsers */
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
    border: none;
  }
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

/* Dropdown */
.dropdown {
  position: relative;
  z-index: 1001;
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 2000;
  background: rgba(59, 59, 59, 0.366) !important;
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0px 4px 10px rgba(0,0,0,0.2);
  transition: opacity 0.3s ease-in-out, transform 0.2s ease-in-out;
}
.dropdown-menu .dropdown-item {
  color: white !important;
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s ease-in-out;
}
.dropdown-menu .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}
.dropdown-menu select,
.dropdown-menu input {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  border: none;
  padding: 6px;
  border-radius: 6px;
  outline: none;
  width: 100%;
}
.dropdown-menu select:focus,
.dropdown-menu input:focus {
  background: rgba(255, 255, 255, 0.3) !important;
}
.dropdown-menu {
  opacity: 0;
  transform: translateY(-10px);
  visibility: hidden;
}
.dropdown-menu.show {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}
.dropdown-menu {
  max-height: 400px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.dropdown-menu::-webkit-scrollbar {
  display: none;
}

/* Image Size Slider */
#sizeControlContainer {
  display: inline-block;
  position: relative;
}
#sizeControlButton {
  background: #04AA6D;
  color: white;
  border: 3px solid white;
  padding: 10px 10px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: 0 6px #999;
  transition: background-color 0.3s, box-shadow 0.3s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 5px;
}
#sizeControlButton i { font-size: 14px; }
#sizeControlButton:hover { background-color: #3e8e41; }
@media (max-width: 600px) {
  #sizeControlButton {
    max-width: 150px;
    box-shadow: 0 4px #999;
    border-radius: 6px;
    font-size: 11px;
    padding: 5.3px 5px;
  }
}
.slider-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0px 4px 10px rgba(0,0,0,0.2);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slider-dropdown.active {
  max-height: 150px;
  opacity: 1;
}
.vertical-slider {
  writing-mode: bt-lr;
  -webkit-appearance: slider-vertical;
  appearance: slider-vertical;
  height: 120px;
  width: 8px;
  background: white;
  border-radius: 8px;
  outline: none;
  transition: opacity 0.3s ease-in-out;
}
.vertical-slider::-webkit-slider-thumb {
  appearance: auto;
  width: 25px;
  height: 25px;
  background: #707070;
  border-radius: 90%;
  cursor: pointer;
  transition: transform 0.4s;
}
.vertical-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Image Gallery */
#imageGallery {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2px;
  margin-top: 2px;
  margin-bottom: 200px;
  justify-content: center;
  transition: grid-template-columns 0.3s ease-out;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y pinch-zoom;
  position: relative;
  z-index: 1;
}
.col { flex: 1; }
.aspect-ratio-box {
  width: 100%;
  position: relative;
  padding-bottom: 56.25%;
  overflow: hidden;
}
.aspect-ratio-box img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  transition: transform 0.2s ease-in-out;
}
.aspect-ratio-box:hover img { transform: scale(1.05); }
.aspect-ratio-box:active img { transform: scale(1.02); }

/* Modal Styles */
.modal-dialog-centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 32px);
  margin: 16px auto;
}

@media (max-width: 768px) {
  .modal-dialog-centered {
    min-height: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
  }
}

.modal.fade.show {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.modal-mini-map {
  position: absolute;
  bottom: clamp(10px, 1.5vh, 18px);
  right: clamp(10px, 1.5vw, 18px);
  width: clamp(220px, 30vw, 480px);
  height: clamp(140px, 16vw, 240px);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.35);
  backdrop-filter: blur(10px);
  background: rgba(10, 10, 10, 0.35);
  z-index: 5;
}

.modal-info-stack {
  position: absolute;
  bottom: clamp(10px, 1.5vh, 18px);
  left: clamp(10px, 1.5vw, 18px);
  width: clamp(220px, 30vw, 480px);
  height: clamp(140px, 16vw, 240px);
  overflow: visible;
  z-index: 5;
  perspective: 1200px;
}

.info-stack-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.info-card {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr minmax(20px, auto);
  gap: 6px 8px;
  padding: 8px 10px 6px;
  border-radius: 12px;
  background: rgba(10, 10, 10, 0.35);
  color: #f5f5f5;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(50px);
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.25, 0.8, 0.35, 1), opacity 0.5s ease;
  opacity: 0;
  pointer-events: none;
  transform: translateZ(-120px) scale(0.92) rotateY(0deg);
}

.info-card.is-active {
  opacity: 1;
  transform: translateZ(52px) scale(1) rotateY(0deg);
  pointer-events: auto;
  z-index: 3;
}

.info-card.is-left {
  opacity: 0;
  transform: translateX(-18%) translateZ(-24px) rotateY(-26deg) scale(0.95);
  z-index: 2;
}

.info-card.is-right {
  opacity: 0;
  transform: translateX(18%) translateZ(-24px) rotateY(26deg) scale(0.95);
  z-index: 2;
}

.info-card--street,
.info-card--map,
.info-card--mini-map,
.info-card--meta {
  min-width: 100%;
  min-height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.info-card--street,
.info-card--map,
.info-card--mini-map {
  padding: 0;
  gap: 0;
}

.info-card__map-container {
  width: 100%;
  height: 100%;
  min-height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 12px;
  overflow: hidden;
}

/* Hide mobile-only elements on desktop */
.mobile-only {
  display: none !important;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block !important;
  }
  
  .info-stack-dot.mobile-only {
    display: inline-block !important;
  }
}

.info-card__columns {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  align-items: stretch;
}

.info-card__column {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 8px 10px;
  letter-spacing: 0.4px;
  font-size: 0.9rem;
  color: #e6fff6;
  backdrop-filter: blur(8px);
}

.info-card__title {
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #ffffff;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

.info-field {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
}

.info-field .label {
  color: rgba(255, 255, 255, 0.68);
  font-weight: 600;
  letter-spacing: 0.3px;
  font-size: 0.7rem;
}

.info-field .value {
  color: #f5f5f5;
  font-weight: 600;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.info-card__footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 4px 6px;
  margin-top: auto;
  background: transparent;
  border-radius: 8px;
  font-size: 0.75rem;
  color: #e8fdf4;
  min-height: 25px;
  text-align: center;
  width: 100%;
}

.info-card__embed {
  grid-column: 1 / -1;
  grid-row: 1 / span 2;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e8fdf4;
  font-weight: 600;
  font-size: 0.85rem;
  text-align: center;
  padding: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.info-card__embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
  box-shadow: none;
}

.info-stack-controls {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 6;
  padding: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  border: none;
}

.info-stack-controls .button.ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  height: 34px;
  width: 44px;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

.info-stack-dots {
  display: flex;
  align-items: center;
  gap: 14px;
}

.info-stack-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 0 rgba(13, 223, 146, 0);
}

.info-stack-dot.active {
  background: linear-gradient(135deg, #E6C200, #FFD700);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.9);
  transform: scale(1.2);
}

.info-stack-dot:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

/* Overlay arrow buttons for card stack */
.info-stack-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  padding: 0;
  font-size: 2rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.info-stack-arrow:hover {
  color: rgba(255, 255, 255, 1);
  transform: translateY(-50%) scale(1.15);
}

.info-stack-arrow-left {
  left: 2px;
}

.info-stack-arrow-right {
  right: 2px;
}

@media (max-width: 768px) {
  .info-stack-arrow {
    font-size: 1.8rem;
  }
  
  .info-stack-arrow-left {
    left: 2px;
  }
  
  .info-stack-arrow-right {
    right: 2px;
  }
}


@media (max-width: 1024px) {
  .modal-mini-map { display: none !important; }
}

/* Mobile positioning for info stack */
@media (max-width: 768px) {
  .modal-info-stack {
    position: fixed;
    top: clamp(30px, 8svh, 45px);
    left: 50%;
    transform: translateX(-50%);
    width: min(95vw, 500px);
    height: clamp(200px, 32svh, 380px);
    z-index: 1060;
  }
  
  .info-stack-controls {
    top: auto;
    bottom: -30px;
  }
  
  /* Hide navigation buttons on mobile */
  .info-stack-controls .button.ghost {
    display: none !important;
  }
  
  /* Adjust dot spacing on mobile */
  .info-stack-dots {
    gap: 18px;
  }
  
  .info-stack-dot {
    width: 16px;
    height: 16px;
  }
  
  .info-card {
    padding: 6px 8px 10px;
  }
  
  /* Remove padding from embed cards on mobile */
  .info-card--street,
  .info-card--map,
  .info-card--mini-map {
    padding: 0 !important;
  }
  
  /* Make info cards wider and adjust text size */
}

/* Smaller mobile screens and short screens */
@media (max-width: 768px) and (max-height: 700px) {
  .modal-info-stack {
    top: clamp(25px, 6svh, 38px);
    height: clamp(180px, 28svh, 320px);
  }
}

@media (max-width: 768px) and (max-height: 600px) {
  .modal-info-stack {
    top: clamp(22px, 5svh, 32px);
    height: clamp(160px, 26svh, 280px);
  }
}

/* Very small screens (iPhone SE, etc) */
@media (max-width: 390px) {
  .modal-info-stack {
    width: 96vw;
  }
  
  .info-stack-dot {
    width: 14px;
    height: 14px;
  }
  .info-card {
    font-size: 0.6rem;
    gap: 4px 6px;
    padding: 6px 8px 10px;
  }
  
  .info-card__title {
    font-size: 0.65rem;
    margin-bottom: 0;
  }
  
  .info-card__column {
    gap: 2px;
    padding: 5px 7px;
    font-size: 0.6rem;
  }
  
  .info-field {
    font-size: 0.6rem;
    gap: 2px;
  }
  
  .info-card__footer {
    font-size: 0.6rem;
    min-height: 20px;
    padding: 4px 2px 6px;
  }
  
  .info-field .label {
    font-size: 0.55rem;
  }
}

.modal-logo-container {
  position: fixed;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  z-index: 1070;
}

.modal-logo {
  max-width: 100px;
  height: auto;
  opacity: 0.9;
  transition: opacity 0.3s ease;
  display: block;
  margin-bottom: -13px;
}

.modal-logo:hover {
  opacity: 1;
}

.modal-logo-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: color 0.3s ease;
  margin-top: -10px;
  position: relative;
  z-index: 1;
}

.modal-logo-container:hover .modal-logo-text {
  color: rgba(255, 255, 255, 1);
}

@media (max-width: 768px) {
  .modal-logo-container {
    display: none !important;
  }
}

.modal-dialog.modal-dialog-centered.modal-lg {
  max-width: 99vw;
}
@media (max-width: 768px) {
  .modal-dialog.modal-dialog-centered.modal-lg {
    max-width: 100vw;
    width: 100vw;
    margin: 0;
  }
}
.modal-header,
.modal-footer {
  padding: 0.35rem 0.65rem;
  border: none;
}

@media (max-width: 768px) {
  .modal-header {
    padding: 0.25rem 0.5rem 0.05rem 0.5rem;
  }
  
  .modal-title {
    font-size: clamp(1rem, 4vw, 1.5rem);
  }
}
.modal-header-tight {
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-header-tight .modal-title {
  flex: 1;
  text-align: center;
  margin: 0;
}
.modal-close-top {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1060;
  margin: 0;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}
.modal-close-top:hover {
  opacity: 1;
}
@media (max-width: 768px) {
  .modal-close-top {
    top: auto;
    bottom: clamp(15px, 8svh, 30px);
    right: clamp(20px, 4vw, 30px);
    font-size: clamp(1.2rem, 6vw, 1.5rem);
    font-weight: 800;
    padding: clamp(4px, 1.5vw, 6px);
  }
}
.modal-title {
  margin: 0 auto;
  white-space: nowrap;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(0.9rem, 3vw, 1.25rem);
  text-align: center;
  color: white;
  max-width: 100%;
}
.modal-footer {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
  overflow-x: auto;
  padding: 0.35rem 0.45rem;
}

@media (max-width: 768px) {
  .modal-footer {
    display: none !important;
  }
}
.modal-body {
  padding: clamp(8px, 1.5vh, 16px) clamp(10px, 2vw, 18px) clamp(18px, 3vh, 30px);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 95vh;
  max-height: 98vh;
  height: auto;
  overflow: hidden;
}
@media (max-width: 768px) {
  .modal-body {
    min-height: auto;
    height: calc(100dvh - 40px); /* Subtract only header height since footer is hidden */
    max-height: calc(100dvh - 40px);
    padding: 2px 8px 16px;
    overflow: hidden;
  }
}
#modalBody.modal-body-flex {
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(8px, 1.5vw, 16px);
  padding: clamp(8px, 1.2vh, 12px) clamp(10px, 1.5vw, 20px) clamp(12px, 2vh, 24px);
  min-height: 85vh;
  max-height: 96vh;
  height: auto;
  overflow: hidden;
}
@media (max-width: 768px) {
  #modalBody.modal-body-flex {
    padding: 8px 8px 16px;
    min-height: auto;
    height: calc(100dvh - 40px);
    max-height: calc(100dvh - 40px);
    overflow: hidden;
  }
}
#modalImageContainer, #modalMapContainer {
  flex: 1;
  transition: width 0.3s ease;
}
#modalImage {
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  height: 100%;
  margin: 0 auto;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.modal-title {
  font-weight: bold !important;
  color: white;
}
#mobileAppText,
#updateInfoText,
#aboutAppText {
  color: white;
}
.update-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.update-list .update-header {
  font-size: 1.2rem;
  font-weight: bold;
  margin: 0.5rem;
}
.update-list li {
  font-size: 0.75rem;
  margin: 0.25rem;
}



.aspect-ratio-box.overview-map {
  position: relative;
  overflow: hidden;
  border: 2px solid #ff7800;
  box-sizing: border-box;
  border-radius: 8px;
}
.aspect-ratio-box.overview-map #overview-tile {
  position: absolute;
  inset: 0;

}


/* Stack content vertically and fill dialog */
#overviewMapModal .modal-content {
  display: flex;
  flex-direction: column;
  height: 100% !important;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  overflow: hidden;
}

/* Header */
#overviewMapModal .modal-header {
  flex: 0 0 auto;
  border-bottom: none;
  justify-content: center;
  background: rgba(255,255,255,0.2);
  padding: none;
}
#overviewMapModal .modal-title {
  margin: 0;
  text-align: center;
  font-size: 1.25rem;
  color: #ffffff;
}

/* Body: flex container for the map */
#overviewMapModal .modal-body {
  flex: 1 1 auto;
  display: flex !important;
  flex-direction: column;
  padding: 0;
  min-height: 0; /* allow flex shrink */
  overflow: hidden;
}

/* Map container full size */
#overviewMap {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
}

/* Footer */
#overviewMapModal .modal-footer {
  flex: 0 0 auto;
  max-height: auto;
  max-width: auto;
  border-radius: 6px;
  border-top: none;
  justify-content: center;
  padding: none;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 0.5rem 0.25rem;
}
#overviewMapModal .modal-footer .button {
  min-width: 0;
  flex-shrink: 1;
  font-size: 14px;
  padding: 0.4rem 0.7rem;
  white-space: nowrap;
  max-width: 100vw;
}

/* --- Responsive Overview Map Modal Footer Buttons --- */
@media (max-width: 600px) {
  #overviewMapModal .modal-footer {
    gap: 0.2rem;
    padding: 0.3rem 0.1rem;
  }
  #overviewMapModal .modal-footer .button {
    font-size: 11px !important;
    padding: 0.25rem 0.4rem !important;
    min-width: 0 !important;
    flex-shrink: 1 !important;
    max-width: 100vw !important;
  }
}

/* ─── Desktop (≥601px): keep 98vw/98vh ─────────────────────────── */
@media (min-width: 601px) {
  #overviewMapModal.modal.show .modal-dialog {
    margin:     0 auto           !important;
    width:      98vw             !important;
    max-width:  98vw             !important;
    height:     98vh             !important;
    max-height: 98vh             !important;
  }
}

/* ─── Mobile (≤600px): inset fixed dialog with 1rem gutters ───── */
@media (max-width: 600px) {
  /* 1) Kill Bootstrap’s extra centering min-height */
  #overviewMapModal .modal-dialog.modal-dialog-centered {
    min-height: 0 !important;
  }

  /* 2) Fixed‐position inset, 1rem gutter + safe‐area support */
  #overviewMapModal.modal.show .modal-dialog {
    position:      fixed                          !important;
    top:           calc(env(safe-area-inset-top,    0px) + 1rem) !important;
    bottom:        calc(env(safe-area-inset-bottom, 0px) + 1rem) !important;
    left:          1rem                            !important;
    right:         1rem                            !important;
    margin:        0                               !important;

    /* cancel out any vw/vh sizing */
    width:         auto                            !important;
    max-width:     none                            !important;
    height:        auto                            !important;
    max-height:    none                            !important;
    min-height:    0                               !important;

    border-radius: 0.75rem                        !important;
  }
}

/* ─────────────────────────────────────────────────
   T O O L T I P   I M A G E   S T Y L I N G
   ───────────────────────────────────────────────── */

/* ────────── TOOLTIP CONTAINER ────────── */
.leaflet-tooltip {
  background: none       !important;
  border: none           !important;
  box-shadow: none       !important;
  padding: 0             !important;
}

/* keep Leaflet’s default arrow positioning (do NOT override ::before) */

/* ensure the inner wrapper has no extra padding or background */
.leaflet-tooltip .leaflet-tooltip-content {
  background: none       !important;
  border: none           !important;
  padding: 0             !important;
  margin: 0              !important;
}

/* ─────── IMAGE SIZING & RATIO ─────── */
.leaflet-tooltip img {
  display: block         !important; /* kill inline gap */
  width: 120px           !important;
  aspect-ratio: 16 / 9   !important;
  border-radius: 8px     !important;
}
.custom-marker {
  width:            8px;
  height:           8px;
  background-color: #ff7800;
  border:           .5px solid #ffffff;
  border-radius:    50%;
  box-shadow:       0 0 2px rgb(255, 255, 255);
}
.leaflet-tooltip:before,
.leaflet-tooltip:after {
  display: none !important;
}

.leaflet-tooltip .glass-popup-content img {
  border: 2px solid #ff7800 !important;
  border:           .5px solid #ffffff;
  border-radius: 8px !important;
  box-sizing: border-box;
}


@keyframes pulse {
  0%   { transform: scale(1); opacity: 0.8; }
  50%  { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}



.user-dot-marker {
  background: #2186f6;
  border: 3px solid #ffffff;
  border-radius: 50%;
  width: 10px;
  height: 10px;
  box-shadow: 0 0 8px #1257aa55;
}

/* ─────────────────────────────────────────────────────────────────────
   Custom Route Modal Styling
   ───────────────────────────────────────────────────────────────────── */

/* 1) Dialog width & always centered */
#customRouteModal .modal-dialog {
  width:     98vw;
  max-width: 98vw;
  margin:    auto;
}

/* 2) Cap height & hide overflow */
#customRouteModal .modal-content {
  max-height: 98vw;
  overflow:   hidden;
}

/* 3) Split form & map */
#customRouteModal .modal-body {
  display:    flex;
  gap:        1rem;
  padding:    1rem;
  height:     85vh;
  box-sizing: border-box;
}

@media (min-width: 601px) {
  #customRouteModal .modal-body {
    flex-direction: row-reverse;
  }
}

/* 4) Form column scrolls, room for header */
#customRouteFormContainer {
  position:    relative;
  flex:        1 1 300px;
  overflow-y:  auto;
  padding-top: 2rem;
}

/* ─── Grid for header + data rows ──────────────────────────────── */
/* handle | Route | From | swap | To | remove */
.custom-route-headers,
.custom-route-row {
  display:             grid !important;
  grid-template-columns:
    1.5rem  /* ☰ handle */
    120px    /* Route # */
    60px    /* MP From */
    1.2rem  /* swap btn */
    60px    /* MP To */
    1.2rem  /* remove btn */
  ;
  column-gap:          1rem;    /* extra space between Route→From */
  align-items:         center;
  margin-bottom:       0.5rem;
}

/* header labels (white, centered, tiny) */
.custom-route-headers span {
  color:       white;
  text-align:  center;
  font-size:   0.75rem;
  line-height: 1;
}

    /* make the placeholder in .route-input a bit smaller */
  #customRouteModal .route-input::placeholder {
    /* 0.75em of the 16px base ⇒ ~12px placeholder */
    font-size: 0.7em;
    opacity:    1;      /* nice and visible */
  }

  /* vendor prefixes for max compatibility */
  #customRouteModal .route-input::-webkit-input-placeholder {
    font-size: 0.7em;
    opacity:    1;
  }
  #customRouteModal .route-input::-moz-placeholder {
    font-size: 0.7em;
    opacity:    1;
  }
  #customRouteModal .route-input:-ms-input-placeholder {
    font-size: 0.7em;
    opacity:    1;
  }
  #customRouteModal .route-input::-ms-input-placeholder {
    font-size: 0.7em;
    opacity:    1;
  }

/* remove spinner arrows on number inputs */
.mp-input::-webkit-inner-spin-button,
.mp-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin:            0;
}
.mp-input {
  -moz-appearance:  textfield;
  appearance:       textfield;
}

/* ─── Swap & Remove ICON-ONLY Buttons ───────────────────────── */
.swap-btn,
.remove-btn {
  display:         flex;
  align-items:     center;
  justify-content: center;
  padding:         0.2rem;
  background:      transparent !important;
  border:          none        !important;
  box-shadow:      none        !important;
  cursor:          pointer;
  color: white !important;  
  opacity: 0.6;
}

.swap-btn:hover,
.remove-btn:hover { 
  transform: scale(1.4);
  opacity: 1;
}

.swap-btn:active,
.remove-btn:active { 
  transform: scale(1.4);
  opacity: 1;
}

/* ─── Drag-handle cursor ────────────────────────────────────── */
.drag-handle {
  cursor:      grab;
  user-select: none;
}
.drag-handle:hover {
  cursor:      grab;
  transform: scale(1.4);
  color: white !important;
}
.drag-handle:active {
  cursor: grabbing;
  color: white !important;
}

/* ─── Map column: fill remaining space ─────────────────────── */
#customRouteMap {
  flex:         2 1 600px;
  width:        100%;
  height:       100%;
  border-radius:0.75rem;
  overflow:     hidden;
}

/* ─── “+ Add Segment” (reuse .button theme) ───────────────── */
#customRouteFormContainer .button {
  padding:          6px 10px;
  font-size:        14px;
  color:            #fff;
  background-color: #04AA6D;
  border:           3px solid white;
  border-radius:    8px;
  box-shadow:       0 6px #999;
  transition:       background-color 0.3s, box-shadow 0.3s, transform 0.1s;
  display:          flex;
  align-items:      center;
  gap:              5px;
  cursor:           pointer;
  margin-bottom:       5px;
}
#customRouteFormContainer .button:hover {
  background-color: #3e8e41;
}
#customRouteFormContainer .button:active {
  background-color: #3e8e41;
  box-shadow:       0 5px #666;
  transform:        translateY(4px);
}

/* ─── Footer Buttons: Reset / Copy / Apply ───────────────── */
#customRouteModal .modal-footer button {
  padding:          6px 10px;
  font-size:        14px;
  color:            #fff;
  background-color: #04AA6D;
  border:           3px solid white;
  border-radius:    8px;
  box-shadow:       0 6px #999;
  transition:       background-color 0.3s, box-shadow 0.3s, transform 0.1s;
  display:          flex;
  align-items:      center;
  gap:              5px;
  cursor:           pointer;
}
#customRouteModal .modal-footer button:hover {
  background-color: #3e8e41;
}
#customRouteModal .modal-footer button:active {
  background-color: #3e8e41;
  box-shadow:       0 5px #666;
  transform:        translateY(4px);
}

/* “Copied!” feedback */
#customRouteModal .modal-footer #customRouteCopyUrl.copied {
  background-color: #ffc107 !important;
  color:            #212529;
}

#customRouteModal .modal-footer .btn-close {
  background-color: transparent !important;
  border:            none        !important;
  box-shadow:        none        !important;
  padding:           0.25rem     !important; /* match other modals */
}


/* ─── Mobile Overrides (screens ≤600px) ───────────────────────────── */
@media (max-width: 600px) {
  /* 0) Undo desktop caps */
  #customRouteModal .modal-content { max-height: none   !important; }
  #customRouteModal .modal-body    { height:      auto !important; }

  /* 1) **Kill** Bootstrap’s min-height on the centered dialog */
  #customRouteModal .modal-dialog.modal-dialog-centered {
    min-height: 0 !important;
  }

  /* 2) Fixed inset dialog with 1rem gutters + safe-area support */
  #customRouteModal .modal-dialog {
    position:      fixed                          !important;
    top:           calc(env(safe-area-inset-top,    0px) + 1rem) !important;
    bottom:        calc(env(safe-area-inset-bottom, 0px) + 1rem) !important;
    left:          1rem                            !important;
    right:         1rem                            !important;
    margin:        0                               !important;
    width:         auto                            !important; /* override 98vw */
    max-width:     none                            !important;
    min-height:    0                               !important;
    border-radius: 0.75rem                        !important;
  }

  /* 3) Fill that box: flex‐column so header/footer stay pinned */
  #customRouteModal .modal-content {
    display:        flex     !important;
    flex-direction: column   !important;
    height:         100%     !important;
    overflow:       hidden   !important;
    border-radius:  inherit  !important;
  }
  #customRouteModal .modal-header,
  #customRouteModal .modal-footer {
    flex:    0 0 auto !important;
    padding: 0.5rem   !important;
    margin:  0        !important;
  }

  /* 4) Body scrolls internally, stacks form above map */
  #customRouteModal .modal-body {
    display:                    flex      !important;
    flex-direction:             column    !important;
    flex:                       1 1 auto  !important;
    overflow-y:                 auto      !important;
    padding:                    1rem      !important;
    gap:                        1rem      !important;
    border-bottom-left-radius:  0.75rem   !important;
    border-bottom-right-radius: 0.75rem   !important;
  }

  /* 5) Form at natural height + full width */
  #customRouteModal #customRouteFormContainer {
    flex:        0 0 auto !important;
    width:       100%     !important;
    overflow-y:  auto     !important;
    padding-top: 1rem     !important;
  }

  /* 6) Map fills remaining space, rounded corners */
  #customRouteModal #customRouteMap,
  #customRouteModal #customRouteMapContainer {
    flex:           1 1 auto !important;
    width:          100%     !important;
    min-height:     0        !important;
    height:         auto     !important;
    border-radius:  0.75rem  !important;
    overflow:       hidden   !important;
  }

  /* 7) Prevent zoom: inputs full-width & 16px font */
  #customRouteModal .form-control,
  #customRouteModal select,
  #customRouteModal textarea,
  #customRouteModal .route-input,
  #customRouteModal .mp-input {
    font-size:                16px    !important;
    -webkit-text-size-adjust: 100%    !important;
    width:                    100%    !important;
    box-sizing:               border-box !important;
  }
  #customRouteModal .mp-input::-webkit-inner-spin-button,
  #customRouteModal .mp-input::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin:            0   !important;
  }
  #customRouteModal .mp-input {
    -moz-appearance: textfield !important;
    appearance:      textfield !important;
  }

  /* 8) Grid for your route rows */
  #customRouteModal .custom-route-headers,
  #customRouteModal .custom-route-row {
    display:       grid     !important;
    grid-template-columns:
      1rem   /* handle */
      85px   /* route  */
      55px   /* from   */
      0.8rem /* swap   */
      55px   /* to     */
      0.5rem /* remove */ !important;
    column-gap:    0.4rem  !important;
  }
  #customRouteModal .custom-route-headers span {
    font-size: 0.6rem !important;
  }

  /* 9) Shrink only “+ Add Segment” & footer buttons */
  #customRouteModal .button,
  #customRouteModal .modal-footer button {
    font-size:   0.6rem  !important;
    padding:     0.3rem 0.6rem !important;
    box-shadow:  0 4px #999 !important;
  }

  /* 10) Remove underline on swap/remove only */
  #customRouteModal .swap-btn,
  #customRouteModal .remove-btn {
    text-decoration: none !important;
    border-bottom:   none !important;
  }
  #customRouteModal .swap-btn i,
  #customRouteModal .remove-btn i {
    font-size: 1rem !important;
  }

  /* 11) Placeholder sizing */
  #customRouteModal .route-input::placeholder {
    font-size: 0.5em !important;
    opacity:    1    !important;
  }
  /* …plus the vendor‐prefixed variants… */
}


/* ─── Mobile (≤600px) fixes ─────────────────────────────── */
@media (max-width: 600px) {
  /* hide the size slider control entirely on mobile */
  #sizeControlContainer {
    display: none !important;
  }
    .header-controls .button {
    
    margin: 0 2px;
    max-width: auto;
    height: 35px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px #999;
    border-radius: 6px;
    font-size: 12px;
    padding: 3px 8px;
  }
  
}

/* pulsating glow on the active button */
@keyframes button-glow {
  0% {
    box-shadow: 0 0 6px rgba(255,193,7,0.8);
  }
  50% {
    box-shadow: 0 0 20px rgba(255,193,7,0.9);
  }
  100% {
    box-shadow: 0 0 8px rgba(255,193,7,0.8);
  }
}

.header-controls .button[aria-expanded="true"] {
  border-color: #ffc107 !important;
  /* static glow fallback: */
  box-shadow: 0 0 12px rgba(255,193,7,0.8) !important;
  /* animated glow: */
  animation: button-glow 1.5s infinite ease-in-out !important;
}

/* ─── Weather Preview Tile Styles ─────────────────────────── */

/* 1) The exact same 16∶9 wrapper as your camera thumbnails */
.aspect-ratio-box.forecast-item {
  position:       relative;
  padding-bottom: 56.25% !important; /* 9 ÷ 16 */
  overflow:       hidden;
  border:         2px solid rgba(255,255,255,0.7);
  border-radius:  8px;
  box-shadow:     0 4px 24px 0 rgba(0,0,0,0.25), 0 1.5px 8px 0 rgba(0,0,0,0.10);
  box-sizing:     border-box;
  /* background:     rgba(40,40,50,0.7); */ /* Remove old solid background */
}
.forecast-bg-lottie {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.aspect-ratio-box.forecast-item > *:not(.forecast-bg-lottie) {
  position: relative;
  z-index: 1;
}

/* 2) Make our <button> fill and stack its icon/text */
.aspect-ratio-box.forecast-item .forecast-preview {
  position:       absolute;
  inset:          0;
  width:          100%;
  height:         100%;
  border:         none;
  background:     linear-gradient(135deg, rgba(60,60,80,0.7) 60%, rgba(80,120,255,0.18) 100%);
  display:        flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  cursor:         pointer;
  padding:        0;
  transition: background 0.3s;
  min-height:     0;
  min-width:      0;
  overflow:       hidden;
}

/* Responsive scaling for all contents as a group */
.aspect-ratio-box.forecast-item .forecast-preview-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  box-sizing: border-box;
  padding: 0;
}

/* Main row fills all available space */
.forecast-main-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 0;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  gap: clamp(0.3em, 5vw, 2em);
  box-sizing: border-box;
  padding: 0;
}

.forecast-icon-col, .forecast-text-col {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.forecast-icon-col lottie-player {
  width: 40%;
  height: auto;
  max-width: 6em;
  min-width: 2.2em;
  aspect-ratio: 1 / 1;
  filter: drop-shadow(0 0 8px #ffd54f88);
  display: block;
  transition: width 0.2s, max-width 0.2s;
}

@media (max-width: 600px) {
  .forecast-icon-col lottie-player {
    width: 32vw;
    max-width: 4em;
    min-width: 1.5em;
  }
}

@media (max-width: 400px) {
  .forecast-icon-col lottie-player {
    width: 28vw;
    max-width: 3em;
    min-width: 1em;
  }
}

.aspect-ratio-box.forecast-item .temp-preview {
  font-weight: bold;
  color: #fff;
  filter: drop-shadow(0 0 8px #ffd54f88);
  margin: 0 0.2em 0 0;
  font-size: clamp(1.3em, 7vw, 2.8em);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 0;
  align-items: center;
  display: flex;
  justify-content: flex-start;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  transition: font-size 0.2s;
}

@media (max-width: 600px) {
  .aspect-ratio-box.forecast-item .temp-preview {
    font-size: clamp(1em, 8vw, 2em);
  }
}

@media (max-width: 400px) {
  .aspect-ratio-box.forecast-item .temp-preview {
    font-size: clamp(0.8em, 10vw, 1.5em);
  }
}

/* Label stays pinned to bottom */
.aspect-ratio-box.forecast-item .label-preview {
  width: 100%;
  text-align: center;
  font-size: clamp(0.6rem, 1vw, 1.2rem);
  margin: 0.2em 0 0 0;
  line-height: 1.1;
  color: #fff;
  overflow-wrap: break-word;
  align-self: center;
  flex: 0 0 auto;
}




