/* Bagtick Docs */

:root {
    color-scheme: light;
    --docs-header-h: 64px;
    --docs-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --docs-font-head: "Instrument Sans", "Inter", system-ui, sans-serif;
    --docs-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --docs-bg: #ffffff;
    --docs-bg-soft: #f7f7fb;
    --docs-surface: #ffffff;
    --docs-header-bg: rgba(255, 255, 255, 0.86);
    --docs-text: #1d2130;
    --docs-text-soft: #545b6c;
    --docs-text-muted: #6b7183;
    --docs-border: #e6e7ef;
    --docs-border-strong: #d5d7e3;
    --docs-primary: #433aeb;
    --docs-primary-hover: #3128d4;
    --docs-primary-soft: rgba(67, 58, 235, 0.08);
    --docs-on-primary: #ffffff;
    --docs-button: #433aeb;
    --docs-button-hover: #3128d4;
    --docs-code-bg: #f1f1f7;
    --docs-shadow: 0 1px 2px rgba(20, 22, 40, 0.04), 0 8px 24px rgba(20, 22, 40, 0.06);
    --docs-focus: #433aeb;
    --docs-backdrop: rgba(15, 17, 28, 0.45);

    --docs-note: #2563eb;
    --docs-note-bg: #eff5ff;
    --docs-tip: #0f7a4a;
    --docs-tip-bg: #ebf8f1;
    --docs-warning: #a85a00;
    --docs-warning-bg: #fff6e6;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --docs-bg: #0e1016;
    --docs-bg-soft: #151821;
    --docs-surface: #161922;
    --docs-header-bg: rgba(14, 16, 22, 0.86);
    --docs-text: #e7e9f0;
    --docs-text-soft: #b0b5c3;
    --docs-text-muted: #8d93a3;
    --docs-border: #252935;
    --docs-border-strong: #343947;
    --docs-primary: #8a84ff;
    --docs-primary-hover: #a6a1ff;
    --docs-primary-soft: rgba(138, 132, 255, 0.14);
    --docs-on-primary: #ffffff;
    --docs-button: #4f46e5;
    --docs-button-hover: #5d55f0;
    --docs-code-bg: #1d2130;
    --docs-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
    --docs-focus: #a6a1ff;
    --docs-backdrop: rgba(0, 0, 0, 0.6);

    --docs-note: #7fb0ff;
    --docs-note-bg: rgba(59, 130, 246, 0.12);
    --docs-tip: #5fd39b;
    --docs-tip-bg: rgba(16, 185, 129, 0.11);
    --docs-warning: #f5b454;
    --docs-warning-bg: rgba(245, 158, 11, 0.12);
}

/* Which logo / theme icon shows follows the active theme */
.docs-logo-dark,
.docs-theme-light-icon { display: none; }

:root[data-theme="dark"] .docs-logo-light,
:root[data-theme="dark"] .docs-theme-dark-icon { display: none; }
:root[data-theme="dark"] .docs-logo-dark,
:root[data-theme="dark"] .docs-theme-light-icon { display: inline-block; }

/* ---------- Base ---------- */

html { scroll-padding-top: calc(var(--docs-header-h) + 20px); }

body.docs {
    margin: 0;
    background: var(--docs-bg);
    color: var(--docs-text);
    font-family: var(--docs-font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.docs h1, .docs h2, .docs h3, .docs h4 {
    font-family: var(--docs-font-head);
    color: var(--docs-text);
    letter-spacing: -0.01em;
}

.docs a { color: var(--docs-primary); }
.docs a:hover { color: var(--docs-primary-hover); }

.docs :focus-visible {
    outline: 2px solid var(--docs-focus);
    outline-offset: 2px;
    border-radius: 6px;
}

.docs-skip {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 1100;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--docs-button);
    color: var(--docs-on-primary) !important;
    text-decoration: none;
}

.docs-skip:focus { top: 12px; }

.docs-kbd {
    padding: 2px 6px;
    border: 1px solid var(--docs-border-strong);
    border-radius: 6px;
    background: var(--docs-bg-soft);
    color: var(--docs-text-muted);
    font-family: var(--docs-font);
    font-size: 11.5px;
    line-height: 1.4;
    box-shadow: none;
}

.docs-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 40px;
    height: 40px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--docs-text-soft);
    font-size: 18px;
    cursor: pointer;
}

