    .lso-district-map-wrapper {
    position: relative;
    width: 100%;
    height: var(--lso-district-map-height, 90vh);
    min-height: 700px;
    overflow: hidden;

    --lso-map-panel-bg: var(--wp--preset--color--base, #ffffff);
    --lso-map-panel-text: var(--wp--preset--color--contrast, #111111);
    --lso-map-panel-border: var(--wp--preset--color--tertiary, #dcdcdc);
    --lso-map-accent: #0b5190; /* Improved contrast from #0f6cbf */
    --lso-map-muted: #595959; /* Improved contrast from #666666 */
    --lso-map-card-bg: var(--wp--preset--color--base, #ffffff);
    --lso-map-card-border: var(--wp--preset--color--tertiary, #dcdcdc);
}

#lso-district-map {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 25%;
    right: 25%;
    z-index: 1;
}

.lso-district-map-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 25%;
    overflow-y: auto;
    box-sizing: border-box;
    background: var(--lso-map-panel-bg);
    color: var(--lso-map-panel-text);
    padding: var(--wp--preset--spacing--40, 1.25rem);
    font-family: inherit;
}

.lso-district-map-panel-left {
    left: 0;
    border-right: 1px solid var(--lso-map-panel-border);
}

.lso-district-map-panel-right {
    right: 0;
    border-left: 1px solid var(--lso-map-panel-border);
}

.lso-district-map-panel-title {
    text-align: center;
    margin-top: 0;
    color: inherit;
    font-family: inherit;
}

.lso-district-map-panel-title:focus {
    outline: 2px solid #005fcc;
    outline-offset: 4px;
}

.lso-district-map-district-indicator {
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--lso-map-accent);
    margin-bottom: 1rem;
}

.lso-district-map-section {
    border: 1px solid var(--lso-map-card-border);
    border-radius: var(--wp--custom--border--radius, 8px);
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--lso-map-card-bg);
    color: inherit;
    overflow: auto;
}

.lso-district-map-start-message,
.lso-district-map-attribute-tag {
    font-weight: 700;
    color: var(--lso-map-accent);
}

.lso-district-map-attribute-tag {
    display: inline-block;
    margin-bottom: 0.75rem;
}

    .lso-district-map-profile-img {
        flex: 0 0 80px;
        width: 80px;
        height: auto;
        align-self: flex-start;
    }

    .lso-district-map-legislator-summary {
        display: flex;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 0.75rem;
    }

    .lso-district-map-legislator-name-line {
        white-space: wrap;
        overflow: hidden;
        font-size: 0.95rem;
    }

    .lso-district-map-legislator-party {
        color: var(--lso-map-muted);
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .lso-district-map-legislator-details {
        min-width: 0;
        line-height: 1.5;
        font-size: 0.95rem;
    }

    .lso-district-map-legislator-contact {
        clear: both;
        line-height: 1.5;
        font-size: 0.95rem;
    }

    .lso-district-map-profile-img-placeholder {
        flex: 0 0 80px;
        width: 80px;
        min-height: 1px;
    }

.lso-district-map-muted {
    color: var(--lso-map-muted);
    font-size: 0.9em;
}

.lso-district-map-small-text {
    font-size: 0.85em;
    margin-bottom: 0.5rem;
}

.lso-district-map-line-height {
    line-height: 1.8;
}

.lso-district-map-metric-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9em;
    margin-bottom: 0.5rem;
}

.lso-district-map-bar-track {
    background: color-mix(in srgb, var(--lso-map-panel-text) 15%, transparent);
    border-radius: 999px;
    width: 100%;
    height: 12px;
    position: relative;
    margin-bottom: 0.75rem;
}

.lso-district-map-bar-fill {
    height: 12px;
    border-radius: 999px;
}

.lso-district-map-bar-marker {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: var(--lso-map-panel-text);
}

.lso-district-map-stacked-bar {
    display: flex;
    width: 100%;
    height: 15px;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

    .lso-district-map-stacked-bar div {
        border-right: 1px solid #ffffff;
    }
    .lso-district-map-stacked-bar div:last-child {
        border-right: none;
    }

.lso-district-map-floating-legend {
    position: absolute;
    left: 20px;
    bottom: 20px;
    z-index: 1001;
    display: none;
    padding: 0.5rem 0.65rem;
    background: var(--lso-map-panel-bg);
    color: var(--lso-map-panel-text);
    border: 1px solid var(--lso-map-panel-border);
    border-radius: var(--wp--custom--border--radius, 6px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.14);
    font-size: 0.9rem;
    line-height: 1.4;
    max-width: 220px;
    pointer-events: auto;
}

.lso-district-map-floating-legend h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 700;
}

.lso-district-map-floating-legend ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lso-district-map-legend-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 2px solid white;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
    color: white;
    font-size: 12px;
    font-weight: bold;
    font-family: sans-serif;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.lso-district-map-legend-dot.higher-ed { background: #2574a9; } /* #2980b9 -> #2574a9 */
.lso-district-map-legend-dot.hospital { background: #962d22; } /* #c0392b -> #962d22 */
.lso-district-map-legend-dot.fire { background: #b74800; } /* #e67e22 -> #d35400  -> #b74800 */
.lso-district-map-legend-dot.police { background: #2c3e50; } /* #34495e -> #2c3e50 */
.lso-district-map-legend-dot.courthouse { background: #666666; } /* #7f8c8d -> #666666 */

.lso-district-map-infrastructure-list {
    margin: 0.5rem 0 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.9em;
}

.lso-district-map-infrastructure-list li {
    margin-bottom: 0.35rem;
}

.lso-district-map-dot {
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    font-family: sans-serif;
}

.lso-district-map-watermark {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background-color: rgba(192, 57, 43, 0.9);
    color: white;
    padding: 8px 24px;
    font-size: 1.2em;
    font-weight: bold;
    letter-spacing: 2px;
    border: 2px solid white;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
    pointer-events: none;
}


path.leaflet-interactive {
    transition: fill 0.3s ease, stroke 0.3s ease, fill-opacity 0.3s ease;
}

    .lso-district-map-lift {
        /* Ensure selected district sits above all others */
        z-index: 1000 !important;
        transition: stroke 0.3s ease;
    }

    /* Apply to the path element specifically */
    path.leaflet-interactive.lso-district-map-lift {
        stroke-opacity: 1 !important;
        /* This prevents the border from changing thickness when zooming in/out */
        vector-effect: non-scaling-stroke !important;
    }

    @media (max-width: 900px) {
        .lso-district-map-wrapper {
            min-height: 100vh;
        }

        .lso-district-map-panel {
            width: 100%;
            height: 35%;
            bottom: auto;
        }

        .lso-district-map-panel-left {
            top: 0;
            left: 0;
            right: 0;
            border-right: none;
            border-bottom: 1px solid var(--lso-map-panel-border);
        }

        .lso-district-map-panel-right {
            top: auto;
            bottom: 0;
            left: 0;
            right: 0;
            border-left: none;
            border-top: 1px solid var(--lso-map-panel-border);
        }

        #lso-district-map {
            top: 35%;
            bottom: 35%;
            left: 0;
            right: 0;
        }

        .lso-district-map-floating-legend {
            left: 10px;
            bottom: 36%;
        }
    }

.lso-district-map-segment-legend {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.85em;
}

.lso-district-map-segment-legend-item {
    display: grid;
    grid-template-columns: 14px 1fr auto auto;
    align-items: center;
    gap: 0.5rem;
}

.lso-district-map-segment-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 1px solid currentColor;
}

.lso-district-map-segment-label {
    min-width: 0;
}

.lso-district-map-segment-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.lso-district-map-segment-comparison {
    color: var(--lso-map-muted);
    font-size: 0.9em;
    white-space: nowrap;
}

.lso-district-map-district-label {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #111;
    font-size: 1rem;
    font-weight: 700;
    text-shadow:
            0 1px 2px #fff,
            1px 0 2px #fff,
            0 -1px 2px #fff,
            -1px 0 2px #fff;
    pointer-events: none;
}

.lso-district-map-district-label::before {
    display: none;
}

.screen-reader-text,
.lso-district-map-screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.lso-district-map-skip-link {
    background: #005fcc;
    color: white;
    padding: 10px 20px;
    z-index: 10002;
    top: 10px;
    left: 10px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
}

.lso-district-map-skip-link:focus {
    clip: auto !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
}

.lso-district-map-selector {
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    border: 1px solid var(--lso-map-panel-border);
    background: var(--lso-map-card-bg);
    color: var(--lso-map-panel-text);
    font-size: 1rem;
}

.lso-district-map-wrapper a:focus,
.lso-district-map-wrapper button:focus,
.lso-district-map-wrapper select:focus {
    outline: 3px solid #005fcc;
    outline-offset: 3px;
}

    .lso-district-map-wrapper .leaflet-marker-icon:focus,
    .lso-district-map-wrapper .leaflet-interactive:focus {
        outline: 3px solid #005fcc;
        outline-offset: 4px;
    }

    .lso-district-map-point-list-button {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        padding: 0.35rem;
        border: 1px solid transparent;
        border-radius: var(--wp--custom--border--radius, 4px);
        background: transparent;
        color: inherit;
        font: inherit;
        text-align: left;
        cursor: pointer;
    }

    .lso-district-map-point-list-button .lso-district-map-legend-dot {
        flex: 0 0 24px;
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        margin-right: 0;
    }

    .lso-district-map-point-list-button:hover {
        border-color: var(--lso-map-panel-border);
        background: color-mix(in srgb, var(--lso-map-panel-text) 6%, transparent);
    }

    .lso-district-map-point-list-button:focus {
        outline: 3px solid #005fcc;
        outline-offset: 3px;
    }

    @media (prefers-reduced-motion: reduce) {
        path.leaflet-interactive,
        .lso-district-map-lift {
            transition: none !important;
        }

        .leaflet-zoom-animated {
            transition: none !important;
        }
    }

    .lso-district-map-button{
        background-color: var(--lso-map-accent);
        color:#ffffff;
        border: none;
        margin-top: 8px;
        padding: 0.25rem 0.5rem;
        cursor: pointer;
        font-size: .85rem;
        transition: background-color 0.3s ease;
    }