/* Editorial theme: paper, one ink, one accent, hairline rules, serif text and
   monospaced labels. Loaded last; overrides the earlier blue card theme.
   Article structure (opener, § numbers, statement labels, figure captions)
   is produced by book_layout.py and overrides/partials/book-opener.html. */

/* ---------- Tokens ---------- */
body {
    --ed-paper: #f4f1ea;
    --ed-paper-deep: #ebe6db;
    --ed-ink: #1c1b19;
    --ed-ink-soft: #3a3833;
    --ed-muted: #77726a;
    --ed-rule: rgba(28, 27, 25, 0.16);
    --ed-rule-strong: #1c1b19;
    --ed-accent: #a8361f;
    --ed-serif: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif", "Songti SC", "STSong", "SimSun", serif;
    --ed-mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", Menlo, Consolas, var(--ed-serif);
    --ed-margin: 280px;
}

body[data-md-color-scheme="slate"] {
    --ed-paper: #151412;
    --ed-paper-deep: #1d1c19;
    --ed-ink: #e9e4d8;
    --ed-ink-soft: #cfc9bc;
    --ed-muted: #8f897d;
    --ed-rule: rgba(233, 228, 216, 0.14);
    --ed-rule-strong: #e9e4d8;
    --ed-accent: #e0805f;
}

body,
body[data-md-color-scheme="slate"] {
    --zdd-reading-font: var(--ed-serif);
    --zdd-canvas: var(--ed-paper);
    --zdd-article-bg: var(--ed-paper);
    --zdd-nav-bg: var(--ed-paper);
    --zdd-nav-ink: var(--ed-ink);
    --zdd-paper: var(--ed-paper);
    --zdd-paper-soft: var(--ed-paper-deep);
    --zdd-ink: var(--ed-ink);
    --zdd-muted: var(--ed-muted);
    --zdd-line: var(--ed-rule);
    --zdd-progress: var(--ed-accent);
    --zdd-surface: var(--ed-paper);
    --zdd-surface-hover: var(--ed-paper-deep);
    --zdd-surface-border: var(--ed-rule);
    --zdd-surface-shadow: none;
    --zdd-surface-ink: var(--ed-ink);
    --zdd-surface-muted: var(--ed-muted);
    --zdd-card-bg: var(--ed-paper);
    --zdd-card-bg-hover: var(--ed-paper-deep);
    --zdd-card-border: var(--ed-rule);
    --zdd-card-shadow: none;
    --zdd-card-ink: var(--ed-ink);
    --zdd-card-muted: var(--ed-muted);
    --zdd-display-ink: var(--ed-ink);
    --zdd-scroll-thumb: var(--ed-muted);
    --zdd-scroll-track: transparent;
    --zdd-reading-link: var(--ed-accent);
    --md-default-bg-color: var(--ed-paper);
    --md-default-fg-color: var(--ed-ink);
    --md-default-fg-color--light: var(--ed-muted);
    --md-default-fg-color--lighter: var(--ed-rule);
    --md-typeset-color: var(--ed-ink);
    --md-typeset-a-color: var(--ed-ink);
    --md-accent-fg-color: var(--ed-accent);
    --md-primary-fg-color: var(--ed-ink);
    --md-code-bg-color: var(--ed-paper-deep);
    background: var(--ed-paper);
    color: var(--ed-ink);
}

/* ---------- Chrome ---------- */
body .md-header {
    background: var(--ed-paper) !important;
    color: var(--ed-ink) !important;
    box-shadow: none !important;
    border-bottom: 1px solid var(--ed-rule-strong);
}

body .md-header a,
body .md-header .md-header__button,
body .md-header .md-ellipsis { color: var(--ed-ink) !important; }

