/* Deki theme on top of doxygen-awesome.
 *
 * The palette, the fonts and the square-cornered schematic look are
 * dekiengine.com's, so the docs and the site read as one product. The site's
 * values live in hugo-dekiengine/static/css/main.css; the accent is also
 * EditorTheme.h's Accent, which is why the editor matches too.
 *
 * Loaded last of the three stylesheets, but being last is not enough on its
 * own. doxygen-awesome carries its dark palette twice: on `html.dark-mode`
 * for its toggle, and on `html:not(.light-mode)` inside a
 * `prefers-color-scheme: dark` media query. Doxygen does not put a class on
 * <html> at all here, so a bare `html { --x: y }` (0,0,1) LOST to that
 * media-query rule (0,1,1) on any machine set to dark - the pages rendered in
 * doxygen-awesome's #1C1D1F rather than the site's #0a0b0d, and would have
 * differed from one visitor to the next depending on an OS setting. Matching
 * all three selectors is what makes these values win everywhere. The site has
 * one appearance, so the docs follow it whatever the visitor's preference is.
 */

html,
html.dark-mode,
html:not(.light-mode) {
    color-scheme: dark;

    --primary-color: #3ac3ff;
    --primary-dark-color: #7ad6ff;
    --primary-light-color: #3ac3ff;
    --primary-lighter-color: rgba(58, 195, 255, 0.14);
    --primary-lightest-color: rgba(58, 195, 255, 0.07);

    --page-background-color: #0a0b0d;
    --page-foreground-color: #e8e6e1;
    --page-secondary-foreground-color: #7a7a76;
    --separator-color: #1d1f23;
    --side-nav-background: #0d0e11;
    --side-nav-foreground: #e8e6e1;
    --header-background: #0d0e11;
    --header-foreground: #e8e6e1;

    --menu-selected-background: rgba(58, 195, 255, 0.12);
    --menu-focus-background: rgba(58, 195, 255, 0.18);
    --menu-focus-foreground: #e8e6e1;
    --searchbar-background: #101113;
    --searchbar-foreground: #e8e6e1;
    --searchbar-border-radius: 0;
    --search-background-color: #101113;
    --search-foreground-color: #e8e6e1;
    --search-filter-background-color: #101113;
    --search-filter-foreground-color: #e8e6e1;

    --code-background: #060709;
    --code-foreground: #e8e6e1;
    --tablehead-background: #101113;
    --tablehead-foreground: #e8e6e1;
    --blockquote-background: #101113;
    --blockquote-foreground: #9a9a95;

    --odd-color: rgba(255, 255, 255, 0.022);
    --box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);

    /* The site draws hairlines and right angles; nothing on it is rounded. */
    --border-radius-large: 0;
    --border-radius-medium: 0;
    --border-radius-small: 0;

    /* The site sets everything in JetBrains Mono, which suits pages that are
     * a screen long. Reference pages are not: they are read in paragraphs, and
     * mono is tiring at that length. Prose here takes Space Grotesk - the
     * site's other face, so this adds no third typeface - and everything that
     * is code stays mono: signatures, fragments, inline code, the type names
     * in the tree, and the bar, which mirrors the site's own mono nav.
     * Noto Sans JP, SC and KR draw Japanese, Chinese and Korean after the
     * Latin faces; each language's pages load only their own. */
    --font-family: "Space Grotesk", "Noto Sans JP", "Noto Sans SC", "Noto Sans KR", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-family-monospace: "JetBrains Mono", "Noto Sans JP", "Noto Sans SC", "Noto Sans KR", "Fira Code", ui-monospace, Consolas, monospace;
    --font-family-display: "Space Grotesk", "Noto Sans JP", "Noto Sans SC", "Noto Sans KR", ui-sans-serif, system-ui, sans-serif;

    --page-font-size: 15px;
    --navigation-font-size: 13px;
    --toc-font-size: 13px;
    --code-font-size: 13px;
    --title-font-size: 21px;
    --content-line-height: 26px;

    /* Admonitions, keyed to the site's blue and its warm syntax colours. */
    --warning-color: #241d08;
    --warning-color-dark: #e2c799;
    --warning-color-darker: #f0e0c4;
    --note-color: #0c1f2b;
    --note-color-dark: #3ac3ff;
    --note-color-darker: #cdecfb;
    --todo-color: #141a26;
    --todo-color-dark: #8ab4f8;
    --todo-color-darker: #d6e4fb;
    --deprecated-color: #16171a;
    --deprecated-color-dark: #7a7a76;
    --deprecated-color-darker: #c7c6c2;
    --bug-color: #23120f;
    --bug-color-dark: #e08a7d;
    --bug-color-darker: #f5cdc7;
    --invariant-color: #11201a;
    --invariant-color-dark: #9bd0a0;
    --invariant-color-darker: #d3ecd6;

    --fragment-background: #060709;
    --fragment-foreground: #e8e6e1;
    --fragment-keyword: #3ac3ff;
    --fragment-keywordtype: #7ad6ff;
    --fragment-keywordflow: #e2c799;
    --fragment-token: #9bd0a0;
    --fragment-comment: #6a6a66;
    --fragment-link: #3ac3ff;
    --fragment-preprocessor: #9bd0a0;
    --fragment-linenumber-color: #52524f;
    --fragment-linenumber-background: #0a0b0d;
    --fragment-linenumber-border: #1d1f23;

    /* Height of the site bar in the header; the layout below offsets by it. */
    --deki-bar-height: 52px;

    /* Doxygen-awesome's sidebar header block, which holds the project name,
     * the brief and the search box. Its 120px default was sized for the
     * stock font; the mono face and the brief at this size overflow it, and
     * the search box then lands on top of the first tree item. */
    --top-height: 148px;
}

