* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    background: #0d0d1a;
    color: #e0e0e0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: #4d7cff;
    text-decoration: none;
}

a:hover {
    color: #6b9aff;
}

/* ── Top Bar ── */
.docs-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 56px;
    background: rgba(13, 13, 26, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}

.topbar-brand:hover {
    color: #fff;
}

.topbar-brand svg {
    filter: drop-shadow(0 0 8px rgba(77, 124, 255, 0.4));
}

.topbar-sep {
    color: #333;
    margin: 0 12px;
    font-weight: 300;
}

.topbar-title {
    color: #888;
    font-size: 14px;
    font-weight: 400;
}

.topbar-spacer {
    flex: 1;
}

.topbar-link {
    font-size: 13px;
    color: #666;
}

.topbar-link:hover {
    color: #aaa;
}

/* ── Mobile menu toggle ── */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 8px;
    margin-right: 8px;
}

/* ── Layout ── */
.docs-layout {
    display: flex;
    margin-top: 56px;
    min-height: calc(100vh - 56px);
}

/* ── Sidebar ── */
.docs-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 24px 0;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(13, 13, 26, 0.98);
    z-index: 50;
}

.docs-sidebar::-webkit-scrollbar {
    width: 4px;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.sidebar-section {
    margin-bottom: 4px;
}

.sidebar-link {
    display: block;
    padding: 7px 24px;
    font-size: 13px;
    color: #777;
    transition: all 0.15s ease;
    border-left: 2px solid transparent;
}

.sidebar-link:hover {
    color: #bbb;
    background: rgba(77, 124, 255, 0.04);
}

.sidebar-link.active {
    color: #4d7cff;
    border-left-color: #4d7cff;
    background: rgba(77, 124, 255, 0.06);
}

.sidebar-sub {
    display: flex;
    flex-direction: column;
    padding: 0 0 4px 0;
}

.sidebar-sub a {
    display: block;
    padding: 3px 24px 3px 36px;
    font-size: 12px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: #555;
    transition: color 0.15s ease;
}

.sidebar-sub a:hover {
    color: #6b9aff;
}

/* ── Main Content ── */
.docs-main {
    flex: 1;
    margin-left: 260px;
    padding: 40px 48px 80px;
    max-width: 820px;
}

.docs-main h1 {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.docs-main .docs-intro {
    font-size: 16px;
    color: #888;
    margin-bottom: 40px;
    line-height: 1.7;
}

/* Section headings */
.docs-main h2 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-top: 56px;
    margin-bottom: 8px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    letter-spacing: -0.3px;
    scroll-margin-top: 72px;
}

.docs-main h2:first-of-type {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

/* Function headings */
.docs-main h3 {
    font-size: 16px;
    font-weight: 600;
    color: #e0e0e0;
    margin-top: 36px;
    margin-bottom: 8px;
    scroll-margin-top: 72px;
}

.docs-main h3 code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 15px;
    background: rgba(77, 124, 255, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    color: #6b9aff;
}

/* Descriptions */
.docs-main p {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 12px;
    line-height: 1.6;
}

.docs-main strong {
    color: #ccc;
}

/* Parameter lists */
.docs-main ul {
    list-style: none;
    padding: 0;
    margin-bottom: 12px;
}

.docs-main ul li {
    font-size: 13px;
    color: #999;
    padding: 3px 0 3px 16px;
    position: relative;
    line-height: 1.5;
}

.docs-main ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #4d7cff;
}

.docs-main ul li code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    background: rgba(77, 124, 255, 0.08);
    padding: 1px 5px;
    border-radius: 3px;
    color: #6b9aff;
}

/* Inline code */
.docs-main code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    background: rgba(77, 124, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    color: #6b9aff;
}

/* Code blocks */
.docs-main pre {
    background: #12121f;
    border: 1px solid rgba(77, 124, 255, 0.1);
    border-radius: 10px;
    padding: 16px 20px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.docs-main pre code {
    font-size: 13px;
    line-height: 1.6;
    background: none;
    padding: 0;
    border-radius: 0;
    color: #e0e0e0;
}

/* Syntax highlighting */
.docs-main pre .c { color: #5c6370; font-style: italic; }
.docs-main pre .k { color: #c678dd; }
.docs-main pre .f { color: #61afef; }
.docs-main pre .s { color: #98c379; }
.docs-main pre .n { color: #d19a66; }
.docs-main pre .o { color: #56b6c2; }

/* Tables */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 16px;
    font-size: 0.92rem;
}
.docs-table th,
.docs-table td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid #2a2a3d;
}
.docs-table th {
    background: #1a1a2e;
    color: #a0a0b8;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.docs-table td {
    background: #12121f;
}

/* Ordered lists (for notes section) */
.docs-main ol {
    padding-left: 20px;
    margin-bottom: 16px;
}

.docs-main ol li {
    font-size: 14px;
    color: #aaa;
    padding: 4px 0;
    line-height: 1.6;
}

/* Notes section */
.docs-note {
    background: rgba(77, 124, 255, 0.05);
    border-left: 3px solid #4d7cff;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 16px;
}

.docs-note p {
    margin-bottom: 0;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .docs-main {
        padding: 32px 24px 60px;
    }
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }

    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        width: 280px;
        box-shadow: none;
    }

    .docs-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

    .docs-main {
        margin-left: 0;
        padding: 24px 16px 60px;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .docs-main h1 {
        font-size: 26px;
    }

    .docs-main h2 {
        font-size: 20px;
    }

    .docs-main h3 code {
        font-size: 13px;
        word-break: break-all;
    }

    .docs-main pre {
        padding: 12px 14px;
        font-size: 12px;
        max-width: calc(100vw - 32px);
    }

    .docs-main pre code {
        font-size: 12px;
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 56px 0 0 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 40;
    }

    .sidebar-overlay.active {
        display: block;
    }
}
