/* Default behaviour: hide miniTOC if 1-19 L2s and hide TOC if 20+ L2s. */
[data-minitoc-length="1"], [data-minitoc-length="2"], [data-minitoc-length="3"], [data-minitoc-length="4"], [data-minitoc-length="5"], [data-minitoc-length="6"], [data-minitoc-length="7"], [data-minitoc-length="8"], [data-minitoc-length="9"], [data-minitoc-length="10"], [data-minitoc-length="11"], [data-minitoc-length="12"], [data-minitoc-length="13"], [data-minitoc-length="14"], [data-minitoc-length="15"], [data-minitoc-length="16"], [data-minitoc-length="17"], [data-minitoc-length="18"], [data-minitoc-length="19"] {
    display: none;
}

[data-toc-length]:not([data-toc-length="1"]):not([data-toc-length="2"]):not([data-toc-length="3"]):not([data-toc-length="4"]):not([data-toc-length="5"]):not([data-toc-length="6"]):not([data-toc-length="7"]):not([data-toc-length="8"]):not([data-toc-length="9"]):not([data-toc-length="10"]):not([data-toc-length="11"]):not([data-toc-length="12"]):not([data-toc-length="13"]):not([data-toc-length="14"]):not([data-toc-length="15"]):not([data-toc-length="16"]):not([data-toc-length="17"]):not([data-toc-length="18"]):not([data-toc-length="19"]) {
    display: none;
}

/* In Vector 2022: hide miniTOC if there are 1-9 L2s and always show TOC. */
/* This overrides the default miniTOC style. It is not necessary to override the default TOC style as it already gets invalidated. */
body.skin-vector-2022 [data-minitoc-length="10"], body.skin-vector-2022 [data-minitoc-length="11"], body.skin-vector-2022 [data-minitoc-length="12"], body.skin-vector-2022 [data-minitoc-length="13"], body.skin-vector-2022 [data-minitoc-length="14"], body.skin-vector-2022 [data-minitoc-length="15"], body.skin-vector-2022 [data-minitoc-length="16"], body.skin-vector-2022 [data-minitoc-length="17"], body.skin-vector-2022 [data-minitoc-length="18"], body.skin-vector-2022 [data-minitoc-length="19"] {    
    display: block;
}

/* On mobile with width < 720px: hide miniTOC if there are 1-4 L2s, and hide TOC if 5+ L2s. */
/* This overrides the default miniTOC and TOC styles. */
@media screen and (max-width: 719px) {
    body.skin-minerva [data-minitoc-length="5"], body.skin-minerva [data-minitoc-length="6"], body.skin-minerva [data-minitoc-length="7"], body.skin-minerva [data-minitoc-length="8"], body.skin-minerva [data-minitoc-length="9"], body.skin-minerva [data-minitoc-length="10"], body.skin-minerva [data-minitoc-length="11"], body.skin-minerva [data-minitoc-length="12"], body.skin-minerva [data-minitoc-length="13"], body.skin-minerva [data-minitoc-length="14"], body.skin-minerva [data-minitoc-length="15"], body.skin-minerva [data-minitoc-length="16"], body.skin-minerva [data-minitoc-length="17"], body.skin-minerva [data-minitoc-length="18"], body.skin-minerva [data-minitoc-length="19"] {
        display: block;
    }

    body.skin-minerva [data-toc-length]:not([data-toc-length="1"]):not([data-toc-length="2"]):not([data-toc-length="3"]):not([data-toc-length="4"]) {
        display: block;
    }
}