/* The package sites build with SEARCHENGINE = NO, so their header has no
 * search box and the reserved height left a gap above the tree. Keyed off the
 * box itself rather than a per-site stylesheet, so one theme serves both. */
html:not(:has(#MSearchBox)),
html.dark-mode:not(:has(#MSearchBox)),
html:not(.light-mode):not(:has(#MSearchBox)) {
    --top-height: 96px;
}

/* Doxygen 1.18 builds the results as a plain div, and it grows past the
 * window the script sizes: 1125px of hits inside a 402px box, spilling down
 * the page over the nav tree with nothing behind them. */
#MSearchResultsWindow {
    max-height: min(60vh, 520px);
    overflow-y: auto;
    background: var(--page-background-color);
}

/* The 32px grid the site draws across every page. */
body {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px);
    background-size: 32px 32px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
div.title, .title, #projectname {
    font-family: var(--font-family-display);
    letter-spacing: -0.01em;
}

/* ───────────────────────────── site bar ───────────────────────────── */
.deki-bar {
    font-family: var(--font-family-monospace);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 18px;
    height: var(--deki-bar-height);
    padding: 0 20px;
    border-bottom: 1px solid var(--separator-color);
    background: rgba(10, 11, 13, 0.86);
    backdrop-filter: blur(12px) saturate(1.2);
    font-size: 12px;
}

.deki-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
}
.deki-bar a:link,
.deki-bar a:visited {
    color: var(--page-foreground-color) !important;
    font-weight: 400;
    text-decoration: none;
}
.deki-brand .deki-cat { display: block; width: 32px; height: 18px; flex-shrink: 0; }
/* Every link here loads a whole page, so the cat stays still instead of climbing
 * back into view each time. */
.deki-brand .deki-cat * { animation: none !important; }
.deki-brand-name {
    font-size: 12.5px;
    letter-spacing: 0.08em;
    white-space: nowrap;
}
.deki-slash { color: var(--page-secondary-foreground-color); }

.deki-bar-tag {
    padding: 2px 7px;
    border: 1px solid rgba(58, 195, 255, 0.45);
    color: var(--primary-color);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Manual and API reference: the bar's underlined pair, in the site's nav style. */
.deki-tabs { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.deki-tab { position: relative; padding: 8px 12px; }
.deki-tab::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 3px;
    height: 1.5px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.12s ease;
}
.deki-tab:hover::after { transform: scaleX(1); }
html[data-deki-tab="manual"] .deki-tab-manual::after,
html[data-deki-tab="api"] .deki-tab-api::after { transform: scaleX(1); }
html[data-deki-tab="manual"] .deki-bar a.deki-tab-manual:link,
html[data-deki-tab="manual"] .deki-bar a.deki-tab-manual:visited,
html[data-deki-tab="api"] .deki-bar a.deki-tab-api:link,
html[data-deki-tab="api"] .deki-bar a.deki-tab-api:visited { color: var(--primary-color) !important; }

.deki-bar-links {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.deki-nav-label {
    font-size: 11.5px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}
.deki-bar-links > a {
    padding: 7px 10px;
    transition: background-color 120ms linear, color 120ms linear;
}
.deki-bar-links > a:not(.deki-chip):hover {
    background: #101113;
    color: var(--primary-color) !important;
}
.deki-bar-sep {
    width: 1px;
    height: 20px;
    margin: 0 8px;
    background: var(--separator-color);
}

.deki-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px !important;
    border: 1px solid #26282d;
    background: #101113;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}
.deki-chip:hover {
    border-color: var(--primary-color);
    background: rgba(58, 195, 255, 0.12);
}
/* A mark with no word beside it: GitHub, Discord and donate. The word stays
 * in the markup for screen readers. Same as the site's bar. */
.deki-chip-icon { padding: 6px 8px !important; }
.deki-chip-icon span { display: none; }

/* The language menu: one entry per language, each in its own script. A
 * <details> opens it without script; the script only points each entry at
 * the same page in that language. */
.deki-lang { position: relative; }
.deki-lang > summary {
    list-style: none;
    cursor: pointer;
    padding: 7px 10px;
    white-space: nowrap;
}
.deki-lang > summary::-webkit-details-marker { display: none; }
/* doxygen.css turns every summary into a rotating triangle. */
.deki-lang > summary::before { content: none; }
.deki-lang > summary::after { content: " \25BE"; color: var(--page-secondary-foreground-color); }
.deki-lang > summary:hover { background: #101113; color: var(--primary-color); }
.deki-lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    display: flex;
    flex-direction: column;
    min-width: 140px;
    border: 1px solid #26282d;
    background: #0a0b0d;
}
.deki-lang-menu a { padding: 8px 12px; }
.deki-lang-menu a:hover { background: #101113; color: var(--primary-color) !important; }
.deki-lang-menu a[aria-current] { color: var(--primary-color) !important; }

/* ─────────────────────── room for the site bar ───────────────────────
 * Doxygen's treeview layout fixes the sidebar and scrolls #doc-content
 * rather than the page, so nothing moves out of the bar's way on its own:
 * each fixed piece is offset by the bar's height here. */
#top { margin-top: var(--deki-bar-height); }

@media screen and (min-width: 768px) {
    #side-nav {
        top: calc(var(--top-height) + var(--deki-bar-height));
    }
    #nav-tree,
    #side-nav {
        height: calc(100vh - var(--top-height) - var(--deki-bar-height)) !important;
    }
    #doc-content {
        height: calc(100vh - 31px - var(--deki-bar-height)) !important;
        margin-top: var(--deki-bar-height);
    }
    /* The splitter draws its own shadow up the full height of the header;
     * without the extra reach it stops short of the bar. */
    .ui-resizable-handle {
        box-shadow: 0 calc(-2 * (var(--top-height) + var(--deki-bar-height))) 0 0 var(--separator-color);
    }
}

@media screen and (max-width: 767px) {
    /* Doxygen's own layout scrolls the page at this width, so the bar rides
     * along instead of being fixed. It also has to be free to grow: at a
     * fixed 52px the links wrapped to a second row that overlapped the
     * project title underneath. The three word links go -- the brand is the
     * way back to the site -- and the two chips stay, since those are what
     * someone reaching for the code or the room is after. */
    .deki-bar {
        position: static;
        height: auto;
        flex-wrap: wrap;
        gap: 10px;
        padding: 8px 14px;
    }
    #top { margin-top: 0; }
    .deki-bar-tag,
    .deki-bar-sep,
    .deki-bar-links > a:not(.deki-chip) { display: none; }
}

/* ───────────────────────── doxygen chrome ───────────────────────── */
/* Doxygen paints the page title in the primary colour. On the site a heading
 * is foreground and the blue is kept for links and marks, so it reads as
 * emphasis rather than as the default. */
div.title, .title { color: var(--page-foreground-color); }
/* Doxygen wraps the main page's own title in a link to itself, and
 * doxygen-awesome colours every link with !important, so the title above
 * stayed blue on exactly one page until this took it back. */
div.title a, .title a { color: inherit !important; }

#titlearea { border-bottom: 1px solid var(--separator-color); }
#projectname { font-size: var(--title-font-size); letter-spacing: 0; }
#projectnumber {
    font-size: 11px;
    color: var(--primary-color);
}
#projectbrief { color: var(--page-secondary-foreground-color); font-size: 11.5px; }

/* Code stays mono even though prose no longer is. Doxygen already uses the
 * monospace face for fragments and inline code, but the member tables and the
 * parameter lists are ordinary tables, and a C++ signature set in a
 * proportional face is worse than any paragraph gains. The tree is mostly
 * type names, and short enough that mono costs nothing there. */
/* doxygen-awesome names `#nav-tree .label` (1,1,0) in its font rule, which
 * outranks a bare `#nav-tree`, so the tree needs the class spelled out. */
#nav-tree,
#nav-tree .label,
#nav-tree a,
.navpath li.navelem a,
#projectnumber,
table.memberdecls .memItemLeft,
table.memberdecls .memItemRight,
table.memberdecls .memTemplItemLeft,
table.memberdecls .memTemplItemRight,
table.memberdecls .memTemplParams,
.memname, .memproto, .memtitle,
.paramtype, .paramname, .retval,
div.contents table.markdownTable td:first-child {
    font-family: var(--font-family-monospace);
}

#nav-tree .item > a,
#nav-tree .label { font-size: var(--navigation-font-size); }
#nav-tree .selected {
    background: var(--menu-selected-background);
    box-shadow: inset 2px 0 0 0 var(--primary-color);
    text-shadow: none;
}

