.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .9rem;
  padding: .75rem 1rem;
  border-top: 1px solid #d8e6e1;
  color: #28453c;
  font-size: .72rem;
  font-weight: 800;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.map-legend i {
  display: inline-block;
  width: .75rem;
  height: .75rem;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}

.context-boundary {
  fill: #d8e3df;
  fill-opacity: .48;
  stroke: #789087;
  stroke-width: 1.5;
  stroke-dasharray: 6 5;
  vector-effect: non-scaling-stroke;
}

.context-label,
.orientation-label {
  fill: #38584e;
  stroke: #f5fbf8;
  stroke-width: 4px;
  paint-order: stroke;
  font-size: 16px;
  font-weight: 900;
  text-anchor: middle;
}

.orientation-label {
  fill: #176a91;
  font-style: italic;
}

.boundary-shape.focused {
  stroke: #e60023;
  stroke-width: 10px;
  filter: drop-shadow(0 0 7px rgba(230, 0, 35, .85));
}

.offline-context-index {
  display: grid;
  gap: .25rem;
  margin: .65rem 1rem 1rem;
  padding: .75rem 1rem;
  border-radius: 10px;
  background: #edf7f2;
  color: #294b40;
}

.offline-context-index span { font-weight: 850; }
.offline-context-index small { line-height: 1.45; }

.embedded .map-legend {
  display: none;
}

.embedded {
  background: transparent;
}

html:has(body.embedded) {
  background: transparent;
}

.embedded .map-toolbar {
  display: none;
}

.embedded #regional-boundary-metrics {
  display: none;
}

.embedded .map-panel {
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.embedded .map-panel svg {
  height: 100vh;
  border-radius: 0;
  background: transparent;
}

.regional-google-map {
  width: 100%;
  height: min(68vh, 680px);
  min-height: 480px;
  border: 0;
  border-radius: 0;
}

.boundary-stat-grid .nation-stat {
  min-width: 0;
  border: 1px solid #d6e5de;
  background: #f3faf7;
  color: #173e32;
}

.boundary-stat-grid .nation-stat strong {
  overflow-wrap: anywhere;
  font-size: clamp(1.15rem, 2.7vw, 1.8rem);
  line-height: 1.2;
}

@media (max-width: 440px) {
  .map-topbar {
    flex-wrap: wrap;
  }

  .map-topbar strong {
    flex: 1 1 90px;
  }

  .map-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-tools {
    flex-wrap: wrap;
    max-width: 100%;
  }

  #regional-boundary-metrics,
  .map-panel,
  .map-detail,
  .nation-population,
  .map-notice {
    min-width: 0;
    max-width: 100%;
  }
}

.google-active .offline-context-index,
.google-active .map-legend { display: none; }

.embedded .regional-google-map {
  height: 100vh;
  min-height: 520px;
  border-radius: 0;
}

.embedded .scope-map-label {
  display: none;
}

.embedded .boundary-label {
  display: none;
}

.embedded.lga-focus .boundary-label {
  display: block;
  font-size: 30px;
}

.embedded .group-boundary-label {
  font-size: 19px;
}
