:root {
  --gid-ink: #091b36;
  --gid-muted: #526176;
  --gid-blue: #0d6efd;
  --gid-blue-dark: #0757cd;
  --gid-tint: #f2f7ff;
  --gid-border: #dce6f7;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--gid-ink);
}

.map-embed {
  box-sizing: border-box;
  padding: 8px 5px 0;
}
.district-controls {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 18px;
  margin-bottom: 10px;
  padding: 10px 12px 10px 16px;
  border-radius: 20px;
  background: var(--gid-tint);
}
.district-label {
  font-size: 14px;
  font-weight: 700;
}
.district-field {
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 520px;
  justify-self: end;
}
.district-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 8px 14px;
  border: 1px solid var(--gid-border);
  border-radius: 14px;
  background: #fff;
  color: var(--gid-ink);
  font: 600 15px/1.3 Inter, system-ui, -apple-system, sans-serif;
  text-align: left;
  cursor: pointer;
}
.district-trigger:disabled {
  color: var(--gid-muted);
  cursor: default;
}
.district-trigger:not(:disabled):hover,
.district-trigger[aria-expanded="true"] {
  border-color: var(--gid-blue);
}
.district-trigger:focus-visible,
.district-search:focus-within {
  outline: 2px solid var(--gid-blue);
  outline-offset: 2px;
}
.district-chevron {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin: -3px 3px 0 0;
  border: solid var(--gid-muted);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.district-trigger[aria-expanded="true"] .district-chevron {
  margin-top: 3px;
  transform: rotate(225deg);
}
.district-panel {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: min(405px, calc(100dvh - 117px));
  padding: 10px;
  border: 1px solid var(--gid-border);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 30px #091b3629;
}
.district-search {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--gid-border);
  border-radius: 13px;
  background: var(--gid-tint);
  color: var(--gid-muted);
}
.district-search input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--gid-ink);
  font: inherit;
}
.district-search input::placeholder {
  color: var(--gid-muted);
  opacity: 1;
}
.district-search-icon {
  position: relative;
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  margin: 0 3px 3px 0;
  border: 1.7px solid currentColor;
  border-radius: 50%;
}
.district-search-icon::after {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 5px;
  height: 1.7px;
  border-radius: 1px;
  background: currentColor;
  content: "";
  transform: rotate(45deg);
  transform-origin: left;
}
.district-options {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.district-group-title {
  margin: 9px 10px 3px;
  color: var(--gid-muted);
  font-size: 12px;
  font-weight: 700;
}
.district-option {
  position: relative;
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 34px 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--gid-ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.district-option:hover,
.district-option.is-active {
  background: var(--gid-tint);
}
.district-option[aria-selected="true"] {
  background: #e7f0ff;
  color: var(--gid-blue-dark);
  font-weight: 700;
}
.district-option[aria-selected="true"]::after {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 8px;
  height: 5px;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  content: "";
  transform: translateY(-65%) rotate(-45deg);
}
.district-empty {
  margin: 2px 8px 9px;
  color: var(--gid-muted);
  font-size: 14px;
}

.map-shell {
  isolation: isolate;
  min-height: 245px;
  height: clamp(245px, calc(100dvh - 182px), 520px);
}
.map-embed:has(#projects:empty) .map-shell {
  height: clamp(245px, calc(100dvh - 128px), 570px);
}
.map-shell .maplibregl-ctrl-group {
  overflow: hidden;
  border: 1px solid var(--gid-border);
  border-radius: 13px;
  box-shadow: 0 2px 8px #091b3614;
}
.map-shell .maplibregl-ctrl-group button {
  width: 36px;
  height: 36px;
}
.map-shell .maplibregl-ctrl-group button + button {
  border-top-color: var(--gid-border);
}
.map-shell .maplibregl-ctrl-group button:focus-visible {
  outline-offset: -3px;
}
.district-results p {
  margin: 9px 0 4px;
  color: var(--gid-muted);
  font-size: 14px;
  line-height: 1.4;
}
.district-results .places {
  flex-wrap: nowrap;
  overflow-x: auto;
  margin: 0;
  padding: 3px 3px 8px;
  list-style: none;
  scrollbar-width: thin;
}
.district-results .places .project-link {
  max-width: 215px;
  border-radius: 999px;
  color: var(--gid-blue-dark);
  font-weight: 600;
}
.district-results ul:empty {
  display: none;
}
.map-popup a {
  display: inline-block;
  padding: 3px 0;
}
@media (max-width: 530px) {
  .map-embed {
    padding-inline: 3px;
  }
  .district-controls {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    padding: 10px;
  }
  .district-label {
    padding-left: 3px;
    font-size: 13px;
  }
  .district-field {
    max-width: none;
  }
  .district-trigger {
    padding-inline: 10px;
    font-size: 14px;
  }
  .district-panel {
    max-height: min(355px, calc(100dvh - 125px));
  }
  .map-shell {
    height: clamp(245px, calc(100dvh - 202px), 480px);
  }
  .map-shell .maplibregl-ctrl-group button {
    width: 44px;
    height: 44px;
  }
  .map-embed:has(#projects:empty) .map-shell {
    height: clamp(245px, calc(100dvh - 142px), 530px);
  }
}
