:root {
  color-scheme: light dark;
  --cl-map-text: #111318;
  --cl-map-muted: #5d6672;
  --cl-map-surface: rgba(255, 255, 255, 0.82);
  --cl-map-surface-strong: rgba(255, 255, 255, 0.94);
  --cl-map-border: rgba(17, 19, 24, 0.12);
  --cl-map-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
  --cl-map-accent: #111318;
  --cl-map-accent-text: #ffffff;
  --cl-map-teal: #0f766e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --cl-map-text: #f7fafc;
    --cl-map-muted: #bac4cf;
    --cl-map-surface: rgba(18, 22, 28, 0.74);
    --cl-map-surface-strong: rgba(18, 22, 28, 0.94);
    --cl-map-border: rgba(255, 255, 255, 0.16);
    --cl-map-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    --cl-map-accent: #f7fafc;
    --cl-map-accent-text: #111318;
  }
}

html.citylens-map-active,
html.citylens-map-active body {
  height: 100%;
  overflow: hidden;
}

.citylens-map-page {
  background: #eef2f3;
  color: var(--cl-map-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  height: 100dvh;
  min-height: 640px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.citylens-map-canvas {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
  z-index: 0;
}

.citylens-map-canvas .leaflet-control-attribution {
  background: var(--cl-map-surface);
  color: var(--cl-map-muted);
  font-size: 10px;
}

.citylens-map-topbar {
  box-sizing: border-box;
  display: grid;
  gap: 10px;
  left: max(14px, env(safe-area-inset-left));
  pointer-events: none;
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  top: max(14px, env(safe-area-inset-top));
  z-index: 1000;
}

.citylens-map-titlebar,
.citylens-chip-row,
.citylens-map-notice,
.citylens-map-error {
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  background: var(--cl-map-surface);
  border: 1px solid var(--cl-map-border);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  pointer-events: auto;
}

.citylens-map-titlebar {
  align-items: center;
  border-radius: 26px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px 10px 18px;
}

.citylens-map-titlebar h1 {
  color: var(--cl-map-text);
  font-size: 22px;
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
}

.citylens-map-titlebar p {
  color: var(--cl-map-muted);
  font-size: 12px;
  font-weight: 700;
  margin: 4px 0 0;
}

.citylens-locate-button {
  align-items: center;
  background: var(--cl-map-accent);
  border: 0;
  border-radius: 999px;
  color: var(--cl-map-accent-text);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
}

.citylens-chip-row {
  border-radius: 24px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
  scrollbar-width: none;
}

.citylens-chip-row::-webkit-scrollbar {
  display: none;
}

.citylens-map-chip {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--cl-map-border);
  border-radius: 999px;
  color: var(--cl-map-text);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 850;
  min-height: 34px;
  padding: 0 13px;
}

@media (prefers-color-scheme: dark) {
  .citylens-map-chip {
    background: rgba(255, 255, 255, 0.08);
  }
}

.citylens-map-chip.is-active {
  background: var(--cl-map-accent);
  border-color: var(--cl-map-accent);
  color: var(--cl-map-accent-text);
}

.citylens-map-notice,
.citylens-map-error {
  border-radius: 18px;
  color: var(--cl-map-text);
  font-size: 13px;
  font-weight: 750;
  padding: 10px 14px;
}

.citylens-map-error {
  background: var(--cl-map-surface-strong);
  left: 50%;
  max-width: min(420px, calc(100% - 32px));
  position: absolute;
  text-align: center;
  top: 48%;
  transform: translate(-50%, -50%);
  z-index: 1000;
}

.citylens-marker {
  align-items: center;
  background: #111318;
  border: 3px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(17, 19, 24, 0.28);
  color: #ffffff;
  display: flex;
  font-size: 13px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.citylens-marker.is-progress {
  background: #0f766e;
}

.citylens-marker.is-resolved {
  background: #737373;
}

.citylens-map-sheet {
  backdrop-filter: blur(26px) saturate(1.2);
  -webkit-backdrop-filter: blur(26px) saturate(1.2);
  background: var(--cl-map-surface-strong);
  border: 1px solid var(--cl-map-border);
  border-radius: 28px 28px 0 0;
  bottom: 84px;
  box-shadow: var(--cl-map-shadow);
  color: var(--cl-map-text);
  left: 50%;
  max-width: 720px;
  padding: 14px;
  position: absolute;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 22px));
  z-index: 1001;
}

