* {
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --bg: #f7f9fc;
    --bg-elevated: #ffffff;
    --bg-soft: #edf3f8;
    --text: #18212f;
    --text-muted: #667085;
    --text-soft: #8a96a8;
    --border: #d9e2ec;
    --border-soft: #e9eef5;
    --brand: #1f6feb;
    --brand-strong: #174ea6;
    --accent: #0f9f8f;
    --code-bg: #111827;
    --code-text: #e7edf5;
    --shadow: 0 18px 45px rgba(22, 34, 51, 0.08);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(31, 111, 235, 0.13), transparent 34rem),
        linear-gradient(145deg, #f9fbff 0%, #eff5f8 48%, #f7f9fc 100%);
    color: var(--text);
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.7;
}

.docs-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 28px;
    background:
        linear-gradient(135deg, rgba(12, 19, 32, 0.98), rgba(20, 45, 70, 0.96)),
        #111827;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(16px);
}

.docs-brand,
.docs-topbar a {
    color: #fff;
    text-decoration: none;
}

.docs-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 750;
}

.docs-brand-mark {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    font-size: 15px;
    line-height: 1;
}

.docs-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.docs-topbar nav {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.docs-topbar nav a {
    padding: 8px 11px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.82);
}

.docs-theme-toggle {
    min-height: 34px;
    padding: 0 11px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.docs-topbar nav a:hover,
.docs-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.docs-shell {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    min-height: calc(100vh - 64px);
}

.docs-sidebar {
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 30px 22px;
    border-right: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.76);
    backdrop-filter: blur(18px);
}

.docs-sidebar-label,
.docs-outline-title {
    margin: 0 0 12px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.docs-sidebar h1 {
    margin: 0 0 16px;
    font-size: 17px;
    line-height: 1.25;
}

.docs-sidebar ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.docs-sidebar li {
    margin: 3px 0;
}

.docs-sidebar a,
.docs-outline a {
    display: block;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
}

.docs-sidebar a {
    padding: 7px 9px;
    font-size: 14px;
}

.docs-sidebar a:hover,
.docs-outline a:hover {
    background: rgba(31, 111, 235, 0.08);
    color: var(--brand-strong);
}

.docs-main {
    display: grid;
    grid-template-columns: minmax(0, 900px) 240px;
    gap: 38px;
    width: min(100%, 1240px);
    padding: 42px 36px 76px;
}

.docs-content {
    min-width: 0;
    color: var(--text);
}

.docs-content > * {
    max-width: 860px;
}

.docs-content > h1:first-child {
    max-width: 980px;
    margin: 0 0 18px;
    padding: 30px 34px;
    border: 1px solid rgba(31, 111, 235, 0.14);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(31, 111, 235, 0.12), rgba(15, 159, 143, 0.1)),
        rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow);
    font-size: 40px;
    letter-spacing: 0;
}

.docs-content h1,
.docs-content h2,
.docs-content h3 {
    line-height: 1.25;
    color: #121926;
}

.docs-content h2 {
    margin-top: 44px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    font-size: 26px;
}

.docs-content h2::before {
    content: "";
    display: block;
    width: 46px;
    height: 4px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
}

.docs-content h3 {
    margin-top: 30px;
    font-size: 20px;
}

.docs-content p,
.docs-content li {
    color: #2c3748;
}

.docs-content a {
    color: var(--brand-strong);
    font-weight: 650;
    text-decoration: none;
    text-underline-offset: 3px;
}

.docs-content a:hover {
    text-decoration: underline;
}

.docs-content ul,
.docs-content ol {
    padding-left: 24px;
}

.docs-content li + li {
    margin-top: 5px;
}

.docs-content code {
    padding: 2px 6px;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    background: #eef3f7;
    color: #1f3b57;
    font-family:
        "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono",
        monospace;
    font-size: 0.9em;
}

.docs-content pre {
    max-width: 100%;
    overflow-x: auto;
    margin: 20px 0 26px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
        var(--code-bg);
    color: var(--code-text);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
}

.docs-content pre code {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 13px;
}

