/* Custom styling for section titles (part titles) in sidebar */
.chapter li.part-title {
    font-weight: bold;
    font-size: 1.2em;
    color: var(--sidebar-fg);
    background: var(--sidebar-bg);
    border-top: 1px solid var(--sidebar-spacer);
    border-bottom: 1px solid var(--sidebar-spacer);
    padding: 0.7em 0.8em;
    margin: 0.8em 0 0.5em 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85em;
    border-radius: 3px;
}
/* .chapter li.part-title {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--sidebar-fg);
    background: var(--sidebar-bg);
    border-top: 1px solid var(--sidebar-spacer);
    padding-top: 0.5em;
    margin-top: 0.5em;
} */

/* Ensure part titles are not clickable and look distinct */
.chapter li.part-title {
    cursor: default;
    user-select: none;
}

/* Add some spacing after part titles */
.chapter li.part-title + li {
    margin-top: 0.3em;
}

/* Style regular chapter items under part titles */
.chapter li:not(.part-title) {
    margin-left: 0.5em;
}

/* Hide in-page heading entries nested under another heading from the sidebar.
   mdBook 0.5+ toc.js injects h2-h6 from the current page into <ol class="section">
   wrappers. Hide any such wrapper that sits inside a header-item <li> — that
   matches "h3 under h2", "h4 under h3", etc. while leaving the top tier
   visible. Skeleton wrappers for skipped levels are NOT inside a header-item,
   so h3-only pages still surface their h3s. */
.on-this-page li.header-item ol.section {
    display: none;
}

/* Normalize indent across siblings on the same heading level.
   mdBook 0.5 toc.js has a bug: when an h3 follows an h4 (e.g. Withdraw -> h4
   children -> Resolve Payment), the pop loop pops the level-3 entry too,
   so subsequent h3 siblings get appended to the level-2 skeleton instead of
   the level-3 ol — leaving the two groups of h3 siblings nested at different
   depths. Each .section adds 20px padding-inline-start, so the visible result
   is staggered indent for what should be sibling entries. Zero the extra
   padding on nested .sections; the outermost still gets padding-left: 0 from
   .on-this-page > ol above. */
.on-this-page ol.section ol.section {
    padding-inline-start: 0;
}