.map-hero {
  width: min(100% - 52px, 1460px);
  margin: 28px auto 0;
}

.map-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.34fr);
  height: clamp(720px, calc(100vh - 150px), 820px);
  border: 1px solid rgba(23, 23, 23, 0.14);
  border-bottom: 0;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 18px 52px rgba(61, 48, 34, 0.05);
}

.map-stage {
  position: relative;
  --map-title-band: 138px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--surface);
}

.map-toolbar {
  position: absolute;
  z-index: 650;
  top: 28px;
  left: 34px;
  right: 34px;
  width: min(520px, calc(100% - 68px));
  pointer-events: none;
}

.map-toolbar h1 {
  color: #0f1f3d;
  font-size: clamp(1.5rem, 2vw, 2.1rem);
  line-height: 1.05;
}

.map-toolbar p:not(.section-label) {
  margin-top: 8px;
  color: #41546b;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.95rem;
}

.value-map {
  position: absolute;
  inset: var(--map-title-band) 0 0;
  z-index: 1;
  overflow: hidden;
  background: var(--surface);
}

.value-map.leaflet-container {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  isolation: isolate;
}

.value-map .leaflet-pane,
.value-map .leaflet-tile,
.value-map .leaflet-marker-icon,
.value-map .leaflet-marker-shadow,
.value-map .leaflet-tile-container,
.value-map .leaflet-pane > svg,
.value-map .leaflet-pane > canvas,
.value-map .leaflet-zoom-box,
.value-map .leaflet-image-layer,
.value-map .leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.value-map .leaflet-container {
  overflow: hidden;
}

.value-map .leaflet-tile,
.value-map .leaflet-marker-icon,
.value-map .leaflet-marker-shadow {
  user-select: none;
}

.value-map .leaflet-marker-icon {
  display: grid;
  place-items: center;
}

.value-map .leaflet-tile {
  border: 0;
  filter: saturate(0.84) contrast(0.95) brightness(1.04);
}

.value-map .leaflet-pane {
  z-index: 400;
}

.value-map .leaflet-tile-pane {
  z-index: 200;
}

.value-map .leaflet-overlay-pane {
  z-index: 400;
}

.value-map .leaflet-shadow-pane {
  z-index: 500;
}

.value-map .leaflet-marker-pane {
  z-index: 600;
}

.value-map .leaflet-tooltip-pane {
  z-index: 650;
}

.value-map .leaflet-popup-pane {
  z-index: 700;
}

.value-map .leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: auto;
}

.value-map .leaflet-top,
.value-map .leaflet-bottom {
  position: absolute;
  z-index: 800;
  pointer-events: none;
}

.value-map .leaflet-top {
  top: 0;
}

.value-map .leaflet-right {
  right: 0;
}

.value-map .leaflet-bottom {
  bottom: 0;
}

.value-map .leaflet-left {
  left: 0;
}

.value-map .leaflet-control-zoom {
  margin: 0 18px 20px 0;
  border: 1px solid rgba(15, 31, 61, 0.14);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(15, 31, 61, 0.12);
}

.value-map .leaflet-control-zoom a {
  display: block;
  width: 34px;
  height: 34px;
  background: rgba(255, 252, 246, 0.94);
  color: #0f1f3d;
  line-height: 34px;
  text-align: center;
  text-decoration: none;
}

.value-map .leaflet-control-zoom a + a {
  border-top: 1px solid rgba(15, 31, 61, 0.12);
}

.value-map .leaflet-control-attribution {
  margin: 0 10px 8px 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.78);
  color: #4a6483;
  font-size: 0.65rem;
}

.value-map .leaflet-control-zoom a,
.value-map .leaflet-control-attribution {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.portal-marker {
  display: block;
  width: 22px;
  height: 22px;
  border: 3px solid #fffaf2;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(158, 62, 45, 0.22), 0 8px 18px rgba(45, 41, 36, 0.28);
}

.portal-marker-active {
  width: 26px;
  height: 26px;
  background: #0f1f3d;
  box-shadow: 0 0 0 8px rgba(158, 62, 45, 0.32), 0 10px 24px rgba(45, 41, 36, 0.32);
}

.map-legend {
  position: absolute;
  z-index: 650;
  left: 34px;
  bottom: 22px;
  display: flex;
  gap: 22px;
  color: #314963;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
}

.legend-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: -1px;
}

.legend-dot.portfolio {
  background: var(--accent);
}

