.eco-map {
  --map-ink: #213d30;
  --map-muted: #596d60;
  --map-border: #d9e3d7;
  background: #f9fbf7;
  border: 1px solid var(--map-border);
  border-radius: 20px;
  color: var(--map-ink);
  isolation: isolate;
  overflow: hidden;
}

.eco-map [hidden] { display: none !important; }

.eco-map__top, .eco-map__footer {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: space-between;
  padding: 13px 16px;
}

.eco-map__title, .eco-map__filters, .eco-map__legend, .eco-map__legend > span {
  align-items: center;
  display: flex;
  gap: 7px;
}

.eco-map__title {
  font-size: 0.84rem;
  letter-spacing: -0.02em;
}

.eco-map__status {
  background: #539a4a;
  border-radius: 50%;
  box-shadow: 0 0 0 4px #e0f0db;
  display: inline-block;
  height: 7px;
  margin: 0 4px;
  width: 7px;
}

.eco-map__filters { flex-wrap: wrap; }

.eco-map__filters select {
  appearance: auto;
  background: #fff;
  border: 1px solid var(--map-border);
  border-radius: 8px;
  color: var(--map-ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  line-height: 1.35;
  max-width: 160px;
  min-height: 33px;
  padding: 5px 8px;
  width: auto;
}

.eco-map__viewport {
  background:
    radial-gradient(ellipse at 12% 86%, rgba(183, 202, 154, 0.26), transparent 45%),
    radial-gradient(ellipse at 90% 11%, rgba(163, 197, 180, 0.25), transparent 42%),
    #e9efe4;
  border-block: 1px solid var(--map-border);
  min-height: var(--eco-map-height, 365px);
  overflow: hidden;
  position: relative;
  user-select: none;
}

.eco-map__viewport[tabindex] { cursor: grab; touch-action: pan-y; }
.eco-map__viewport.eco-map__viewport--dragging { cursor: grabbing; }
.eco-map__viewport:focus-visible { outline: 2px solid #347342; outline-offset: -3px; }

.eco-map__viewport canvas, .eco-map__labels, .eco-map__pins {
  display: block;
  height: 100%;
  inset: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
}

.eco-map__label {
  color: #607464;
  font-size: 0.65rem;
  font-weight: 550;
  left: 50%;
  letter-spacing: 0.035em;
  position: absolute;
  text-shadow: 0 1px 5px #f7fff4, 0 0 4px #f7fff4;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.eco-map__label--primary {
  color: #284a36;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.eco-map__label--water {
  color: #356e68;
  font-size: 0.67rem;
  font-style: italic;
  letter-spacing: 0.04em;
}

.eco-map__pin {
  align-items: center;
  background: #9fe46d;
  border: 2px solid #f8fff2;
  border-radius: 50%;
  box-shadow: 0 1px 5px #1737254a, 0 0 0 1px #326341;
  color: #183a25;
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  height: 19px;
  justify-content: center;
  line-height: 1;
  min-height: 0;
  min-width: 0;
  padding: 0;
  pointer-events: auto;
  position: absolute;
  transform: translate(-50%, -50%);
  transition: background 130ms ease, box-shadow 130ms ease, transform 130ms ease;
  width: 19px;
}

.eco-map__pin::before {
  content: '';
  inset: -5px;
  position: absolute;
}

.eco-map__pin--highlighted { height: 31px; width: 31px; }

.eco-map__pin--hub {
  background: #1a482e;
  border-radius: 9px;
  color: #d8ffb8;
}

.eco-map__pin:hover, .eco-map__pin[aria-pressed='true'], .eco-map__pin:focus-visible {
  background: #c1ff72;
  box-shadow: 0 0 0 5px #36674540, 0 0 0 1px #326341;
  color: #173925;
  transform: translate(-50%, -50%) scale(1.18);
  z-index: 2;
}

.eco-map__pin:disabled { cursor: inherit; }

.eco-map__north {
  align-items: center;
  background: #f9fcf4c9;
  border: 1px solid #ccdccd;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  font-size: 0.65rem;
  font-weight: 750;
  gap: 1px;
  left: 12px;
  padding: 5px 7px 8px;
  position: absolute;
  top: 12px;
}

.eco-map__north i {
  background: #3a6648;
  clip-path: polygon(50% 0, 100% 100%, 50% 74%, 0 100%);
  height: 13px;
  width: 9px;
}

.eco-map__controls {
  background: #fbfdf8;
  border: 1px solid #d0dfcf;
  border-radius: 9px;
  box-shadow: 0 3px 14px #14321a0e;
  display: grid;
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 3;
}

.eco-map__controls button, .eco-map__close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #264837;
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 1.15rem;
  height: 33px;
  justify-content: center;
  line-height: 1;
  min-height: 0;
  min-width: 0;
  padding: 0;
  width: 34px;
}

.eco-map__controls button + button { border-top: 1px solid #e2e9df; }
.eco-map__controls button:first-child { border-radius: 9px 9px 0 0; }
.eco-map__controls button:last-child { border-radius: 0 0 9px 9px; }
.eco-map__controls button:hover:enabled { background: #eef6e6; }
.eco-map__controls button:disabled { color: #a0ada2; cursor: default; }

.eco-map__scale {
  align-items: flex-end;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  font-size: 0.67rem;
  font-weight: 750;
  gap: 2px;
  position: absolute;
  right: 13px;
  text-shadow: 0 0 4px #fcfff8;
}

.eco-map__scale i {
  border: 1px solid #59705c;
  border-top: 0;
  display: block;
  height: 4px;
  width: 46px;
}

.eco-map__detail, .eco-map__empty {
  background: #fafff7;
  border: 1px solid var(--map-border);
  border-radius: 12px;
  bottom: 12px;
  box-shadow: 0 5px 24px #1738241a;
  color: var(--map-ink);
  cursor: default;
  display: grid;
  font-size: 0.74rem;
  gap: 2px;
  left: 12px;
  max-width: min(300px, calc(100% - 108px));
  padding: 9px 33px 9px 11px;
  position: absolute;
}

.eco-map__detail strong { font-size: 0.8rem; }
.eco-map__detail span { color: var(--map-muted); }
.eco-map__detail span:empty { display: none; }
.eco-map__close { height: 28px; position: absolute; right: 2px; top: 2px; width: 28px; }
.eco-map__empty { margin: 0; padding-right: 11px; }

.eco-map__footer {
  color: var(--map-muted);
  font-size: 0.68rem;
  line-height: 1.40;
}

.eco-map__legend { flex-wrap: wrap; gap: 5px 15px; }
.eco-map__legend > span { white-space: nowrap; }

.eco-map__legend i {
  background: #a0dd7a;
  border: 1px solid #58935c;
  border-radius: 50%;
  display: inline-block;
  height: 8px;
  width: 8px;
}

.eco-map__legend i.eco-map__legend-hub { background: #266040; border-radius: 2px; }
.eco-map__legend i.eco-map__legend-route { background: none; border: 0; border-top: 2px dashed #266040; border-radius: 0; height: 0; width: 12px; }
.eco-map__footer a { color: var(--map-muted); text-decoration-thickness: 1px; text-underline-offset: 3px; }

@media (max-width: 550px) {
  .eco-map__top, .eco-map__footer { padding: 10px 11px; }
  .eco-map__filters select { max-width: 140px; }
  .eco-map__viewport { min-height: var(--eco-map-height-mobile, 315px); }
}

@media (prefers-reduced-motion: reduce) {
  .eco-map__pin { transition: none; }
}
