/* Vivitta Design System - maps.tobroker.ru */
:root {
  --color-signal-violet: #5f79ff;
  --color-mint-pulse: #01fe93;
  --color-pure-white: #ffffff;
  --color-ink-black: #000000;
  --color-fog-gray: #f5f5f5;
  --color-mist-gray: #a6a6a6;
  --color-ash-gray: #4d4d4d;
  --color-smoke-gray: #9c9c9c;
  --color-slate-gray: #707070;
  --border-hairline: #eaeaea;
  --border-subtle: #f0f0f0;

  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-full: 100px;
  --shadow-nav: 0 0 48px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.04);
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--color-pure-white);
  color: var(--color-ink-black);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.font-editorial {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
}

/* Hairline Cards per DESIGN.md */
.hairline-card {
  background-color: var(--color-pure-white);
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
}

.hairline-card-fog {
  background-color: var(--color-fog-gray);
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
}

/* Floating Navigation Bar */
.floating-nav {
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  box-shadow: var(--shadow-nav);
}

/* Pill Buttons */
.pill-btn {
  border-radius: 100px;
  transition: all 0.15s ease-in-out;
}

.pill-btn-violet {
  background-color: var(--color-signal-violet);
  color: #ffffff;
  border-radius: 100px;
}

.pill-btn-violet:hover {
  background-color: #4b66f2;
}

.pill-btn-secondary {
  background-color: #ffffff;
  border: 1px solid var(--border-hairline);
  color: var(--color-ash-gray);
  border-radius: 100px;
}

.pill-btn-secondary:hover {
  background-color: var(--color-fog-gray);
  color: var(--color-ink-black);
  border-color: var(--color-mist-gray);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d4d4d4;
  border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a6a6a6;
}

/* Leaflet Popup Styling (Vivitta Theme) */
.leaflet-popup-content-wrapper {
  background: #ffffff !important;
  color: #000000 !important;
  border-radius: 16px !important;
  border: 1px solid var(--border-hairline) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08) !important;
  padding: 4px 6px !important;
}

.leaflet-popup-content {
  margin: 10px 14px !important;
  line-height: 1.4 !important;
  font-family: 'Inter', sans-serif !important;
}

.leaflet-popup-tip-container {
  overflow: visible !important;
}

.leaflet-popup-tip {
  background: #ffffff !important;
  box-shadow: none !important;
  border: 1px solid var(--border-hairline) !important;
}

.leaflet-popup-close-button {
  color: var(--color-mist-gray) !important;
  font-size: 16px !important;
  padding: 6px 10px !important;
}

.leaflet-popup-close-button:hover {
  color: var(--color-ink-black) !important;
}

/* Custom Leaflet Controls */
.leaflet-bar {
  border: 1px solid var(--border-hairline) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

.leaflet-bar a {
  background-color: #ffffff !important;
  color: var(--color-ash-gray) !important;
  border-bottom: 1px solid var(--border-hairline) !important;
  transition: all 0.15s ease-in-out !important;
}

.leaflet-bar a:hover {
  background-color: var(--color-fog-gray) !important;
  color: var(--color-ink-black) !important;
}

/* MapLibre Controls (Vivitta Design System) */
.maplibregl-ctrl-group {
  background-color: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid var(--border-hairline) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
  overflow: hidden !important;
}

.maplibregl-ctrl-group button {
  width: 32px !important;
  height: 32px !important;
  border-bottom: 1px solid var(--border-hairline) !important;
  transition: all 0.15s ease-in-out !important;
}

.maplibregl-ctrl-group button:last-child {
  border-bottom: none !important;
}

.maplibregl-ctrl-group button:hover {
  background-color: var(--color-fog-gray) !important;
}

.maplibregl-ctrl-scale {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid var(--border-hairline) !important;
  border-radius: 6px !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 10px !important;
  color: var(--color-ash-gray) !important;
  padding: 2px 6px !important;
}

/* MapLibre Popup Styling (Vivitta Theme) */
.maplibregl-popup-content {
  background: #ffffff !important;
  color: #000000 !important;
  border-radius: 16px !important;
  border: 1px solid var(--border-hairline) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08) !important;
  padding: 12px 14px !important;
  font-family: 'Inter', sans-serif !important;
  line-height: 1.4 !important;
}

.maplibregl-popup-tip {
  border-top-color: #ffffff !important;
  border-bottom-color: #ffffff !important;
}

.maplibregl-popup-close-button {
  color: var(--color-mist-gray) !important;
  font-size: 16px !important;
  padding: 6px 10px !important;
}

.maplibregl-popup-close-button:hover {
  color: var(--color-ink-black) !important;
}