/* doxygen-awesome fakes a full-bleed rule under a section heading with a
 * stack of box-shadows painted in --page-background-color. That only works on
 * a flat page: over the site's grid the shadows cover it in opaque blocks
 * that end in mid-air, which is the stray bar at the right of every section
 * heading. A plain border does the same job. */
div.contents .doxysection,
h1.groupheader,
h2.groupheader,
td h2.groupheader {
    box-shadow: none;
    border-bottom: 1px solid var(--separator-color);
    color: var(--page-foreground-color);
}

/* Doxygen's own dark sheet draws the member tables in its navy (#233250 on
 * the borders, black in the heading shadows). doxygen-awesome recolours the
 * cells' top and bottom but not their sides, and not the description rows at
 * all, which left blue rules down a table that is grey everywhere else. */
table.memberdecls .memItemLeft,
table.memberdecls .memItemRight,
table.memberdecls .memTemplParams,
table.memberdecls .memTemplItemLeft,
table.memberdecls .memTemplItemRight,
table.memberdecls .mdescLeft,
table.memberdecls .mdescRight,
table.memberdecls .memSeparator {
    border-color: var(--separator-color);
}

/* Tables are the site's tables now. The hairline grid was already the same
 * colour, but the cells were half the site's padding, which packed the rules
 * into a ladder, and the head row was plain bold text rather than the site's
 * small accent caps. */