.docs-icon-btn:hover {
    background: var(--docs-bg-soft);
    color: var(--docs-text);
}

/* ---------- Header ---------- */

.docs-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--docs-header-h);
    border-bottom: 1px solid var(--docs-border);
    background: var(--docs-header-bg);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
}

.docs-header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

.docs-menu-btn { display: none; margin-left: -8px; }

.docs-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: none;
    text-decoration: none;
}

.docs-logo { width: auto; height: 26px; }

.docs-search-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    max-width: 380px;
    height: 40px;
    margin-left: 24px;
    padding: 0 8px 0 12px;
    border: 1px solid var(--docs-border);
    border-radius: 10px;
    background: var(--docs-bg-soft);
    color: var(--docs-text-muted);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.docs-search-btn:hover { border-color: var(--docs-border-strong); }
.docs-search-btn-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.docs-header-links {
    display: flex;
    gap: 20px;
    margin-left: auto;
    font-size: 14px;
    white-space: nowrap;
}

.docs-header-links a { color: var(--docs-text-soft); text-decoration: none; }
.docs-header-links a:hover { color: var(--docs-text); }

.docs-open-app {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: none;
    height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    background: var(--docs-button);
    color: var(--docs-on-primary) !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.docs-open-app:hover { background: var(--docs-button-hover); }

/* ---------- Page layout ---------- */

.docs-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 240px;
    max-width: 1440px;
    margin: 0 auto;
}

.docs-main {
    min-width: 0;
    padding: 40px 48px 72px;
}

.docs-article {
    max-width: 760px;
    margin: 0 auto;
}

/* ---------- Sidebar ---------- */

.docs-sidebar {
    position: sticky;
    top: var(--docs-header-h);
    height: calc(100vh - var(--docs-header-h));
    padding: 20px 12px 48px 16px;
    overflow-y: auto;
    border-right: 1px solid var(--docs-border);
    scrollbar-width: thin;
}

.docs-sidebar-head { display: none; }

.docs-nav-section + .docs-nav-section { margin-top: 2px; }

.docs-nav-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--docs-text);
    font-size: 14.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.docs-nav-toggle:hover { background: var(--docs-bg-soft); }
.docs-nav-icon { width: 18px; color: var(--docs-text-muted); text-align: center; }
.docs-nav-toggle span { flex: 1; }

.docs-nav-chevron {
    color: var(--docs-text-muted);
    font-size: 12px;
    transition: transform 0.15s ease;
}

.docs-nav-toggle[aria-expanded="false"] .docs-nav-chevron { transform: rotate(-90deg); }

.docs-nav-pages {
    margin: 2px 0 10px;
    padding: 0;
    list-style: none;
}

.docs-nav-link {
    display: block;
    padding: 6px 10px 6px 38px;
    border-radius: 8px;
    color: var(--docs-text-soft) !important;
    font-size: 14px;
    line-height: 1.45;
    text-decoration: none;
}

.docs-nav-link:hover { background: var(--docs-bg-soft); color: var(--docs-text) !important; }

.docs-nav-link.is-active {
    background: var(--docs-primary-soft);
    color: var(--docs-primary) !important;
    font-weight: 600;
}

