.legend {
    font: 12px sans-serif;
    position: absolute;
    padding: 10px;
    margin: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 1001;
}
.legend .legend-title {
    font-weight: bold;
    position: relative;
    margin: auto;
    width: fit-content;
}
.legend .legend-toggle {
    position: absolute;
    right: 0;
    font-weight: normal;
    cursor: pointer;
    color: #337ab7;
    font: 12px/1 sans-serif;
}
.legend .legend-toggle:hover {
    color: #23527c;
    text-decoration: underline;
}
.legend .keys {
    margin-top: 5px;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    padding: 0px 10px 0px 10px;
}
.legend .key {
    margin: 5px 10px 0 0;
}
.legend .key .color {
    display: inline-block;
    width: 12px;
    margin-right: 5px;
    border: 1px solid #888;
}
.legend.top {
    top: 24px;
    left: 50%;
    transform: translate(-50%, 0);
}
.legend.top.offscreen {
    margin-top: -32px;
    -webkit-transition: margin-top 1s;
    transition: margin-top 1s;
}
.legend.top.offscreen:hover,.legend.top.offscreen:focus {
    margin-top: 10px;
}
.legend.bottom {
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 0);
    width: 100%;
    margin: 0px 0px 0px 0px;
}
.legend.bottom.offscreen {
    margin-bottom: -32px;
    -webkit-transition: margin-bottom 1s;
    transition: margin-bottom 1s;
}
.legend.bottom.offscreen:hover,.legend.bottom.offscreen:focus {
    margin-bottom: 10px;
}
.legend.top .legend-title, .legend.bottom .legend-title {
}
.legend.top .key, .legend.bottom .key {
    float: left;
}
.legend.left {
    left: 0;
    top: 50%;
    margin-top: -61px;
}
.legend.right {
    right: 0;
    top: 40%;
    margin-top: -61px;
}
.legend.top_left {
    top: 24px;
    left: 0;
}
.legend.top_right {
    atop: 24px;
    right: 0;
}
.legend.bottom_left {
    bottom: 0;
    left: 0;
}
.legend.bottom_right {
    bottom: 0;
    right: 0;
}
.legend.hidden {
    display: none;
}