/* Reset and base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --sidebar-width: 260px;
    --header-height: 48px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    --color-bg: #fff;
    --color-sidebar-bg: #f7f8fa;
    --color-border: #e1e4e8;
    --color-border-light: #d3d3d3;
    --color-text: #24292e;
    --color-text-secondary: #586069;
    --color-link: #0366d6;
    --color-active: rgb(38, 163, 217);
    --color-code-bg: #f6f8fa;
    --color-deprecated-bg: #fff8e1;
    --color-deprecated-border: #f9a825;
    --color-badge-deprecated: #e65100;
    --color-shadow: rgba(0, 0, 0, 0.12);
    /* Syntax highlighting */
    --color-syntax-keyword: #d73a49;
    --color-syntax-string: #032f62;
    --color-syntax-number: #005cc5;
    --color-syntax-comment: #6a737d;
    --color-syntax-name: #6f42c1;
}

/* Dark theme — explicit toggle */
[data-theme="dark"] {
    --color-bg: #1a1a2e;
    --color-sidebar-bg: #16162a;
    --color-border: #2a2a4a;
    --color-border-light: #3a3a5a;
    --color-text: #e0e0e8;
    --color-text-secondary: #9898b0;
    --color-link: #58a6ff;
    --color-active: rgb(80, 190, 230);
    --color-code-bg: #1e1e38;
    --color-deprecated-bg: #2e2a1a;
    --color-deprecated-border: #b8860b;
    --color-badge-deprecated: #f0a030;
    --color-shadow: rgba(0, 0, 0, 0.4);
    --color-syntax-keyword: #ff7b72;
    --color-syntax-string: #a5d6ff;
    --color-syntax-number: #79c0ff;
    --color-syntax-comment: #8b949e;
    --color-syntax-name: #d2a8ff;
}

/* Dark theme — system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-bg: #1a1a2e;
        --color-sidebar-bg: #16162a;
        --color-border: #2a2a4a;
        --color-border-light: #3a3a5a;
        --color-text: #e0e0e8;
        --color-text-secondary: #9898b0;
        --color-link: #58a6ff;
        --color-active: rgb(80, 190, 230);
        --color-code-bg: #1e1e38;
        --color-deprecated-bg: #2e2a1a;
        --color-deprecated-border: #b8860b;
        --color-badge-deprecated: #f0a030;
        --color-shadow: rgba(0, 0, 0, 0.4);
        --color-syntax-keyword: #ff7b72;
        --color-syntax-string: #a5d6ff;
        --color-syntax-number: #79c0ff;
        --color-syntax-comment: #8b949e;
        --color-syntax-name: #d2a8ff;
    }
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    font-size: 15px;
}

/* Site header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.site-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    font-weight: 600;
    font-size: 16px;
    color: var(--color-text);
    text-decoration: none;
}

.site-header-logo {
    height: 17px;
    width: auto;
    transform: translateY(-1px);
}

.site-header-title:hover {
    text-decoration: none;
    color: var(--color-link);
}

/* Layout */
.layout {
    display: flex;
    min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--color-sidebar-bg);
    border-right: 1px solid var(--color-border);
    padding: 20px 0;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: scroll;
    scrollbar-width: thin;
}


.sidebar-section {
    padding: 0 16px;
    margin-bottom: 16px;
}

.sidebar-section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.sidebar-sub-header {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    margin-top: 12px;
    margin-bottom: 4px;
    padding: 2px 4px;
}

.sidebar-sub-header:first-child {
    margin-top: 0;
}

.sidebar-section > ul {
    padding-left: 12px;
}

/* Nested package accordions */
.sidebar details:not(.sidebar-section) {
    list-style: none;
}

.sidebar details:not(.sidebar-section) > summary {
    display: flex;
    align-items: center;
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    padding: 2px 4px;
    font-size: 13px;
}

.sidebar details:not(.sidebar-section) > summary::-webkit-details-marker { display: none; }

.sidebar details:not(.sidebar-section) > summary::after {
    content: "";
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 3px 0 3px 5px;
    border-color: transparent transparent transparent var(--color-text-secondary);
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.sidebar details:not(.sidebar-section)[open] > summary::after {
    transform: rotate(90deg);
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 2px;
}

.sidebar details > ul {
    padding-left: 12px;
}

.sidebar a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 13px;
    display: block;
    padding: 2px 4px;
    border-radius: 3px;
}

.sidebar a:hover {
    color: var(--color-link);
    text-decoration: none;
}

.sidebar a.active {
    font-weight: 600;
    color: var(--color-active);
}

/* Content */
.content {
    flex: 1;
    min-width: 0;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 40px;
}