.docs-nav-group {
    padding: 10px 10px 4px 38px;
    color: var(--docs-text-muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.docs-backdrop { display: none; }

/* ---------- On this page ---------- */

.docs-toc {
    position: sticky;
    top: var(--docs-header-h);
    height: calc(100vh - var(--docs-header-h));
    padding: 44px 24px 40px 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

.docs-toc-title {
    margin: 0 0 12px;
    color: var(--docs-text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.docs-toc ul {
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--docs-border);
    list-style: none;
}

.docs-toc a {
    display: block;
    margin-left: -1px;
    padding: 4px 0 4px 14px;
    border-left: 2px solid transparent;
    color: var(--docs-text-soft);
    font-size: 13.5px;
    line-height: 1.45;
    text-decoration: none;
}

.docs-toc .docs-toc-l3 a { padding-left: 26px; font-size: 13px; }
.docs-toc a:hover { color: var(--docs-text); }

.docs-toc a.is-active {
    border-left-color: var(--docs-primary);
    color: var(--docs-primary);
    font-weight: 500;
}

.docs-toc-mobile {
    display: none;
    margin: 0 0 28px;
    border: 1px solid var(--docs-border);
    border-radius: 12px;
    background: var(--docs-bg-soft);
}

.docs-toc-mobile summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.docs-toc-mobile summary::-webkit-details-marker { display: none; }

.docs-toc-mobile summary::after {
    content: "\f078";
    margin-left: auto;
    color: var(--docs-text-muted);
    font-family: "Font Awesome 6 Pro";
    font-size: 12px;
    font-weight: 300;
    transition: transform 0.15s ease;
}

.docs-toc-mobile[open] summary::after { transform: rotate(180deg); }

.docs-toc-mobile ul { margin: 0; padding: 0 16px 12px; list-style: none; }
.docs-toc-mobile li { padding: 4px 0; font-size: 14px; }
.docs-toc-mobile .docs-toc-l3 { padding-left: 14px; }
.docs-toc-mobile a { color: var(--docs-text-soft); text-decoration: none; }

/* ---------- Article ---------- */

.docs-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 14px;
    padding: 0;
    color: var(--docs-text-muted);
    font-size: 13.5px;
    list-style: none;
}

.docs-breadcrumb li + li::before {
    content: "/";
    margin-right: 6px;
    color: var(--docs-border-strong);
}

.docs-breadcrumb a { color: var(--docs-text-muted); text-decoration: none; }
.docs-breadcrumb a:hover { color: var(--docs-primary); }

.docs-title {
    margin: 0 0 12px;
    font-size: 38px;
    font-weight: 600;
    line-height: 1.2;
}

.docs-lead {
    margin: 0 0 32px;
    color: var(--docs-text-soft);
    font-size: 18px;
    line-height: 1.6;
}

.docs-body {
    font-size: 16.5px;
    line-height: 1.7;
    overflow-wrap: break-word;
}

.docs-body > * + * { margin-top: 1.1em; }
.docs-body p, .docs-body ul, .docs-body ol { margin-bottom: 0; }

.docs-body h2 {
    margin: 1.9em 0 0.6em;
    padding-top: 1.3em;
    border-top: 1px solid var(--docs-border);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.3;
}

.docs-body > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.docs-body h3 {
    margin: 1.8em 0 0.5em;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
}

.docs-body h2 + *, .docs-body h3 + * { margin-top: 0; }

.docs-anchor {
    margin-left: 0.4em;
    color: var(--docs-text-muted) !important;
    font-weight: 400;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.docs-body h2:hover .docs-anchor,
.docs-body h3:hover .docs-anchor { opacity: 1; }
.docs-anchor.is-copied { color: var(--docs-tip) !important; opacity: 1; }

.docs-body a:not(.docs-anchor) {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: color-mix(in srgb, var(--docs-primary) 40%, transparent);
}

.docs-body a:not(.docs-anchor):hover { text-decoration-color: currentColor; }
.docs-body strong { font-weight: 600; color: var(--docs-text); }

.docs-body ul, .docs-body ol { padding-left: 1.4em; }
.docs-body li + li { margin-top: 0.35em; }
.docs-body li::marker { color: var(--docs-text-muted); }

/* Numbered steps */
.docs-body > ol {
    padding-left: 0;
    list-style: none;
    counter-reset: docs-step;
}

.docs-body > ol > li {
    position: relative;
    padding-left: 2.4em;
    counter-increment: docs-step;
}

.docs-body > ol > li::before {
    content: counter(docs-step);
    position: absolute;
    left: 0;
    top: 0.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.6em;
    height: 1.6em;
    border-radius: 50%;
    background: var(--docs-primary-soft);
    color: var(--docs-primary);
    font-size: 0.82em;
    font-weight: 600;
}

.docs-body > ol > li + li { margin-top: 0.7em; }

.docs-body code {
    padding: 0.15em 0.4em;
    border-radius: 6px;
    background: var(--docs-code-bg);
    color: var(--docs-text);
    font-family: var(--docs-font-mono);
    font-size: 0.86em;
}

.docs-body pre {
    padding: 16px 18px;
    border: 1px solid var(--docs-border);
    border-radius: 12px;
    background: var(--docs-code-bg);
    overflow-x: auto;
}

.docs-body pre code { padding: 0; background: none; font-size: 0.88em; }

.docs-body hr { border: 0; border-top: 1px solid var(--docs-border); opacity: 1; }

/* Quotes and callouts */
.docs-body blockquote {
    margin-left: 0;
    margin-right: 0;
    padding: 2px 0 2px 16px;
    border-left: 3px solid var(--docs-border-strong);
    color: var(--docs-text-soft);
}

.docs-body blockquote > * + * { margin-top: 0.6em; }
.docs-body blockquote p { margin-bottom: 0; }

.docs-body .docs-callout {
    --callout: var(--docs-note);
    padding: 14px 18px;
    border: 1px solid color-mix(in srgb, var(--callout) 22%, transparent);
    border-left: 4px solid var(--callout);
    border-radius: 10px;
    background: var(--docs-note-bg);
    color: var(--docs-text);
    font-size: 15.5px;
}

.docs-body .docs-callout-tip { --callout: var(--docs-tip); background: var(--docs-tip-bg); }
.docs-body .docs-callout-warning { --callout: var(--docs-warning); background: var(--docs-warning-bg); }

.docs-body .docs-callout-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--callout);
    font-size: 14px;
    font-weight: 600;
}

.docs-body .docs-callout-title::before {
    content: "\f05a";
    font-family: "Font Awesome 6 Pro";
    font-weight: 300;
}

.docs-body .docs-callout-tip .docs-callout-title::before { content: "\f0eb"; }
.docs-body .docs-callout-warning .docs-callout-title::before { content: "\f071"; }
.docs-body .docs-callout .docs-callout-title + * { margin-top: 0.35em; }

/* Tables */
.docs-table-wrap {
    border: 1px solid var(--docs-border);
    border-radius: 12px;
    overflow-x: auto;
}

.docs-body .docs-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--docs-text);
    --bs-table-border-color: var(--docs-border);
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
}