.legend-dot.muted {
  border: 1px solid rgba(49, 73, 99, 0.24);
  background: rgba(49, 73, 99, 0.12);
}

.map-detail-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: clamp(30px, 3vw, 46px);
  border-left: 1px solid rgba(23, 23, 23, 0.12);
  background: rgba(255, 252, 246, 0.82);
}

.map-detail-panel > * {
  min-width: 0;
}

.map-detail-panel h2 {
  color: #0f1f3d;
  font-size: clamp(1.7rem, 2.4vw, 2.65rem);
  line-height: 0.95;
  overflow-wrap: anywhere;
  word-break: normal;
}

.detail-location {
  color: #4a6483;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.detail-summary {
  color: #263f61;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-metrics div {
  min-height: 88px;
  padding: 18px 12px 14px 0;
}

.detail-metrics div:nth-child(even) {
  border-left: 1px solid var(--line);
  padding-left: 20px;
}

.detail-metrics div:nth-child(n + 3) {
  border-top: 1px solid var(--line);
}

.detail-metrics dt {
  color: #0f1f3d;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.5rem, 2vw, 2.2rem);
  font-weight: 950;
  line-height: 1;
}

.detail-metrics dd {
  margin-top: 8px;
  color: #4a6483;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-source {
  border-bottom: 1px solid var(--line);
}

.detail-source div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  padding: 0 0 18px;
}

.detail-source dt,
.detail-source dd {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.82rem;
}

.detail-source dt {
  color: #637187;
}

.detail-source dd {
  color: #263241;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.detail-actions {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.detail-actions .button {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.detail-source-link {
  color: var(--accent-dark);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 850;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}

.map-table-section {
  display: grid;
  gap: 34px;
}

.map-table-heading {
  display: block;
}

.map-table-heading h2 {
  margin-top: 12px;
  max-width: none;
  font-size: clamp(2rem, 3vw, 3.4rem);
  line-height: 0.98;
  white-space: nowrap;
}

.map-table-heading p:not(.section-label) {
  max-width: 920px;
  margin-top: 14px;
  color: #4f5f70;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.45;
}

.map-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.46);
}

.portal-stats-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.portal-stats-table th,
.portal-stats-table td {
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  padding: 15px 18px;
  text-align: left;
}

.portal-stats-table th:first-child,
.portal-stats-table td:first-child {
  border-left: 0;
}

.portal-stats-table thead th {
  border-top: 0;
  background: rgba(255, 252, 246, 0.72);
}

.portal-stats-table th button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 0;
  background: none;
  color: #5b6572;
  cursor: pointer;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.86rem;
  font-weight: 850;
}

.portal-stats-table th button::after {
  content: "↕";
  color: #66717e;
  font-size: 0.8rem;
}

.portal-stats-table td {
  color: #172033;
  font-size: 0.95rem;
}

.portal-stats-table a {
  color: #172033;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.map-join-section {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(340px, 0.46fr);
  gap: 58px;
  border-top: 1px solid var(--line);
}

.map-join-section h2 {
  max-width: 920px;
  font-size: clamp(2rem, 3vw, 3.3rem);
  line-height: 0.98;
}

.map-join-section p {
  max-width: 860px;
}

.map-join-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 22px;
}

.map-join-actions .button {
  min-width: 260px;
}

.map-join-benefits {
  display: grid;
  gap: 18px;
  border-left: 1px solid var(--line);
  padding-left: 34px;
}

.map-join-benefits li {
  display: grid;
  gap: 4px;
  color: #4f5f70;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.map-join-benefits strong {
  color: #172033;
}

@media (max-width: 980px) {
  .map-shell,
  .map-table-heading,
  .map-join-section {
    grid-template-columns: 1fr;
  }

  .map-shell {
    height: auto;
  }

  .map-detail-panel {
    border-left: 0;
    border-top: 1px solid rgba(23, 23, 23, 0.12);
    overflow: visible;
  }

  .map-table-heading h2 {
    white-space: normal;
  }

  .map-toolbar {
    top: 24px;
    left: 24px;
    right: 24px;
    width: min(520px, calc(100% - 48px));
  }

  .map-stage {
    --map-title-band: 150px;
    min-height: 560px;
    height: 560px;
  }

  .map-join-benefits {
    border-left: 0;
    padding-left: 0;
  }
}

@media (max-width: 640px) {
  .map-hero {
    width: min(100% - 28px, 1460px);
  }

  .map-legend {
    left: 20px;
    right: 20px;
    flex-wrap: wrap;
  }
}
