/* FOUC suppression */
#loading-animation { display: none; }
/* must match the inline <style> from <head> */
:where(body>:not(#loading-animation)) {
    display: unset;
}

:root {
    --color-primary: #1a365d;
    --color-accent: #2b6cb0;
    --color-bg: #ffffff;
    --color-bg-alt: #f7fafc;
    --color-border: #e2e8f0;
    --color-text: #2d3748;
    --color-text-light: #718096;
    --color-sidebar-bg: #ebf8ff;
    --color-sidebar-border: #90cdf4;
    --color-example-bg: #f0fff4;
    --color-example-border: #9ae6b4;
    --color-warning-bg: #fffbeb;
    --color-warning-border: #fbd38d;
    --color-target: #FBF7FF;
    --color-deemphasized: #999;
    --color-button-bg: hsl(210 70% 91%);

    --standard-shadow: 0 8px 24px rgba(26, 54, 93, 0.15);

    --font-body: 'Georgia', 'Times New Roman', serif;

    --target-max-content-width: 1440px;
    --site-header-height: 4rem;

    --toc-radius: 8px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;

    /* leaves a bit of breathing room after #hash navigation */
    scroll-padding-top: 6rem;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

dialog {
    width: min(100% - 3rem, 36rem);
    padding: 1.5rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-sidebar-border);
    border-radius: var(--toc-radius);
    box-shadow: var(--standard-shadow);

    & > :first-child {
        margin-top: 0;
    }

    .close-dialog-button {
        position: absolute;
        top: 1rem;
        right: 1rem;
        padding: 0.2em;

        svg {
            display: block;
            width: 1.25rem;
            height: 1.25rem;
            fill: none;
            stroke: currentColor;
            stroke-linecap: round;
            stroke-width: 2;
        }
    }
}

dialog::backdrop {
    background: rgba(26, 54, 93, 0.35);
}

.site-header {
    min-height: var(--site-header-height);
    box-shadow: 0 2px 8px rgba(26, 54, 93, 0.2);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: var(--color-bg-alt);
}

.site-header-content,
.site-footer-content {
    width: min(100% - 3rem, var(--target-max-content-width));
    margin: 0 auto;
}

.site-header-content {
    min-height: var(--site-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.site-brand {
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.site-brand-logo {
    height: 2rem;
}

.site-navigation,
.site-footer-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.site-navigation a {
    text-decoration: none;
}

.site-navigation-logout {
    margin: 0;
}

.site-navigation-logout button {
    padding: 0;
    font: inherit;
    border: 0;
    cursor: pointer;
    background: none;
    color: var(--color-accent);

    &:hover {
        background: none;
        text-decoration: underline;
    }
}

.site-navigation-dropdown .site-navigation-dropdown-list {
    display: none;
    position: absolute;
    z-index: 6;
    background: white;

    border-radius: 1rem;
    box-shadow: 0 0.4rem 1rem #0003;

    ul {
        list-style: none;
        padding: 0.5rem 1.3rem 1rem;
    }
}

.site-navigation-dropdown:hover .site-navigation-dropdown-list {
    display: block;
}

.site-content {
    flex: 1 0 auto;
}

.error-page-content {
    width: min(100% - 3rem, var(--target-max-content-width));
    margin: 2rem auto;
}

.site-footer {
    margin-top: 2rem;
    padding: 1.25rem 0;
    color: var(--color-text-light);
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9rem;
}

.site-footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-footer-navigation a {
    color: inherit;
}

:target {
    box-shadow: inset 0rem 6rem 3rem -7rem var(--color-accent);
}

.book-header {
    padding: 2rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);

    .book-header-content {
        margin: 0 auto;
        max-width: var(--target-max-content-width);
        color: white;
        h1 { color: white; }
        a { color: white; text-decoration: underline; }
        display: flex;
        gap: 2rem;

        .book-header-image {
            flex: 0 0 300px;
        }
    }
}

.index-landing-header {
    font-family: sans-serif;
    text-align: center;
    h1, h2, h3 {
        color: white;
    }
    h3 {
        margin-block: 0.5em 2em;
    }
    border: 5px solid rgb(70, 22, 107);
    color: white;
    background: url('images/index-header-bg.jpg') #58587A;
}

.index-landing-carousel {
    display: flex;
    justify-content: center;
    min-height: 40rem; /* best effort to avoid layout shift */
    width: 90%;
    margin: 2rem auto;
    align-items: center;
    gap: 2rem;

    --carousel-color: rgb(70, 22, 107);

    .index-landing-carousel-control {
        width: 3rem;
        flex: 0 0 content;
        align-items: center;
        font-size: 64pt;
        font-weight: bold;
        cursor: pointer;
    }

    .index-landing-carousel-slides {
        min-width: 3rem;
        flex: 0 1 content;
        overflow: hidden;

        .index-landing-carousel-slide {
            font-family: sans-serif;
            display: flex;
            align-items: center;

            .info-panel {
                font-size: 120%;
                h3 {
                    color: white;
                    font-size: 24pt;
                    margin-top: 0;
                }
                a {
                    color: #7ACBF3;
                    font-weight: bold;
                    font-size: 120%;
                }
                background: var(--carousel-color);
                color: white;
                min-height: 36rem;
                padding: 4em 9em 4em 3em;
                width: 32em;
                flex: 0 0 32em;
            }
            .graphic {
                flex: 1 0 0;
                margin-left: -110px;
                img {
                    width: 100%;
                    max-width: 1200px;
                }
            }
        }

        .index-landing-carousel-slide:not(.active) {
            display: none;
        }
    }
}

.index-landing-feature-cards-heading {
    text-align: center;
    font-size: 24pt;
    font-family: sans-serif;
}

.index-landing-feature-cards {
    margin: 2em;
    display: flex;
    gap: 3em;
    justify-content: safe center;

    .index-landing-feature-card {
        flex: 0 0 24rem;
        box-shadow: 0px 3px 5px #0003;
        font-family: sans-serif;

        img {
            width: 100%;
        }

        .index-landing-feature-card-info {
            margin: 1em;

            h1 {
                font-size: 18pt;
                margin-top: 0;
            }

            .index-landing-feature-card-link {
                display: inline-block;
                padding: 6px 18px;
                margin-top: 3em;
                border: 2px solid #522398;
                border-radius: 4px;
                color: #522398;
                font-size: 16px;
                font-weight: 600;
                text-decoration: none;
            }
        }
    }
}

.book-landing {
    max-width: var(--target-max-content-width);
    margin: 1rem auto;
    width: min(100% - 3rem, 64rem);

    .book-landing-forms {
        display: flex;
        gap: 2em;

        .search-form, .jump-page-form {
            flex: 1 0 content;

            form {
                display: flex;
                .input-expand {
                    flex-grow: 1;
                }
            }
        }
    }

    .book-links {
        display: flex;
        gap: 2em;

        .toc {
            flex: 1 1 30em;
        }

        .book-tools {
            flex: 1 1 10em;
        }
    }
}

.newsletter-landing {
    max-width: var(--target-max-content-width);
    margin: 2rem auto;
    width: min(100% - 3rem, 64rem);

    .newsletter-landing-header {
        margin-bottom: 2rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid var(--color-primary);

        h1 {
            margin: 0;
            color: var(--color-primary);
        }
    }

    .newsletter-landing-publication-info {
        font-size: 120%;
    }

    .newsletter-landing-copyright {
        color: var(--color-text-light);
    }

    .newsletter-landing-content {
        display: flex;
        align-items: flex-start;
        gap: 2rem;
    }

    .newsletter-articles {
        flex: 1 1 30rem;
    }

    .newsletter-article-list {
        list-style: none;
        padding-left: 0;

        li + li {
            margin-top: 1.5rem;
        }

        h3,
        p {
            margin: 0;
        }

        p + p {
            margin-top: 0.25rem;
        }
    }

    .newsletter-article-abstract {
        margin-top: 0.5rem;
    }

    .newsletter-article-abstract-preview {
        position: relative;
        max-height: 7em;
        overflow: hidden;

        &::after {
            position: absolute;
            right: 0;
            bottom: 0;
            left: 0;
            height: 3em;
            content: "";
            pointer-events: none;
            background: linear-gradient(to bottom, transparent, var(--color-bg));
        }
    }

    .newsletter-article-abstract-toggle {
        margin-top: 0.25rem;
        padding: 0;
        color: var(--color-accent);
        font: inherit;
        font-weight: bold;
        background: none;
        border: 0;
        cursor: pointer;
        text-decoration: underline;

        &:focus-visible {
            outline: 2px solid var(--color-accent);
            outline-offset: 2px;
        }
    }

    .newsletter-tools {
        flex: 0 1 20rem;
        padding: 1.25rem;
        background: var(--color-bg-alt);
        border: 1px solid var(--color-border);
        border-radius: var(--toc-radius);

        h2 {
            margin-top: 0;
        }

        dl,
        dd {
            margin: 0;
        }

        dl > div + div {
            margin-top: 0.75rem;
        }

        dt {
            font-weight: bold;
        }
    }

    .newsletter-issue-cover-image {
        display: block;
        width: 100%;
        height: auto;
    }

    .newsletter-landing-copyright {
        margin-top: 2rem;
        font-size: 0.9rem;
    }
}

.newsletter-index {
    width: min(100% - 3rem, 64rem);
    margin: 2rem auto;

    .newsletter-index-header {
        margin-bottom: 2rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid var(--color-primary);

        h1 {
            margin: 0;
            color: var(--color-primary);
        }

        p {
            margin-bottom: 0;
        }
    }

    .newsletter-year-group + .newsletter-year-group {
        margin-top: 2rem;
    }

    .newsletter-year-group h2 {
        margin-bottom: 0.75rem;
        color: var(--color-primary);

        .newsletter-year-volume {
            font-weight: normal;
        }
    }

    .newsletter-issue-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
        gap: 0.75rem 1.5rem;
        margin: 0;
        padding: 0;
        list-style: none;

        li {
            display: flex;
            flex-wrap: wrap;
            gap: 0.25rem 0.5rem;
            align-items: baseline;
        }
    }

    .newsletter-issue-date {
        color: var(--color-text-light);
        font-size: 0.9rem;
    }
}

.case-scenarios,
.case-scenario-content {
    width: min(100% - 3rem, 64rem);
    margin: 2rem auto;
}

.case-scenarios-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-primary);

    h1 {
        margin: 0;
        color: var(--color-primary);
    }

    p {
        margin-bottom: 0;
    }
}