table.doxtable th,
table.markdownTable th {
    background: rgba(255, 255, 255, 0.012);
    color: var(--primary-color);
    font-family: var(--font-family-monospace);
    font-weight: 500;
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
table.doxtable th,
table.doxtable td,
table.markdownTable th,
table.markdownTable td {
    border-color: var(--separator-color);
    padding: 10px 14px;
    vertical-align: top;
}
table.markdownTable tr:last-child td,
table.doxtable tr:last-child td { border-bottom: none; }

/* The member tables set every signature row on the code background, which
 * against the page makes a striped ladder the site has no equivalent of. A
 * tenth of that contrast still groups the signature with its description. */
table.memberdecls .memItemLeft,
table.memberdecls .memItemRight,
table.memberdecls .memTemplItemLeft,
table.memberdecls .memTemplItemRight,
table.memberdecls .memTemplParams {
    background-color: var(--odd-color);
    border-top-color: transparent;
}

div.memitem,
div.memproto,
div.fragment,
pre.fragment,
div.toc {
    border-color: var(--separator-color);
}
div.memproto { background: #101113; }

/* Doxygen 1.18 emits inline code from Markdown as <span class="tt">, which
 * doxygen-awesome 2.3 does not style, so it fell back to the browser's
 * light background in dark mode. Give it the theme's code colours. */
span.tt,
.tt {
    font-family: var(--font-family-monospace);
    font-size: var(--code-font-size, 13px);
    background: var(--code-background);
    color: var(--code-foreground);
    border: 1px solid var(--separator-color);
    padding: 1px 5px;
}

/* Generated property tables are wide; let the first column keep its name on one line. */
div.contents table.markdownTable td:first-child {
    white-space: nowrap;
}

/* The breadcrumb strip Doxygen puts at the bottom of every page. Its
 * chevrons are drawn by doxygen-awesome as CSS triangles in
 * --page-background-color, so the strip has to keep that background or the
 * notch in each chevron shows up as a black wedge. */
#nav-path ul {
    background: var(--page-background-color);
    border-top: 1px solid var(--separator-color);
    font-size: 11px;
}
#nav-path li.footer { color: var(--page-secondary-foreground-color); }

/* The package's drawing. Small on purpose: it says what kind of thing the
 * package is, and the reference below it is what the page is for.
 *
 * Matched on the file name because that is all doxygen leaves to match on: it
 * emits every markdown image as <img class="inline"> and keeps nothing else.
 * Covers are the only deki-*.png a package page has. */
div.contents img[src^="deki-"] {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    margin: 4px 0 24px;
    border: 1px solid var(--separator-color);
}
/* Screenshots and diagrams in the guides. */
div.contents img { max-width: 100%; height: auto; }

/* Doxygen wraps a lone image in div.image and centres it. */
div.contents div.image { margin: 0; text-align: left; }

/* The donate chip, the same solid one the website's bar carries. The
 * !important is not decoration: doxygen's own sheet paints every anchor's
 * background and colour from a more specific selector, which is why the chip
 * above does the same. Without it this came out as an outline. */
.deki-chip-solid {
    border-color: var(--primary-color);
    background: var(--primary-color) !important;
    font-weight: 600;
}
/* Spelled out through .deki-bar because that is what the rule it has to beat
 * looks like: .deki-bar a:link paints every link in the bar, !important and
 * all, and a plain .deki-chip-solid loses to it on specificity. */
.deki-bar a.deki-chip-solid:link,
.deki-bar a.deki-chip-solid:visited { color: #0a0b0d !important; }
.deki-chip-solid:hover { background: transparent !important; }
.deki-bar a.deki-chip-solid:hover { color: var(--primary-color) !important; }

/* ───────────────────────── guides and home ─────────────────────────
 * Reads like dekiengine.com: one column of prose at a width people can read,
 * a large plain title, and a lot of room around everything. Doxygen gives a
 * guide page no class of its own; its anchors are the only mark it carries.
 * API pages keep the width their tables need. */
#projectbrief { display: none; }
html, html.dark-mode, html:not(.light-mode) {
    --top-height: 112px;
    --page-font-size: 16px;
    --content-line-height: 28px;
}

/* #doc-content does the scrolling; the bar's offset left the page 21px too tall. */
@media screen and (min-width: 768px) {
    html, body { overflow: clip; }
}

#nav-tree, #nav-tree .label, #nav-tree a { font-family: var(--font-family); }
#nav-tree .item > a, #nav-tree .label { font-size: 15px; }
#nav-tree .item { height: 40px; line-height: 40px; }
#nav-tree .item > a, #nav-tree .label, #nav-tree .label a { line-height: 40px; }
#nav-tree-contents { margin: 16px 0 32px; }
#nav-tree a, #nav-tree a:hover, #nav-tree .label a:hover { text-decoration: none !important; }
#nav-tree .item:hover .label a { color: var(--primary-color) !important; }
/* A small chevron with room around it, always shown so rows do not jump. */
#nav-tree .arrow { opacity: 1 !important; margin-right: 10px; }
#nav-tree span.arrowhead {
    width: 6px;
    height: 6px;
    margin: 0 0 2px 0;
    border-right: 1.5px solid var(--page-secondary-foreground-color);
    border-bottom: 1.5px solid var(--page-secondary-foreground-color);
    transition: transform 0.12s ease;
}
#nav-tree .item:hover span.arrowhead,
#nav-tree .selected span.arrowhead { border-color: var(--primary-color); }
/* The API is one entry. Hidden here and not in DoxygenLayout.xml: a namespaces
 * tab turned off there spills every namespace's functions into the tree. */
#nav-tree li:has(> .item a[href="namespaces.html"]),
#nav-tree li:has(> .item a[href="files.html"]) { display: none; }
/* The tree's root only repeats the title above it. Its children move left by
 * the indent it gave them. */
html[data-deki-tab] #nav-tree-contents > ul > li > .item { display: none; }
html[data-deki-tab] #nav-tree-contents > ul > li > ul.children_ul { margin-left: -16px; }
/* Two halves, one tree: each tab shows its own groups. */
html[data-deki-tab="manual"] #nav-tree-contents > ul > li > ul > li:has(> .item a[href="annotated.html"]) { display: none; }
html[data-deki-tab="api"] #nav-tree-contents > ul > li > ul > li:not(:has(> .item a[href="annotated.html"])) { display: none; }
/* The API tab already says what this list is, so its row goes too. */
html[data-deki-tab="api"] #nav-tree-contents > ul > li > ul > li > .item { display: none; }
html[data-deki-tab="api"] #nav-tree-contents > ul > li > ul > li > ul.children_ul { margin-left: -16px; }
html[data-deki-tab="api"] #nav-tree-contents > ul > li > ul > li > ul > li > .item { display: none; }
html[data-deki-tab="api"] #nav-tree-contents > ul > li > ul > li > ul > li > ul.children_ul { margin-left: -16px; }
/* A class's members are on its page; the sidebar lists classes. */
html[data-deki-tab="api"] #nav-tree-contents li:has(> .item .label a[href*="#a"]) { display: none; }
/* A namespace inside Deki would sit above the classes and break the alphabet. */
html[data-deki-tab="api"] #nav-tree-contents li:has(> .item .label a[href^="namespace_"]) li:has(> .item .label a[href^="namespace_"]) { display: none; }
/* So a class has nothing to open. Hidden and not removed, so the names stay in line. */
html[data-deki-tab="api"] #nav-tree-contents .item:has(.label a[href^="class_"], .label a[href^="struct_"], .label a[href^="union_"]) .arrow { visibility: hidden; }

body:has(.textblock > p:first-child > a.anchor[id^="md_"]) #nav-path { display: none; }

table.markdownTable th { text-align: left !important; padding: 18px 24px; font-size: 14px; letter-spacing: 0.04em; }
table.markdownTable td { padding: 18px 24px; line-height: 28px; }
div.contents div.image { margin: 40px 0; }
div.contents div.image img { border: 1px solid var(--separator-color); }
div.contents div.image .caption {
    margin-top: 12px;
    font-family: var(--font-family-monospace);
    font-size: 12.5px;
    font-weight: 400;
    color: var(--page-secondary-foreground-color);
    text-align: left;
}

/* Guides and the packages page: one roomy column. */
#doc-content:has(a.anchor[id*="guide-"], a.anchor[id*="section-"]) div.header,
#doc-content:has(a.anchor[id*="guide-"], a.anchor[id*="section-"]) div.contents {
    margin: 0 auto;
    padding-left: 48px;
    padding-right: 48px;
    box-sizing: border-box;
}
#doc-content:has(a.anchor[id*="guide-"]) div.header,
#doc-content:has(a.anchor[id*="guide-"]) div.contents { max-width: 816px; }
#doc-content:has(a.anchor[id*="section-"]) div.header,
#doc-content:has(a.anchor[id*="section-"]) div.contents { max-width: 816px; }
#doc-content:has(a.anchor[id*="section-packages"]) div.header,
#doc-content:has(a.anchor[id*="section-packages"]) div.contents { max-width: 1040px; }
#doc-content:has(a.anchor[id*="guide-"], a.anchor[id*="section-"]) div.header {
    background: none;
    border: none;
    padding-top: 96px;
    padding-bottom: 0;
}
#doc-content:has(a.anchor[id*="guide-"], a.anchor[id*="section-"]) div.headertitle,
#doc-content:has(a.anchor[id*="guide-"], a.anchor[id*="section-"]) div.title { padding: 0; }
#doc-content:has(a.anchor[id*="guide-"], a.anchor[id*="section-"]) div.title {
    font-size: 56px;
    line-height: 1.1;
    font-weight: 500;
    margin: 0;
}
#doc-content:has(a.anchor[id*="guide-"], a.anchor[id*="section-"]) div.contents { padding-bottom: 160px; }
#doc-content:has(a.anchor[id*="guide-"], a.anchor[id*="section-"]) .textblock > p:first-child { margin: 0; }
#doc-content:has(a.anchor[id*="guide-"], a.anchor[id*="section-"]) .textblock p,
#doc-content:has(a.anchor[id*="guide-"]) .textblock li {
    font-size: 17px;
    line-height: 31px;
    color: #cdcbc6;
    margin-top: 0;
    margin-bottom: 22px;
}
#doc-content:has(a.anchor[id*="guide-"], a.anchor[id*="section-"]) .textblock > p:first-child + p {
    font-size: 22px;
    line-height: 36px;
    color: var(--page-foreground-color);
    margin: 28px 0 24px;
}
#doc-content:has(a.anchor[id*="guide-"]) .textblock li { margin-bottom: 12px; }
#doc-content:has(a.anchor[id*="guide-"]) .textblock ul,
#doc-content:has(a.anchor[id*="guide-"]) .textblock ol { margin: 24px 0 32px; padding-left: 24px; }
#doc-content:has(a.anchor[id*="guide-"], a.anchor[id*="section-"]) h1.doxsection {
    font-size: 32px;
    line-height: 1.25;
    font-weight: 500;
    margin: 96px 0 24px;
    padding: 0;
    border: none;
}
#doc-content:has(a.anchor[id*="guide-"]) h2.doxsection {
    font-size: 23px;
    line-height: 1.3;
    font-weight: 500;
    margin: 64px 0 18px;
    padding: 0;
    border: none;
}
#doc-content:has(a.anchor[id*="guide-"]) div.fragment { margin: 32px 0; padding: 22px 24px; }
#doc-content:has(a.anchor[id*="guide-"]) div.line { line-height: 24px; }
#doc-content:has(a.anchor[id*="guide-"], a.anchor[id*="section-"]) table.markdownTable {
    margin: 32px 0 40px;
    width: 100%;
}

