body{
    margin:0;
    font-family:Arial;
}

h2{
    margin:15px;
}

#mobileMenuButton {
    display:none;
}

#map{
    width:100%;
    height:90vh;
}

#contact {
    padding:10px 15px;
    text-align:center;
    font-size:14px;
    background:#fff;
}

#contact a {
    color:#1565c0;
}

.footer-note {
    max-width:900px;
    margin:8px auto 0;
    color:#555;
    font-size:12px;
    line-height:1.4;
}

.analytics-toggle {
    margin-top:4px;
    padding:2px 6px;
    border:0;
    background:transparent;
    color:#1565c0;
    font:inherit;
    font-size:12px;
    text-decoration:underline;
    cursor:pointer;
}

.egms-timeseries-chart {
    min-height:240px;
}

#controls {

    position:absolute;
    top:70px;
    right:20px;

    background:white;

    padding:15px;

    z-index:1000;

    border:2px solid gray;

    border-radius:5px;

    width:220px;

}

.language-switch {
    display:flex;
    justify-content:flex-end;
    gap:4px;
    margin-bottom:10px;
}

.language-switch button {
    border:1px solid #777;
    border-radius:3px;
    background:#fff;
    padding:3px 7px;
    cursor:pointer;
    font-size:12px;
}

.language-switch button.active {
    background:#333;
    border-color:#333;
    color:#fff;
}

.anomaly-filter {
    margin-top:14px;
}

.anomaly-filter label {
    display:block;
    font-weight:bold;
    margin-bottom:5px;
}

.anomaly-filter select {
    width:100%;
    padding:5px;
}

#info {

    position:absolute;

    bottom:20px;
    left:20px;

    background:white;

    padding:15px;

    z-index:1000;

    border:2px solid gray;

    border-radius:5px;

    width:300px;

    font-size:14px;

    line-height:1.4;

    max-height:45vh;

    overflow:auto;

}

#info summary {
    cursor:pointer;
    font-weight:bold;
    list-style:none;
}

#info summary::-webkit-details-marker {
    display:none;
}

#info .info-content {
    margin-top:10px;
}

#info:not([open]) {
    max-height:40px;
    overflow:hidden;
}

#info ul {

    padding-left:20px;

}

.range-values {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.dual-range {
    position: relative;
    width: 100%;
    height: 30px;
    margin-top: 5px;
}

.range-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 14px;
    height: 4px;
    background: #ccc;
    border-radius: 2px;
}

.dual-range input[type="range"] {
    position: absolute;
    left: 0;
    top: 5px;
    width: 100%;
    height: 20px;
    margin: 0;
    background: transparent;
    pointer-events: none;
    appearance: none;
    -webkit-appearance: none;
}

.dual-range input[type="range"]::-webkit-slider-runnable-track {
    background: transparent;
}

.dual-range input[type="range"]::-moz-range-track {
    background: transparent;
}

.dual-range input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #333;
    border: 2px solid white;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
    pointer-events: auto;
    cursor: pointer;
}

.dual-range input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #333;
    border: 2px solid white;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
    pointer-events: auto;
    cursor: pointer;
}

.legend-toggle {
    display:none;
}

@media (max-width: 700px) {
    h2 {
        min-height:42px;
        margin:10px 104px 8px 10px;
        font-size:18px;
        line-height:1.15;
    }

    #map {
        height:calc(100vh - 70px);
        min-height:420px;
    }

    #mobileMenuButton {
        position:absolute;
        top:10px;
        right:10px;
        z-index:1100;
        display:flex;
        align-items:center;
        gap:6px;
        min-height:40px;
        padding:7px 10px;
        border:1px solid #666;
        border-radius:5px;
        background:#fff;
        color:#222;
        box-shadow:0 1px 5px rgba(0,0,0,.3);
        font-weight:bold;
        cursor:pointer;
    }

    .mobile-menu-icon {
        font-size:20px;
        line-height:1;
    }

    #controls {
        top:58px;
        right:10px;
        display:none;
        width:min(260px, calc(100vw - 20px));
        max-height:calc(100vh - 78px);
        box-sizing:border-box;
        overflow:auto;
        padding:12px;
        box-shadow:0 2px 10px rgba(0,0,0,.25);
    }

    #controls.mobile-open {
        display:block;
    }

    #info {
        bottom:10px;
        left:10px;
        width:min(280px, calc(100vw - 86px));
        max-height:42vh;
        box-sizing:border-box;
        padding:9px 11px;
        border-width:1px;
        box-shadow:0 1px 5px rgba(0,0,0,.25);
    }

    #info:not([open]) {
        width:auto;
        max-width:calc(100vw - 86px);
    }

    .leaflet-control.legend {
        margin-right:10px;
        margin-bottom:10px;
        padding:0;
        border-radius:5px;
        box-shadow:0 1px 5px rgba(0,0,0,.35);
    }

    .legend-toggle {
        display:block;
        min-width:42px;
        min-height:42px;
        padding:8px 10px;
        border:0;
        border-radius:5px;
        background:#fff;
        color:#222;
        font-weight:bold;
        cursor:pointer;
    }

    .legend-content {
        display:none;
        max-height:55vh;
        overflow:auto;
        padding:12px;
        background:#fff;
        border-radius:5px;
    }

    .leaflet-control.legend.is-open .legend-content {
        display:block;
    }

    .leaflet-control.legend.is-open .legend-toggle {
        width:100%;
        border-bottom:1px solid #ddd;
        border-radius:5px 5px 0 0;
        text-align:left;
    }

    .leaflet-control-layers {
        max-width:calc(100vw - 80px);
    }

    #contact {
        font-size:13px;
    }
}
