/* zh-locale channel submenu: drop the sidebar.css outer frame (include fragment styles can still override details) */
aside.sidebar.sidebar-about-nav-wrap {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* zh-locale submenu layout (10:2; on large screens the menu is on the left, see .about-cn-sidebar-left / .resources-cn-sidebar-left) */
.about-cn-sidebar-left > .container > .row > .about-sidebar-col,
.resources-cn-sidebar-left > .container > .row > .about-sidebar-col {
    order: 2;
}
@media (min-width: 992px) {
    .about-cn-sidebar-left > .container > .row > .about-sidebar-col,
    .resources-cn-sidebar-left > .container > .row > .about-sidebar-col {
        order: -1;
    }
    /* Long parenting resources: right-column in-chapter nav */
    .resources-cn-sidebar-left > .container > .row > .resources-inpage-toc-col {
        order: 1;
    }
}

.resources-cn-sidebar-left > .container > .row > .resources-inpage-toc-col {
    order: 3;
}

/* Do not clip when a right in-chapter nav is present, otherwise sticky/fixed pinning breaks */
.resources-intro.resources-cn-sidebar-left:has(.resources-inpage-toc-col) {
    overflow: visible;
}

@media (min-width: 992px) {
    .resources-inpage-toc-col {
        position: relative;
        overflow: visible;
        z-index: 2;
    }
    .resources-cn-sidebar-left > .container > .row > .resources-inpage-toc-col {
        padding-right: 0;
    }
    .resources-inpage-toc-col .resources-toc-slot {
        overflow: visible;
        box-sizing: border-box;
    }
    .resources-inpage-toc-col .resources-toc-shell,
    .resources-inpage-toc-col .quick-toc {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .resources-inpage-toc-col .quick-toc {
        border-radius: 14px 0 0 14px;
        border-right: none;
        padding-right: max(12px, calc(var(--bs-gutter-x, 1.5rem) * 0.5));
    }
    .resources-inpage-toc-col .resources-toc-shell {
        box-sizing: border-box;
        max-height: min(calc(100dvh - 7.25rem), calc(100vh - 7.25rem));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        scrollbar-width: thin;
        scrollbar-color: rgba(34, 177, 140, 0.4) transparent;
    }
    .resources-inpage-toc-col .resources-toc-shell::-webkit-scrollbar {
        width: 6px;
    }
    .resources-inpage-toc-col .resources-toc-shell::-webkit-scrollbar-thumb {
        background: rgba(34, 177, 140, 0.38);
        border-radius: 6px;
    }
    .resources-inpage-toc-col .resources-toc-shell .quick-toc,
    .resources-inpage-toc-col .resources-toc-shell.is-pinned .quick-toc {
        position: static;
        top: auto;
    }
}
@media (max-width: 991.98px) {
    .resources-inpage-toc-col .resources-toc-shell.is-pinned {
        position: static !important;
        top: auto !important;
        left: auto !important;
        width: auto !important;
    }
}

/* Parent handbook - right chapter TOC (sticky to avoid sideways jumps from fixed pinning) */
section.resources-cn-sidebar-left:has(.handbook-parents-layout),
section.resources-cn-sidebar-left.faq-section {
    overflow: visible;
    padding-top: 3rem !important;
    padding-bottom: 3.25rem !important;
}
@media (min-width: 992px) {
    .handbook-parents-layout {
        align-items: stretch;
    }
    .handbook-parents-layout .handbook-chapter-toc-col {
        position: relative;
        align-self: stretch;
    }
    .handbook-parents-layout .handbook-chapter-toc-col .handbook-toc-slot,
    .handbook-parents-layout .handbook-chapter-toc-col.faq-toc-col .handbook-toc-slot {
        position: sticky;
        top: 6.25rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .handbook-parents-layout .handbook-chapter-toc-col.faq-toc-col {
        align-self: flex-start;
    }
    .handbook-parents-layout .handbook-chapter-toc-col .handbook-toc-shell {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        max-height: min(calc(100dvh - 7.25rem), calc(100vh - 7.25rem));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: rgba(34, 177, 140, 0.4) transparent;
    }
    .handbook-parents-layout .handbook-chapter-toc-col .handbook-toc-shell::-webkit-scrollbar {
        width: 6px;
    }
    .handbook-parents-layout .handbook-chapter-toc-col .handbook-toc-shell::-webkit-scrollbar-thumb {
        background: rgba(34, 177, 140, 0.38);
        border-radius: 6px;
    }
    .handbook-parents-layout .handbook-chapter-toc-col .handbook-toc-shell .sidebar {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

.about-page-layout > .container > .row,
.team-section-wrapper > .container > .row,
.service-details > .container > .row,
.faq-section > .container > .row,
.contact-section > .container > .row,
.resources-intro > .container > .row,
.list-main-section > .container > .row {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

@media (min-width: 992px) {
    .about-sidebar-col {
        position: relative;
    }
    .about-sidebar-col .about-sidebar-shell {
        box-sizing: border-box;
        /* Scroll within the viewport when there are many items, avoiding off-screen content from fixed pinning */
        max-height: min(calc(100dvh - 7.25rem), calc(100vh - 7.25rem));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        scrollbar-width: thin;
        scrollbar-color: rgba(34, 177, 140, 0.4) transparent;
    }
    .about-sidebar-col .about-sidebar-shell::-webkit-scrollbar {
        width: 6px;
    }
    .about-sidebar-col .about-sidebar-shell::-webkit-scrollbar-track {
        background: transparent;
    }
    .about-sidebar-col .about-sidebar-shell::-webkit-scrollbar-thumb {
        background: rgba(34, 177, 140, 0.38);
        border-radius: 6px;
    }
    .about-sidebar-col .about-sidebar-shell::-webkit-scrollbar-thumb:hover {
        background: rgba(34, 177, 140, 0.55);
    }
}

/* About ADHD channel (blue): left/right sidebar scrollbars */
@media (min-width: 992px) {
    .channel-resources .about-sidebar-col .about-sidebar-shell {
        scrollbar-color: rgba(59, 130, 246, 0.4) transparent;
    }
    .channel-resources .about-sidebar-col .about-sidebar-shell::-webkit-scrollbar-thumb {
        background: rgba(59, 130, 246, 0.38);
    }
    .channel-resources .about-sidebar-col .about-sidebar-shell::-webkit-scrollbar-thumb:hover {
        background: rgba(59, 130, 246, 0.55);
    }
    .channel-resources .handbook-parents-layout .handbook-chapter-toc-col .handbook-toc-shell,
    .channel-resources .resources-inpage-toc-col .resources-toc-shell {
        scrollbar-color: rgba(59, 130, 246, 0.4) transparent;
    }
    .channel-resources .handbook-parents-layout .handbook-chapter-toc-col .handbook-toc-shell::-webkit-scrollbar-thumb,
    .channel-resources .resources-inpage-toc-col .resources-toc-shell::-webkit-scrollbar-thumb {
        background: rgba(59, 130, 246, 0.38);
    }
    .channel-resources .handbook-parents-layout .handbook-chapter-toc-col .handbook-toc-shell::-webkit-scrollbar-thumb:hover,
    .channel-resources .resources-inpage-toc-col .resources-toc-shell::-webkit-scrollbar-thumb:hover {
        background: rgba(59, 130, 246, 0.55);
    }
}

@media (max-width: 991.98px) {
    .about-sidebar-col {
        margin-top: 1.5rem;
    }
}

/* Spacing between banner and body heading (aligned across reference / team / help-center etc.) */
.page-header + .about-page-layout,
.page-header + .team-section-wrapper,
.page-header + .faq-section,
.page-header + .contact-section,
.page-header + .service-details,
.page-header + .resources-intro,
.page-header + .list-main-section {
    padding-top: 28px !important;
}

.about-page-main > #references.team-section,
.about-page-main > .team-info-section,
.about-page-main > #faq-top,
.contact-section .about-page-main > .text-center:first-child {
    padding-top: 36px;
}

/* When nesting .container in the main column, fill the column width so viewport-relative centering does not misalign with the left menu */
.about-page-main > section > .container,
.about-page-main > .about-section > .container,
.about-page-main > .mission-vision > .container,
.about-page-main > .values-section > .container,
.about-page-main > .stats-section > .container,
.about-page-main > .team-section > .container,
.about-page-main > .brand-section > .container {
    width: 100%;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

/* About ADHD channel: right chapter TOC / in-page TOC (overrides sidebar.css green, other channels unaffected) */
.channel-resources .sidebar .toc-link:hover {
    background: #eff6ff;
    color: #1e3a8a;
}
.channel-resources .sidebar .toc-link {
    font-weight: 400;
}
.channel-resources .sidebar .toc-link.active {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 400;
}
.channel-resources .sidebar-title {
    border-bottom-color: rgba(59, 130, 246, 0.22);
    font-weight: 400;
}
.channel-resources .sidebar .toc-group {
    font-weight: 400;
}
.channel-resources .help-item {
    border-bottom-color: rgba(59, 130, 246, 0.2);
}

/* About ADHD: primary buttons (override theme-green hover, other channels unaffected) */
.channel-resources .btn-primary {
    --bs-btn-bg: #3b82f6;
    --bs-btn-border-color: #3b82f6;
    --bs-btn-hover-bg: #2563eb;
    --bs-btn-hover-border-color: #1d4ed8;
    --bs-btn-active-bg: #1d4ed8;
    --bs-btn-active-border-color: #1e40af;
    --bs-btn-focus-shadow-rgb: 59, 130, 246;
}
.channel-resources .btn-outline-primary {
    --bs-btn-color: #2563eb;
    --bs-btn-border-color: #3b82f6;
    --bs-btn-hover-bg: #3b82f6;
    --bs-btn-hover-border-color: #3b82f6;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #2563eb;
    --bs-btn-active-border-color: #2563eb;
    --bs-btn-active-color: #fff;
    --bs-btn-focus-shadow-rgb: 59, 130, 246;
}
.channel-resources .btn-check:checked + .btn-outline-primary,
.channel-resources .btn-check:active + .btn-outline-primary {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.channel-resources .sidebar .help-item a:hover {
    color: #2563eb;
}

/* Legacy FAQ topic nav (EN until handbook layout fully migrated) */
.channel-resources .sidebar-cat-btn {
    border: 1px solid #e8ecef;
    background: #fff;
}
.channel-resources .sidebar-cat-btn:hover,
.channel-resources .sidebar-cat-btn.active {
    background: #dbeafe;
    color: #1e40af;
    border-color: transparent;
    transform: none;
    box-shadow: none;
}