div.contents div.image img[src^="device-"] { max-width: 300px; border: none; }

/* A group's page: a row per page, each with what it is for. */
p.deki-section-lede {
    font-size: 22px !important;
    line-height: 36px !important;
    color: var(--page-foreground-color) !important;
    margin: 28px 0 72px !important;
}
.deki-rows { border-top: 1px solid var(--separator-color); }
a.deki-row {
    display: block;
    padding: 32px 56px 32px 0;
    position: relative;
    border-bottom: 1px solid var(--separator-color);
    background: none !important;
    transition: padding-left 0.12s;
}
a.deki-row::after {
    content: "\2192";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: var(--page-secondary-foreground-color);
}
a.deki-row:hover { padding-left: 12px; }
a.deki-row:hover::after { color: var(--primary-color); }
.deki-row-title {
    display: block;
    font-family: var(--font-family-display);
    font-size: 25px;
    line-height: 1.25;
    font-weight: 500;
    color: var(--page-foreground-color);
}
a.deki-row:hover .deki-row-title { color: var(--primary-color); }
.deki-row-text { display: block; margin-top: 10px; font-size: 17px; line-height: 28px; color: var(--page-secondary-foreground-color); }

/* The site draws right angles and hairlines, here too. */
#nav-tree .selected, #nav-tree .item { border-radius: 0 !important; }
.ui-resizable-e, #splitbar { background: var(--separator-color) !important; background-image: none !important; }
#splitbar::after { display: none; }

