.map-panel {
  overflow: hidden;
  padding: 0;
  border-color: #345a4a;
  background:
    linear-gradient(180deg, rgba(29, 59, 48, .52), transparent 150px),
    var(--panel);
  box-shadow: 0 22px 65px rgba(0, 0, 0, .2);
}

.map-panel .panel-header {
  align-items: flex-end;
  margin: 0;
  padding: 18px 19px 16px;
  border-bottom: 1px solid rgba(74, 117, 96, .35);
}

.panel-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #6fe2ad;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
}

.map-panel .panel-header h2 {
  font-size: 17px;
  letter-spacing: -.02em;
}

.map-panel .legend {
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-bottom: 2px;
}

.map-stage {
  position: relative;
  height: auto;
  overflow: hidden;
  border-radius: 0;
  background:
    radial-gradient(circle at 52% 38%, rgba(39, 100, 75, .42), transparent 46%),
    linear-gradient(150deg, #0b2018 0%, #071510 72%);
}

.map-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: .38;
  background-image: radial-gradient(circle at 1px 1px, rgba(109, 170, 141, .22) 1px, transparent 1.2px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, #000 5%, transparent 88%);
  pointer-events: none;
}

.map-canvas {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 330px;
  aspect-ratio: 1000 / 640;
}

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

#coverage-map {
  cursor: grab;
  touch-action: none;
  user-select: none;
  outline: none;
}

#coverage-map.dragging { cursor: grabbing; }

#coverage-map:focus-visible {
  filter: drop-shadow(0 0 5px rgba(93, 211, 158, .48));
}

.map-controls {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 17px;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(101, 151, 126, .5);
  border-radius: 10px;
  background: rgba(6, 21, 15, .9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .24);
  backdrop-filter: blur(8px);
}

.map-controls button {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: #17362a;
  color: #e5f4ec;
  font-size: 17px;
  font-weight: 650;
  line-height: 1;
}

.map-controls button:hover:not(:disabled) {
  background: #24513e;
  color: #72e4b0;
}

.map-controls button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.map-controls button:disabled {
  cursor: default;
  opacity: .42;
}

.map-controls .map-reset {
  grid-template-columns: auto auto;
  gap: 6px;
  font-size: 9px;
  letter-spacing: .04em;
}

.map-reset span {
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.map-reset b {
  color: #9bb4a8;
  font-weight: 600;
}

.map-gesture-hint {
  position: absolute;
  z-index: 2;
  right: 19px;
  bottom: 13px;
  color: #789689;
  font-size: 8px;
  letter-spacing: .08em;
  pointer-events: none;
}

.geo-ocean { fill: url(#ocean-glow); }

.geo-frame {
  fill: none;
  stroke: #5f9479;
  stroke-width: 1.35;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 8px rgba(86, 192, 143, .12));
}

.geo-grid {
  stroke: #5e8d7650;
  stroke-width: 1;
  stroke-dasharray: 2 7;
  vector-effect: non-scaling-stroke;
}

.country-layer { filter: url(#country-glow); }

.coverage-country {
  fill: #245b45;
  fill-opacity: .88;
  stroke: #99c7ae;
  stroke-width: 1.15;
  vector-effect: non-scaling-stroke;
  transition: fill .2s ease, filter .2s ease;
}

.coverage-usa { fill: #1f5844; }
.coverage-bra { fill: #2c684b; }
.coverage-chn { fill: #286249; }

.coverage-country.crop-muted {
  fill: #173328;
  fill-opacity: .35;
  stroke-opacity: .35;
  filter: saturate(.35);
}

.coverage-country.crop-active {
  fill-opacity: .96;
  stroke: #b7e0ca;
}

.country-label {
  fill: rgba(189, 226, 207, .62);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .2em;
  paint-order: stroke;
  stroke: rgba(8, 25, 19, .78);
  stroke-width: 5px;
}

.geo-axis,
.geo-title,
.geo-subtitle,
.map-scale text {
  fill: #83a797;
  font-size: 9px;
  letter-spacing: .08em;
}

.geo-title {
  fill: #d8eee2;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .13em;
}

.geo-subtitle {
  fill: #6fa089;
  font-size: 8px;
  letter-spacing: .14em;
}

.map-scale line {
  stroke: #527963;
  stroke-width: 1;
}

.map-scale circle { fill: #6f9e85; }

.map-scale text {
  font-size: 7px;
  letter-spacing: .1em;
}

.map-route {
  fill: none;
  stroke: #79ad916e;
  stroke-width: 1.25;
  stroke-dasharray: 4 6;
  vector-effect: non-scaling-stroke;
}

.map-route.ready {
  stroke: #61dfa4;
  stroke-width: 1.65;
  opacity: .82;
}

.map-node text {
  fill: #f0f6f2;
  font-size: 14px;
  font-weight: 650;
  paint-order: stroke;
  stroke: #0a1914;
  stroke-width: 4px;
  stroke-linejoin: round;
}

.map-node .node-meta {
  fill: #9db6aa;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .03em;
}

.map-stage .map-node.region .node-halo {
  fill: rgba(104, 184, 255, .12);
  stroke: rgba(104, 184, 255, .35);
  stroke-width: 1;
}

.map-stage .map-node.region .node-core {
  fill: var(--blue);
  stroke: #e0f2ff;
  stroke-width: 1.4;
}

.map-stage .map-node.market .market-halo {
  fill: rgba(246, 173, 85, .12);
  stroke: rgba(246, 173, 85, .28);
  stroke-width: 1;
}

.map-stage .map-node.market.ready .market-halo {
  fill: rgba(93, 211, 158, .13);
  stroke: rgba(93, 211, 158, .34);
}

.map-stage .map-node.market .market-core {
  fill: var(--orange);
  stroke: #fff0d4;
  stroke-width: 1.6;
}

.map-stage .map-node.market.ready .market-core {
  fill: var(--green);
  stroke: #dcffec;
}

.market-tag {
  fill: rgba(7, 21, 16, .9);
  stroke: rgba(123, 170, 147, .48);
  stroke-width: 1;
}

.map-node .market-label {
  fill: #ecf7f1;
  stroke: none;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .06em;
}

.map-stage .map-node.selected .market-core {
  r: 9px;
  filter: drop-shadow(0 0 8px var(--green));
}

.map-stage .map-node.selected .market-halo { r: 16px; }

.map-caption {
  position: relative;
  inset: auto;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  align-items: center;
  max-width: none;
  min-height: 66px;
  margin: 0;
  padding: 13px 19px;
  border-top: 1px solid rgba(74, 117, 96, .35);
  background: rgba(7, 20, 15, .82);
  color: var(--muted);
  font-size: 12px;
}

.map-caption span {
  color: var(--green);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
  white-space: nowrap;
}

.map-caption p {
  padding-left: 13px;
  border-left: 1px solid #416b57;
}

@media (max-width: 700px) {
  .map-panel .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-panel .legend { justify-content: flex-start; }

  .map-canvas {
    min-height: 360px;
    aspect-ratio: 4 / 3;
  }

  .map-caption {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .map-caption p {
    padding: 0;
    border: 0;
  }
}
