.map-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: none;
  padding: max(8px, env(safe-area-inset-top)) 0 max(8px, env(safe-area-inset-bottom));
}

.map-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 10px;
  flex-shrink: 0;
}

.map-topbar h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.map-topbar-info {
  flex: 1;
  min-width: 0;
}

.map-notice {
  margin: 0 12px 10px;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 0 12px 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.map-legend-dot.open { background: #16a34a; }
.map-legend-dot.soon { background: #eab308; }
.map-legend-dot.closed { background: #9ca3af; }

.map-wrap {
  position: relative;
  flex: 1;
  min-height: 55vh;
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
}

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

.map-footer {
  padding: 12px 12px 0;
  flex-shrink: 0;
}

.map-status {
  padding: 0 12px 8px;
  font-size: 13px;
}

.azs-map-marker {
  width: 36px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mcolor, #9ca3af);
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
}

.azs-map-marker svg {
  width: 18px;
  height: 18px;
  color: #fff;
  transform: rotate(45deg);
}

.map-user-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0f62fe;
  border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

.map-station-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.35);
}

.map-station-panel {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 10001;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 40px 14px 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  max-height: min(70vh, 420px);
  overflow: auto;
  color: #111827;
}

.map-station-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.map-station-close:active {
  background: #f3f4f6;
}

.map-popup h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: #111827;
}

.map-popup p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.35;
  color: #4b5563;
}

.map-popup .badge {
  margin-bottom: 8px;
}

.map-popup-route {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--route-bg);
  color: #fff !important;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.map-popup-route:hover,
.map-popup-route:focus,
.map-popup-route:visited {
  color: #fff !important;
  background: var(--route-bg);
  text-decoration: none;
}

/* Подсказки Яндекс.Карт — всегда светлые */
#map [class*="hint"],
#map [class*="hint"] [class*="hint__text"] {
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
  font-family: inherit;
}

#map [class*="hint"] [class*="hint__tail"] {
  background: #ffffff !important;
  border-color: #e5e7eb !important;
}