body .md-header .md-ellipsis,
body .zdd-header-search,
body .zdd-header-nav a {
    color: var(--ed-ink) !important;
    font-family: var(--ed-mono) !important;
    font-size: 0.62rem !important;
    font-weight: 400 !important;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

body .zdd-header-nav a:hover,
body .zdd-header-search:hover { color: var(--ed-accent) !important; }

body .md-content,
body.article-layout .md-content {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-top: 0 !important;
}

body .md-footer,
body .md-footer-meta { background: var(--ed-paper) !important; color: var(--ed-muted); }
body .md-footer { border-top: 1px solid var(--ed-rule-strong); }

body .md-footer .md-copyright,
body .md-footer .md-copyright * {
    color: var(--ed-muted) !important;
    font-family: var(--ed-mono);
    font-size: 0.56rem;
    letter-spacing: 0.08em;
}

body .md-footer .md-social__link { color: var(--ed-ink); }

body .md-top {
    border: 1px solid var(--ed-rule-strong);
    border-radius: 0;
    background: var(--ed-paper);
    box-shadow: none;
    color: var(--ed-ink);
    font-family: var(--ed-mono);
    font-size: 0.56rem;
    letter-spacing: 0.12em;
}

/* ---------- Text (all pages) ---------- */
body .md-typeset {
    color: var(--ed-ink);
    font-family: var(--ed-serif);
    text-autospace: normal;
    text-spacing-trim: trim-start;
    hanging-punctuation: allow-end;
}

body .md-typeset a {
    color: var(--ed-ink);
    text-decoration: underline;
    text-decoration-color: var(--ed-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
}

body .md-typeset a:hover { color: var(--ed-accent); }

body .md-typeset :is(h1, h2, h3, h4) { color: var(--ed-ink); font-family: var(--ed-serif); }

body .md-typeset h1 {
    font-size: 2.1em;
    font-weight: 900;
    letter-spacing: 0.01em;
}

body .md-typeset h2 {
    margin: 3em 0 1em;
    padding: 0.7em 0 0 !important;
    border: 0 !important;
    border-top: 1px solid var(--ed-rule-strong) !important;
    font-size: 1.4em;
    font-weight: 900;
    line-height: 1.35;
}

body .md-typeset h3 { font-size: 1.05em; font-weight: 700; }
body .md-typeset .headerlink { color: var(--ed-muted); text-decoration: none; }

body .md-typeset :is(code, pre > code) { background: var(--ed-paper-deep); border-radius: 0; }

body .md-typeset table:not([class]) {
    border: 0;
    border-top: 1px solid var(--ed-rule-strong);
    border-bottom: 1px solid var(--ed-rule-strong);
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

body .md-typeset table:not([class]) th {
    background: transparent;
    border-bottom: 1px solid var(--ed-rule-strong);
    color: var(--ed-ink);
    font-family: var(--ed-mono);
    font-size: 0.85em;
    font-weight: 400;
    letter-spacing: 0.08em;
}

body .md-typeset table:not([class]) td { border-top: 1px solid var(--ed-rule); }
body .md-typeset table:not([class]) tr:hover { background: var(--ed-paper-deep); box-shadow: none; }

/* ---------- Article body ---------- */
body.article-layout .md-typeset {
    font-size: 0.84rem;
    line-height: 1.95;
}

body.article-layout .md-typeset strong { font-weight: 700; }

body.article-layout .md-typeset h2 { margin-top: 3.6em; font-size: 1.45em; }

body .book-secnum {
    display: block;
    margin-bottom: 0.55em;
    color: var(--ed-accent);
    font-family: var(--ed-mono);
    font-size: 0.42em;
    font-weight: 400;
    letter-spacing: 0.18em;
}

body.article-layout .md-typeset h3 { margin: 2.4em 0 0.7em; }

.book-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Chapter opener ---------- */
.book-opener { margin: 0.6rem 0 3.4rem; }

.book-runhead {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--ed-rule-strong);
    font-family: var(--ed-mono);
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.md-typeset .book-runhead a,
.book-runhead span { color: var(--ed-ink) !important; text-decoration: none !important; }
.md-typeset .book-runhead a:hover { color: var(--ed-accent) !important; }

.book-title-row { margin: 2.6rem 0 0; }

.book-title-row.has-numeral {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: end;
    gap: 0 1.6rem;
}

.book-numeral {
    color: var(--ed-accent);
    font-family: var(--ed-serif);
    font-size: 6.2rem;
    font-weight: 300;
    line-height: 0.78;
    letter-spacing: -0.04em;
}

.md-typeset .book-opener h1 {
    margin: 0;
    font-size: 2.35em;
    font-weight: 900;
    line-height: 1.22;
}

.md-typeset .book-standfirst {
    margin: 2rem 0 0;
    color: var(--ed-ink-soft);
    font-size: 1.16em;
    line-height: 1.85;
}

.book-meta {
    display: flex;
    flex-wrap: wrap;
    margin-top: 2rem;
    border-top: 1px solid var(--ed-rule-strong);
    border-bottom: 1px solid var(--ed-rule);
    color: var(--ed-muted);
    font-family: var(--ed-mono);
    font-size: 0.56rem;
    letter-spacing: 0.08em;
}

.book-meta span {
    margin-right: 1.1rem;
    padding: 0.5rem 1.1rem 0.5rem 0;
    border-right: 1px solid var(--ed-rule);
}

.book-meta span:last-child { border-right: 0; }

/* Older article heads (series catalogs) */
body.article-layout .zdd-reading-dates { font-family: var(--ed-mono); font-size: 0.58rem; letter-spacing: 0.08em; color: var(--ed-muted); }
body .zdd-course-crumb, body .zdd-course-crumb a { font-family: var(--ed-mono); letter-spacing: 0.12em; color: var(--ed-ink); }

/* ---------- Statements ---------- */
body .md-typeset :is(.admonition, details):is(.theorem, .proposition, .prop, .lemma, .corollary, .property,
    .definition, .problem, .example) {
    margin: 2em 0 1.6em;
    padding: 0.75rem 0 0.2rem;
    border: 0;
    border-top: 1px solid var(--ed-rule);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 1em;
}

/* Theorem-like statements carry a short accent tick on their rule. */
body .md-typeset :is(.admonition, details):is(.theorem, .proposition, .prop, .lemma, .corollary, .property, .problem) {
    background: linear-gradient(var(--ed-accent), var(--ed-accent)) 0 -1px / 2.2rem 2px no-repeat;
}

body .md-typeset :is(.theorem, .proposition, .prop, .lemma, .corollary, .property, .definition, .problem, .example)
    > :is(.admonition-title, summary) {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 0.9em;
    margin: 0 0 0.35em;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ed-ink);
    font-weight: 400;
}

body .md-typeset :is(.theorem, .proposition, .prop, .lemma, .corollary, .property, .definition, .problem, .example)
    > :is(.admonition-title, summary)::before { display: none; }

body .md-typeset .book-label {
    flex: none;
    color: var(--ed-accent);
    font-weight: 700;
    letter-spacing: 0.08em;
}

body .md-typeset .book-name { color: var(--ed-ink); font-weight: 700; }

body .md-typeset :is(.admonition, details).definition {
    padding: 0.8rem 1.1rem 0.4rem;
    border-top: 0;
    background: var(--ed-paper-deep);
}

body .md-typeset :is(.admonition, details).problem { border-top-style: dotted; }
body .md-typeset .example .book-label { color: var(--ed-muted); }

/* Proofs */
body .md-typeset :is(.admonition, details):is(.proof, .solution) {
    margin-top: -0.6em;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body .md-typeset :is(.admonition, details):is(.proof, .solution) > :is(.admonition-title, summary) {
    background: transparent;
    color: var(--ed-muted);
    font-family: var(--ed-mono);
    font-size: 0.7em;
    font-style: normal;
    font-weight: 400;
    letter-spacing: 0.12em;
}

body .md-typeset :is(.admonition, details[open]):is(.proof, .solution) { border-left: 1px solid var(--ed-rule); }
body .md-typeset :is(.proof, .solution) > :last-child:not(summary):not(.admonition-title)::after { color: var(--ed-ink); }

/* Other admonitions: quiet ruled notes */
body .md-typeset .admonition:is(.note, .remark, .info, .tip, .warning, .abstract, .question, .quote),
body .md-typeset details:is(.note, .remark, .info, .tip, .warning, .abstract, .question, .quote) {
    border: 0;
    border-top: 1px solid var(--ed-rule);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0.5rem 0 0;
    font-size: 0.9em;
}

body .md-typeset .admonition:is(.note, .remark, .info, .tip, .warning, .abstract, .question, .quote) > .admonition-title,
body .md-typeset details:is(.note, .remark, .info, .tip, .warning, .abstract, .question, .quote) > summary {
    padding: 0;
    background: transparent;
    color: var(--ed-accent);
    font-family: var(--ed-mono);
    font-size: 0.86em;
    font-weight: 400;
    letter-spacing: 0.12em;
}

body .md-typeset .admonition:is(.note, .remark, .info, .tip, .warning, .abstract, .question, .quote) > .admonition-title::before { display: none; }

/* ---------- Figures ---------- */
body .md-typeset p.book-figure {
    position: relative;
    margin: 2.6em 0;
    text-align: center;
}

body .md-typeset p.book-figure img {
    border-radius: 0;
    box-shadow: none !important;
    outline: 1px solid var(--ed-rule);
    background: #fff;
}

body .md-typeset p.book-figure.is-wide img { display: block; width: 100%; height: auto; max-width: 100% !important; margin: 0 !important; }

body .book-caption {
    display: flex;
    gap: 0.9em;
    margin-top: 0.7rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--ed-rule);
    color: var(--ed-ink-soft);
    font-size: 0.72rem;
    line-height: 1.6;
    text-align: left;
}

body .book-caption b {
    flex: none;
    color: var(--ed-accent);
    font-family: var(--ed-mono);
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body .md-typeset p.book-figure .zdd-media-expand {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    margin: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}

body .md-typeset p.book-figure:hover .zdd-media-expand,
body .md-typeset p.book-figure .zdd-media-expand:focus-visible { opacity: 1; }

/* ---------- Table of contents ---------- */
body .md-sidebar--secondary .md-nav--secondary {
    padding: 0.55rem 0 0 !important;
    border: 0 !important;
    border-top: 1px solid var(--ed-rule-strong) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body .md-sidebar--secondary .md-nav--secondary .md-nav__title {
    padding: 0 0 0.6rem;
    background: transparent;
    box-shadow: none;
    color: var(--ed-ink);
    font-family: var(--ed-mono);
    font-size: 0.56rem;
    font-weight: 400;
    letter-spacing: 0.16em;
}

body .md-sidebar--secondary .md-nav--secondary .md-nav__link {
    padding-left: 0;
    border-left: 0 !important;
    color: var(--ed-muted);
    font-family: var(--ed-serif);
    font-size: 0.64rem;
}

body .md-sidebar--secondary .md-nav--secondary .md-nav__link:hover { color: var(--ed-ink); }

body .md-sidebar--secondary .md-nav--secondary .md-nav__link--active {
    margin-left: -0.6rem;
    padding-left: 0.5rem;
    box-shadow: inset 2px 0 0 var(--ed-accent);
    color: var(--ed-ink);
    font-weight: 700;
}

/* ---------- Article end ---------- */
body .zdd-article-end {
    margin-top: 4.5rem;
    padding: 0.8rem 0 0;
    border: 0;
    border-top: 1px solid var(--ed-rule-strong);
    border-radius: 0;
    background: transparent;
}

body .md-typeset .zdd-pager-link {
    padding: 0.2rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

body .md-typeset a.zdd-pager-link:hover { transform: none; }
body .md-typeset a.zdd-pager-link:hover .zdd-pager-title { color: var(--ed-accent); }

body .zdd-pager-label,
body .zdd-end-label,
body .md-typeset .zdd-pager-catalog,
body .zdd-comments-title {
    color: var(--ed-muted);
    font-family: var(--ed-mono);
    font-size: 0.62rem;
    font-weight: 400;
    letter-spacing: 0.12em;
}

body .md-typeset .zdd-pager-title { color: var(--ed-ink); font-size: 1.05em; }
body .md-typeset .zdd-end-chip { border-radius: 0; font-family: var(--ed-mono); font-size: 0.9em; }
body .md-typeset .zdd-end-chip.is-category { background: var(--ed-ink); color: var(--ed-paper); }
body .md-typeset :is(a.zdd-pager-link, a.zdd-end-chip, .zdd-end-links a, .zdd-pager-catalog) { text-decoration: none; }

/* ---------- Home ---------- */
body.home-layout .md-typeset h1,
body.home-layout .md-content__inner > h1 {
    font-family: var(--ed-serif) !important;
    font-weight: 900 !important;
    color: var(--ed-ink) !important;
}

body .minimal-search input {
    border: 0 !important;
    border-bottom: 1px solid var(--ed-rule-strong) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--ed-ink) !important;
    font-family: var(--ed-serif) !important;
}

body .minimal-search input:focus { border-bottom-color: var(--ed-accent) !important; }
body .minimal-search input::placeholder { color: var(--ed-muted) !important; }

body .minimal-search-results {
    border: 1px solid var(--ed-rule-strong) !important;
    border-radius: 0 !important;
    background: var(--ed-paper) !important;
    box-shadow: none !important;
}

/* ---------- Cards and lists (blog, tags, friends, lab) ---------- */
body :is(.zdd-post-card, .zdd-catalog-folder, .friend-card, .zdd-lab-card, .zdd-statement-card, .zdd-tag-group) {
    border: 0 !important;
    border-top: 1px solid var(--ed-rule-strong) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--ed-ink) !important;
}

body :is(.zdd-post-card, .friend-card):hover {
    transform: none !important;
    background: var(--ed-paper-deep) !important;
}

body .md-typeset :is(.zdd-tag-cloud a, .zdd-tag-chip, .zdd-category-chip) {
    border-radius: 0 !important;
    font-family: var(--ed-mono);
    text-decoration: none;
}

body .md-typeset .zdd-tag-cloud a { border-color: var(--ed-rule) !important; color: var(--ed-ink) !important; background: transparent !important; }
body .md-typeset .zdd-tag-cloud a:hover { border-color: var(--ed-accent) !important; color: var(--ed-accent) !important; }
body .md-typeset .zdd-tag-cloud small { color: var(--ed-muted) !important; }

body .md-typeset .zdd-tag-group h2 {
    border-top: 0 !important;
    padding-top: 0 !important;
    font-family: var(--ed-mono);
    font-size: 0.62rem;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

body .friend-avatar { border-radius: 0 !important; }

/* ---------- Wide layout: contents | text | margin ---------- */
@media screen and (min-width: 76.25em) {
    body.article-layout .md-main__inner.md-grid { max-width: 1240px; }

    body.article-layout .md-sidebar--secondary {
        order: -1;
        width: 190px;
        margin-right: 56px;
    }

    body.article-layout .md-sidebar--secondary .md-sidebar__scrollwrap { margin-top: 2.2rem; }

    body.article-layout .md-content {
        flex: 0 1 980px;
        max-width: 980px;
    }

    body.article-layout .md-content__inner {
        margin: 0 var(--ed-margin) 3rem 0 !important;
        padding-top: 1.6rem !important;
    }

    body.article-layout .book-opener { margin-right: calc(-1 * var(--ed-margin)); }
    body.article-layout .md-typeset .book-standfirst { max-width: 700px; }

    /* Top-level remarks sit in the margin. */
    body.article-layout .md-typeset .md-content__inner > .admonition:is(.note, .remark, .info, .tip),
    body.article-layout .md-content__inner.md-typeset > .admonition:is(.note, .remark, .info, .tip) {
        float: right;
        clear: right;
        width: 220px;
        margin: 0.3em calc(-1 * var(--ed-margin)) 1em 0;
        color: var(--ed-ink-soft);
        font-size: 0.74em;
        line-height: 1.8;
    }

    body.article-layout .md-content__inner > .admonition:is(.note, .remark, .info, .tip) mjx-container[display="true"] {
        overflow-x: auto;
        max-width: 100%;
        font-size: 90% !important;
    }

    body.article-layout .md-typeset p.book-figure.is-wide { margin-right: calc(-1 * var(--ed-margin)); }
    body.article-layout .zdd-article-end,
    body.article-layout .zdd-comments { margin-right: calc(-1 * var(--ed-margin) + 60px); }
}

@media screen and (max-width: 44.9375em) {
    .book-title-row.has-numeral { grid-template-columns: 1fr; gap: 0.8rem; margin-top: 1.8rem; }
    .book-numeral { font-size: 4.2rem; }
    .md-typeset .book-opener h1 { font-size: 1.8em; }
    .md-typeset .book-standfirst { font-size: 1.04em; }
}

/* ---------- Component clean-up: square corners, ink and accent only ---------- */
body .friend-directory,
body[data-md-color-scheme="slate"] .friend-directory,
body {
    --friend-ink: var(--ed-ink);
    --friend-muted: var(--ed-muted);
    --friend-line: var(--ed-rule);
    --friend-hover: var(--ed-paper-deep);
    --zdd-statement-definition: var(--ed-paper-deep);
    --zdd-statement-problem: var(--ed-paper-deep);
}

html body .md-top.md-icon, html body [dir] .md-top.md-icon { border-radius: 0 !important; }
body .minimal-search-results:empty { display: none; }

body .md-typeset .zdd-catalog-folder,
body .md-typeset .zdd-catalog-folder > summary,
body .md-typeset a.zdd-post-card.catalog {
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body .md-typeset .zdd-catalog-folder > summary { font-family: var(--ed-serif); }
body .md-typeset .zdd-catalog-folder > summary:hover,
body .md-typeset a.zdd-post-card.catalog:hover { background: var(--ed-paper-deep) !important; }

body .zdd-tag-heading {
    color: var(--ed-ink) !important;
    font-family: var(--ed-serif);
    font-weight: 900;
}

body .md-typeset h1,
body .md-typeset .friend-directory-header :is(h1, h2) { color: var(--ed-ink); }
body .md-typeset .friend-directory a.friend-link { border-radius: 0; }
body .md-typeset .friend-directory a.friend-link:hover { transform: none; }
body .friend-avatar { border-radius: 0; background: var(--ed-paper-deep); }
body .md-typeset .friend-directory :is(.friend-desc, .friend-domain, p) { color: var(--ed-muted); }

body .zdd-lab-list,
body .zdd-lab-list > * { border-color: var(--ed-rule) !important; }
body .md-typeset :is(.zdd-lab-status, .zdd-lab-tag) {
    border-color: var(--ed-rule) !important;
    border-radius: 0 !important;
    color: var(--ed-muted) !important;
    font-family: var(--ed-mono);
    font-size: 0.6rem;
    letter-spacing: 0.06em;
}
body .md-typeset .zdd-lab-status { color: var(--ed-accent) !important; border-color: var(--ed-accent) !important; }

body .md-typeset :is(input[type="search"], input[type="text"], .zdd-statement-more, .zdd-statement-kind-filter) { border-radius: 0 !important; }
body .md-typeset .zdd-statement-kind-filter.is-active { background: var(--ed-ink) !important; color: var(--ed-paper) !important; }
body .md-typeset .zdd-statement-kind {
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--ed-accent) !important;
    font-family: var(--ed-mono);
    font-size: 0.6rem;
    letter-spacing: 0.06em;
}

body .md-typeset .md-button { border-radius: 0; border-color: var(--ed-ink); color: var(--ed-ink); background: transparent; }
body .md-typeset .md-button--primary,
body .md-typeset .md-button:hover { background: var(--ed-ink); border-color: var(--ed-ink); color: var(--ed-paper); }

body.article-layout .md-sidebar--secondary .md-nav--secondary,
body .md-sidebar--secondary .md-nav--secondary { border-radius: 0 !important; padding: 0.55rem 0 0 !important; }
body .md-sidebar--secondary .md-nav--secondary .md-nav__title { padding-left: 0 !important; }

body .md-typeset .zdd-end-label { color: var(--ed-muted) !important; white-space: nowrap; }
body .md-typeset .md-button { text-decoration: none; font-family: var(--ed-mono); font-size: 0.66rem; font-weight: 400; letter-spacing: 0.12em; border-width: 1px; }
body .md-typeset .zdd-end-links a { color: var(--ed-ink); }
body .md-typeset .zdd-end-links a:hover { color: var(--ed-accent); }
body .md-typeset .zdd-catalog-folder > summary .zdd-folder-meta { font-family: var(--ed-mono); font-weight: 400; font-size: 0.58rem; letter-spacing: 0.06em; }
body .md-typeset .zdd-catalog-folder > summary { padding-top: 0.9rem !important; padding-bottom: 0.9rem !important; min-height: 0 !important; align-items: baseline; }
body .md-typeset .zdd-catalog-folder > summary .zdd-folder-name { font-weight: 900; }
body .md-typeset .zdd-catalog-folder[data-level="1"] { border-top-color: var(--ed-rule) !important; }
body .md-typeset .zdd-catalog-folder { padding: 0 !important; margin: 0 !important; }
body .md-typeset .zdd-catalog-folder:not([open]) > .zdd-folder-content { display: none; }
body .md-typeset .admonition:is(.note, .remark, .info, .tip, .warning, .abstract, .question, .quote) > .admonition-title { margin: 0 0 0.2em !important; }

/* ---------- Blog catalog: rows sit evenly between their rules ---------- */
body .md-typeset .zdd-blog-catalog,
body .md-typeset .zdd-catalog-posts { gap: 0 !important; row-gap: 0 !important; }
body .md-typeset .zdd-catalog-folder > summary { align-items: center; margin: 0 !important; }
body .md-typeset .zdd-catalog-folder[open] > .zdd-folder-content { padding-bottom: 0.8rem; }

/* ---------- Code ---------- */
body .md-typeset .highlight,
body .md-typeset pre > code { border-radius: 0 !important; }
body .md-typeset pre > code { font-size: 0.68rem; line-height: 1.7; }

/* Annotated listings have line numbers, so long lines can wrap with a
   hanging indent instead of hiding behind a horizontal scrollbar. */
body .md-typeset code[data-zdd-code] { white-space: pre-wrap; }
body .md-typeset code[data-zdd-code] .zdd-code-line {
    width: 100%;
    padding-left: 4ch;
    text-indent: -4ch;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
body .md-typeset code[data-zdd-code] .zdd-code-line::before { text-indent: 0; }

html body.article-layout .zdd-code-note {
    border: 1px solid var(--ed-rule-strong);
    border-radius: 0;
    background: var(--ed-paper);
    box-shadow: none;
    font-family: var(--ed-serif);
}
html body.article-layout .zdd-code-note-header { border-bottom-color: var(--ed-rule); }
body.article-layout .zdd-code-note-header > #zdd-code-note-title { font-weight: 700; }

/* Plain listings use the margin column on wide screens. */
@media screen and (min-width: 76.25em) {
    body.article-layout .md-content__inner > .highlight:not(:has(code[data-zdd-code])) {
        margin-right: calc(-1 * var(--ed-margin));
    }
}