/* In a guide the first column is words, so it wraps and is set like the rest. */
#doc-content:has(a.anchor[id*="guide-"]) table.markdownTable td:first-child {
    white-space: normal;
    font-family: var(--font-family);
}

/* Code inside a heading is part of the heading, not a chip beside it. */
h1.doxsection .tt, h2.doxsection .tt, h3.doxsection .tt, div.title .tt {
    font-size: 0.86em;
    font-weight: 500;
    background: none;
    border: none;
    padding: 0;
    color: var(--primary-color);
}

/* The home page: a title, then the cards, and nothing else. */
#doc-content:has(.deki-home) div.header { display: none; }
#doc-content:has(.deki-home) div.contents { max-width: none; padding: 0; margin: 0; }
/* Sized by the space the page has, not the window: the sidebar takes a third
 * of a small window, so a media query here lets the hero overlap itself. */
#doc-content:has(.deki-home) div.contents { container: deki-home / inline-size; }
.deki-home { max-width: 1160px; margin: 0 auto; padding: 112px 64px 176px; box-sizing: border-box; }
.deki-hero { max-width: 760px; }
.deki-home-title {
    font-family: var(--font-family-display);
    font-size: 64px;
    line-height: 1.06;
    font-weight: 500;
    margin: 0;
    border: none;
    padding: 0;
    box-shadow: none;
}
.deki-home-lede { font-size: 21px; line-height: 35px; color: #cdcbc6; margin: 32px 0 44px; }
.deki-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; }
.deki-actions a {
    padding: 16px 24px;
    border: 1px solid var(--separator-color);
    font-family: var(--font-family-monospace);
    font-size: 12.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--page-foreground-color) !important;
    background: none !important;
}
.deki-actions a:hover { border-color: var(--primary-color); color: var(--primary-color) !important; }
.deki-actions a.deki-action-solid {
    background: var(--primary-color) !important;
    border-color: var(--primary-color);
    color: #0a0b0d !important;
    font-weight: 600;
}
/* The three guides to begin with: a card each, numbered, as the site's own
 * cards are drawn. */