/* Typography */
h1 { font-size: 28px; margin-bottom: 16px; border-bottom: 1px solid var(--color-border); padding-bottom: 8px; }
h2 { font-size: 22px; margin: 28px 0 12px; border-bottom: 1px solid var(--color-border); padding-bottom: 6px; }
h3 { font-size: 18px; margin: 20px 0 8px; }

p { margin-bottom: 6px; }

a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--color-code-bg);
    padding: 2px 5px;
    border-radius: 3px;
}

pre {
    background: var(--color-code-bg);
    padding: 12px 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
    line-height: 1.5;
}

pre code {
    background: none;
    padding: 0;
    font-size: 13px;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

/* Badges */
.badge {
    display: inline-block;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 6px;
}

.badge.deprecated {
    background: var(--color-deprecated-bg);
    color: var(--color-badge-deprecated);
    border: 1px solid var(--color-deprecated-border);
}

/* Admonitions */
.admonition {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 16px 0;
    border-left: 4px solid;
}

.admonition.deprecated {
    background: var(--color-deprecated-bg);
    border-color: var(--color-deprecated-border);
}

/* Card grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.card {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 16px;
}

.card.deprecated {
    border-color: var(--color-deprecated-border);
    background: var(--color-deprecated-bg);
}

.card h3 {
    font-size: 16px;
    margin: 0 0 8px;
    border: none;
    padding: 0;
}

.card ul { list-style: none; }
.card li { font-size: 14px; margin-bottom: 4px; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

th, td {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border);
}

th {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-secondary);
}

tr.deprecated td { background: var(--color-deprecated-bg); }

/* Method detail */
.method-detail {
    margin: 16px 0;
    /* padding: 12px 16px; */
    /* border: 1px solid var(--color-border); */
    /* border-radius: 6px; */
}

.method-signature {
    font-family: var(--font-mono);
    font-size: 14px;
    background: var(--color-code-bg);
    padding: 8px 12px;
    /* border-radius: 4px; */
    border-left: 4px solid var(--color-border-light);
    overflow-x: auto;
    margin-bottom: 8px;
}

.method-signature code {
    background: none;
    padding: 0;
}

.method-decorator {
    color: var(--color-text-secondary);
    font-style: italic;
    font-size: 12px;
}

.return-type {
    color: var(--color-text-secondary);
}

.method-doc {
    font-size: 14px;
    padding-left: 8px;
}

/* Docstring param lists — name and description on the same line, descriptions aligned */
dl.params {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 16px;
    row-gap: 4px;
    margin: 8px 0;
}

dl.params dt {
    font-weight: 600;
}

dl.params dd {
    color: var(--color-text-secondary);
}

/* Class bases */
.class-bases {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

/* Guide content */
.guide-content {
    line-height: 1.7;
}

.guide-content h1 { font-size: 28px; }
.guide-content h2 { font-size: 22px; scroll-margin-top: calc(var(--header-height) + 16px); }
.guide-content h3 { font-size: 18px; scroll-margin-top: calc(var(--header-height) + 16px); }

.guide-content ul, .guide-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.guide-content li { margin-bottom: 6px; }

.guide-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 0 10px 4px rgba(0, 0, 0, 0.3);
    display: block;
    margin: 16px auto;
}

/* Download block */
.download-block {
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 12px 16px;
    margin: 16px 0;
    background: var(--color-bg);
}
.download-block .file-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}
.download-block .file-icon svg { width: 24px; height: 24px; fill: currentColor; }
.download-block .file-icon .file-size { font-size: 11px; }
.download-block .file-info { flex: 1; }
.download-block .file-info .file-name { font-weight: 600; font-size: 14px; }
.download-block .file-info .file-type { font-size: 13px; color: var(--color-text-secondary); }
.download-block .download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--color-text);
    text-decoration: none;
    flex-shrink: 0;
}
.download-block .download-btn:hover { background: var(--color-code-bg); }
.download-block .download-btn svg { width: 14px; height: 14px; fill: currentColor; }
.download-block-caption {
    text-align: center;
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-top: -8px;
    margin-bottom: 16px;
}

/* Frame type tables (analyzer reference pages) */
.frame-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.frame-table td { padding: 6px 12px; border-bottom: 1px solid var(--color-border); font-size: 14px; vertical-align: top; }
.frame-type-row td { background: var(--color-code-bg); padding: 10px 12px; font-weight: 600; }
.frame-type-row code { font-size: 15px; font-family: var(--font-mono); }
.frame-type-row .frame-desc { font-weight: 400; color: var(--color-text-secondary); font-size: 13px; margin-left: 8px; }
.frame-desc-row td { font-size: 13px; color: var(--color-text-secondary); padding: 4px 12px 8px 12px; border-bottom: none; }
.prop-row .prop-name { font-family: var(--font-mono); font-size: 13px; white-space: nowrap; width: 1%; padding-left: 28px; }
.prop-row .prop-type { font-family: var(--font-mono); font-size: 13px; color: var(--color-text-secondary); white-space: nowrap; width: 1%; }
.prop-row .prop-desc { font-size: 13px; color: var(--color-text-secondary); }
.prop-row .prop-empty { font-size: 13px; color: var(--color-text-secondary); font-style: italic; padding-left: 28px; }

