/* Component rules that must remain in a same-origin stylesheet for CSP. */
.lieflat-draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.lieflat-draw.is-revealed { animation: lieflat-draw 1000ms cubic-bezier(.165,.84,.44,1) forwards; }
.lieflat-pop,
.lieflat-dumbbell-mark { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0); }
.lieflat-pop.is-revealed { animation: lieflat-pop 420ms cubic-bezier(.165,.84,.44,1) both; }
.lieflat-gauge-tick { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.35); }
[data-revealed="true"] .lieflat-gauge-tick { animation: lieflat-gauge-in 360ms cubic-bezier(.165,.84,.44,1) both; }
.lieflat-dumbbell-rail { stroke-dasharray: 1; stroke-dashoffset: 1; }
[data-revealed="true"] .lieflat-dumbbell-rail { animation: lieflat-dumbbell-draw 620ms cubic-bezier(.165,.84,.44,1) forwards; }
[data-revealed="true"] .lieflat-dumbbell-mark { animation: lieflat-dumbbell-pop 320ms cubic-bezier(.165,.84,.44,1) both; }
.lieflat-waterfall-rung,
.lieflat-waterfall-link,
.lieflat-waterfall-label { opacity: 0; }
[data-revealed="true"] .lieflat-waterfall-rung { animation: lieflat-waterfall-rung 420ms cubic-bezier(.165,.84,.44,1) both; }
[data-revealed="true"] .lieflat-waterfall-link,
[data-revealed="true"] .lieflat-waterfall-label { animation: lieflat-waterfall-fade 360ms cubic-bezier(.165,.84,.44,1) both; }

@keyframes lieflat-draw { to { stroke-dashoffset: 0; } }
@keyframes lieflat-pop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
@keyframes lieflat-gauge-in { to { opacity: 1; transform: scale(1); } }
@keyframes lieflat-dumbbell-draw { to { stroke-dashoffset: 0; } }
@keyframes lieflat-dumbbell-pop { to { opacity: 1; transform: scale(1); } }
@keyframes lieflat-waterfall-rung { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes lieflat-waterfall-fade { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .lieflat-draw,
  .lieflat-pop,
  .lieflat-gauge-tick,
  .lieflat-dumbbell-rail,
  .lieflat-dumbbell-mark,
  .lieflat-waterfall-rung,
  .lieflat-waterfall-link,
  .lieflat-waterfall-label {
    animation: none !important;
    opacity: 1;
    transform: none;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }
}

/* Keep browser autofill visually consistent with the glass authentication form. */
.auth-field:-webkit-autofill,
.auth-field:-webkit-autofill:hover,
.auth-field:-webkit-autofill:focus {
  -webkit-text-fill-color: #17181a;
  -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.9) inset;
  box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.9) inset;
  transition: background-color 9999s ease-out 0s;
}

.leaflet-control-attribution {
  display: block !important;
  margin: 0 8px 8px 0 !important;
  padding: 2px 7px !important;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.88) !important;
  color: #64748b !important;
  font-size: 10px !important;
  line-height: 1.35 !important;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
}

.leaflet-control-attribution a {
  color: #334155 !important;
  text-decoration: none;
}

.leaflet-control-attribution a:hover {
  text-decoration: underline;
}

.theme-dark .leaflet-tile-pane {
  filter: brightness(0.62) invert(1) contrast(1.55) hue-rotate(180deg) saturate(0.45) brightness(0.78);
}

.theme-dark .leaflet-control-attribution {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.86) !important;
  color: #cbd5e1 !important;
}

.theme-dark .leaflet-control-attribution a {
  color: #e2e8f0 !important;
}

@keyframes limrm-not-found-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  opacity: 0;
  animation: limrm-not-found-fade-in 2s ease-out 1s forwards;
}

#startup-error-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: #111827;
  color: #f87171;
  z-index: 999999;
  padding: 40px;
  font-family: monospace;
  overflow: auto;
}

#startup-error-overlay h2 {
  margin-top: 0;
  color: #ef4444;
}

#startup-error-overlay pre {
  background: #1f2937;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #374151;
  color: #e5e7eb;
  white-space: pre-wrap;
}

.theme-dark .leaflet-popup-content-wrapper,
.theme-dark .leaflet-popup-tip {
  background: rgba(31, 41, 55, 0.85) !important;
  backdrop-filter: blur(8px);
  color: #e5e7eb !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
  border-radius: 12px !important;
  border: 1px solid rgba(93, 42, 26, 0.15) !important;
}

.theme-dark .leaflet-popup-content b {
  color: #fbe1d1 !important;
}

.theme-dark .leaflet-container a.leaflet-popup-close-button {
  color: #9ca3af !important;
}

.theme-dark .leaflet-container a.leaflet-popup-close-button:hover {
  color: #fff !important;
}

.theme-dark .leaflet-control-layers {
  background: rgba(31, 41, 55, 0.85) !important;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(93, 42, 26, 0.15) !important;
  border-radius: 12px !important;
  color: #e5e7eb !important;
}

.theme-dark .leaflet-control-layers-separator {
  border-top: 1px solid #4b5563 !important;
}

.theme-light .leaflet-popup-content-wrapper,
.theme-light .leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(8px);
  color: #17191c !important;
  box-shadow: 0 1px 0 rgba(23, 25, 28, 0.06), 0 10px 15px -3px rgba(23, 25, 28, 0.1) !important;
  border-radius: 12px !important;
  border: 1px solid rgba(163, 166, 175, 0.4) !important;
}

.theme-light .leaflet-popup-content b {
  color: #5d2a1a !important;
}

.theme-light .leaflet-container a.leaflet-popup-close-button {
  color: #4b5563 !important;
}

.theme-light .leaflet-container a.leaflet-popup-close-button:hover {
  color: #000 !important;
}

.theme-light .leaflet-control-layers {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(8px);
  color: #17191c !important;
  border: 1px solid rgba(163, 166, 175, 0.4) !important;
  border-radius: 12px !important;
}

.theme-light .leaflet-control-layers-separator {
  border-top: 1px solid #d1d5db !important;
}

.leaflet-popup-content {
  margin: 14px !important;
  font-family: Sohne, Inter, sans-serif !important;
}

.leaflet-container a.leaflet-popup-close-button {
  padding: 8px 8px 0 0 !important;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #1f2937;
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: #4b5563;
  border-radius: 10px;
  border: 2px solid #1f2937;
}

@keyframes pulse-animation {
  0%, 100% {
    transform: scale(1);
    fill-opacity: 0.8;
    filter: drop-shadow(0 0 3px rgba(251, 191, 36, 0.6));
  }

  50% {
    transform: scale(1.1);
    fill-opacity: 1;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 1));
  }
}

.pulsing-marker {
  animation: pulse-animation 2.5s infinite ease-in-out;
  transform-origin: center;
}

.leaflet-control-layers-base label,
.leaflet-control-layers-overlays label {
  font-weight: normal !important;
}

.leaflet-control-layers-selector {
  margin-top: 2px;
}

.leaflet-control-layers-overlays label span {
  display: inline-flex;
  align-items: center;
}

.leaflet-control-layers-overlays label span span:first-child {
  min-width: 80px;
}