.deki-starts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 88px; }
a.deki-start {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 28px 28px 32px;
    border: 1px solid var(--separator-color);
    background: #101113 !important;
    color: var(--page-foreground-color) !important;
    transition: border-color 0.15s, transform 0.15s;
}
a.deki-start:hover { border-color: var(--primary-color); transform: translateY(-3px); }
.deki-start-step { font-family: var(--font-family-monospace); font-size: 12px; letter-spacing: 0.16em; color: var(--primary-color); }
.deki-start-title { font-family: var(--font-family-display); font-size: 25px; font-weight: 500; line-height: 1.2; }
.deki-start-text { font-size: 16px; line-height: 26px; color: var(--page-secondary-foreground-color); }
.deki-start-more { margin: 24px 0 0; font-size: 16px; color: var(--page-secondary-foreground-color); }
.deki-start-more a { color: #cdcbc6 !important; background: none !important; }
.deki-start-more a:hover { color: var(--primary-color) !important; }
.deki-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 72px; }
.deki-card-lede { margin: -14px 0 24px; font-size: 16px; line-height: 26px; color: var(--page-secondary-foreground-color); }
/* The guide before and the guide after, at the end of a guide. */
.deki-steps { display: flex; gap: 16px; margin: 96px 0 0; }
a.deki-step {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px 24px;
    border: 1px solid var(--separator-color);
    background: #101113 !important;
    font-family: var(--font-family-display);
    font-size: 21px;
    color: var(--page-foreground-color) !important;
}
a.deki-step span { font-family: var(--font-family-monospace); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--page-secondary-foreground-color); }
a.deki-step-on { text-align: right; }
a.deki-step-on:only-child { margin-left: auto; flex: 0 1 50%; }
a.deki-step:hover { border-color: var(--primary-color); color: var(--primary-color) !important; }
.deki-card { padding: 36px 40px 40px; border: 1px solid var(--separator-color); background: #101113; }
.deki-card:last-child { grid-column: 1 / -1; }
.deki-card:last-child ul { columns: 3; }
.deki-home h2 {
    font-family: var(--font-family-display) !important;
    font-size: 27px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--page-foreground-color) !important;
    margin: 0 0 28px;
    padding: 0;
    border: none;
    box-shadow: none;
    background: none !important;
}
.deki-home ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; }
.deki-home li { margin: 0; line-height: 44px; font-size: 17px; break-inside: avoid; }
.deki-home li a { color: #cdcbc6 !important; background: none !important; }
.deki-home li a:hover { color: var(--primary-color) !important; }

@container deki-home (max-width: 1000px) {
    .deki-starts { grid-template-columns: 1fr; }
}
@container deki-home (max-width: 900px) {
    .deki-home ul, .deki-card:last-child ul { columns: 1; }
}
@container deki-home (max-width: 640px) {
    .deki-home { padding: 56px 16px 96px; }
    .deki-home-title { font-size: 44px; }
    .deki-cards { grid-template-columns: 1fr; gap: 16px; margin-top: 56px; }
    .deki-starts { margin-top: 56px; }
    .deki-steps { flex-direction: column; }
    a.deki-step-on:only-child { flex-basis: auto; margin-left: 0; }
    .deki-card:last-child { grid-column: auto; }
    .deki-card { padding: 28px 24px 32px; }
}
@media screen and (max-width: 767px) {
    #doc-content:has(a.anchor[id*="guide-"], a.anchor[id*="section-"]) div.header,
    #doc-content:has(a.anchor[id*="guide-"], a.anchor[id*="section-"]) div.contents { padding-left: 16px; padding-right: 16px; }
    #doc-content:has(a.anchor[id*="guide-"], a.anchor[id*="section-"]) div.header { padding-top: 56px; }
    #doc-content:has(a.anchor[id*="guide-"], a.anchor[id*="section-"]) div.title { font-size: 40px; }
    table.markdownTable th, table.markdownTable td { padding: 12px 14px; }
}

/* The class list: a title, then one line per class. tools/docs/class_list.py
 * writes the rows. */
#doc-content:has(.deki-api) div.header,
#doc-content:has(.deki-api) div.contents {
    max-width: 1040px;
    margin: 0 auto;
    padding-left: 48px;
    padding-right: 48px;
    box-sizing: border-box;
}
#doc-content:has(.deki-api) div.header { background: none; border: none; padding-top: 96px; padding-bottom: 0; }
#doc-content:has(.deki-api) div.headertitle { padding: 0; }
#doc-content:has(.deki-api) div.title { font-size: 56px; line-height: 1.1; font-weight: 500; margin: 0; padding: 0; }
#doc-content:has(.deki-api) div.contents { padding-bottom: 160px; margin-top: 0; }
#doc-content:has(.deki-api) .textblock {
    font-family: var(--font-family-display);
    font-size: 22px;
    line-height: 1.4;
    color: var(--page-secondary-foreground-color);
    margin: 20px 0 0;
}
.deki-api-heading {
    font-family: var(--font-family-display);
    font-size: 30px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--page-foreground-color);
    border: none;
    margin: 88px 0 20px;
    padding: 0;
}
.deki-api-rows { border-top: 1px solid var(--separator-color); }
.deki-api-row {
    display: grid;
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    gap: 32px;
    align-items: baseline;
    padding: 16px 8px;
    border-bottom: 1px solid var(--separator-color);
    text-decoration: none !important;
    background: none !important;
}
.deki-api-row:hover { background: var(--deki-hover, rgba(255, 255, 255, 0.03)) !important; }
.deki-api-name { font-family: var(--font-family-monospace); font-size: 14.5px; color: var(--primary-color); overflow-wrap: anywhere; }
.deki-api-text { font-size: 15.5px; line-height: 24px; color: var(--page-secondary-foreground-color); }
@media screen and (max-width: 767px) {
    #doc-content:has(.deki-api) div.header,
    #doc-content:has(.deki-api) div.contents { padding-left: 20px; padding-right: 20px; }
    #doc-content:has(.deki-api) div.header { padding-top: 48px; }
    #doc-content:has(.deki-api) div.title { font-size: 40px; }
    .deki-api-row { grid-template-columns: 1fr; gap: 4px; }
}

