@media screen {
    .public-sticky-layout {
        --public-header-height: 196px;
        --sidebar-top: calc(var(--public-header-height) + 12px);
    }

    .public-sticky-header {
        position: sticky;
        top: 0;
        z-index: 999;
    }

    .public-sticky-header .navbar { position: relative; }
    .public-sticky-layout :is(#main-content, #page-reading-pane, main :target) { scroll-margin-top: var(--sidebar-top); }

    .main-with-sidebar .page-layout { padding-block: 18px 32px; }
    .main-with-sidebar .page-content { min-width: 0; overflow-wrap: anywhere; }
    .main-with-sidebar .page-sidebar {
        position: sticky;
        top: var(--sidebar-top);
        align-self: start;
        z-index: 2;
    }

    .main-with-sidebar .page-sidebar .sidebar-menu {
        max-height: calc(100vh - var(--sidebar-top) - 12px);
        max-height: calc(100dvh - var(--sidebar-top) - 12px);
        overflow: auto;
    }

    .main-with-sidebar .sidebar-title {
        position: sticky;
        top: 0;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        cursor: pointer;
    }

    .main-with-sidebar .sidebar-title::-webkit-details-marker { display: none; }
    .main-with-sidebar .sidebar-title::after {
        content: '';
        flex: 0 0 7px;
        height: 7px;
        border: solid currentColor;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
    }
    .main-with-sidebar .sidebar-menu[open] > summary::after { transform: rotate(225deg); }

    @media (max-width: 992px) {
        .main-with-sidebar .page-layout { gap: 8px; }
        .main-with-sidebar .sidebar-title { padding-block: 10px; }
        .main-with-sidebar .page-sidebar-links {
            max-height: 28vh;
            max-height: 28dvh;
            overflow: auto;
        }
    }

    @media (max-width: 768px), (max-height: 540px) {
        .public-sticky-header .topbar { display: none; }
    }
}