.case-scenario-list {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.case-scenario-back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
}

.case-scenario-content {
    overflow-wrap: break-word;

    table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }
}

@media (max-width: 40rem) {
    .newsletter-landing .newsletter-landing-content {
        flex-direction: column;
    }

    .newsletter-landing .newsletter-tools {
        box-sizing: border-box;
        width: 100%;
    }
}

.newsletter-article-page {
    width: min(100% - 3rem, 64rem);
    margin: 2rem auto;

    .newsletter-article {
        .book-header {
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 2px solid var(--color-primary);
        }

        .book-title {
            color: var(--color-primary);
        }

        .abstract {
            margin-bottom: 2rem;
            padding: 1.25rem;
            background: var(--color-bg-alt);
            border: 1px solid var(--color-border);
            border-radius: var(--toc-radius);
        }
    }
}

.book-changes {
    width: min(100% - 3rem, 64rem);
    margin: 2rem auto;
}

.book-changes-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-primary);
}

.book-changes-header h1 {
    margin: 0;
    color: var(--color-primary);
}

.book-changes-content {
    padding: 2rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--toc-radius);
    box-shadow: var(--standard-shadow);
}

.cover-image {
    max-width: 300px;
    width: 100%;
    height: auto;
    margin-bottom: 2rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    border-radius: 4px;
}