.docs-body .docs-table th {
    background: var(--docs-bg-soft);
    color: var(--docs-text);
    font-weight: 600;
    white-space: nowrap;
}

.docs-body .docs-table th,
.docs-body .docs-table td { padding: 10px 14px; vertical-align: top; }
.docs-body .docs-table tr:last-child td { border-bottom: 0; }

/* Images */
.docs-body .docs-img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--docs-border);
    border-radius: 12px;
    background: var(--docs-bg-soft);
    box-shadow: var(--docs-shadow);
    cursor: zoom-in;
}

/* Stub notice */
.docs-stub {
    display: flex;
    gap: 16px;
    padding: 22px 24px;
    border: 1px dashed var(--docs-border-strong);
    border-radius: 14px;
    background: var(--docs-bg-soft);
}

.docs-stub > i { margin-top: 3px; color: var(--docs-primary); font-size: 22px; }
.docs-stub strong { display: block; font-size: 17px; font-weight: 600; }
.docs-stub p { margin: 4px 0 8px; color: var(--docs-text-soft); }
.docs-stub a { font-weight: 500; }

/* Pager */
.docs-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 64px;
    padding-top: 28px;
    border-top: 1px solid var(--docs-border);
}

.docs-pager-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    border: 1px solid var(--docs-border);
    border-radius: 12px;
    text-decoration: none;
    transition: border-color 0.15s ease;
}

.docs-pager-link:hover { border-color: var(--docs-primary); }
.docs-pager-next { grid-column: 2; text-align: right; }
.docs-pager-label { color: var(--docs-text-muted); font-size: 13px; }
.docs-pager-title { color: var(--docs-text); font-weight: 600; }

/* ---------- Landing ---------- */

.docs-landing { padding-bottom: 80px; }

.docs-hero {
    padding: 72px 24px 48px;
    background: radial-gradient(60% 120% at 50% 0%, var(--docs-primary-soft), transparent 70%);
    text-align: center;
}

.docs-eyebrow {
    display: inline-block;
    margin: 0 0 16px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--docs-primary-soft);
    color: var(--docs-primary);
    font-size: 13px;
    font-weight: 600;
}

.docs-hero h1 {
    max-width: 760px;
    margin: 0 auto 14px;
    font-size: 46px;
    font-weight: 600;
    line-height: 1.15;
}

.docs-hero .docs-lead { max-width: 600px; margin: 0 auto 32px; }

