.leaflet-legend {
    background: #FFF;
    border: 2px solid #FFF;
    padding: 6px;
    max-height: 250px;
    overflow-y: auto;
    line-height: 1.2;
}

.leaflet-legend h4 {
    margin: 0 0 4px 0;
    cursor: pointer;
}
.leaflet-legend h4:hover {
    background: #F6F6F6;
}

.leaflet-legend h4 > span {
    margin-left: 18px;
    color: #333;
}

.leaflet-legend h4.closed + .legend-elements {
    display: none;
}

.leaflet-legend img {
    margin-right: 6px;
    display: inline;
    vertical-align: middle;
}

.leaflet-legend label {
    max-width: 200px;
    display: inline-block;
    vertical-align: middle;
    word-wrap: break-word;
    color: #555;
}

.legend-block {
    margin-right: 7px;
    width: 100%;
}

.legend-block + .legend-block {
    margin-top: 8px;
    border-top: 1px solid #EEE;
    padding-top: 4px;
}

.legend-row + .legend-row {
    margin-top: 8px;
}

.legend-stretched .legend-row + .legend-row {
    margin-top: 0;
}

/* force OSX to show a scrollbar */
.leaflet-legend::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 7px;
}

.leaflet-legend::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: rgba(0, 0, 0, .5);
    -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5);
}

.leaflet-legend::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

/* from http://lugolabs.com/caret */
.leaflet-legend .legend-caret {
    position: relative;
    display: inline-block;
    vertical-align: top;
}
.leaflet-legend .legend-caret:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
}
.leaflet-legend .legend-caret {
    top: 0.5em;
    left: 0;
}
.leaflet-legend .legend-caret:before {
    border-top: 0.5em solid #555;
    border-left: 0.5em solid transparent;
    border-right: 0.5em solid transparent;
}
.leaflet-legend h4.closed .legend-caret {
    top: 0.25em;
    left: 0.25em;
}
.leaflet-legend h4.closed .legend-caret:before {
    border-left: 0.5em solid #555;
    border-top: 0.5em solid transparent;
    border-bottom: 0.5em solid transparent;
}
