* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#map {
    width: 100%;
    height: 100%;
    height: 100dvh;
}

#legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    font-size: 13px;
    backdrop-filter: blur(4px);
    max-width: 200px;
}

#legend h3 {
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}

.dot.birth {
    background: #E8683A;
}

.dot.living {
    background: #9B2D8E;
}

#counter {
    margin-top: 6px;
    font-weight: 600;
    color: #555;
    font-size: 12px;
}

.user-tooltip {
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.leaflet-popup-content {
    font-size: 13px;
    line-height: 1.5;
}

.leaflet-popup-content b {
    font-size: 14px;
}

/* Мобильные стили */
@media (max-width: 768px) {
    #legend {
        bottom: 10px;
        left: 10px;
        padding: 8px 10px;
        font-size: 12px;
        max-width: 170px;
        border-radius: 6px;
    }

    #legend h3 {
        font-size: 12px;
        margin-bottom: 4px;
    }

    #counter {
        font-size: 11px;
        margin-top: 4px;
    }

    .dot {
        width: 8px;
        height: 8px;
        margin-right: 4px;
    }

    .user-tooltip {
        font-size: 11px;
        padding: 3px 6px;
    }

    .leaflet-popup-content {
        font-size: 12px;
    }

    .leaflet-popup-content b {
        font-size: 13px;
    }

    .leaflet-control-zoom {
        margin-top: 80px !important;
    }
}

@media (max-width: 400px) {
    #legend {
        bottom: 8px;
        left: 8px;
        padding: 6px 8px;
        font-size: 11px;
        max-width: 150px;
    }

    #legend h3 {
        font-size: 11px;
    }

    .dot {
        width: 7px;
        height: 7px;
    }
}
