body.map-page {
  height: 100dvh;
  overflow: hidden;
  background: var(--color-surface);
  padding: 0;
}
body.map-page::before,
body.map-page::after { background: var(--color-surface); }

.map-page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 5vw 6vw 1rem;
  flex-shrink: 0;
}

.map-page-back {
  display: flex;
  color: var(--color-text);
  opacity: 0.4;
  transition: opacity var(--duration-fast) var(--ease-standard);
  flex-shrink: 0;
}
.map-page-back:hover { opacity: 1; }

.map-page-title {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-text-lighter);
}

.map-page-count {
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--color-text-lighter);
  letter-spacing: 0.02em;
}

#map-canvas {
  flex: 1;
  min-height: 0;
  width: 100%;
  background: var(--surface-sunken);
}

.map-page-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6vw 10vw;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-lighter);
  line-height: 1.6;
}

/* ---------- Leaflet popup, restyled to match tokens ---------- */
.map-popup .leaflet-popup-content-wrapper {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 0;
  overflow: hidden;
}
.map-popup .leaflet-popup-content {
  margin: 0;
  width: 180px !important;
}
.map-popup .leaflet-popup-tip {
  box-shadow: var(--shadow-md);
}
.map-popup-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
}
.map-popup-img {
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--border);
  overflow: hidden;
}
.map-popup-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.map-popup-open {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in oklch, var(--surface) 80%, transparent);
  color: var(--ink);
}
.map-popup-open .icon { width: 13px; height: 13px; }
.map-popup-body {
  padding: 10px 12px 12px;
}
.map-popup-label {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leaflet-control-attribution {
  font-size: 9px !important;
  background: color-mix(in oklch, var(--surface) 85%, transparent) !important;
}