.book-title {
    font-size: 2rem;
    margin: 0 0 1rem;
    font-weight: normal;
}

.book-header .authors {
    margin: 1rem 0;
}

.book-header .author {
    margin: 0.25rem 0;
    font-size: 0.95rem;
}

.publication-info {
    font-size: 110%;
}

.publication-info p {
    margin: 0.2rem 0;
}

.chapter-list {
    padding-left: 1.5rem;
    list-style: none;

    li {
        margin: 0.35rem 0;
    }
}

#book-scroll {
    --side-panel-width: 21rem;
    --body-text-width: 62rem;
    --content-gap: 2em;

    display: flex;
    gap: var(--content-gap);
    justify-content: safe center;

    #book-scroll-left-panel {
        flex: 0 0 var(--side-panel-width);

        .toc-sticky {
            position: sticky;
            top: 1rem;
            z-index: 10;
            margin: 1rem;
        }

        #book-scroll-left-panel-toggle {
            position: absolute;
            z-index: 1;
            top: 7rem;
            right: -1.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 1.5rem;
            height: 2.5rem;
            color: var(--color-primary);
            background: var(--color-button-bg);
            border: 1px solid var(--color-border);
            border-left: 0;
            border-radius: 0 var(--toc-radius) var(--toc-radius) 0;
            box-shadow: 4px 4px 8px rgba(26, 54, 93, 0.1);
            cursor: pointer;
            user-select: none;


            svg {
                width: 1rem;
                height: 1rem;
                fill: none;
                stroke: currentColor;
                stroke-linecap: round;
                stroke-linejoin: round;
                stroke-width: 2;
            }
        }

        nav.toc {
            max-height: calc(100vh - 2rem);
            overflow: auto;
            margin: 0;
            padding: 1rem;
            background: var(--color-bg-alt);
            border: 1px solid var(--color-border);
            border-radius: var(--toc-radius);
            box-shadow: var(--standard-shadow);
            font-family: 'Helvetica Neue', Arial, sans-serif;
        }

        nav.toc h4 {
            margin-top: 0;
            font-weight: bold;
        }

        nav.toc summary {
            cursor: pointer;
            color: var(--color-primary);
        }

        nav.toc .toc-root > summary {
            margin-bottom: 0.75rem;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid var(--color-primary);
            font-size: 1.25rem;
        }

        nav.toc ol {
            padding-left: 0;
        }

        nav.toc .toc-list {
            margin: 0.5rem 0 0;
            list-style: none;
        }

        nav.toc .toc-list .toc-list {
            border-left: solid 1px #ccc;
            padding-left: 1em;
        }

        nav.toc .toc-list .toc-list {
            margin-top: 0.25rem;
        }

        nav.toc .toc-node>summary {
            margin-left: 1em;
            text-indent: -1em;
        }

        nav.toc li {
            margin: 0.8rem 0;
            font-size: 0.9rem;
            line-height: 1.35;
        }

        nav.toc a {
            color: var(--color-accent);
            text-decoration: none;
        }

        nav.toc a:hover {
            text-decoration: underline;
        }

        nav.toc a.is-active {
            color: var(--color-primary);
            font-weight: bold;
        }

        nav.toc span {
            color: var(--color-text);
        }

        nav.toc details[open] > summary {
            margin-bottom: 0.25rem;
        }

    }

    #book-scroll-main {
        flex: 0 1 var(--body-text-width);
        width: var(--body-text-width);

        #active-toc-breadcrumb {
            position: sticky;
            top: 1em;
            z-index: 5;
            margin: 1.5rem -1rem;
            padding: 0.5rem 1rem;
            background: var(--color-bg-alt);
            border: 1px solid var(--color-border);
            border-radius: var(--toc-radius);
            box-shadow: var(--standard-shadow);
            font-family: 'Helvetica Neue', Arial, sans-serif;

            ol#breadcrumb-list {
                display: flex;
                align-items: center;
                width: 100%;
                margin: 0;
                padding: 0;
                list-style: none;

                li {
                    display: flex;
                    flex: 0 1 content;
                    align-items: center;
                    min-width: 7em;
                    max-width: 22em;
                    white-space: nowrap;
                }

                li + li::before {
                    margin: 0 0.5rem;
                    color: var(--color-text-light);
                    content: "›";
                }

                a {
                    display: block;
                    overflow: hidden;
                    color: var(--color-accent);
                    text-decoration: none;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                }

                a:hover {
                    text-decoration: underline;
                }

                li:last-child a {
                    color: var(--color-primary);
                    font-weight: bold;
                }
            }

            #special-command-buttons {
                display: flex;
                gap: 1em;
                padding: 0;
                margin: 0;

                a, a:hover, button {
                    border: none;
                    color: var(--color-accent);
                    background: var(--color-button-bg);
                    border-radius: 4px;
                    padding: 4px 8px;
                    cursor: pointer;
                    text-decoration: none;
                }
            }

        }
    }

    #book-scroll-filler {
        flex: 0 999 var(--side-panel-width);
    }

    &.toc-is-collapsed {
        --side-panel-width: 2em;

        #book-scroll-left-panel {
            nav.toc {
                display: none;
            }

            #book-scroll-left-panel-toggle {
                position: fixed;
                left: 0;

                svg {
                    transform: rotate(180deg);
                }
            }
        }
    }
}

