/* The city view is deliberately scoped: the directory, guide and network keep
   their existing behaviour when the illustrated map is not active. */
/* The initial HTML can paint before the bootstrap request finishes. */
#explore-view[data-starting] :is(.discovery-toolbar, .directory-panel, .directory-resizer, .mobile-view-toggle, .map-topbar) {
  display: none;
}
#explore-view[data-starting] #map-panel { display: block; grid-area: 1 / 1 / -1 / -1; }
#explore-view[data-starting] :is(#map-panel, #ecosystem-map) { background: #e7eff1; }
html[data-theme="dark"] #explore-view[data-starting] :is(#map-panel, #ecosystem-map) { background: #243342; }

body:not(.city-scene-active) #city-close-directory { display: none; }
.directory-close-rail { display: contents; }
body.city-scene-active {
  --city-slate: #333c46;
  --city-ink: #26313c;
  --city-paper: #f7f3ed;
  --city-peach: #e8bca3;
  --city-white: #fffdf9;
  --city-edge: 24px;
  --city-directory-width: var(--resized-directory-width, var(--discovery-directory-width, 360px));
  overflow: hidden;
  background: var(--city-slate);
}

body.city-scene-active .masthead {
  position: fixed;
  inset: 0 0 auto;
  color: var(--city-white);
  background: linear-gradient(180deg, #27303bbf, #27303b00);
  box-shadow: none;
  z-index: 500;
}
body.city-scene-active .brand-copy { color: var(--city-white); }
body.city-scene-active .nav-button { color: #fffdf9b3; }
body.city-scene-active .nav-button:is(:hover, .active) { color: var(--city-white); }
body.city-scene-active .nav-button.active::after { background: var(--city-peach); }
body.city-scene-active .ask-button {
  min-height: 44px;
  padding: 9px 14px;
  color: var(--city-white);
  background: transparent;
  border: 1px solid #fffdf94d;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 400;
}
body.city-scene-active .ask-button:hover { background: #fffdf90d; border-color: var(--city-peach); }
body.city-scene-active .header-actions { color: var(--city-white); }
body.city-scene-active .header-actions .icon-button { color: var(--city-white); }
body.city-scene-active .header-actions .icon-button:is(:hover, .active) { background: #fffdf912; }

body.city-scene-active #main-content { position: fixed; inset: 0; }
body.city-scene-active #explore-view {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  isolation: isolate;
}
body.city-scene-active #explore-view .discovery-toolbar,
body.city-scene-active #explore-view .mobile-view-toggle,
body.city-scene-active #explore-view .map-topbar { display: none; }
body.city-scene-active #explore-view #map-panel {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--city-slate);
  z-index: 0;
}
body.city-scene-active #ecosystem-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  outline-offset: -5px;
  background: var(--city-slate);
}
body.city-scene-active #ecosystem-map:active { cursor: grabbing; }
body.city-scene-active #ecosystem-map:focus-visible::after {
  content: '';
  position: absolute;
  inset: 2px;
  z-index: 4;
  border: 3px solid var(--city-peach);
  pointer-events: none;
}
body.city-scene-active #ecosystem-map > canvas { display: block; width: 100%; height: 100%; touch-action: none; }
body.city-scene-active #map-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, #333c4629 0%, transparent 25%, transparent 77%, #27303b66 100%);
}