.docs-hero-search {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 580px;
    height: 54px;
    margin: 0 auto;
    padding: 0 12px 0 18px;
    border: 1px solid var(--docs-border-strong);
    border-radius: 14px;
    background: var(--docs-surface);
    box-shadow: var(--docs-shadow);
    color: var(--docs-text-muted);
    font-size: 15.5px;
    text-align: left;
    cursor: pointer;
}

.docs-hero-search:hover { border-color: var(--docs-primary); }
.docs-hero-search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.docs-popular,
.docs-cards {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

.docs-popular { margin-bottom: 40px; text-align: center; }

.docs-popular h2 {
    margin: 0 0 14px;
    color: var(--docs-text-muted);
    font-family: var(--docs-font);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.docs-popular ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.docs-popular a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--docs-border);
    border-radius: 999px;
    background: var(--docs-surface);
    color: var(--docs-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.docs-popular a:hover { border-color: var(--docs-primary); color: var(--docs-primary); }
.docs-popular-section { color: var(--docs-text-muted); font-weight: 400; }

.docs-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.docs-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    border: 1px solid var(--docs-border);
    border-radius: 16px;
    background: var(--docs-surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.docs-card:hover { border-color: var(--docs-border-strong); box-shadow: var(--docs-shadow); }

.docs-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: var(--docs-primary-soft);
    color: var(--docs-primary);
    font-size: 19px;
}

.docs-card h3 { margin: 0 0 6px; font-size: 19px; font-weight: 600; }
.docs-card h3 a { color: var(--docs-text); text-decoration: none; }
.docs-card h3 a:hover { color: var(--docs-primary); }

.docs-card p {
    margin: 0 0 14px;
    color: var(--docs-text-soft);
    font-size: 14.5px;
    line-height: 1.55;
}

.docs-card ul {
    margin: 0 0 4px;
    padding: 12px 0 0;
    border-top: 1px solid var(--docs-border);
    list-style: none;
}

.docs-card li { padding: 3px 0; font-size: 14.5px; }
.docs-card li a { color: var(--docs-text-soft); text-decoration: none; }
.docs-card li a:hover { color: var(--docs-primary); }
.docs-card-more { margin-top: auto; padding-top: 8px; font-size: 13.5px; font-weight: 500; text-decoration: none; }

/* ---------- Footer ---------- */

.docs-footer { border-top: 1px solid var(--docs-border); }

.docs-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    flex-wrap: wrap;
    max-width: 1440px;
    margin: 0 auto;
    padding: 22px 24px;
    color: var(--docs-text-muted);
    font-size: 14px;
}

.docs-footer p { margin: 0; }
.docs-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.docs-footer a { color: var(--docs-text-muted); text-decoration: none; }
.docs-footer a:hover { color: var(--docs-text); }

/* ---------- Lightbox ---------- */

.docs-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8, 9, 16, 0.86);
    cursor: zoom-out;
}

.docs-lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

.docs-lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.docs-lightbox-close:hover { color: #ffffff; background: rgba(255, 255, 255, 0.22); }

/* ---------- Search ---------- */

.docs-search {
    position: fixed;
    inset: 0;
    z-index: 1150;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10vh 16px 16px;
    background: var(--docs-backdrop);
}

.docs-search-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 640px;
    max-height: 76vh;
    border: 1px solid var(--docs-border);
    border-radius: 16px;
    background: var(--docs-surface);
    box-shadow: 0 24px 64px rgba(10, 12, 24, 0.28);
    overflow: hidden;
}

.docs-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px 0 18px;
    border-bottom: 1px solid var(--docs-border);
    color: var(--docs-text-muted);
    font-size: 18px;
}

.docs-search-input {
    flex: 1;
    min-width: 0;
    height: 58px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--docs-text);
    font-size: 17px;
}

.docs-search-input::placeholder { color: var(--docs-text-muted); }
.docs-search-input::-webkit-search-cancel-button { display: none; }
.docs.docs .docs-search-input:focus-visible { outline: 0; }

.docs-search-close {
    padding: 4px;
    border: 0;
    background: transparent;
    color: var(--docs-text-soft);
    font-size: 20px;
    cursor: pointer;
}

.docs-search-close-icon { display: none; }