section {
    margin-bottom: 1.5rem;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-primary);
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

h2 { font-size: 1.6rem; border-bottom: 1px solid var(--color-border); padding-bottom: 0.4rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
h5 { font-size: 1.05rem; }
h6 { font-size: 1rem; }

.page-marker {
    text-align: right;
    color: var(--color-deemphasized);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: normal;
    text-decoration: none;
    font-style: normal;
    
    margin: 1.5rem 0.8rem 0;
    hr {
        height: 1px;
        border: 0;
        background-color: #ddd;
    }
}

.label {
    color: var(--color-accent);
    font-weight: bold;
}

li > .label {
    margin-right: 0.4em;
    float: left;
}

p, .paragraph {
    margin: 0.75rem 0;

    img {
        max-width: 100%;
    }
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

input,
textarea,
button {
    font: inherit;
}

input,
textarea {
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
}

textarea {
    min-height: 6rem;
    resize: vertical;
}

button, input[type=submit], .button-link {
    color: white;
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
}

.button-link {
    display: inline-block;
}

input:disabled,
textarea:disabled,
button:disabled {
    color: var(--color-text-light);
    background: var(--color-bg-alt);
    border-color: var(--color-border);
    cursor: not-allowed;
    opacity: 0.7;
}

input:focus,
textarea:focus,
button:focus-visible,
.button-link:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

button:hover,
.button-link:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    text-decoration: none;
}

#citation-text.is-copied {
    animation: citation-copy-success 400ms ease-out;
}

