#toc-button {
    flex: 0 0 auto;
    background: none;
    border: none;
    width: 4.4rem;
    height: 4.4rem;
    margin-right: -1.0rem;
    font-size: 0;
}

#toc-button img {
    width: 2.2rem;
    height: 1.83rem;
}

#toc-button.close img {
    width: 3.2rem;
    height: 3.2rem;
}

#toc {
    position: fixed;
    overflow: auto;
    right: -320px;
    top: 0;
    width: 320px;
    bottom: 0;
    background-color: #EEE;
    z-index: 50;
    padding: 15px 0;
    color: #333;
    transition: right 0.25s;
}

#toc.active {
    right: 0;
    box-shadow: -1px 0 15px rgba(0,0,0,0.05);
    transition: right 0.25s;
}

#toc-bg {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #F1F1F1;
    opacity: 0.85;
    z-index: 49;
    transition: opacity 0.25s;
}

#toc a {
    color: rgb(63, 141, 237);
    text-decoration: none;
    display: block;
}

#toc .header {
    position: fixed;
    padding: 6px 12px;
    /* background-color: rgba(255, 255, 255, 0.85); */
    width: 320px;
    top: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: right;
    box-sizing: border-box;
}

#toc.active .header {
    right: 0;
}

#toc .header a {
    display: inline-block;
    flex: 1 0 auto;
    font-size: 0;
}

#toc .container {
    padding: 5.0rem 20px 20px 30px;
}

#toc .section {
    margin-top: 15px;
}

#toc .section:first-of-type {
    margin-top: 0;
}

#toc button.close {
    flex: 0 0 auto;
    border: none;
    background: none;
}

#toc .section-title {
    font-size: 1.8rem;
    font-weight: 600;
}

#toc ul {
    margin-top: 15px;
    padding-left: 0;
}

#toc li {
    list-style: none;
    padding: 5px 0;
}

@media only screen and (min-width: 1000px) {
    #toc .header {
        height: 5.6rem;
    }
}

@media only screen and (min-width: 1200px) {
    #toc {
        right: 0;
        top: 0;
        background-color: #F1F1F1;
    }

    #toc-bg {
        display: none;
    }

    #toc .header {
        display: none;
    }
}

@media (prefers-color-scheme: dark) {
    #toc {
        background-color: #222;
        color: #CCC;
    }

    #toc.active {
        box-shadow: -1px 0 15px rgba(0,0,0,0.65);
    }
    
    #toc a {
        color: rgb(63, 141, 237);
    }

    #toc-bg {
        background-color: #111;
    }
    
    #toc .header {
        background-color: rgba(0, 0, 0, 0.85);
    }

    #toc-button img {
        filter: invert(1);
    }
}

@media only screen and (min-width: 1200px) and (prefers-color-scheme: dark) {
    #toc {
        background-color: #161616;
    }
}
