#terrain-topography { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.map-layer-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  padding-inline: 6px 3px;
  min-width: 0;
  max-width: 100%;
}

.map-layer-control {
  min-width: 0;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: .81rem;
  line-height: 1.2;
  color: #d7c7ac;
  text-shadow: inherit;
  pointer-events: auto;
}
.map-layer-control:where([aria-pressed="true"], select:has(option:checked:not([value="off"]))) {
  color: #f2dfba;
}
.map-layer-control:is(:hover, :focus-visible, :open) {
  color: #fff0d4;
}
.map-layer-control:focus-visible { outline-offset: 1px; }
button.map-layer-control[aria-pressed] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-inline-size: 5em;
  white-space: nowrap;
}
button.map-layer-control[aria-pressed="false"] {
  color: #beb49e;
}
button.map-layer-control[aria-pressed="false"]:is(:hover, :focus-visible) {
  color: #fff0d4;
}
button.map-layer-control[aria-pressed]::before {
  content: "";
  width: 5px;
  height: 5px;
  border: 1px solid #c8ab75;
  transform: rotate(45deg);
}
button.map-layer-control[aria-pressed="true"]::before { background: #e3c188; }
.map-layer-select {
  position: relative;
  min-width: 0;
  inline-size: 10.25em;
  font-size: .81rem;
}
.map-layer-select::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 50% 11px auto auto;
  width: 6px;
  height: 6px;
  transform: translateY(-70%) rotate(45deg);
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  color: var(--muted);
  pointer-events: none;
}
.map-layer-select:is(:hover, :focus-within)::after { color: var(--steel-blue-light); }
.map-layer-select > select {
  appearance: none;
  inline-size: 100%;
  block-size: 44px;
  padding-inline-end: 24px;
  color-scheme: dark;
  cursor: pointer;
}
.map-layer-control option {
  color: var(--topography-ink, #f0e1c8);
  background: #25221e;
}
.topography-switch { inline-size: 11.8em; }
.map-layer-select .topography-select { padding-inline-start: 25px; }
.topography-swatch {
  position: absolute;
  inset: 50% auto auto 10px;
  z-index: 1;
  width: 8px;
  height: 8px;
  transform: translateY(-50%);
  border: 1px solid var(--active-topography-ink, #a49982);
  border-radius: 50%;
  background: var(--active-topography-ink, transparent);
  pointer-events: none;
}

@supports (appearance: base-select) {
  .map-layer-select > .topography-select, .topography-select::picker(select) { appearance: base-select; }
  .map-layer-select > .topography-select { display: flex; align-items: center; }
  .topography-select::picker(select) {
    padding: 4px;
    border: 1px solid #766852;
    border-radius: 5px;
    background: #252422;
    box-shadow: 0 3px 10px #17120fb0;
  }
  .topography-select::picker-icon { display: none; }
  .topography-select option {
    gap: 8px;
    min-height: 34px;
    padding: 4px 8px;
    border-radius: 2px;
    color: #f0e1c8;
    background: transparent;
  }
  .topography-select option:is(:hover, :focus-visible) { background: var(--steel-blue-field); }
  .topography-select option::before {
    content: "";
    flex: 0 0 9px;
    height: 9px;
    border: 1px solid var(--topography-ink, #a49982);
    border-radius: 50%;
    background: var(--topography-ink, transparent);
  }
  .topography-select option::checkmark { order: 1; margin-inline-start: auto; color: var(--moss-light); }
}

.topography-status {
  position: absolute;
  inset: calc(100% + 6px) 0 auto auto;
  width: max-content;
  max-width: min(290px, calc(100vw - 25px));
  padding: 8px 11px 7px;
  font-size: .82rem;
  line-height: 1.25;
}
.topography-status .map-key { pointer-events: auto; padding-inline: 4px; margin-top: 4px; }
.local-visit .map-display-filters { display: none; }

@media (max-width: 590px) {
  .map-display-filters { flex-direction: column; align-items: stretch; }
  .map-layer-control { padding-inline: 5px; font-size: .75rem; }
  .map-layer-select { inline-size: 10.4em; font-size: .75rem; }
  .map-layer-select::after { inset-inline-end: 8px; }
  .map-layer-select > select { padding-inline-end: 19px; }
  .map-layer-select .topography-select { padding-inline-start: 21px; }
  .topography-swatch { inset-inline-start: 8px; }
}

@media (pointer: coarse) {
  .topography-select option { min-height: 44px; }
}

.map-viewport.landscape-painting { cursor: crosshair; }
.map-viewport.landscape-painting.dragging { cursor: grabbing; }
.map-viewport.landscape-painting :is(#places, #squads, #developer-locations) * { pointer-events: none; }
.landscape-footprint {
  display: block;
  position: absolute;
  background: color-mix(in srgb, var(--steel-blue) 18%, transparent);
  border: 2px solid var(--steel-blue-light);
  box-shadow: 0 0 0 1px var(--map-outline), inset 0 0 0 1px var(--map-outline);
  pointer-events: none;
}
.landscape-footprint[data-dragging="true"] { border: 0; color: var(--steel-blue-light); }
:is(#developer-footprint, .landscape-footprint[data-dragging="true"])::before,
:is(#developer-footprint, .landscape-footprint[data-dragging="true"])::after {
  content: "";
  position: absolute;
  inset: 0;
  --phase: 0px;
  --stops: currentColor calc(var(--phase) - 2.5px) calc(var(--phase) + 2.5px),
    transparent calc(var(--phase) + 2.5px) calc(var(--phase) - 2.5px + var(--map-edge-period, 12px));
  --horizontal: repeating-linear-gradient(90deg, var(--stops));
  --vertical: repeating-linear-gradient(180deg, var(--stops));
  background: var(--horizontal) top / 100% 2px, var(--horizontal) bottom / 100% 2px,
    var(--vertical) left / 2px 100%, var(--vertical) right / 2px 100%;
  background-repeat: no-repeat;
  pointer-events: none;
}
:is(#developer-footprint, .landscape-footprint[data-dragging="true"])::after {
  --phase: calc(var(--map-edge-period, 12px) / 2);
  opacity: var(--map-edge-detail, 0);
}

.landscape-brush-mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: color-mix(in srgb, var(--steel-blue) 42%, transparent);
  pointer-events: none;
}
