.citymap.citymap-exploring {
  --explorer-cream: #f5f4ef;
  --explorer-ink: #123e35;
  --explorer-green: #17694e;
  --explorer-muted: #64776c;
  --explorer-line: #173e3520;
  --explorer-shadow: 0 8px 30px #133c3517, 0 1px 3px #133c350a;
}

.citymap.citymap-exploring .citymap-stage {
  height: clamp(580px, 75vh, 840px);
  background: #dce8dd;
}

.citymap.citymap-exploring .citymap-inspector,
.citymap.citymap-exploring .citymap-legend,
.citymap.citymap-exploring .citymap-location {
  display: none;
}

.city-explorer {
  position: absolute;
  z-index: 3;
  inset: 0;
  color: var(--explorer-ink);
  pointer-events: none;
  font-size: 12px;
  line-height: 1.5;
}

.city-explorer [hidden] { display: none !important; }

.city-explorer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--explorer-line);
  border-radius: 9px;
  color: var(--explorer-ink);
  background: #fffdf7;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  pointer-events: auto;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.city-explorer button:hover {
  border-color: #17694e60;
  background: #eaf1e9;
}

.city-explorer button:active { background: #dfeadb; }

.city-explorer button[aria-pressed="true"],
.city-explorer button[aria-selected="true"],
.city-explorer button[aria-expanded="true"],
.city-explorer button[data-state="active"] {
  border-color: var(--explorer-green);
  color: #fff;
  background: var(--explorer-green);
  box-shadow: 0 2px 5px #123e3518;
}

.city-explorer button:focus-visible,
.city-explorer a:focus-visible,
.city-explorer [tabindex]:focus-visible {
  outline: 3px solid #2a8963;
  outline-offset: 3px;
}

.city-explorer button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.city-explorer button svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.city-explorer-top {
  position: absolute;
  top: 18px;
  right: 60px;
  left: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.city-explorer-badge,
.city-explorer-playback,
.city-explorer-panel,
.city-explorer-empty,
.city-explorer-list {
  border: 1px solid #ffffffad;
  border-radius: 14px;
  background: #f9f9f2f2;
  box-shadow: var(--explorer-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.city-explorer-badge {
  min-width: 0;
  padding: 11px 15px 12px;
}

.city-explorer-kicker {
  display: block;
  margin: 0 0 4px;
  color: var(--explorer-muted);
  font-size: 9px;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: 1.35px;
  text-transform: uppercase;
}

.city-explorer-badge > strong {
  display: block;
  color: var(--explorer-ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.45px;
}

.city-explorer-badge > span:last-child:not(.city-explorer-kicker) {
  display: block;
  margin-top: 5px;
  color: var(--explorer-muted);
  font-size: 10px;
  line-height: 1.4;
}

.city-explorer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  max-width: 62%;
  padding: 4px;
  border: 1px solid #ffffff9e;
  border-radius: 12px;
  background: #f9f9f2e8;
  box-shadow: var(--explorer-shadow);
  pointer-events: auto;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.city-explorer-actions button { border-color: transparent; background: transparent; }

.city-explorer-bottom {
  position: absolute;
  right: 18px;
  bottom: 40px;
  left: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.city-explorer-playback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 9px;
  pointer-events: auto;
}

.city-explorer-playback button[data-action="play"] {
  min-width: 42px;
  border-color: var(--explorer-green);
  color: #fff;
  background: var(--explorer-green);
}

.city-explorer-playback button[data-action="play"]:hover { background: #11563e; }
.city-explorer-playback button[data-speed] { min-width: 36px; padding-inline: 9px; }

.city-explorer-speeds {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.city-explorer-clock {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 64px;
  margin-left: 6px;
  padding-inline: 12px;
  border-left: 1px solid var(--explorer-line);
}

.city-explorer-clock strong {
  color: var(--explorer-ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
}

.city-explorer-clock span {
  color: var(--explorer-muted);
  font-size: 9px;
  line-height: 1.3;
}

.city-explorer-status {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 185px;
  padding: 0 6px;
  color: #315c47;
  font-size: 10px;
  line-height: 1.4;
}

.city-explorer-status small { color: var(--explorer-muted); font-size: 9px; }
.city-explorer[data-state="paused"] .city-explorer-status { color: #876d3e; }

.city-explorer-help {
  max-width: 250px;
  margin: 0 0 5px;
  padding: 7px 10px;
  border-radius: 8px;
  color: #385445;
  background: #f9f9f2de;
  font-size: 10px;
  line-height: 1.6;
  text-align: right;
}

.city-explorer-panel {
  position: absolute;
  top: 88px;
  right: 60px;
  bottom: 120px;
  width: 280px;
  height: max-content;
  max-height: calc(100% - 208px);
  overflow: auto;
  padding: 21px;
  scrollbar-width: thin;
  scrollbar-color: #b6c9b9 transparent;
  pointer-events: auto;
  overscroll-behavior: contain;
}

.city-explorer-panel > .city-explorer-kicker { padding-right: 26px; }

.city-explorer-panel h3 {
  margin: 8px 25px 12px 0;
  color: var(--explorer-ink);
  font-size: 23px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -.6px;
  overflow-wrap: anywhere;
}

.city-explorer button.city-explorer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-color: transparent;
  color: #5f7867;
  background: transparent;
  font-size: 22px;
  font-weight: 400;
}

.city-explorer button.city-explorer-close:hover { background: #e3ece0; }
.city-explorer-detail { color: #536d5e; font-size: 12px; line-height: 1.7; }
.city-explorer-detail p { margin: 0 0 12px; }
.city-explorer-detail p:last-child { margin-bottom: 0; }

.city-explorer-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px 14px;
  margin: 16px 0;
  padding-top: 14px;
  border-top: 1px solid var(--explorer-line);
}

.city-explorer-facts > div,
.city-explorer-facts dl { min-width: 0; margin: 0; }
.city-explorer-facts dt { color: var(--explorer-muted); font-size: 10px; line-height: 1.5; }
.city-explorer-facts dd { margin: 0 0 9px; color: var(--explorer-ink); font-size: 12px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }

dl.city-explorer-facts > dt { align-self: center; }
dl.city-explorer-facts > dd { margin-bottom: 6px; text-align: right; }

.city-explorer-panel-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.city-explorer-panel-actions button { flex: 1 1 auto; }
.city-explorer-panel-actions button:first-child { border-color: var(--explorer-green); color: #fff; background: var(--explorer-green); }
.city-explorer-panel-actions button:first-child:hover { background: #11563e; }

.city-explorer-disclaimer {
  margin: 14px 0 0;
  padding-top: 11px;
  border-top: 1px solid var(--explorer-line);
  color: #6c7d70;
  font-size: 10px;
  line-height: 1.6;
}

.city-explorer-empty {
  position: absolute;
  top: 105px;
  left: 18px;
  max-width: 238px;
  padding: 14px 16px;
  color: #516b5d;
  font-size: 11px;
  line-height: 1.7;
}

.city-explorer-empty strong { display: block; margin-bottom: 4px; color: var(--explorer-ink); font-size: 13px; }
.city-explorer-empty p { margin: 0; }

.city-explorer-list {
  position: absolute;
  top: 105px;
  bottom: 130px;
  left: 18px;
  width: 232px;
  max-height: 370px;
  overflow: auto;
  padding: 7px;
  scrollbar-width: thin;
  scrollbar-color: #b6c9b9 transparent;
  pointer-events: auto;
  overscroll-behavior: contain;
}

.city-explorer button.city-explorer-list-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  min-height: 54px;
  padding: 11px;
  border-color: transparent;
  background: transparent;
  text-align: left;
}

.city-explorer-list-item + .city-explorer-list-item { margin-top: 2px; }
.city-explorer-list > .city-explorer-kicker { padding: 7px 10px 5px; }
.city-explorer-list > p { margin: 4px 10px 9px; color: var(--explorer-muted); font-size: 11px; line-height: 1.7; }
.city-explorer-list-item strong { font-size: 12px; font-weight: 700; }
.city-explorer-list-item span { color: var(--explorer-muted); font-size: 10px; font-weight: 450; }
.city-explorer button.city-explorer-list-item:hover { background: #e6eee1; }
.city-explorer button.city-explorer-list-item[aria-pressed="true"],
.city-explorer button.city-explorer-list-item[aria-selected="true"] { border-color: #a4bfa9; color: var(--explorer-ink); background: #e4edde; box-shadow: none; }

.city-explorer-hover {
  position: absolute;
  z-index: 5;
  max-width: 230px;
  padding: 8px 11px;
  border: 1px solid #ffffff9e;
  border-radius: 8px;
  color: #fffdf7;
  background: #123e35f0;
  box-shadow: 0 3px 12px #123e3526;
  font-size: 11px;
  line-height: 1.4;
  pointer-events: none;
}

.citymap.citymap-exploring .maplibregl-ctrl-top-right { top: 8px; }
.citymap.citymap-exploring .maplibregl-ctrl-group button { width: 36px; height: 36px; }
.citymap.citymap-exploring .citymap-map-tools { top: 132px; }
.citymap.citymap-exploring .citymap-map-tools button { width: 36px; height: 36px; }
.citymap.citymap-exploring .maplibregl-ctrl-attrib { border-radius: 5px 0 0 0; }
.citymap.citymap-exploring .citymap-network-note { top: 95px; max-width: min(300px, calc(100% - 370px)); }

.citymap.citymap-expanded {
  position: fixed;
  z-index: 1000;
  inset: 12px;
  display: flex;
  flex-direction: column;
  width: auto;
  height: auto;
  max-width: none;
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 0 0 20px #123e35a6, 0 18px 80px #123e3538;
}

.citymap.citymap-expanded .citymap-stage { flex: 1 1 auto; height: auto; min-height: 0; border-bottom: 0; }
.citymap.citymap-expanded .citymap-toolbar { flex: 0 0 auto; }
.citymap.citymap-expanded .citymap-data-toolbar,
.citymap.citymap-expanded .citymap-district-list,
.citymap.citymap-expanded .citymap-disclaimer,
.citymap.citymap-expanded .citymap-search-credit { display: none; }

@media (max-width: 1000px) {
  .city-explorer-help { max-width: 180px; font-size: 9px; }
  .city-explorer-status { max-width: 140px; }
  .city-explorer-top { gap: 8px; }
  .city-explorer-actions { gap: 4px; max-width: 65%; }
  .city-explorer-actions button { padding-inline: 9px; font-size: 10px; }
  .city-explorer-panel { width: 260px; padding: 18px; }
}

@media (max-width: 670px) {
  .citymap.citymap-exploring .citymap-stage { height: clamp(640px, 82vh, 800px); }
  .city-explorer-top { top: 12px; right: 68px; left: 12px; flex-direction: column; gap: 8px; }
  .city-explorer-badge { max-width: 100%; padding: 10px 12px; border-radius: 12px; }
  .city-explorer-badge > strong { font-size: 16px; }
  .city-explorer-kicker { font-size: 8px; letter-spacing: 1px; }
  .city-explorer button { min-width: 44px; min-height: 44px; padding: 10px 11px; }
  .city-explorer-actions { flex-wrap: nowrap; justify-content: flex-start; width: 100%; max-width: 100%; overflow-x: auto; scrollbar-width: thin; overscroll-behavior-x: contain; }
  .city-explorer-actions button { flex: 0 0 auto; min-height: 44px; padding-inline: 10px; font-size: 10px; white-space: nowrap; }
  .city-explorer-bottom { right: 12px; bottom: 35px; left: 12px; gap: 0; }
  .city-explorer-playback { flex: 1 1 auto; gap: 4px; padding: 7px; border-radius: 12px; }
  .city-explorer-playback button[data-action="play"] { min-width: 44px; }
  .city-explorer-playback button[data-speed] { min-width: 44px; padding-inline: 7px; }
  .city-explorer-clock { min-width: 59px; margin-left: 3px; padding-inline: 8px; }
  .city-explorer-clock strong { font-size: 18px; }
  .city-explorer-clock span { font-size: 8px; }
  .city-explorer-status { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: 3px 8px; max-width: none; padding: 4px 3px 0; font-size: 9px; }
  .city-explorer-status small { font-size: 9px; }
  .city-explorer-help { display: none; }
  .city-explorer-panel { top: auto; right: 12px; bottom: 140px; left: 12px; width: auto; max-height: 220px; padding: 15px 17px; border-radius: 13px; }
  .city-explorer-panel h3 { margin-top: 5px; margin-bottom: 9px; font-size: 20px; }
  .city-explorer button.city-explorer-close { top: 5px; right: 5px; width: 44px; min-height: 44px; }
  .city-explorer-detail { font-size: 11px; line-height: 1.6; }
  .city-explorer-facts { margin-block: 11px; padding-top: 10px; }
  .city-explorer-panel-actions { margin-top: 11px; }
  .city-explorer-disclaimer { margin-top: 11px; padding-top: 9px; }
  .city-explorer-empty { top: auto; right: 68px; bottom: 145px; left: 12px; max-width: 250px; padding: 12px 14px; font-size: 10px; }
  .city-explorer-empty strong { font-size: 12px; }
  .city-explorer-list { top: 154px; right: 68px; bottom: 145px; left: 12px; width: auto; max-height: 225px; }
  .city-explorer-hover { display: none; }
  .citymap.citymap-exploring .maplibregl-ctrl-top-right { top: 2px; }
  .citymap.citymap-exploring .maplibregl-ctrl-group button { width: 44px; height: 44px; }
  .citymap.citymap-exploring .citymap-map-tools { top: 154px; }
  .citymap.citymap-exploring .citymap-map-tools button { width: 44px; height: 44px; }
  .citymap.citymap-exploring .citymap-network-note { top: 158px; right: 68px; left: 12px; max-width: none; }
  .citymap.citymap-expanded { inset: 0; border: 0; border-radius: 0; }
  .citymap.citymap-expanded .citymap-toolbar { padding: 10px 12px; gap: 8px; border-radius: 0; }
  .citymap.citymap-expanded .citymap-stage { height: auto; min-height: 0; }
}

@media (max-width: 380px) {
  .city-explorer-playback { gap: 3px; padding: 6px; }
  .city-explorer-playback button[data-speed] { min-width: 44px; padding-inline: 6px; }
  .city-explorer-clock { padding-inline: 6px; margin-left: 0; }
}

@media (max-height: 670px) and (orientation: landscape) {
  .citymap.citymap-expanded .city-explorer-badge { padding-block: 7px; }
  .citymap.citymap-expanded .city-explorer-panel { top: 80px; bottom: 108px; max-height: calc(100% - 188px); }
  .citymap.citymap-expanded .city-explorer-empty { display: none; }
  .citymap.citymap-expanded .city-explorer-help { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .city-explorer *,
  .city-explorer *::before,
  .city-explorer *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .city-explorer { display: none; }
  .citymap.citymap-expanded { position: static; height: auto; box-shadow: none; }
  .citymap.citymap-exploring .citymap-stage { height: 350px; }
}