/* Codehilite (markdown extension) */
.codehilite {
    background: var(--color-code-bg);
    padding: 12px 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
    border: 1px solid var(--color-border-light);
}

.codehilite pre {
    margin: 0;
    padding: 0;
    background: none;
}

/* Syntax highlighting (Pygments tokens) */
.codehilite .k, .codehilite .kn, .codehilite .kd, .codehilite .kc, .codehilite .kr,
.highlight .k, .highlight .kn, .highlight .kd, .highlight .kc, .highlight .kr,
.method-signature .k, .method-signature .kn, .method-signature .kd, .method-signature .kc, .method-signature .kr { color: var(--color-syntax-keyword); font-weight: 600; }  /* keywords */
.codehilite .s, .codehilite .s1, .codehilite .s2, .codehilite .sd, .codehilite .sb, .codehilite .sc, .codehilite .se, .codehilite .sa, .codehilite .sh,
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sd, .highlight .sb, .highlight .sc, .highlight .se, .highlight .sa, .highlight .sh,
.method-signature .s, .method-signature .s1, .method-signature .s2, .method-signature .sd, .method-signature .sb, .method-signature .sc, .method-signature .se, .method-signature .sa, .method-signature .sh { color: var(--color-syntax-string); }  /* strings */
.codehilite .mi, .codehilite .mf, .codehilite .mh, .codehilite .mo, .codehilite .mb,
.highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .mb,
.method-signature .mi, .method-signature .mf, .method-signature .mh, .method-signature .mo, .method-signature .mb { color: var(--color-syntax-number); }  /* numbers */
.codehilite .c, .codehilite .c1, .codehilite .cm, .codehilite .cs, .codehilite .ch, .codehilite .cp, .codehilite .cpf,
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .ch, .highlight .cp, .highlight .cpf,
.method-signature .c, .method-signature .c1, .method-signature .cm, .method-signature .cs, .method-signature .ch, .method-signature .cp, .method-signature .cpf { color: var(--color-syntax-comment); font-style: italic; }  /* comments */
.codehilite .nb, .codehilite .bp, .highlight .nb, .highlight .bp, .method-signature .nb, .method-signature .bp { color: var(--color-syntax-name); }  /* builtins */
.codehilite .nf, .codehilite .fm, .highlight .nf, .highlight .fm, .method-signature .nf, .method-signature .fm { color: var(--color-syntax-name); }  /* functions */
.codehilite .nd, .highlight .nd, .method-signature .nd { color: var(--color-syntax-name); }  /* decorators */
.codehilite .nn, .highlight .nn, .method-signature .nn { color: var(--color-text); }  /* module names */
.codehilite .nc, .highlight .nc, .method-signature .nc { color: var(--color-syntax-name); font-weight: 600; }  /* class names */
.codehilite .o, .codehilite .ow, .highlight .o, .highlight .ow, .method-signature .o, .method-signature .ow { color: var(--color-syntax-keyword); }  /* operators */
.codehilite .p, .highlight .p, .method-signature .p { color: var(--color-text); }  /* punctuation */
.codehilite .si, .highlight .si, .method-signature .si { color: var(--color-syntax-string); }  /* string interpolation */
.codehilite .nx, .highlight .nx, .method-signature .nx { color: var(--color-syntax-name); }  /* other names */

/* Cross-links: dotted underline, inherit color so they don't disrupt
   syntax highlighting or inline code styling */
.method-signature a,
.class-bases code a,
.attr-table code a,
.method-doc code a,
.class-docstring code a,
.module-docstring code a,
.codehilite a,
code.highlight a,
a:has(> code) {
    color: inherit;
    text-decoration: underline 1px;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

/* External-link indicator for stdlib types */
.method-signature a[target="_blank"]::after,
.attr-table code a[target="_blank"]::after,
.class-bases code a[target="_blank"]::after {
    content: "\2009\2197";  /* thin space + ↗ */
}

.method-signature a:hover,
.class-bases code a:hover,
.attr-table code a:hover,
.method-doc code a:hover,
.class-docstring code a:hover,
.module-docstring code a:hover,
.codehilite a:hover,
code.highlight a:hover,
a:has(> code):hover {
    text-decoration-style: solid;
}

/* Copy button on code blocks */
.has-copy-btn {
    position: relative;
}

.copy-btn {
    position: sticky;
    float: right;
    top: 8px;
    right: 0;
    padding: 2px 8px;
    font-size: 12px;
    font-family: var(--font-sans);
    color: var(--color-text-secondary);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.has-copy-btn:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    color: var(--color-text);
    border-color: var(--color-text-secondary);
}

@media (hover: none) {
    .copy-btn {
        opacity: 0.6;
    }
}

/* Mobile nav select — hidden on desktop, shown in header on mobile */
.mobile-nav-select {
    display: none;
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-family: var(--font-sans);
    padding: 4px 8px;
    margin-left: 16px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-text);
    appearance: auto;
}

