.legend {
  width: 10em;
  border: 1px solid black;
}

.legend .title {
    margin-left: 0.5em;
    border-style: solid;
    border-width: 0 0 0 0.3em;
    padding: 0 0.3em;
}

.legend {
  width: 10em;
  border: 1px solid black;
}

.legend .title {
    display: block;
    margin: 0.5em;
    border-style: solid;
    border-width: 0 0 0 1em;
    padding: 0 0.3em;
}

Tweak CSS so it's closer to the original layout
Tweak CSS so it's closer to the original layout

In practice people can style it however they want of course.
