.map-legend {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    padding: 8px 10px;
    color: #222;
    min-width: 180px;
}

.map-legend-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.map-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
}

.map-legend-icon {
    width: 16px;
    display: flex;
    justify-content: center;
}

.map-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.map-legend-gradient {
    width: 80px;
    height: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.map-legend-label {
    flex: 1;
}

.map-legend-container {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 1000;
    pointer-events: auto;
}

.map-legend-toggle {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 600;
    color: #222;
    font-size: 12px;
}

.map-legend {
    display: none;
    margin-top: 6px;
}

.map-legend-container:hover .map-legend,
.map-legend-container:focus-within .map-legend {
    display: block;
}

.map-legend-container:hover .map-legend-toggle,
.map-legend-container:focus-within .map-legend-toggle {
    display: none;
}