.docs-search-body {
    flex: 1;
    min-height: 0;
    padding: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.docs-search-results {
    margin: 0;
    padding: 0;
    list-style: none;
}

.docs-search-group {
    padding: 12px 10px 6px;
    color: var(--docs-text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.docs-search-option a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
}

.docs-search-option[aria-selected="true"] a { background: var(--docs-primary-soft); }

.docs-search-title {
    color: var(--docs-text);
    font-size: 15px;
    font-weight: 600;
}

.docs-search-option[aria-selected="true"] .docs-search-title { color: var(--docs-primary); }
.docs-search-sep { color: var(--docs-text-muted); font-weight: 400; }

.docs-search-snippet {
    color: var(--docs-text-soft);
    font-size: 13.5px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.docs-search mark {
    padding: 0 1px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--docs-primary) 18%, transparent);
    color: inherit;
}

.docs-search-state {
    margin: 0;
    padding: 28px 16px;
    color: var(--docs-text-muted);
    font-size: 14.5px;
    text-align: center;
}

.docs-search-empty p { margin: 0 0 6px; }
.docs-search-empty strong { color: var(--docs-text); font-weight: 600; }

.docs-search-empty-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
    margin-top: 12px !important;
}

.docs-search-empty-links a { font-weight: 500; text-decoration: none; }

.docs-search-foot {
    display: flex;
    gap: 18px;
    padding: 10px 16px;
    border-top: 1px solid var(--docs-border);
    background: var(--docs-bg-soft);
    color: var(--docs-text-muted);
    font-size: 12.5px;
}

.docs-search-foot .docs-kbd { margin-right: 3px; }

@media (max-width: 767.98px) {
    .docs-search { padding: 0; }
    .docs-search-panel { max-width: none; height: 100%; max-height: none; border: 0; border-radius: 0; }
    .docs-search-foot { display: none; }
    .docs-search-close-kbd { display: none; }
    .docs-search-close-icon { display: inline-block; padding: 6px; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1199.98px) {
    .docs-layout { grid-template-columns: 248px minmax(0, 1fr); }
    .docs-toc { display: none; }
    .docs-toc-mobile { display: block; }
    .docs-main { padding: 36px 36px 64px; }
    .docs-header-links { display: none; }
    .docs-search-btn { margin-right: auto; }
    .docs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    :root { --docs-header-h: 58px; }

    .docs-header-inner { gap: 4px; padding: 0 12px 0 16px; }
    .docs-menu-btn { display: inline-flex; }
    .docs-logo { height: 22px; }
    .docs-search-btn { width: 40px; max-width: none; flex: none; justify-content: center; margin-left: auto; margin-right: 0; padding: 0; border-color: transparent; background: transparent; font-size: 17px; }
    .docs-search-btn-text, .docs-search-btn .docs-kbd { display: none; }
    .docs-open-app { width: 40px; padding: 0; justify-content: center; }
    .docs-open-app span { display: none; }

    .docs-layout { display: block; }
    .docs-main { padding: 24px 16px 56px; }

    .docs-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1050;
        width: min(320px, 86vw);
        height: 100%;
        padding-top: 8px;
        border-right: 1px solid var(--docs-border);
        background: var(--docs-bg);
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform 0.2s ease, visibility 0.2s ease;
    }

    .docs-sidebar.is-open { transform: none; visibility: visible; box-shadow: var(--docs-shadow); }

    .docs-sidebar-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 4px 0 8px 10px;
        font-weight: 600;
    }

    .docs-backdrop:not([hidden]) {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1040;
        background: var(--docs-backdrop);
    }

    .docs-title { font-size: 30px; }
    .docs-lead { font-size: 17px; margin-bottom: 24px; }
    .docs-body { font-size: 16px; }
    .docs-body h2 { font-size: 22px; }
    .docs-body h3 { font-size: 18px; }

    .docs-pager { grid-template-columns: 1fr; margin-top: 48px; }
    .docs-pager-next { grid-column: auto; }

    .docs-hero { padding: 48px 16px 32px; }
    .docs-hero h1 { font-size: 31px; }
    .docs-hero-search .docs-kbd { display: none; }
    .docs-popular, .docs-cards { padding: 0 16px; }
    .docs-cards { grid-template-columns: 1fr; gap: 14px; }
    .docs-card { padding: 20px; }
    .docs-footer-inner { padding: 20px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .docs * { transition: none !important; scroll-behavior: auto !important; }
}