/* Custom Origin Pulse Marker */
.custom-pulse-marker {
  position: relative;
  width: 24px;
  height: 24px;
  cursor: grab;
  touch-action: none;
}
.custom-pulse-marker:active {
  cursor: grabbing;
}

.custom-pulse-marker .pulse-ring {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(95, 121, 255, 0.35);
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.custom-pulse-marker .pin-center {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #5f79ff;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 14px rgba(95, 121, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 10px;
}

/* Landmark Pin */
.landmark-pin {
  cursor: pointer;
  transition: transform 0.15s ease-in-out;
}
.landmark-pin:hover {
  transform: scale(1.15);
}

/* Isochrone Legend */
.iso-chip-5 {
  background-color: rgba(1, 254, 147, 0.18);
  border: 1px solid #00c872;
  color: #00874c;
}

.iso-chip-10 {
  background-color: rgba(245, 158, 11, 0.15);
  border: 1px solid #f59e0b;
  color: #b45309;
}

.iso-chip-15 {
  background-color: rgba(67, 85, 185, 0.12);
  border: 1px solid #4355b9;
  color: #2b3675;
}

/* Mobile & Touch Ergonomics */
html, body {
  height: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overscroll-behavior: none;
}

#map {
  touch-action: pan-x pan-y pinch-zoom;
  overscroll-behavior: none;
}

.safe-pb {
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
}

.safe-pt {
  padding-top: max(8px, env(safe-area-inset-top, 0px));
}

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

/* Floating Toast Notification */
.floating-toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background-color: rgba(24, 24, 27, 0.95);
  color: #ffffff;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  z-index: 60;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.floating-toast.fade-out {
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
}

/* Mobile Bottom Sheet Styles (< 768px) */
@media (max-width: 767px) {
  #analysis-panel {
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), height 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  #analysis-panel.sheet-hidden {
    transform: translateY(115%) !important;
  }

  #analysis-panel.sheet-peek {
    transform: translateY(0) !important;
    height: 94px !important;
  }

  #analysis-panel.sheet-expanded {
    transform: translateY(0) !important;
    height: 78dvh !important;
  }

  #inspector-panel {
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    max-height: 80dvh !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  #inspector-panel.sheet-hidden {
    transform: translateY(115%) !important;
  }

  #inspector-panel.sheet-visible {
    transform: translateY(0) !important;
  }
}

/* Disambiguation Picker Popup */
.polygon-picker-popup .maplibregl-popup-content {
  padding: 8px 10px !important;
  border-radius: 18px !important;
  min-width: 270px !important;
  max-width: 330px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid var(--border-hairline) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12) !important;
}

.polygon-picker-popup .maplibregl-popup-close-button {
  top: 8px !important;
  right: 10px !important;
  font-size: 15px !important;
  color: var(--color-mist-gray) !important;
  border-radius: 50% !important;
  width: 22px !important;
  height: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.polygon-picker-popup .maplibregl-popup-close-button:hover {
  background: #f5f5f5 !important;
  color: #000000 !important;
}

/* Grounded Complex Pin (Apple Maps Style) */
.complex-target-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 100;
  user-select: none;
  filter: drop-shadow(0 6px 14px rgba(15, 23, 42, 0.3));
}

.complex-target-marker .pin-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #0f172a;
  color: #ffffff;
  padding: 5px 12px 5px 6px;
  border-radius: 9999px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

.complex-target-marker .pin-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background: #4f46e5;
  color: #ffffff;
}

.complex-target-marker .pin-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.complex-target-marker .pin-pointer-arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #0f172a;
  margin-top: -1px;
}
.poi-spotlight-pulse {
  position: relative;
  width: 44px;
  height: 44px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 55;
}
.poi-spotlight-pulse .pulse-ring {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2.5px solid #4f46e5;
  background: rgba(79, 70, 229, 0.15);
  animation: poi-pulse-scale 1.8s ease-out infinite;
}
.poi-spotlight-pulse .pulse-core {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4f46e5;
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.8);
}
@keyframes poi-pulse-scale {
  0% { transform: scale(0.6); opacity: 0.9; }
  70% { transform: scale(1.4); opacity: 0.1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.poi-spotlight-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 60;
}

.poi-spotlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #0f172a;
  padding: 5px 12px;
  border-radius: 9999px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.20), 0 1px 3px rgba(15, 23, 42, 0.10);
  border: 1px solid rgba(226, 232, 240, 0.9);
  white-space: nowrap;
  margin-bottom: 2px;
  pointer-events: auto;
}

.poi-spotlight-badge .badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.6);
}


