button#toc-button {
    position: fixed;
    top: 0;
    left: 0;
    cursor: pointer;
    width: 1.4em;
    height: 1.4em;
    line-height: 1.4em;
    font-size: 2.5em;
    text-align: center;
    padding: 0;
    appearance: none;
    background: rgba(0, 0, 0, 0.2);
    color: #ddd;
    border: none;
    z-index: 9001;
    transition: all 0.3s ease;
}

button#toc-button:hover {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}

button#toc-button.hide {
    opacity: 0;
    width: 0;
    height: 0;
}

body.show-toc #toc-overlay {
    display: block;
}

#toc-overlay {
    overscroll-behavior: contain;
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
    z-index: 100;
}

#toc-underlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
    z-index: -1;
    background: rgba(0, 0, 0, 0.8);
}

#toc-dialog {
    padding: 5%;
    pointer-events: none;
}

#toc-colocated .title,
#toc-dialog .title {
    text-align: center;
    font-size: 2em;
    font-weight: bold;
    color: #eee;
}

#toc-colocated ul,
#toc-dialog ul {
    padding: 0;
    pointer-events: all;
    max-width: 80%;
    margin: 0 auto;
    column-count: 1;
    column-gap: 1em;
}

@media only screen and (min-width: 768px) {

    #toc-colocated ul,
    #toc-dialog ul {
        column-count: 2;
    }
}


#toc-colocated ul li,
#toc-dialog ul li {
    user-select: none;
    margin-bottom: 0;
    display: block;
    font-size: 1.25em;
    column-break-inside: avoid;
    -webkit-column-break-inside: avoid;
}

#toc-colocated ul li:not(:last-child),
#toc-dialog ul li:not(:last-child) {
    border-bottom: 1px solid #afafaf;
}

/* #toc-colocated ul li.H3:not(:last-child),
#toc-dialog ul li.H3:not(:last-child) {
    margin-left: 2em;
    margin-bottom: 0;
    display: block;
    font-size: 1em;
    border-bottom: 1px solid #afafaf;
} */

#toc-colocated ul li a:hover,
#toc-dialog ul li a:hover {
    background-color: #222;
    color: #fff;
}

#toc-colocated ul li a,
#toc-dialog ul li a {
    padding: 0.5em;
    background-color: #666;
    display: block;
    text-decoration: none;
    color: #ccc;
}

#toc-colocated ul li.H2 a,
#toc-dialog ul li.H2 a {
    background-color: #668;
}

#toc-colocated ul li.H2 a:hover,
#toc-dialog ul li.H2 a:hover {
    background-color: #224;
}

.toc-legend {
    margin: 1em 0;
    text-align: center;
    color: #bbb;
    font-size: 1.3em;
}

.toc-link-symbol {
    color: red;
    float: right;
}

.toc-legend .toc-link-symbol {
    float: none ;
}