.docs-content .mermaid {
    max-width: 100%;
    overflow-x: auto;
    margin: 20px 0 30px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-elevated);
    box-shadow: 0 12px 30px rgba(22, 34, 51, 0.06);
}

.docs-content .mermaid svg {
    max-width: 100%;
    height: auto;
}

.docs-content table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 22px 0 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-elevated);
    box-shadow: 0 12px 30px rgba(22, 34, 51, 0.05);
}

.docs-content thead {
    background: #edf4fb;
}

.docs-content th,
.docs-content td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    vertical-align: top;
}

.docs-content th {
    color: #253348;
    font-size: 13px;
    font-weight: 800;
}

.docs-content td {
    min-width: 180px;
}

.docs-content blockquote {
    margin: 22px 0;
    padding: 14px 18px;
    border-left: 4px solid var(--accent);
    border-radius: 0 8px 8px 0;
    background: rgba(15, 159, 143, 0.08);
}

.docs-outline {
    position: sticky;
    top: 94px;
    align-self: start;
    max-height: calc(100vh - 118px);
    overflow-y: auto;
    padding: 18px 0 18px 18px;
    border-left: 1px solid var(--border-soft);
}

.docs-outline nav {
    display: grid;
    gap: 2px;
}

.docs-outline a {
    padding: 6px 9px;
    font-size: 13px;
    line-height: 1.35;
}

.docs-outline a.level-3 {
    padding-left: 18px;
    color: var(--text-soft);
}

body.dark-mode {
    color-scheme: dark;
    --bg: #0b0f17;
    --bg-elevated: #111827;
    --bg-soft: #1b2638;
    --text: #eef4ff;
    --text-muted: #9aa8bd;
    --text-soft: #7f8da3;
    --border: rgba(255, 255, 255, 0.14);
    --border-soft: rgba(255, 255, 255, 0.09);
    --code-bg: #050914;
    --code-text: #eef4ff;
    background:
        radial-gradient(circle at top left, rgba(31, 111, 235, 0.18), transparent 34rem),
        linear-gradient(145deg, #070a10 0%, #101827 48%, #0a111d 100%);
}

body.dark-mode .docs-sidebar {
    background: rgba(13, 19, 31, 0.76);
}

body.dark-mode .docs-content > h1:first-child,
body.dark-mode .docs-content .mermaid,
body.dark-mode .docs-content table {
    background-color: rgba(17, 24, 39, 0.86);
}

body.dark-mode .docs-content thead {
    background: rgba(31, 41, 55, 0.92);
}

body.dark-mode .docs-content h1,
body.dark-mode .docs-content h2,
body.dark-mode .docs-content h3,
body.dark-mode .docs-content p,
body.dark-mode .docs-content li,
body.dark-mode .docs-content th {
    color: var(--text);
}

body.dark-mode .docs-content th {
    border-bottom-color: rgba(255, 255, 255, 0.16);
}

body.dark-mode .docs-content td {
    color: var(--text-muted);
}

body.dark-mode .docs-content code {
    background: rgba(255, 255, 255, 0.07);
    color: #d8ecff;
}

@media screen and (max-width: 1120px) {
    .docs-main {
        grid-template-columns: minmax(0, 1fr);
        width: min(100%, 920px);
    }

    .docs-outline {
        display: none;
    }
}

@media screen and (max-width: 860px) {
    html {
        scroll-padding-top: 74px;
    }

    .docs-topbar {
        min-height: 58px;
        padding: 0 16px;
    }

    .docs-brand-mark {
        width: 28px;
        height: 28px;
    }

    .docs-shell {
        display: block;
    }

    .docs-sidebar {
        position: static;
        height: auto;
        padding: 20px 16px;
        border-right: 0;
        border-bottom: 1px solid var(--border-soft);
    }

    .docs-main {
        padding: 26px 18px 56px;
    }

    .docs-content > h1:first-child {
        padding: 22px;
        font-size: 30px;
    }

    .docs-content h2 {
        font-size: 23px;
    }

    .docs-topbar nav a {
        padding: 7px 8px;
    }
}
