.blog-map {
  width: 100%;
  height: 500px;
}

.broadband-map-layout {
  display: grid;
  gap: 0;
  border: 1px solid rgba(222, 228, 234, 0.95);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 6px 18px rgba(36, 51, 66, 0.08);
}

.broadband-map-layout .blog-map {
  min-width: 0;
}

.broadband-map-panel {
  border-top: 1px solid rgba(222, 228, 234, 0.95);
  padding: 0;
  color: #34424f;
}

.broadband-map-panel-section + .broadband-map-panel-section {
  margin-top: 18px;
}

.broadband-map-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.broadband-map-widget {
  padding: 18px 18px 20px;
}

.broadband-map-widget + .broadband-map-widget {
  border-left: 1px solid rgba(222, 228, 234, 0.95);
}

.broadband-map-widget-top {
  margin-bottom: 18px;
}

.broadband-map-style-toggle {
  border: 1px solid #c6d0d8;
  border-radius: 999px;
  background: #ffffff;
  color: #6f7b86;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}

.broadband-map-style-toggle:hover {
  border-color: #aeb8c0;
  color: #4f5b66;
  background: #f8fafb;
}

.broadband-map-style-toggle-active {
  border-color: #9fb3c4;
  color: #34424f;
  background: #eef4f8;
}

.broadband-map-style-toggle-active:hover {
  border-color: #8fa4b6;
  color: #243342;
  background: #e4edf4;
}

.broadband-map-filter-stack {
  display: grid;
  gap: 18px;
}

.broadband-map-filter-header {
  margin-bottom: 10px;
}

.broadband-map-filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.broadband-map-filter-label {
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8d98a1;
}

.broadband-map-filter-style-toggle {
  flex: 0 0 auto;
}

.broadband-map-slider {
  margin: 0 6px 0 2px;
}

.broadband-map-filter-scale {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.broadband-map-filter-scale-value {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
  color: #5d6a76;
}

.broadband-map-filter-scale-value-max {
  text-align: right;
}

.broadband-map-count {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #5d6a76;
}

.broadband-map-panel-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-top: 1px solid rgba(222, 228, 234, 0.95);
  padding: 16px 18px 18px;
}

.broadband-map-reset {
  border: 1px solid #c6d0d8;
  border-radius: 8px;
  background: #ffffff;
  color: #34424f;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  cursor: pointer;
}

.broadband-map-reset:hover {
  background: #f6f8fa;
}

.broadband-map-panel .noUi-target {
  border: 0;
  box-shadow: none;
  background: #dfe5ea;
  height: 6px;
}

.broadband-map-panel .noUi-connect {
  background: #2f80ed;
}

.broadband-map-widget-tracts .noUi-connect {
  background: #9AC89F;
}

.broadband-map-widget-fcc .noUi-connect {
  background: #8FD2DB;
}

.broadband-map-panel .noUi-horizontal .noUi-handle {
  width: 18px;
  height: 18px;
  right: -9px;
  top: -6px;
  border-radius: 50%;
  border: 2px solid #2f80ed;
  box-shadow: none;
}

.broadband-map-panel .noUi-handle::before,
.broadband-map-panel .noUi-handle::after {
  display: none;
}

.broadband-map-panel .noUi-tooltip {
  bottom: 160%;
  border: 0;
  border-radius: 6px;
  background: #34424f;
  color: #ffffff;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  padding: 5px 7px;
}

.map-legend {
  max-width: 240px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(36, 51, 66, 0.16);
  padding: 11px 12px 13px;
  color: #34424f;
}

.map-legend-title {
  margin: 0 0 11px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
}

.map-legend-subtitle {
  margin: 0 0 5px;
  font-size: 8px;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8d98a1;
}

.map-legend-scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
  font-size: 10px;
  line-height: 1.2;
}

.map-legend-gradient {
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(183, 166, 87, 0.55);
  background-image: var(--legend-gradient);
}

.map-legend-swatches {
  display: grid;
  gap: 10px;
}

.map-legend-toggle {
  display: grid;
  gap: 8px;
}

.map-legend-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.map-legend-toggle-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.map-legend-toggle-box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid #c6d0d8;
  background: #ffffff;
  position: relative;
  flex: 0 0 auto;
}

.map-legend-toggle-input:checked + .map-legend-toggle-heading .map-legend-toggle-box {
  background: #2f80ed;
  border-color: #2f80ed;
}

.map-legend-toggle-input:checked + .map-legend-toggle-heading .map-legend-toggle-box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.map-legend-toggle-title {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
}

.map-legend-swatch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  line-height: 1.2;
}

.map-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(52, 66, 79, 0.24);
  flex: 0 0 auto;
}

.maplibregl-popup {
  overflow: visible;
}

.maplibregl-popup-content {
  position: relative;
  overflow: visible;
  padding: 20px 22px;
}

.maplibregl-popup-close-button {
  top: -20px;
  right: -20px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #2f80ed;
  font-size: 32px;
  line-height: 1;
  font-weight: 300;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(36, 51, 66, 0.18);
  cursor: pointer;
}

.maplibregl-popup-close-button:hover {
  background: #f8fafb;
  color: #256fd0;
}

.maplibregl-popup-close-button:focus-visible {
  outline: 2px solid #2f80ed;
  outline-offset: 2px;
}

.map-popup {
  min-width: 180px;
  color: #34424f;
}

.map-popup-shell .maplibregl-popup-content {
  width: 320px;
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(141, 152, 161, 0.85) transparent;
}

.map-popup-shell .maplibregl-popup-content::-webkit-scrollbar {
  width: 8px;
}

.map-popup-shell .maplibregl-popup-content::-webkit-scrollbar-track {
  background: transparent;
}

.map-popup-shell .maplibregl-popup-content::-webkit-scrollbar-thumb {
  background: rgba(141, 152, 161, 0.85);
  border-radius: 999px;
}

.map-popup-row + .map-popup-row {
  margin-top: 18px;
}

.map-popup-label {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8d98a1;
}

.map-popup-value {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
}

@media (max-width: 767px) {
  .broadband-map-layout {
    gap: 0;
  }

  .broadband-map-panel {
    flex-basis: auto;
  }

  .broadband-map-panel-grid {
    grid-template-columns: 1fr;
  }

  .broadband-map-widget {
    padding: 16px;
  }

  .broadband-map-widget + .broadband-map-widget {
    border-left: 0;
    border-top: 1px solid rgba(222, 228, 234, 0.95);
  }

  .broadband-map-panel-actions {
    display: grid;
    gap: 12px;
    padding: 16px;
  }

  .broadband-map-filter-header {
    margin-bottom: 10px;
  }

  .map-legend {
    max-width: min(220px, calc(100vw - 64px));
    padding: 10px 10px 12px;
  }

  .map-legend-title {
    margin-bottom: 10px;
    font-size: 13px;
  }

  .map-legend-subtitle {
    font-size: 8px;
  }

  .map-legend-scale-labels {
    margin-bottom: 8px;
    font-size: 9px;
  }

  .map-legend-swatch-row {
    font-size: 10px;
  }

  .map-legend-toggle-title {
    font-size: 11px;
  }

  .map-popup {
    min-width: 150px;
  }

  .maplibregl-popup-close-button {
    top: -16px;
    right: -16px;
    width: 38px;
    height: 38px;
    font-size: 28px;
  }

  .map-popup-shell .maplibregl-popup-content {
    width: min(280px, calc(100vw - 96px));
    max-height: 320px;
    padding-right: 8px;
  }

  .map-popup-value {
    font-size: 16px;
  }
}