/* A class's page: the same column as the list, and rows that read left to right. */
html[data-deki-tab="api"] #doc-content div.header,
html[data-deki-tab="api"] #doc-content div.contents {
    max-width: 1040px;
    margin: 0 auto;
    padding-left: 48px;
    padding-right: 48px;
    box-sizing: border-box;
}
html[data-deki-tab="api"] #doc-content div.header { background: none; border: none; padding-top: 72px; padding-bottom: 0; }
html[data-deki-tab="api"] #doc-content div.summary { display: none; }
html[data-deki-tab="api"] #doc-content div.headertitle { padding: 0; }
html[data-deki-tab="api"] #doc-content div.title { font-size: 44px; line-height: 1.15; font-weight: 500; margin: 0; padding: 0; }
html[data-deki-tab="api"] #doc-content div.contents { padding-bottom: 120px; }
html[data-deki-tab="api"] #doc-content table.memberdecls { width: 100%; background: none; border: none; }
html[data-deki-tab="api"] #doc-content table.memberdecls td { background: none; border: none; }
html[data-deki-tab="api"] #doc-content td.memItemLeft { text-align: left; width: 220px; padding: 12px 16px 12px 0; color: var(--page-secondary-foreground-color); vertical-align: top; }
html[data-deki-tab="api"] #doc-content td.memItemRight { padding: 12px 0; vertical-align: top; }
html[data-deki-tab="api"] #doc-content td.mdescLeft { padding: 0; }
html[data-deki-tab="api"] #doc-content td.mdescRight { padding: 0 0 14px; color: var(--page-secondary-foreground-color); font-size: 15px; line-height: 24px; }
html[data-deki-tab="api"] #doc-content tr.separator\:* td { border-bottom: none; }
html[data-deki-tab="api"] #doc-content h2.groupheader { font-size: 26px; font-weight: 500; margin: 64px 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--separator-color); }
@media screen and (max-width: 767px) {
    html[data-deki-tab="api"] #doc-content div.header,
    html[data-deki-tab="api"] #doc-content div.contents { padding-left: 20px; padding-right: 20px; }
    html[data-deki-tab="api"] #doc-content div.title { font-size: 32px; }
}