/* Type tooltip popovers */
.type-tooltip {
    position: fixed;
    z-index: 100;
    max-width: 420px;
    max-height: 360px;
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 10px 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    box-shadow: 0 2px 8px var(--color-shadow);
    opacity: 0;
    transition: opacity 0.12s ease;
}

.type-tooltip::-webkit-scrollbar {
    width: 4px;
}

.type-tooltip::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
}

.type-tooltip:not([hidden]) {
    opacity: 1;
}

.type-tooltip-name {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.type-tooltip-doc {
    font-size: 12px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.type-tooltip-doc p {
    margin-bottom: 4px;
}

.type-tooltip-doc pre {
    font-size: 11px;
    padding: 6px 8px;
    margin: 4px 0;
}

.type-tooltip-doc dl.params {
    font-size: 12px;
    column-gap: 10px;
    row-gap: 2px;
}

.type-tooltip-members {
    border-top: 1px solid var(--color-border);
    margin-top: 8px;
    padding-top: 6px;
}

.type-tooltip-section {
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 4px;
}

.type-tooltip-section:last-child {
    margin-bottom: 0;
}

.type-tooltip-label {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-secondary);
}

.type-tooltip-list {
    list-style: none;
    padding-left: 10px;
    margin: 2px 0 0;
}

.type-tooltip-list li {
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.type-tooltip-desc {
    color: var(--color-text-secondary);
    margin-left: 6px;
    font-size: 11px;
}

.type-tooltip-section code {
    font-size: 11px;
    padding: 0 3px;
}

/* Search */
.search-container {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 13px;
    font-family: var(--font-sans);
    color: var(--color-text-secondary);
    background: var(--color-code-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.search-trigger:hover {
    color: var(--color-text);
    border-color: var(--color-text-secondary);
}

.search-trigger svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.search-trigger-label {
    opacity: 0.8;
}

.search-trigger kbd {
    font-family: var(--font-sans);
    font-size: 11px;
    padding: 1px 5px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 3px;
    margin-left: 4px;
}

.search-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    background: rgba(0, 0, 0, 0.4);
}

.search-modal[hidden] {
    display: none;
}

.search-dialog {
    width: 560px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 160px);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    box-shadow: 0 8px 32px var(--color-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    gap: 8px;
}

.search-input-wrap svg {
    width: 18px;
    height: 18px;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: transparent;
}

.search-input::placeholder {
    color: var(--color-text-secondary);
}

.search-results {
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: thin;
}

.search-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 14px;
}

.search-result {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.search-result--active {
    background: var(--color-code-bg);
}

.search-result-text {
    min-width: 0;
    flex: 1;
}

.search-result-name {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-doc {
    font-size: 12px;
    color: var(--color-text-secondary);
    line-height: 1.4;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-pkg {
    font-size: 11px;
    color: var(--color-text-secondary);
    opacity: 0.7;
    margin-top: 1px;
}

.search-badge {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    margin-top: 1px;
}

.search-badge--class { background: #6f42c1; }
.search-badge--method { background: #0366d6; }
.search-badge--property { background: #28a745; }
.search-badge--attribute { background: #e36209; }
.search-badge--guide { background: #6a737d; }

.search-result-doc mark {
    background: none;
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--color-text-secondary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--color-text);
    background: var(--color-code-bg);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

/* LLM callout */
.llm-callout {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 1rem;
    padding: 10px 14px;
    border: 1px solid var(--color-link);
    border-radius: 6px;
    background: color-mix(in srgb, var(--color-link) 8%, transparent);
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.llm-callout svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--color-link);
}

.llm-callout a {
    color: var(--color-link);
}

/* LLM docs link in header */
.llm-link {
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
}

.llm-link:hover { color: var(--color-text); }

.llm-link svg {
    width: 22px;
    height: 22px;
}

/* Mobile layout */
@media (max-width: 768px) {
    .mobile-nav-select {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .content {
        padding: 20px 16px;
    }

    .search-trigger-label,
    .search-trigger kbd {
        display: none;
    }

    .search-trigger {
        padding: 6px;
    }

    .search-modal {
        padding-top: 16px;
    }

    .search-dialog {
        max-height: calc(100vh - 32px);
    }
}
