.baywib-service-map {
    /* BayWIB site brand */
    --baywib-navy: #015f9d;
    --baywib-navy-dark: #112337;
    --baywib-bg: #eef4f9;
    --baywib-bg-deep: #e6edf5;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --surface-soft-2: #fbfcfe;
    --border-soft: #dbe3ec;
    --border-quiet: #e8edf3;
    /* Muted district palette — more refined, less GIS-like */
    --pd-northern-neck: #7893bf;
    --pd-middle-peninsula: #8faf79;
    --pd-george-washington: #d7a36e;
    --pd-eastern-shore: #bc6677;
    --gray-context: #e6ebf1;
    --gray-context-stroke: #d5dde6;
    --text-dark: #112337;
    --text-muted: #5c687b;
    --text-soft: #768296;
    --pin-fill: #015f9d;
    --pin-border: #ffffff;
    --pin-glyph: #ffffff;
    --pin-shadow: rgba(17,35,55,0.28);
  }
  .baywib-service-map, .baywib-service-map * { box-sizing: border-box; margin: 0; padding: 0; }
  .map-section,
  .map-section * {
    font-family: 'Poppins', Helvetica, Arial, Lucida, sans-serif;
  }
  .map-section {
    color: var(--text-dark);
    line-height: 1.5;
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 0 20px;
  }
  .region-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 7px 12px;
    border-radius: 999px;
    background: linear-gradient(180deg, #f4f8fc 0%, #edf4fb 100%);
    border: 1px solid var(--border-soft);
    color: var(--baywib-navy);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .region-kicker::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--baywib-navy);
    box-shadow: 0 0 0 4px rgba(1,95,157,0.10);
  }
  .map-section h1 {
    font-size: clamp(2rem, 4.2vw, 3.1rem);
    line-height: 1.06;
    color: var(--baywib-navy);
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: -0.03em;
  }
  .map-section .lede {
    font-size: 1.06rem;
    color: var(--text-muted);
    max-width: 780px;
    margin-bottom: 30px;
  }
  .map-frame {
    background: linear-gradient(180deg, var(--surface-soft-2) 0%, #f4f7fb 100%);
    border: 1px solid var(--border-soft);
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 16px 40px rgba(17,35,55,0.08);
  }
  .legend-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 12px;
  }
  .legend-eyebrow {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--baywib-navy);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .legend-helper {
    font-size: 0.82rem;
    color: var(--text-soft);
    text-align: right;
  }
  .legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    padding: 0;
    background: transparent;
    border-radius: 0;
  }
  .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-dark);
    padding: 8px 10px;
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--border-quiet);
    border-radius: 14px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.85) inset;
  }
  .legend-swatch {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    border: 1px solid rgba(17,35,55,0.12);
    flex: 0 0 16px;
  }
  .legend-item svg { flex: 0 0 auto; }
  .map-cq-wrap {
    container-type: inline-size;
  }
  .map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 22px;
    align-items: start;
  }
  @container (max-width: 920px) {
    .map-layout { grid-template-columns: 1fr; }
    .info-panel {
      position: static;
      min-height: 0;
    }
  }
  .map-container {
    position: relative;
    width: 100%;
    background: linear-gradient(180deg, #eef3f8 0%, #e9eef4 100%);
    border: 1px solid #d4dde6;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), 0 10px 22px rgba(17,35,55,0.07);
  }
  .baywib-map-svg {
    overflow: visible;
    width: 100%;
    height: auto;
    display: block;
    cursor: default;
  }
  .info-panel {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 12px 28px rgba(17,35,55,0.08);
    min-height: 200px;
    position: sticky;
    top: 20px;
    overflow: hidden;
  }
  .info-panel::before {
    content: '';
    display: block;
    height: 4px;
    width: calc(100% + 48px);
    margin: -24px -24px 18px;
    background: linear-gradient(90deg, var(--baywib-navy) 0%, #5f89bf 100%);
  }
  .info-panel-empty {
    color: var(--text-muted);
    font-size: 0.94rem;
    text-align: center;
    padding: 28px 12px 20px;
    line-height: 1.65;
  }
  .info-panel-empty-icon {
    width: 38px;
    height: 38px;
    margin: 0 auto 14px;
    display: block;
    opacity: 0.75;
  }
  .va-context {
    fill: var(--gray-context);
    stroke: rgba(255,255,255,0.75);
    stroke-width: 0.55;
    pointer-events: none;
  }
  .baywib-county {
    stroke: rgba(17,35,55,0.55);
    stroke-width: 1.1;
    cursor: pointer;
    filter: none;
    transition: filter 0.16s ease, stroke-width 0.16s ease, opacity 0.16s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }
  .baywib-county:focus,
  .baywib-county:focus-visible { outline: none; }
  .baywib-county:hover,
  .baywib-county.active,
  .baywib-county:focus-visible {
    filter: saturate(1.15) brightness(1.03) drop-shadow(0 7px 12px rgba(17,35,55,0.18));
    stroke: rgba(17,35,55,0.35);
    stroke-width: 2.25;
  }
  .baywib-county.pd-northern-neck:hover,
  .baywib-county.pd-northern-neck.active,
  .baywib-county.pd-northern-neck:focus-visible {
    stroke: #2f4978;
  }
  .baywib-county.pd-middle-peninsula:hover,
  .baywib-county.pd-middle-peninsula.active,
  .baywib-county.pd-middle-peninsula:focus-visible {
    stroke: #4d713c;
  }
  .baywib-county.pd-george-washington:hover,
  .baywib-county.pd-george-washington.active,
  .baywib-county.pd-george-washington:focus-visible {
    stroke: #955a27;
  }
  .baywib-county.pd-eastern-shore:hover,
  .baywib-county.pd-eastern-shore.active,
  .baywib-county.pd-eastern-shore:focus-visible {
    stroke: #7c2f40;
  }
  .center-pin {
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }
  .center-pin-shadow,
  .center-pin-pointer,
  .center-pin-circle,
  .center-pin-glyph {
    pointer-events: none;
  }
  .center-pin-hit {
    fill: transparent;
    cursor: pointer;
  }
  .center-pin-shadow {
    fill: var(--pin-shadow);
    opacity: 0.32;
  }
  .center-pin-pointer,
  .center-pin-circle {
    fill: var(--pin-fill);
  }
  .center-pin-circle {
    stroke: var(--pin-border);
    stroke-width: 2.2;
  }
  .center-pin-glyph {
    fill: var(--pin-glyph);
  }
  .center-pin-art {
    transition: transform 0.16s ease, filter 0.16s ease;
    transform-origin: 13px 28px;
    transform-box: fill-box;
  }
  .center-pin:hover .center-pin-art,
  .center-pin.active .center-pin-art,
  .center-pin:focus-visible .center-pin-art {
    transform: scale(1.15);
    filter: drop-shadow(0 4px 8px rgba(17,35,55,0.26));
  }
  .county-label {
    fill: #ffffff;
    font-size: 8.6px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-anchor: middle;
    pointer-events: none;
    paint-order: stroke fill;
    stroke: rgba(17,35,55,0.28);
    stroke-width: 0.7;
    stroke-linejoin: round;
  }
  .county-label-sm {
    font-size: 7.2px;
    paint-order: stroke fill;
    stroke: rgba(17,35,55,0.36);
    stroke-width: 1.0;
  }
  .county-label-clickable {
    cursor: pointer;
    pointer-events: auto;
  }
  .county-label-leader {
    stroke: rgba(255,255,255,0.85);
    stroke-width: 0.7;
    fill: none;
    pointer-events: none;
  }
  .tooltip { font-size: 0.92rem; }
  .tooltip-header {
    border-bottom: 1px solid var(--border-quiet);
    padding-bottom: 12px;
    margin-bottom: 14px;
  }
  .tooltip-county {
    font-size: 1.28rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--baywib-navy-dark);
    margin-bottom: 10px;
  }
  .tooltip-district {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef4fb;
    border: 1px solid #d7e4f1;
    font-size: 0.75rem;
    color: var(--baywib-navy);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
  }
  .tooltip-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border-quiet);
    border-radius: 12px;
    background: #f8fafc;
  }
  .tooltip-stat:last-of-type { margin-bottom: 0; }
  .tooltip-label {
    color: var(--text-muted);
    font-weight: 600;
  }
  .tooltip-value {
    color: var(--text-dark);
    font-weight: 700;
    text-align: right;
  }
  .tooltip-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-quiet);
  }
  .tooltip-section-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--baywib-navy);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
  }
  .tooltip-section-content {
    font-size: 0.92rem;
    color: var(--text-dark);
    line-height: 1.5;
  }
  .tooltip-office {
    font-size: 0.88rem;
    color: var(--text-dark);
  }
  .tooltip-office strong {
    display: block;
    color: var(--baywib-navy);
    margin-bottom: 3px;
  }
  .placeholder-note {
    background: #fff5ed;
    border: 1px solid #f2d5bb;
    border-left: 4px solid var(--pd-george-washington);
    padding: 10px 12px;
    margin-top: 12px;
    font-size: 0.8rem;
    color: #7a4a1f;
    border-radius: 10px;
  }
  .tooltip-pin-header {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(180deg, #f4f8fc 0%, #ebf3fb 100%);
    margin: -24px -24px 16px -24px;
    padding: 14px 24px;
    border-bottom: 1px solid #d7e4f1;
  }
  .tooltip-pin-icon {
    width: 18px;
    height: 22px;
    flex-shrink: 0;
  }
  .tooltip-pin-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--baywib-navy);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .directions-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 9px 14px;
    background: var(--baywib-navy);
    color: #fff !important;
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
    pointer-events: auto;
    box-shadow: 0 8px 18px rgba(1,95,157,0.18);
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
  }
  .directions-link:hover {
    background: var(--baywib-navy-dark);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(17,35,55,0.18);
  }
  @media (max-width: 900px) {
    .map-layout { grid-template-columns: 1fr; }
    .info-panel { position: static; min-height: 0; }
    .legend-header { flex-direction: column; align-items: flex-start; }
    .legend-helper { text-align: left; }
  }
  @media (max-width: 720px) {
    .map-section { padding-top: 18px; }
    .map-frame { padding: 16px; border-radius: 18px; }
    .legend-item { font-size: 0.86rem; padding: 9px 10px; }
    .info-panel, .map-container { border-radius: 18px; }
    .tooltip-county { font-size: 1.16rem; }
  }
  .footnote {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8ef;
    font-size: 0.82rem;
    color: var(--text-soft);
  }
  .footnote a { color: var(--baywib-navy); }
  /* Keep the surrounding Virginia context quiet while district gradients remain visible. */
  .baywib-map-svg .va-context { fill: #e6ebf1 !important; stroke: rgba(255,255,255,0.9) !important; }
  @media (max-width: 720px) {
    .region-kicker {
      font-size: 0.68rem;
      padding: 6px 10px;
    }
    .map-frame {
      padding: 14px;
    }
    .map-container {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
    .baywib-map-svg {
      min-width: 760px;
      max-width: none;
    }
    .legend-header {
      margin-bottom: 8px;
      gap: 4px;
    }
    .legend-eyebrow {
      font-size: 0.7rem;
    }
    .legend-helper {
      font-size: 0.74rem;
      line-height: 1.35;
    }
    .legend {
      display: grid;
      grid-template-columns: 1fr;
      gap: 7px;
      margin-bottom: 14px;
    }
    .legend-item {
      width: fit-content;
      max-width: 100%;
      font-size: 0.78rem;
      line-height: 1.15;
      padding: 7px 9px;
      border-radius: 11px;
    }
    .legend-swatch {
      width: 13px;
      height: 13px;
      border-radius: 4px;
      flex-basis: 13px;
    }
    .tooltip-district {
      font-size: 0.66rem;
      line-height: 1.35;
      padding: 7px 10px;
      border-radius: 16px;
      letter-spacing: 0.05em;
    }
    .tooltip-stat {
      display: grid;
      grid-template-columns: minmax(105px, 40%) minmax(0, 1fr);
      align-items: center;
      padding: 8px 10px;
      border-radius: 10px;
    }
    .tooltip-value {
      min-width: 0;
      overflow-wrap: normal;
    }
  }

.baywib-service-map--teaser,
.baywib-service-map--map-only {
  padding: 0;
}

.baywib-service-map--teaser .map-frame,
.baywib-service-map--map-only .map-frame {
  padding: 0;
}

.baywib-service-map--teaser .map-layout,
.baywib-service-map--map-only .map-layout {
  display: block;
}

.baywib-service-map--teaser .map-container,
.baywib-service-map--map-only .map-container {
  width: 100%;
}

.baywib-service-map--linked .map-container {
  cursor: pointer;
}

.baywib-service-map--linked .baywib-county,
.baywib-service-map--linked .center-pin {
  cursor: pointer;
}