@keyframes citation-copy-success {
    30% {
        background: #c6f6d5;
        box-shadow: inset 0 0 0 0.2rem #48bb78, 0 0 0 0.25rem color-mix(in srgb, #48bb78 45%, transparent);
    }
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

#selection-tools {
    position: absolute;
    z-index: 20;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-bg-alt);
    padding: 8px;
    box-shadow: var(--standard-shadow);
    white-space: nowrap;
    
    button {
        background: var(--color-primary);
        color: var(--color-bg-alt);
        border: 1px solid var(--color-accent);
        border-radius: 4px;
        padding: 0.4rem 0.7rem;
        cursor: pointer;
    }

    button.is-copied {
        background: var(--color-accent);
    }
}

.xref {
    color: var(--color-accent);
}

ul, ol {
    margin: 0.75rem 0;
    padding-left: 1rem;
}

.list-simple {
    list-style: none;
    padding-left: 0;
}

.list-simple li {
    margin-bottom: 0.75rem;
}

.list-bullet li {
    margin-bottom: 0.4rem;
}

.list-number li {
    margin-bottom: 0.4rem;
}

.list-title {
    margin-bottom: 0.5rem;
}

.table-wrap {
    margin: 1.5rem 0;
    overflow-x: auto;
}

.table-caption {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0.5rem 0;
}

