/* Docs site: Docusaurus-style layout (navbar, collapsible sidebar, article, "on this page", pager). Plain CSS, no external requests. */
:root {
    --d-primary: #2e8555;
    --d-primary-dark: #277148;
    --d-primary-soft: rgba(46, 133, 85, .1);
    --d-bg: #fff;
    --d-bg-alt: #f6f7f8;
    --d-text: #1c1e21;
    --d-muted: #606770;
    --d-border: #dadde1;
    --d-code-bg: #f6f7f8;
    --d-nav-h: 3.75rem;
    --d-sidebar-w: 300px;
    --d-toc-w: 240px;
    --d-font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --d-mono: SFMono-Regular, Menlo, Consolas, "Liberation Mono", Courier, monospace;
    --d-radius: .4rem;
}
:root[data-theme="dark"] {
    --d-primary: #25c2a0;
    --d-primary-dark: #21af90;
    --d-primary-soft: rgba(37, 194, 160, .12);
    --d-bg: #1b1b1d;
    --d-bg-alt: #242526;
    --d-text: #e3e3e3;
    --d-muted: #a8acb2;
    --d-border: #3a3b3d;
    --d-code-bg: #2a2b2d;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--d-nav-h) + 1rem); }
.docs-body { margin: 0; background: var(--d-bg); color: var(--d-text); font: 16px/1.65 var(--d-font); -webkit-font-smoothing: antialiased; }
.docs-body a { color: var(--d-primary); text-decoration: none; }
.docs-body a:hover { text-decoration: underline; }
.docs-skip { position: absolute; left: -999px; top: 0; background: var(--d-primary); color: #fff !important; padding: .5rem 1rem; z-index: 100; }
.docs-skip:focus { left: 0; }

/* Navbar */
.docs-nav { position: sticky; top: 0; z-index: 50; height: var(--d-nav-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1rem; background: var(--d-bg); border-bottom: 1px solid var(--d-border); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.docs-nav-left, .docs-nav-right { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.docs-brand { font-weight: 700; font-size: 1.15rem; color: var(--d-text) !important; white-space: nowrap; }
.docs-nav-link { color: var(--d-text) !important; font-weight: 500; }
.docs-nav-link:hover { color: var(--d-primary) !important; text-decoration: none !important; }
.docs-icon-btn { background: none; border: 0; color: var(--d-text); font-size: 1.15rem; line-height: 1; padding: .45rem .55rem; border-radius: var(--d-radius); cursor: pointer; }
.docs-icon-btn:hover { background: var(--d-bg-alt); }
.docs-menu-btn { display: none; }
.docs-search-btn { display: flex; align-items: center; gap: .6rem; background: var(--d-bg-alt); border: 1px solid var(--d-border); color: var(--d-muted); border-radius: 2rem; padding: .35rem .8rem; font: inherit; font-size: .9rem; cursor: pointer; }
.docs-search-btn:hover { border-color: var(--d-primary); }
.docs-search-btn kbd { font: .7rem var(--d-mono); background: var(--d-bg); border: 1px solid var(--d-border); border-radius: .25rem; padding: .05rem .3rem; }
.docs-dropdown { position: relative; }
.docs-dropdown summary { list-style: none; cursor: pointer; font-weight: 500; padding: .35rem .6rem; border-radius: var(--d-radius); white-space: nowrap; }
.docs-dropdown summary::-webkit-details-marker { display: none; }
.docs-dropdown summary::after { content: " ▾"; font-size: .75rem; }
.docs-dropdown summary:hover { background: var(--d-bg-alt); }
.docs-dropdown ul { position: absolute; right: 0; top: calc(100% + .3rem); min-width: 10rem; margin: 0; padding: .3rem; list-style: none; background: var(--d-bg); border: 1px solid var(--d-border); border-radius: var(--d-radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .15); z-index: 60; }
.docs-dropdown li a { display: block; padding: .35rem .6rem; border-radius: .3rem; color: var(--d-text); }
.docs-dropdown li a:hover, .docs-dropdown li a[aria-current] { background: var(--d-primary-soft); color: var(--d-primary); text-decoration: none; }
.docs-badge { font-size: .65rem; text-transform: uppercase; letter-spacing: .04em; background: var(--d-primary-soft); color: var(--d-primary); border-radius: 1rem; padding: .05rem .45rem; margin-left: .25rem; }

/* Shell: sidebar + main */
.docs-shell { display: flex; min-height: calc(100vh - var(--d-nav-h)); }
.docs-sidebar { width: var(--d-sidebar-w); flex: 0 0 var(--d-sidebar-w); position: sticky; top: var(--d-nav-h); align-self: flex-start; max-height: calc(100vh - var(--d-nav-h)); overflow-y: auto; padding: 1rem .5rem 2rem 1rem; border-right: 1px solid var(--d-border); }
.docs-tree, .docs-tree ul { list-style: none; margin: 0; padding: 0; }
.docs-tree ul { padding-left: .75rem; }
.docs-tree li > a, .docs-tree summary > span, .docs-tree summary > a { display: block; padding: .38rem .7rem; border-radius: var(--d-radius); color: var(--d-text); font-size: .93rem; line-height: 1.35; }
.docs-tree li > a:hover, .docs-tree summary:hover > a { background: var(--d-bg-alt); text-decoration: none; }
.docs-tree a.active { background: var(--d-primary-soft); color: var(--d-primary); font-weight: 600; }
.docs-tree summary { list-style: none; cursor: pointer; position: relative; font-weight: 600; }
.docs-tree summary::-webkit-details-marker { display: none; }
.docs-tree summary::after { content: ""; position: absolute; right: .6rem; top: 50%; width: .45rem; height: .45rem; border-right: 2px solid var(--d-muted); border-bottom: 2px solid var(--d-muted); transform: translateY(-70%) rotate(45deg); transition: transform .15s; }
.docs-tree details[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.docs-tree summary > span { color: var(--d-text); }
.docs-backdrop { display: none; }

.docs-main { flex: 1; min-width: 0; }
.docs-banner { background: #fff3cd; color: #664d03; padding: .6rem 1.25rem; text-align: center; font-size: .92rem; border-bottom: 1px solid #ffe69c; }
:root[data-theme="dark"] .docs-banner { background: #332701; color: #ffda6a; border-color: #664d03; }
.docs-article-wrap { display: flex; gap: 2rem; max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.5rem 3rem; }
.docs-article { flex: 1; min-width: 0; max-width: 780px; }
.docs-toc { flex: 0 0 var(--d-toc-w); width: var(--d-toc-w); position: sticky; top: calc(var(--d-nav-h) + 1.5rem); align-self: flex-start; max-height: calc(100vh - var(--d-nav-h) - 3rem); overflow-y: auto; font-size: .85rem; border-left: 1px solid var(--d-border); padding-left: 1rem; }
.docs-toc-title { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; color: var(--d-muted); margin-bottom: .5rem; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; }
.docs-toc li.lvl-3 { padding-left: .85rem; }
.docs-toc a { display: block; padding: .2rem 0; color: var(--d-muted); }
.docs-toc a:hover, .docs-toc a.active { color: var(--d-primary); text-decoration: none; }
.docs-toc a.active { font-weight: 600; }

.docs-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .85rem; color: var(--d-muted); margin-bottom: 1rem; }
.docs-crumbs a { color: var(--d-muted); }
.docs-crumbs span[aria-current] { color: var(--d-text); font-weight: 500; }
.docs-article h1 { font-size: 2.2rem; line-height: 1.2; margin: 0 0 1.25rem; font-weight: 800; }

/* Content typography */
.docs-content h2 { font-size: 1.6rem; margin: 2.2rem 0 .8rem; padding-top: .3rem; line-height: 1.25; }
.docs-content h3 { font-size: 1.25rem; margin: 1.8rem 0 .6rem; }
.docs-content h4 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
.docs-content p, .docs-content ul, .docs-content ol, .docs-content table, .docs-content pre, .docs-content blockquote { margin: 0 0 1.1rem; }
.docs-content ul, .docs-content ol { padding-left: 1.6rem; }
.docs-content li + li { margin-top: .25rem; }
.docs-content li > ul, .docs-content li > ol { margin: .3rem 0 0; }
.docs-content img { max-width: 100%; height: auto; border-radius: var(--d-radius); }
.docs-content hr { border: 0; border-top: 1px solid var(--d-border); margin: 2rem 0; }
.docs-content blockquote { border-left: 4px solid var(--d-border); padding: .2rem 1rem; color: var(--d-muted); }
.docs-content code { font-family: var(--d-mono); font-size: .88em; background: var(--d-code-bg); border: 1px solid var(--d-border); border-radius: .3rem; padding: .08rem .35rem; }
.docs-content pre { position: relative; background: var(--d-code-bg); border: 1px solid var(--d-border); border-radius: var(--d-radius); padding: .9rem 1rem; overflow-x: auto; line-height: 1.5; }
.docs-content pre code { background: none; border: 0; padding: 0; font-size: .86rem; }
.docs-content table { border-collapse: collapse; display: block; overflow-x: auto; width: 100%; }
.docs-content th, .docs-content td { border: 1px solid var(--d-border); padding: .5rem .8rem; text-align: left; }
.docs-content tr:nth-child(2n) { background: var(--d-bg-alt); }
.docs-content th { background: var(--d-bg-alt); }
.docs-content .task-list-item { list-style: none; margin-left: -1.4rem; }
.docs-anchor { opacity: 0; margin-left: .4rem; font-weight: 400; text-decoration: none !important; }
.docs-content h2:hover .docs-anchor, .docs-content h3:hover .docs-anchor, .docs-content h4:hover .docs-anchor { opacity: .7; }
.docs-copy { position: absolute; top: .4rem; right: .4rem; background: var(--d-bg); border: 1px solid var(--d-border); color: var(--d-muted); border-radius: .3rem; padding: .15rem .5rem; font: .75rem var(--d-font); cursor: pointer; opacity: 0; transition: opacity .15s; }
.docs-content pre:hover .docs-copy, .docs-copy:focus { opacity: 1; }

/* Admonitions */
.admonition { border-left: 5px solid var(--adm, #54a8ff); background: var(--adm-bg, rgba(84, 168, 255, .1)); border-radius: var(--d-radius); padding: .8rem 1rem; margin: 0 0 1.2rem; }
.admonition-title { font-weight: 700; text-transform: uppercase; font-size: .85rem; letter-spacing: .03em; margin-bottom: .35rem; color: var(--adm, #54a8ff); }
.admonition-body > :last-child { margin-bottom: 0; }
.admonition-tip { --adm: #009400; --adm-bg: rgba(0, 148, 0, .1); }
.admonition-info { --adm: #4cb3d4; --adm-bg: rgba(76, 179, 212, .1); }
.admonition-warning, .admonition-caution { --adm: #e6a700; --adm-bg: rgba(230, 167, 0, .12); }
.admonition-danger { --adm: #e13238; --adm-bg: rgba(225, 50, 56, .1); }

/* Category index cards, tags, footer, pager */
.docs-cards { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.docs-cards a { display: flex; flex-direction: column; gap: .3rem; height: 100%; padding: 1rem; border: 1px solid var(--d-border); border-radius: var(--d-radius); color: var(--d-text); }
.docs-cards a:hover { border-color: var(--d-primary); text-decoration: none; }
.docs-cards span { color: var(--d-muted); font-size: .88rem; }
.docs-article-foot { margin-top: 3rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: .88rem; color: var(--d-muted); }
.docs-tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.docs-tags li { background: var(--d-bg-alt); border: 1px solid var(--d-border); border-radius: 1rem; padding: .1rem .7rem; }
.docs-meta { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.docs-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.docs-pager a { flex: 1; max-width: 48%; display: flex; flex-direction: column; gap: .15rem; border: 1px solid var(--d-border); border-radius: var(--d-radius); padding: .8rem 1rem; color: var(--d-primary); }
.docs-pager a:hover { border-color: var(--d-primary); text-decoration: none; }
.docs-pager small { color: var(--d-muted); }
.docs-next { text-align: right; margin-left: auto; }
.docs-footer { border-top: 1px solid var(--d-border); background: var(--d-bg-alt); padding: 1.5rem 1rem; text-align: center; color: var(--d-muted); font-size: .9rem; }
.docs-empty { max-width: 640px; margin: 4rem auto; padding: 0 1.5rem; }

/* Search dialog */
.docs-search { width: min(640px, 92vw); margin: 8vh auto auto; padding: 0; border: 1px solid var(--d-border); border-radius: .7rem; background: var(--d-bg); color: var(--d-text); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.docs-search::backdrop { background: rgba(0, 0, 0, .5); }
.docs-search-box { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; border-bottom: 1px solid var(--d-border); }
.docs-search-box input { flex: 1; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; font-size: 1.05rem; padding: .4rem; }
.docs-search-results { max-height: 60vh; overflow-y: auto; padding: .5rem; }
.docs-hit { display: block; padding: .6rem .8rem; border-radius: var(--d-radius); color: var(--d-text) !important; }
.docs-hit:hover, .docs-hit.is-active { background: var(--d-primary-soft); text-decoration: none !important; }
.docs-hit strong { display: block; }
.docs-hit small { display: block; color: var(--d-muted); }
.docs-hit em { font-style: normal; color: var(--d-muted); font-size: .85rem; }
.docs-search-msg { padding: 1rem; color: var(--d-muted); text-align: center; }

/* Code colours (highlight.js token classes), tuned for both themes */
.hljs-comment, .hljs-quote { color: #8b949e; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-doctag, .hljs-meta .hljs-keyword { color: #d73a49; }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-meta .hljs-string { color: #0a7d3e; }
.hljs-number, .hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-selector-attr, .hljs-selector-class, .hljs-selector-id { color: #005cc5; }
.hljs-title, .hljs-section, .hljs-class .hljs-title, .hljs-function .hljs-title { color: #6f42c1; }
.hljs-built_in, .hljs-type, .hljs-name, .hljs-tag { color: #22863a; }
.hljs-deletion { color: #b31d28; }
.hljs-meta { color: #735c0f; }
:root[data-theme="dark"] .hljs-keyword, :root[data-theme="dark"] .hljs-selector-tag, :root[data-theme="dark"] .hljs-literal { color: #ff7b72; }
:root[data-theme="dark"] .hljs-string, :root[data-theme="dark"] .hljs-regexp { color: #7ee787; }
:root[data-theme="dark"] .hljs-number, :root[data-theme="dark"] .hljs-attr, :root[data-theme="dark"] .hljs-variable { color: #79c0ff; }
:root[data-theme="dark"] .hljs-title, :root[data-theme="dark"] .hljs-section { color: #d2a8ff; }
:root[data-theme="dark"] .hljs-built_in, :root[data-theme="dark"] .hljs-type, :root[data-theme="dark"] .hljs-name, :root[data-theme="dark"] .hljs-tag { color: #7ee787; }
:root[data-theme="dark"] .hljs-meta { color: #e3b341; }

/* Tablet and mobile: the sidebar becomes a drawer, "on this page" disappears */
@media (max-width: 1100px) { .docs-toc { display: none; } }
@media (max-width: 996px) {
    .docs-menu-btn { display: inline-block; }
    .docs-hide-sm { display: none; }
    .docs-search-btn span, .docs-search-btn kbd { display: none; }
    .docs-search-btn { border-radius: var(--d-radius); padding: .4rem .6rem; }
    .docs-search-btn::before { content: "🔍"; font-size: .95rem; }
    .docs-sidebar { position: fixed; top: var(--d-nav-h); left: 0; bottom: 0; z-index: 70; width: min(320px, 86vw); max-height: none; background: var(--d-bg); transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
    .docs-sidebar.is-open { transform: none; }
    .docs-backdrop.is-open { display: block; position: fixed; inset: var(--d-nav-h) 0 0 0; background: rgba(0, 0, 0, .45); z-index: 65; }
    .docs-article h1 { font-size: 1.8rem; }
    .docs-article-wrap { padding: 1rem 1rem 2.5rem; }
}
@media print {
    .docs-nav, .docs-sidebar, .docs-toc, .docs-pager, .docs-footer, .docs-copy, .docs-banner { display: none !important; }
    .docs-body { background: #fff; color: #000; }
}
.docs-brand { display: inline-flex; align-items: center; gap: .55rem; }
.docs-logo { height: 30px; width: auto; max-width: 9rem; object-fit: contain; display: block; }
.docs-powered { margin-top: .4rem; font-size: .8rem; opacity: .8; }
.docs-powered a { font-weight: 600; }
.docs-widgets .cp-widget { margin-top: 1.25rem; }
.docs-widgets .cp-widget__title { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; color: var(--d-muted); margin: 0 0 .4rem; }
.docs-widgets ul { list-style: none; margin: 0; padding: 0; }
.docs-widgets li { padding: .2rem 0; }
