.twp-us-map {
    --twp-map-max-width: 980px;
    --twp-map-border: #fff;
    --twp-map-inactive: #e9edf2;
    --twp-map-hover: #fdbf3f;
    --twp-map-label: #fff;
    box-sizing: border-box;
    margin-inline: auto;
    max-width: var(--twp-map-max-width);
    position: relative;
    width: 100%;
}

.twp-us-map *,
.twp-us-map *::before,
.twp-us-map *::after {
    box-sizing: border-box;
}

.twp-us-map__svg {
    display: block;
    height: auto;
    overflow: visible;
    width: 100%;
}

.twp-us-map__state-path {
    fill: var(--twp-state-fill, var(--twp-map-inactive));
    stroke: var(--twp-map-border);
    stroke-linejoin: round;
    stroke-width: 1.5;
    transition: fill 150ms ease, filter 150ms ease, stroke-width 150ms ease;
    vector-effect: non-scaling-stroke;
}

.twp-us-map__state.is-active .twp-us-map__state-path {
    cursor: pointer;
}

.twp-us-map__state.is-active:hover .twp-us-map__state-path,
.twp-us-map__state.is-active.is-focused .twp-us-map__state-path {
    fill: var(--twp-map-hover);
    filter: drop-shadow(0 2px 2px rgb(1 16 64 / 22%));
    stroke-width: 2.5;
}

.twp-us-map__state-path:focus {
    outline: none;
}

.twp-us-map__state-label {
    dominant-baseline: central;
    fill: var(--twp-map-label);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    pointer-events: none;
    text-anchor: middle;
    text-shadow: 0 1px 1px rgb(0 0 0 / 30%);
}

.twp-us-map__tooltip {
    background: #fff;
    border: 1px solid #d8dee8;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgb(1 16 64 / 18%);
    color: #011040;
    font-size: 15px;
    font-weight: 700;
    left: 0;
    line-height: 1.25;
    max-width: 220px;
    padding: 8px 11px;
    pointer-events: none;
    position: absolute;
    top: 0;
    transform: translate(12px, calc(-100% - 12px));
    z-index: 3;
}

.twp-us-map__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    justify-content: center;
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
}

.twp-us-map__legend a {
    align-items: center;
    color: #011040;
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    gap: 7px;
    text-decoration: none;
}

.twp-us-map__legend a:hover,
.twp-us-map__legend a:focus-visible {
    text-decoration: underline;
}

.twp-us-map__swatch {
    background: var(--twp-region-color);
    border: 1px solid rgb(1 16 64 / 12%);
    border-radius: 50%;
    display: inline-block;
    height: 12px;
    width: 12px;
}

.twp-us-map__mobile-control {
    display: none;
    margin-top: 16px;
}

.twp-us-map__mobile-control label {
    color: #011040;
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}

.twp-us-map__mobile-control select {
    background: #fff;
    border: 1px solid #aab4c3;
    border-radius: 4px;
    color: #011040;
    min-height: 44px;
    padding: 8px 36px 8px 12px;
    width: 100%;
}

@media (max-width: 640px) {
    .twp-us-map__mobile-control {
        display: block;
    }

    .twp-us-map__state-label {
        display: none;
    }

    .twp-us-map__legend {
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .twp-us-map__state-path {
        transition: none;
    }
}