/* The directory floats over the city rather than splitting the canvas. */
body.city-scene-active #explore-view .directory-panel {
  --blue: #005293;
  --blue-dark: #003b6a;
  --ink: #26313c;
  --muted: #747977;
  --line: #e2e0da;
  --surface: #f1efe9;
  position: absolute;
  inset: 110px auto 100px var(--city-edge);
  display: flex;
  width: var(--city-directory-width);
  max-width: calc(100% - 48px);
  min-height: 0;
  height: auto;
  color: var(--ink);
  border: 1px solid #fffdf966;
  border-radius: 8px;
  background: var(--city-paper);
  box-shadow: 0 15px 55px #17202d33;
  z-index: 405;
}
body.city-scene-active #explore-view[data-layout="map"] .directory-panel { display: none; }
body.city-scene-active #explore-view[data-layout="directory"] .directory-panel {
  width: min(740px, calc(100% - 48px));
}
body.city-scene-active #explore-view .directory-intro { position: relative; padding: 16px 20px 0; }
body.city-scene-active #city-close-directory {
  position: absolute;
  right: 20px;
  top: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border-radius: 8px;
  z-index: 1;
}
body.city-scene-active #city-close-directory:hover { background: var(--surface); color: var(--ink); }
body.city-scene-active #city-close-directory:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
body.city-scene-active #city-close-directory svg { width: 18px; height: 18px; stroke-width: 1.8; }
body.city-scene-active .directory-panel.guide-profile-active > .directory-close-rail { display: none; }
body.city-scene-active #explore-view .directory-intro > h1 {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 0 56px 12px 0;
  padding: 0;
  line-height: 1.25;
}
body.city-scene-active #explore-view .directory-intro h1 { font-size: 21px; letter-spacing: -.5px; }
body.city-scene-active #explore-view .directory-intro > p { color: var(--muted); font-size: 13.5px; }
body.city-scene-active #explore-view .directory-intro .search-field { border-color: #dcdcd5; background: #fffdf9; border-radius: 4px; }
body.city-scene-active #explore-view .directory-intro .search-field input { color: var(--city-ink); }
body.city-scene-active #explore-view .directory-intro .discovery-shortcuts button { color: #65594f; border-color: #ddd5cc; background: #f2ebe3; border-radius: 4px; }
body.city-scene-active #explore-view .directory-intro .discovery-shortcuts button:is(:hover, .active) { color: #48382d; background: #ead4c4; border-color: #c7ab97; }
body.city-scene-active #explore-view .directory-intro .filter-pill { color: #6b706e; border-color: #deded7; background: transparent; }
body.city-scene-active #explore-view .directory-intro .filter-pill:is(.active, [aria-pressed="true"]) { color: #493b31; background: #e9d0bd; border-color: #d6b79e; }
body.city-scene-active #explore-view .directory-results { padding: 0 20px; background: var(--city-paper); overscroll-behavior: contain; }
body.city-scene-active #explore-view .organisation-card { border-color: #e2e0da; background: transparent; }
body.city-scene-active #explore-view .organisation-card:is(:hover, .selected) { background: #ece5dc; }
body.city-scene-active #explore-view .organisation-card.selected::before { background: #c18e6e; }
body.city-scene-active #explore-view .directory-footer { padding: 8px 20px; background: var(--city-paper); border-color: #e2e0da; }
body.city-scene-active #explore-view .investor-filters select { background: #fffdf9; border-color: #dcdcd5; color: var(--city-ink); }
body.city-scene-active #explore-view[data-layout="directory"] .directory-intro { display: block; }
body.city-scene-active #explore-view[data-layout="directory"] .directory-intro .search-field { max-width: none; }
body.city-scene-active #explore-view[data-layout="directory"] .directory-results { display: block; }
body.city-scene-active #explore-view[data-layout="directory"] .organisation-card { padding: 12px 0; border: 0; border-bottom: 1px solid #e2e0da; border-radius: 0; }
body.city-scene-active #explore-view .directory-resizer {
  top: 122px;
  bottom: 112px;
  left: calc(var(--city-edge) + var(--city-directory-width));
  z-index: 410;
}
body.city-scene-active #explore-view .directory-resizer::before { background: var(--city-peach); }
body.city-scene-active #explore-view .directory-resizer::after { border-color: #d6b8a3; background: #f5e8dd; box-shadow: 0 2px 7px #1a233133; }
body.city-scene-active #explore-view .directory-resizer:is(:hover, :focus-visible, .is-dragging)::after { background: var(--city-peach); border-color: var(--city-peach); }