.citylens-map-sheet::before {
  background: rgba(125, 132, 142, 0.45);
  border-radius: 999px;
  content: "";
  display: block;
  height: 4px;
  margin: 0 auto 12px;
  width: 44px;
}

.citylens-sheet-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 92px 1fr;
}

.citylens-sheet-thumb {
  align-items: center;
  aspect-ratio: 1;
  background: linear-gradient(145deg, rgba(15, 118, 110, 0.18), rgba(17, 19, 24, 0.12));
  border: 1px solid var(--cl-map-border);
  border-radius: 18px;
  color: var(--cl-map-muted);
  display: flex;
  font-weight: 900;
  justify-content: center;
  overflow: hidden;
}

.citylens-sheet-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.citylens-sheet-body h2 {
  color: var(--cl-map-text);
  font-size: 19px;
  letter-spacing: 0;
  line-height: 1.18;
  margin: 0 34px 6px 0;
}

.citylens-sheet-body p {
  color: var(--cl-map-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.citylens-sheet-close {
  background: transparent;
  border: 0;
  color: var(--cl-map-muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  position: absolute;
  right: 18px;
  top: 18px;
}

.citylens-sheet-tags,
.citylens-sheet-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.citylens-sheet-tags span,
.citylens-sheet-stats span {
  background: rgba(125, 132, 142, 0.13);
  border: 1px solid var(--cl-map-border);
  border-radius: 999px;
  color: var(--cl-map-text);
  font-size: 11px;
  font-weight: 850;
  padding: 6px 9px;
}

.citylens-sheet-action {
  align-items: center;
  background: var(--cl-map-accent);
  border-radius: 999px;
  color: var(--cl-map-accent-text);
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  justify-content: center;
  margin-top: 12px;
  min-height: 40px;
  padding: 0 16px;
  text-decoration: none;
}

.citylens-map-nav {
  align-items: center;
  backdrop-filter: blur(24px) saturate(1.25);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  background: var(--cl-map-surface-strong);
  border: 1px solid var(--cl-map-border);
  border-radius: 999px;
  bottom: max(14px, env(safe-area-inset-bottom));
  box-shadow: var(--cl-map-shadow);
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(5, minmax(48px, 1fr));
  left: 50%;
  max-width: 520px;
  padding: 8px;
  position: absolute;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 28px));
  z-index: 1002;
}

.citylens-map-nav a {
  align-items: center;
  border-radius: 999px;
  color: var(--cl-map-muted);
  display: flex;
  flex-direction: column;
  font-size: 10px;
  font-weight: 850;
  gap: 3px;
  justify-content: center;
  min-height: 46px;
  text-decoration: none;
}

.citylens-map-nav a.is-active,
.citylens-map-nav a.citylens-camera-link {
  background: var(--cl-map-accent);
  color: var(--cl-map-accent-text);
}

.citylens-map-nav a.citylens-camera-link {
  box-shadow: 0 12px 32px rgba(17, 19, 24, 0.26);
  min-height: 52px;
}

.citylens-map-nav svg {
  height: 19px;
  width: 19px;
}

@media (max-width: 640px) {
  .citylens-map-page {
    min-height: 100dvh;
  }

  .citylens-map-titlebar h1 {
    font-size: 20px;
  }

  .citylens-locate-button span {
    display: none;
  }

  .citylens-map-sheet {
    bottom: 78px;
    border-radius: 26px 26px 0 0;
  }

  .citylens-sheet-grid {
    grid-template-columns: 76px 1fr;
  }

  .citylens-map-nav a {
    font-size: 0;
  }
}
