/* @media (min-width: 375px) and (max-width: 499px) ( */
.legend {
    display: flex;
    text-align: left;
    font-size: 11px;
    line-height: 13px;
    position: absolute;
    top: 14px;
    z-index: 25;
    padding: 3px 4px;
    background: white;
    background: rgba(255,255,255);
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border-radius: 3px;
    left: calc(100% - 372px);
}

.legend.precipitation {
    top: 33px;
    left: calc(100% - 168px);
    line-height: 17px;
}

.legend .legend-title {
    width: 81px;
    left: calc(100% - 141px);
}

.legend.precipitation .legend-title {
    width: 156px;
    padding-right: 0px;
}

.legend .legend-scale {
    font-size: 9px;
    width: 280px;
}

.legend-scale {
    width: 200px;
}

.legend-color-gradient {
    width: 100%;
    height: 4px;
}

.legend-numbers {
    display: flex;
    justify-content: space-between;
}

.legend-label {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.legend.disabled {
    display: none;
}

@media (min-width: 0px) and (max-width: 359px) {
    .legend {
        font-size: 9px;
        line-height: 11px;
        top: 10px;
        left: calc(100% - 319px);
    }

    .legend .legend-title {
        width: 56px;
    }

    .legend .legend-scale {
        font-size: 8px;
        width: 254px;
    }

    .legend.rain .legend-color-gradient {
        background: linear-gradient(to right,
        rgb(245, 245, 255) 0px,
        rgb(245, 245, 255) 16px,

        rgb(180, 180, 254) 16px,
        rgb(180, 180, 254) 29px,

        rgb(120, 120, 255) 29px,
        rgb(120, 120, 255) 41px,

        rgb(20, 20, 255) 41px,
        rgb(20, 20, 255) 53px,

        rgb(0, 216, 195) 53px,
        rgb(0, 216, 195) 67px, 

        rgb(0, 150, 144) 67px, 
        rgb(0, 150, 144) 82px, 

        rgb(0, 102, 102) 82px, 
        rgb(0, 102, 102) 99px, 

        rgb(255, 255, 0) 99px, 
        rgb(255, 255, 0) 114px, 

        rgb(255, 200, 3) 114px, 
        rgb(255, 200, 3) 129px, 

        rgb(255, 150, 1) 129px, 
        rgb(255, 150, 1) 144px, 

        rgb(255, 100, 0) 144px,
        rgb(255, 100, 0) 163px,

        rgb(255, 0, 0) 163px, 
        rgb(255, 0, 0) 183px, 

        rgb(200, 1, 0) 183px, 
        rgb(200, 1, 0) 204px, 

        rgb(121, 0, 0) 204px, 
        rgb(121, 0, 0) 227px,

        rgb(40, 0, 0) 227px, 
        rgb(40, 0, 0) 254px);
    }
}

@media (min-width: 360px) and (max-width: 411px) {
    .legend {
        font-size: 10px;
        line-height: 13px;
        top: 11px;
        left: calc(100% - 358px);
    }

    .legend .legend-title {
        width: 78px;
    }

    .legend .legend-scale {
        font-size: 9px;
        width: 271px;
    }

    .legend.rain .legend-color-gradient {
        background: linear-gradient(to right,
        rgb(245, 245, 255) 0px,
        rgb(245, 245, 255) 16px,

        rgb(180, 180, 254) 16px,
        rgb(180, 180, 254) 30px,

        rgb(120, 120, 255) 30px,
        rgb(120, 120, 255) 42px,

        rgb(20, 20, 255) 42px,
        rgb(20, 20, 255) 55px,

        rgb(0, 216, 195) 55px,
        rgb(0, 216, 195) 70px, 

        rgb(0, 150, 144) 70px, 
        rgb(0, 150, 144) 86px, 

        rgb(0, 102, 102) 86px, 
        rgb(0, 102, 102) 103px, 

        rgb(255, 255, 0) 103px, 
        rgb(255, 255, 0) 120px, 

        rgb(255, 200, 3) 120px, 
        rgb(255, 200, 3) 136px, 

        rgb(255, 150, 1) 136px, 
        rgb(255, 150, 1) 154px, 

        rgb(255, 100, 0) 154px,
        rgb(255, 100, 0) 174px,

        rgb(255, 0, 0) 174px, 
        rgb(255, 0, 0) 196px, 

        rgb(200, 1, 0) 196px, 
        rgb(200, 1, 0) 218px, 

        rgb(121, 0, 0) 218px, 
        rgb(121, 0, 0) 242px,

        rgb(40, 0, 0) 242px, 
        rgb(40, 0, 0) 271px)
    }
}

@media (min-width: 412px) {
    .legend {
        font-size: 11px;
        line-height: 15px;
        top: 12px;
        left: calc(100% - 412px);
    }

    .legend .legend-title {
        width: 86px;
    }

    .legend .legend-scale {
        font-size: 10px;
        width: 317px;
    }

    /* Legend specific css */
    .legend.rain .legend-color-gradient {
        background: linear-gradient(to right,
        rgb(245, 245, 255) 0px,
        rgb(245, 245, 255) 20px,

        rgb(180, 180, 254) 20px,
        rgb(180, 180, 254) 35px,

        rgb(120, 120, 255) 35px,
        rgb(120, 120, 255) 49px,

        rgb(20, 20, 255) 49px,
        rgb(20, 20, 255) 63px,

        rgb(0, 216, 195) 63px,
        rgb(0, 216, 195) 79px, 

        rgb(0, 150, 144) 79px, 
        rgb(0, 150, 144) 97px, 

        rgb(0, 102, 102) 97px, 
        rgb(0, 102, 102) 117px, 

        rgb(255, 255, 0) 117px, 
        rgb(255, 255, 0) 137px, 

        rgb(255, 200, 3) 137px, 
        rgb(255, 200, 3) 157px, 

        rgb(255, 150, 1) 157px, 
        rgb(255, 150, 1) 178px, 

        rgb(255, 100, 0) 178px,
        rgb(255, 100, 0) 200px,

        rgb(255, 0, 0) 200px, 
        rgb(255, 0, 0) 225px, 

        rgb(200, 1, 0) 225px, 
        rgb(200, 1, 0) 250px,

        rgb(121, 0, 0) 232px, 
        rgb(121, 0, 0) 279px,

        rgb(40, 0, 0) 279px, 
        rgb(40, 0, 0) 317px)
    }
}

@media (min-width: 428px) {
    .legend {
        top: 13px;
        left: calc(100% - 427px);
    }

    .legend .legend-title {
        width: 101px;
    }
}

@media (min-width: 430px) {
    .legend {
        top: 13px;
        left: calc(100% - 429px);
    }

    .legend .legend-title {
        width: 103px;
    }
}

@media (min-width: 500px) {
    .legend {
        top: 19px;
    }
}

@media (min-width: 690px) {
    .legend {
        top: 28px;
    }
}