/* A sparse, quiet HUD leaves the model as the principal view. */
body.city-scene-active #city-map-hud { position: absolute; inset: 0; z-index: 20; pointer-events: none; color: var(--city-white); }
body.city-scene-active .city-map-title { display: block; margin-top: 8px; color: var(--city-white); font-size: 24px; font-weight: 400; line-height: 1.2; letter-spacing: -.5px; }
body.city-scene-active .city-map-tools {
  position: absolute;
  right: 30px;
  bottom: 35px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid #fffdf92e;
  border-radius: 5px;
  background: #29323cbf;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}
body.city-scene-active .city-map-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 3px;
  color: var(--city-white);
  background: transparent;
  font-size: 18px;
  line-height: 1;
  touch-action: manipulation;
}
body.city-scene-active .city-map-tools button:hover { color: var(--city-peach); background: #fffdf90a; }
body.city-scene-active .city-map-tools button:active { background: #fffdf914; }
body.city-scene-active .city-map-tools button svg { width: 18px; height: 18px; }
body.city-scene-active .city-map-tools #city-reset-camera { margin-left: 5px; border-left: 1px solid #fffdf92e; border-radius: 0 3px 3px 0; }
body.city-scene-active .city-map-tools #city-toggle-2d { width: auto; padding: 0 12px; margin-left: 5px; border-left: 1px solid #fffdf92e; border-radius: 0 3px 3px 0; font-size: 12.5px; letter-spacing: .5px; white-space: nowrap; }
body.city-scene-active :is(#city-all-places, #city-directory-toggle) {
  position: absolute;
  left: 32px;
  bottom: 39px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 17px;
  color: var(--city-ink);
  background: var(--city-paper);
  border: 1px solid #fffdf977;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  pointer-events: auto;
  box-shadow: 0 3px 20px #17202d14;
}
body.city-scene-active :is(#city-all-places, #city-directory-toggle):hover { background: var(--city-peach); }
body.city-scene-active .city-map-browse { position: absolute; left: 32px; bottom: 39px; display: flex; align-items: center; gap: 10px; pointer-events: auto; }
body.city-scene-active .city-map-browse #city-all-places { position: static; max-width: none; }
body.city-scene-active #city-plan-visit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 15px;
  color: var(--city-white);
  border: 1px solid #fffdf94d;
  border-radius: 4px;
  background: #29323b80;
  font-size: 14px;
  pointer-events: auto;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
body.city-scene-active #city-plan-visit:hover { background: #fffdf914; border-color: var(--city-peach); }
body.city-scene-active .city-map-browse svg { width: 17px; height: 17px; }
body.city-scene-active #city-map-status { position: absolute; right: 34px; bottom: 103px; max-width: min(360px, calc(100% - 64px)); color: #fffdf9a6; font-size: 12px; line-height: 1.4; text-align: right; pointer-events: auto; }
body.city-scene-active #city-map-status a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
body.city-scene-active .city-map-attribution { position: absolute; bottom: 13px; right: 34px; max-width: calc(100% - 64px); color: #fffdf980; font-size: 12px; line-height: 1.4; text-align: right; pointer-events: auto; }
body.city-scene-active .city-map-attribution a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* Square logo tiles echo the original map, with 44px tap targets. */
body.city-scene-active .city-map-marker {
  /* Fixed-size tap targets isolate logo-size layout from the rest of the page.
     No paint containment: shadows, focus outlines and address leaders stay visible. */
  contain: layout style;
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--city-ink);
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
  z-index: 3;
  transform: translate(-50%, -100%);
  transition: none;
}
body.city-scene-active .city-map-marker::before { content: none; }
body.city-scene-active .city-map-marker .map-group-anchor { position: relative; z-index: 1; touch-action: none; }
body.city-scene-active .city-map-marker .map-logo-group { border-radius: 6px; }
body.city-scene-active .city-map-marker > .map-logo-tile.organisation-avatar { position: relative; z-index: 1; width: calc(24px + var(--city-pin-growth, 0px) + var(--map-category-size, 0px)); height: calc(24px + var(--city-pin-growth, 0px) + var(--map-category-size, 0px)); margin: 0; background: #fff; border: 1px solid #fff; border-radius: 4px; box-shadow: 0 1px 4px #1426384d; font-size: calc(12px + var(--city-pin-growth, 0px) / 3); }
body.city-scene-active .city-map-marker > .map-logo-tile img { padding: 2px; }
body.city-scene-active .city-map-marker .map-logo-group .map-logo-tile { background: var(--city-paper); border-color: #fffdf9cc; border-radius: 4px; box-shadow: 0 2px 7px #1a26394d; }
body.city-scene-active .city-map-marker .map-group-count { background: #e8bca3; color: var(--city-ink); border-color: var(--city-paper); box-shadow: 0 1px 5px #1a26393b; }
body.city-scene-active .city-map-marker:hover .map-logo-tile { border-color: #e8bca3; box-shadow: 0 1px 5px #1a26394d; transform: none; }
body.city-scene-active .city-map-marker > .map-logo-tile.selected { border-color: #8acbff; box-shadow: 0 0 0 2px #8acbff80,0 1px 4px #1426384d; }
body.city-scene-active .city-map-marker.map-group-selected { outline: 2px solid var(--city-peach); outline-offset: 5px; border-radius: 7px; box-shadow: 0 0 0 5px #333c46b3; z-index: 20000 !important; }
body.city-scene-active .city-map-marker.map-group-selected .map-group-count { background: var(--city-paper); color: #6d4833; }
body.city-scene-active .city-map-marker:focus-visible { outline: 3px solid var(--city-peach); outline-offset: 5px; border-radius: 7px; z-index: 20001 !important; }
body.city-scene-active :is(.city-map-labels, .city-marker-layer, .city-scene-markers) { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
body.city-scene-active main[data-view="explore"] > .profile-panel { top: 110px; right: 24px; bottom: 100px; width: 390px; max-width: calc(100vw - 48px); border-radius: 8px; border-color: #fffdf966; box-shadow: 0 15px 55px #17202d33; }
.profile-panel { overscroll-behavior: contain; scroll-padding-block: 56px 12px; }

@media (max-width: 850px) {
  body.city-scene-active { --city-edge: 18px; }
  body.city-scene-active .ask-button { padding: 8px 9px; font-size: 12.5px; }
  body.city-scene-active .ask-button svg { width: 14px; height: 14px; }
  body.city-scene-active .city-map-tools { right: 18px; }
  body.city-scene-active #city-all-places { left: 22px; }
  body.city-scene-active .city-map-browse { left: 22px; }
}

@media (max-width: 650px) {
  body.city-scene-active { --city-edge: 12px; }
  body.city-scene-active .navigation-group .ask-button { min-height: 38px; padding: 7px 10px; font-size: 12.5px; }
  body.city-scene-active .city-map-title { font-size: 21px; margin-top: 7px; }
  body.city-scene-active #explore-view .directory-panel,
  body.city-scene-active #explore-view[data-layout="directory"] .directory-panel {
    inset: calc(114px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(80px, calc(env(safe-area-inset-bottom) + 66px)) max(12px, env(safe-area-inset-left));
    display: none;
    width: auto;
    max-width: none;
    border-radius: 8px;
    box-shadow: 0 12px 55px #17202d59;
  }
  body.city-scene-active #explore-view[data-layout="directory"] .directory-panel,
  body.city-scene-active #explore-view[data-layout="split"].mobile-list .directory-panel { display: flex; }
  body.city-scene-active #explore-view .directory-intro { padding: 15px 16px 0; }
  body.city-scene-active #city-close-directory { top: 15px; right: 16px; }
  body.city-scene-active #explore-view .directory-intro h1 { font-size: 20px; }
  body.city-scene-active #explore-view .directory-results { padding-left: 16px; padding-right: 16px; }
  body.city-scene-active #explore-view .directory-footer { padding: 5px 16px; }
  body.city-scene-active #explore-view .directory-resizer { display: none; }
  body.city-scene-active .city-map-tools { right: max(12px, env(safe-area-inset-right)); bottom: max(40px, calc(env(safe-area-inset-bottom) + 34px)); flex-wrap: wrap; width: 102px; justify-content: center; padding: 4px; gap: 0; }
  body.city-scene-active .city-map-tools button { width: 44px; height: 44px; }
  body.city-scene-active .city-map-tools #city-reset-camera { margin: 0; border: 0; }
  body.city-scene-active .city-map-tools #city-toggle-2d { margin: 0; padding: 0; border: 0; width: 44px; font-size: 12px; }
  body.city-scene-active :is(#city-all-places, #city-directory-toggle) { left: max(16px, env(safe-area-inset-left)); bottom: max(45px, calc(env(safe-area-inset-bottom) + 39px)); max-width: calc(100% - 140px); padding: 10px 13px; min-height: 44px; font-size: 13.5px; gap: 7px; }
  body.city-scene-active .city-map-browse { left: max(16px, env(safe-area-inset-left)); bottom: max(45px, calc(env(safe-area-inset-bottom) + 39px)); align-items: stretch; flex-direction: column-reverse; gap: 8px; max-width: calc(100% - 140px); }
  body.city-scene-active .city-map-browse #city-all-places { max-width: 100%; }
  body.city-scene-active #city-plan-visit { padding: 10px 13px; font-size: 13.5px; gap: 7px; }
  body.city-scene-active #city-map-status { right: 16px; bottom: max(184px, calc(env(safe-area-inset-bottom) + 177px)); max-width: 160px; font-size: 12px; }
  body.city-scene-active main[data-view="explore"] > .profile-panel { top: calc(114px + env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); width: auto; max-width: none; border-radius: 8px; }
}

@media (max-width: 360px) {
  body.city-scene-active .navigation-group .ask-button { padding-left: 8px; padding-right: 8px; }
  body.city-scene-active .navigation-group .ask-button svg { display: none; }
  body.city-scene-active .city-map-title { font-size: 19px; }
  body.city-scene-active #explore-view .directory-intro > h1 { margin-bottom: 8px; }
  body.city-scene-active #explore-view .category-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  body.city-scene-active #explore-view .category-filters .filter-pill { padding-inline: 2px; font-size: 13px; }
  body.city-scene-active #explore-view .category-filters .filter-pill[data-category="Coworking office"] { white-space: normal; line-height: 1.15; }
  body.city-scene-active #explore-view .category-filters .pill-count { position: absolute; clip-path: inset(50%); }
}

@media (prefers-reduced-motion: reduce) {
  body.city-scene-active .city-map-marker,
  body.city-scene-active #city-map-hud *,
  body.city-scene-active .directory-panel { transition: none; animation: none; }
}

/* The directory and its map controls follow the selected appearance. */
html[data-theme="dark"] body.city-scene-active :is(#city-all-places, #city-directory-toggle) {
  color: var(--ink);
  background: var(--theme-panel);
  border-color: var(--line);
}
html[data-theme="dark"] body.city-scene-active :is(#city-all-places, #city-directory-toggle):is(:hover, [aria-pressed="true"]) {
  background: var(--theme-raised);
  border-color: var(--blue);
}
html[data-theme="dark"] body.city-scene-active #explore-view .directory-panel {
  --blue: #8acbff;
  --blue-dark: #b8dfff;
  --ink: #e8f1f8;
  --muted: #a5b5c4;
  --line: #304354;
  --surface: #1c3042;
  --city-ink: #e8f1f8;
  --city-paper: #152636;
  color-scheme: dark;
  color: var(--ink);
  background: var(--city-paper);
  border-color: var(--line);
  box-shadow: 0 15px 55px #0005;
}
html[data-theme="dark"] body.city-scene-active #explore-view .directory-intro .search-field,
html[data-theme="dark"] body.city-scene-active #explore-view .directory-panel :is(.investor-filters select, .startup-filters select, .sort-button) {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
  color-scheme: dark;
}
html[data-theme="dark"] body.city-scene-active #explore-view .directory-intro .search-field:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px #8acbff26;
}
html[data-theme="dark"] body.city-scene-active #explore-view .directory-intro :is(.discovery-shortcuts button, .filter-pill) {
  color: var(--muted);
  background: var(--surface);
  border-color: var(--line);
}
html[data-theme="dark"] body.city-scene-active #explore-view .directory-intro :is(.discovery-shortcuts button, .filter-pill):hover {
  color: var(--ink);
  background: #25445d;
  border-color: #668ba9;
}
html[data-theme="dark"] body.city-scene-active #explore-view .directory-intro :is(.discovery-shortcuts button, .filter-pill):is(.active, [aria-pressed="true"]) {
  color: #0d2538;
  background: var(--blue);
  border-color: var(--blue);
}
html[data-theme="dark"] body.city-scene-active #explore-view :is(.organisation-card, .directory-footer) { border-color: var(--line); }
html[data-theme="dark"] body.city-scene-active #explore-view .organisation-card:is(:hover, .selected) { background: var(--surface); }
html[data-theme="dark"] body.city-scene-active #explore-view .organisation-card.selected::before { background: var(--blue); }

/* Daylight belongs to the whole city view, including its floating chrome. */
html[data-theme="light"] body.city-scene-active {
  --city-slate: #dce9ec;
  --city-ink: #17394c;
  --city-paper: #fffefa;
  --city-peach: #005293;
  --city-muted: #526b7a;
  --city-border: #cbd8de;
  --city-blue-soft: #e8f1f8;
  --city-panel-shadow: 0 12px 40px #2345571a, 0 2px 8px #2345570a;
  background: var(--city-slate);
}
html[data-theme="light"] body.city-scene-active .masthead {
  color: var(--city-ink);
  background: linear-gradient(180deg, #fffefabf, #fffefa00);
  border-bottom: 0;
  box-shadow: none;
}
html[data-theme="light"] body.city-scene-active .brand-copy { color: var(--city-ink); }
html[data-theme="light"] body.city-scene-active .nav-button { color: var(--city-muted); }
html[data-theme="light"] body.city-scene-active .nav-button:is(:hover, .active) { color: #005293; }
html[data-theme="light"] body.city-scene-active .nav-button.active::after { background: #005293; }
html[data-theme="light"] body.city-scene-active .ask-button {
  color: #005293;
  background: #f2f7fb;
  border-color: #b3cddd;
}
html[data-theme="light"] body.city-scene-active .ask-button:hover { background: var(--city-blue-soft); border-color: #005293; }
html[data-theme="light"] body.city-scene-active .header-actions,
html[data-theme="light"] body.city-scene-active .header-actions .icon-button { color: var(--city-ink); }
html[data-theme="light"] body.city-scene-active .header-actions .icon-button:is(:hover, .active) { color: #005293; background: var(--city-blue-soft); }
html[data-theme="light"] body.city-scene-active .saved-count { color: #fff; background: #005293; }
html[data-theme="light"] body.city-scene-active #map-panel::after {
  background: linear-gradient(180deg, #fffefa14 0%, transparent 24%, transparent 78%, #fffefa33 100%);
}

html[data-theme="light"] body.city-scene-active #explore-view .directory-panel,
html[data-theme="light"] body.city-scene-active main[data-view="explore"] > .profile-panel {
  --ink: var(--city-ink);
  --muted: var(--city-muted);
  --line: #dfe7eb;
  --surface: #f2f6f8;
  color: var(--city-ink);
  background: var(--city-paper);
  border-color: var(--city-border);
  box-shadow: var(--city-panel-shadow);
}
html[data-theme="light"] body.city-scene-active #city-close-directory { color: var(--city-muted); }
html[data-theme="light"] body.city-scene-active #city-close-directory:hover { background: var(--city-blue-soft); color: #005293; }
html[data-theme="light"] body.city-scene-active #explore-view .directory-intro .search-field,
html[data-theme="light"] body.city-scene-active #explore-view .investor-filters select { border-color: var(--city-border); background: #fff; }
html[data-theme="light"] body.city-scene-active #explore-view .directory-intro .search-field:focus-within { border-color: #005293; box-shadow: 0 0 0 2px #0052931a; }
html[data-theme="light"] body.city-scene-active #explore-view .directory-intro .search-field input::placeholder { color: #657b88; }
html[data-theme="light"] body.city-scene-active #explore-view .directory-intro .discovery-shortcuts button { color: #31576e; background: #f2f7fa; border-color: #d4e1e9; }
html[data-theme="light"] body.city-scene-active #explore-view .directory-intro .discovery-shortcuts button:is(:hover, .active) { color: #005293; background: var(--city-blue-soft); border-color: #a7c6db; }
html[data-theme="light"] body.city-scene-active #explore-view .directory-intro .filter-pill { color: var(--city-muted); border-color: #d9e3e8; background: #fff; }
html[data-theme="light"] body.city-scene-active #explore-view .directory-intro .filter-pill:hover { color: #005293; border-color: #a7c6db; background: #f2f7fb; }
html[data-theme="light"] body.city-scene-active #explore-view .directory-intro .filter-pill:is(.active, [aria-pressed="true"]) { color: #fff; background: #005293; border-color: #005293; }
html[data-theme="light"] body.city-scene-active #explore-view .organisation-card,
html[data-theme="light"] body.city-scene-active #explore-view .directory-footer { border-color: #dfe7eb; }
html[data-theme="light"] body.city-scene-active #explore-view .organisation-card:is(:hover, .selected) { background: #eef4f8; }
html[data-theme="light"] body.city-scene-active #explore-view .organisation-card.selected::before { background: #005293; }
html[data-theme="light"] body.city-scene-active #explore-view .directory-resizer::after { border-color: #acc7d8; background: #edf5fa; box-shadow: 0 2px 7px #2345571a; }
html[data-theme="light"] body.city-scene-active #explore-view .directory-resizer:is(:hover, :focus-visible, .is-dragging)::after { background: #c5deee; border-color: #005293; }

html[data-theme="light"] body.city-scene-active #city-map-hud { color: var(--city-ink); }
html[data-theme="light"] body.city-scene-active .city-map-title { color: var(--city-ink); }
html[data-theme="light"] body.city-scene-active .city-map-tools {
  background: #fffefaf2;
  border-color: var(--city-border);
  box-shadow: 0 4px 18px #23455712;
}
html[data-theme="light"] body.city-scene-active .city-map-tools button { color: var(--city-ink); }
html[data-theme="light"] body.city-scene-active .city-map-tools button:hover { color: #005293; background: var(--city-blue-soft); }
html[data-theme="light"] body.city-scene-active .city-map-tools button:active { color: #005293; background: #d6e7f2; }
html[data-theme="light"] body.city-scene-active .city-map-tools :is(#city-reset-camera, #city-toggle-2d) { border-left-color: #dce5e9; }
html[data-theme="light"] body.city-scene-active :is(#city-all-places, #city-directory-toggle) {
  color: var(--city-ink);
  background: #fffefaf2;
  border-color: var(--city-border);
  box-shadow: 0 4px 18px #23455712;
}
html[data-theme="light"] body.city-scene-active :is(#city-all-places, #city-directory-toggle):hover { color: #005293; background: var(--city-blue-soft); border-color: #a7c6db; }
html[data-theme="light"] body.city-scene-active #city-plan-visit {
  color: #fff;
  background: #005293;
  border-color: #005293;
  box-shadow: 0 4px 16px #0052931f;
}
html[data-theme="light"] body.city-scene-active #city-plan-visit:hover { color: #fff; background: #003e70; border-color: #003e70; }
html[data-theme="light"] body.city-scene-active :is(#city-map-status, .city-map-attribution) { color: #445f70; text-shadow: 0 1px 3px #fffefa; }

/* White pins separate logos from the pale city; white brand marks retain their
   existing dark image canvas. */
html[data-theme="light"] body.city-scene-active .city-map-marker > .map-logo-tile.organisation-avatar:not(.logo-dark),
html[data-theme="light"] body.city-scene-active .city-map-marker .map-logo-group .map-logo-tile:not(.logo-dark) { background: #fff; border-color: #c0d0da; }
html[data-theme="light"] body.city-scene-active .city-map-marker .map-logo-tile.organisation-avatar.logo-dark { background: #153752; }
html[data-theme="light"] body.city-scene-active .city-map-marker .map-group-count { background: #005293; color: #fff; border-color: #fff; box-shadow: 0 1px 5px #23455726; }
html[data-theme="light"] body.city-scene-active .city-map-marker:hover .map-logo-tile { border-color: #005293; box-shadow: 0 2px 8px #23455726; }
html[data-theme="light"] body.city-scene-active .city-map-marker > .map-logo-tile.selected { border-color: #005293; box-shadow: 0 0 0 2px #00529355,0 1px 4px #23455726; }
html[data-theme="light"] body.city-scene-active .city-map-marker.map-group-selected { outline-color: #005293; box-shadow: 0 0 0 5px #fffefad9; }
html[data-theme="light"] body.city-scene-active .city-map-marker.map-group-selected .map-group-count { background: #005293; color: #fff; }
html[data-theme="light"] body.city-scene-active .city-map-marker:focus-visible { outline-color: #005293; }

/* Background categories stay present as smaller, quiet reference points. */
body.city-scene-active .city-map-marker.map-category-context > .map-logo-tile.organisation-avatar { box-shadow: none; }
@media (max-width: 650px), (max-width: 950px) and (max-height: 500px) {
  body.city-scene-active .masthead { background: #202d39f7; }
  html[data-theme="light"] body.city-scene-active .masthead { background: #fffefaf7; }
  body.city-scene-active .city-map-attribution {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(6px, env(safe-area-inset-bottom));
    max-width: calc(100% - 24px - env(safe-area-inset-left) - env(safe-area-inset-right));
    padding-inline: 7px;
    border-radius: 4px;
    background: #202d39f5;
    color: var(--city-white);
    font-size: 12.5px;
    pointer-events: none;
  }
  html[data-theme="light"] body.city-scene-active .city-map-attribution {
    background: #fffefaf5;
    color: var(--city-ink);
    text-shadow: none;
  }
  body.city-scene-active .city-map-attribution a {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    pointer-events: auto;
  }

  body.city-scene-active #explore-view #directory-panel:not(.guide-profile-active) {
    --directory-panel-scrolls: 1;
    overflow: auto;
    overscroll-behavior: contain;
    scroll-padding-block: 62px 12px;
  }
  body.city-scene-active #explore-view #directory-panel:not(.guide-profile-active) > .directory-close-rail {
    display: block;
    position: sticky;
    top: 0;
    z-index: 3;
    flex: 0 0 0;
  }
  body.city-scene-active #explore-view #city-close-directory {
    background: var(--city-paper);
    border: 1px solid var(--line);
  }
  body.city-scene-active #explore-view #city-close-directory:hover { background: var(--surface); }
  body.city-scene-active #explore-view #directory-panel .directory-intro {
    max-height: none;
    overflow: visible;
  }
  body.city-scene-active #explore-view #directory-panel .directory-results {
    flex: 1 0 auto;
    overflow: visible;
  }
  body.city-scene-active #explore-view #directory-panel .discovery-shortcuts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
  }
  body.city-scene-active #explore-view #directory-panel .discovery-shortcuts button {
    min-width: 0;
    padding-inline: 2px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  body.city-scene-active #explore-view #directory-panel :is(#guide-results-heading, #map-group-heading) {
    margin-inline-end: 48px;
  }
}

@media (max-width: 650px) and (max-height: 650px) {
  body.city-scene-active #explore-view #directory-panel:not(.guide-profile-active) {
    bottom: max(16px, env(safe-area-inset-bottom));
  }
}

@media (min-width: 651px) and (max-width: 950px) and (max-height: 500px) {
  body.city-scene-active #explore-view .directory-panel,
  body.city-scene-active #explore-view[data-layout="directory"] .directory-panel {
    top: calc(68px + env(safe-area-inset-top));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(16px, env(safe-area-inset-left));
    width: min(420px, calc(100% - 252px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  }
  body.city-scene-active #explore-view .directory-resizer { display: none; }
  body.city-scene-active #explore-view #directory-panel :is(input[type="search"], select) { font-size: 16px; }
  body.city-scene-active #explore-view .city-map-tools {
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(38px + env(safe-area-inset-bottom));
  }
  body.city-scene-active #explore-view .city-map-browse {
    left: max(16px, env(safe-area-inset-left));
    bottom: calc(43px + env(safe-area-inset-bottom));
  }
  body.city-scene-active main[data-view="explore"] > .profile-panel {
    top: calc(68px + env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}