thead {
    background: var(--color-primary);
    color: white;
}

th {
    padding: 0.6rem 0.75rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
}

td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
}

tbody tr:nth-child(even) {
    background: var(--color-bg-alt);
}

tbody tr:hover {
    background: #edf2f7;
}

.table-footnotes {
    margin-top: 0.5rem;
    padding: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-light);
    border-top: 1px solid var(--color-border);
}

.table-footnotes .footnote {
    margin: 0.25rem 0;
}

figure {
    margin: 1.5rem 0;
    text-align: center;
}

figure img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text-light);
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.attribution {
    font-size: 0.8rem;
    color: var(--color-text-light);
    font-style: italic;
}

blockquote {
    margin: 0;
    padding: 1.5rem;

    border: 1px solid;
    border-radius: 6px;
    border-color: var(--color-border);

    background: var(--color-bg-alt);
}

.boxed-text {
    margin: 1.5rem 0;
    padding: 1.25rem;
    border-radius: 6px;
    border-left: 4px solid;
}

.boxed-text.sidebar-small, .boxed-text.sidebar-medium {
    background: var(--color-example-bg);
    border-color: var(--color-example-border);
}

.boxed-text.sidebar-large {
    background: var(--color-sidebar-bg);
    border-color: var(--color-sidebar-border);
}

.boxed-text h3,
.boxed-text h4,
.boxed-text h5,
.boxed-text h6 {
    margin-top: 0;
    font-size: 1.05rem;
}

.boxed-text > section {
    margin-bottom: 0;
}

.boxed-text > section > :first-child {
    margin-top: 0;
}

.boxed-text > section > :last-child {
    margin-bottom: 0;
}

.footnotes {
    margin: 1rem 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.footnote {
    margin: 0.3rem 0;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.glossary {
    margin: 2rem 0;
}

dl.def-list {
    margin: 1rem 0;
}

dl.def-list dt {
    font-weight: bold;
    color: var(--color-primary);
    margin-top: 1rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

dl.def-list dd {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
    padding-left: 0;
}

.references {
    margin: 2rem 0;
}

.reference-list {
    font-size: 0.9rem;
    line-height: 1.5;
    list-style: none;
}

.reference-list li {
    margin-bottom: 1rem;
    padding-left: 0.25rem;
    text-indent: 1em hanging;
}

.reference-label {
    margin-inline-end: 0.4em;
}

.chapter {
    padding-top: 2rem;
    border-top: 3px solid var(--color-deemphasized);
    margin-top: 3rem;
}

.chapter:first-child {
    border-top: none;
    margin-top: 0;
}

.front-matter-part {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.front-matter-part.copyright {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.appendix-group, .appendix {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--color-primary);
}

.formula {
    margin: 1rem 0;
    padding: 0.5rem;
    text-align: center;
    font-style: italic;
}

.inline-formula {
    font-style: italic;
}

.small-caps {
    font-variant: small-caps;
}

@media (max-width: 1720px) {
    #book-scroll #book-scroll-left-panel .toc-sticky {
        margin: 0;

        top: 0;
        bottom: 0;
        height: 100vh;

        nav.toc {
            height: 100vh;
            max-height: 100vh;
            border-radius: 0;
        }
    }
}

@media print {
    body { display: none; }
}
