:root {
    --docs-bg: #f4f4f5;
    --docs-surface: #ffffff;
    --docs-border: #e4e4e7;
    --docs-text: #18181b;
    --docs-text-secondary: #71717a;
    --docs-accent: #667eea;
    --docs-accent-hover: #5a6fd6;
    --docs-sidebar-width: 240px;
    --docs-toc-width: 200px;
    --docs-header-height: 56px;
    --docs-radius: 12px;
    --docs-container-max: 1200px;
    --docs-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

.docs-container {
    width: 100%;
    max-width: var(--docs-container-max);
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* Header */
.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--docs-header-height);
    background: var(--docs-surface);
    border-bottom: 1px solid var(--docs-border);
}

.docs-header-inner {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 16px;
}

.docs-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--docs-text);
    flex-shrink: 0;
}

.docs-header-brand:hover {
    color: var(--docs-text);
}

.docs-header-logo {
    width: 28px;
    height: 28px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.docs-header-title {
    font-weight: 600;
    font-size: 15px;
}

.docs-header-badge {
    font-size: 11px;
    font-weight: 500;
    color: var(--docs-text-secondary);
    background: var(--docs-bg);
    padding: 2px 8px;
    border-radius: 6px;
}

.docs-header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.docs-header-nav a {
    color: var(--docs-text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}

.docs-header-nav a:hover {
    color: var(--docs-text);
    background: var(--docs-bg);
}

.docs-header-nav a.is-active {
    color: var(--docs-accent);
    background: rgba(102, 126, 234, 0.08);
}

.docs-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    background: var(--docs-surface);
    cursor: pointer;
    color: var(--docs-text);
    font-size: 18px;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Layout */
.docs-layout {
    padding-top: var(--docs-header-height);
    min-height: 100vh;
}

.docs-layout-inner {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.docs-sidebar {
    position: sticky;
    top: var(--docs-header-height);
    width: var(--docs-sidebar-width);
    flex-shrink: 0;
    height: calc(100vh - var(--docs-header-height));
    overflow-y: auto;
    padding: 24px 16px 24px 0;
    border-right: 1px solid var(--docs-border);
    background: var(--docs-bg);
}

.docs-sidebar-section {
    margin-bottom: 20px;
}

.docs-sidebar-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--docs-text-secondary);
    padding: 0 12px;
    margin-bottom: 8px;
}

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

.docs-sidebar-nav a {
    display: block;
    padding: 8px 12px;
    color: var(--docs-text-secondary);
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}

.docs-sidebar-nav a:hover {
    color: var(--docs-text);
    background: var(--docs-surface);
}

.docs-sidebar-nav a.is-active {
    color: var(--docs-accent);
    background: rgba(102, 126, 234, 0.08);
    font-weight: 500;
}

.docs-main {
    flex: 1;
    min-width: 0;
    padding: 40px 40px 0;
    background: var(--docs-surface);
    border-right: 1px solid var(--docs-border);
    min-height: calc(100vh - var(--docs-header-height));
}

.docs-article {
    max-width: 680px;
}

.docs-article h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 16px;
    letter-spacing: -0.02em;
}

.docs-article h2 {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    margin: 40px 0 16px;
    padding-top: 8px;
    scroll-margin-top: calc(var(--docs-header-height) + 16px);
}

.docs-article h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 28px 0 12px;
    scroll-margin-top: calc(var(--docs-header-height) + 16px);
}

.docs-article p {
    margin: 0 0 16px;
    color: var(--docs-text);
}

.docs-article ul,
.docs-article ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.docs-article li {
    margin-bottom: 8px;
}

.docs-article a {
    color: var(--docs-accent);
    text-decoration: none;
}

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

.docs-lead {
    font-size: 17px;
    color: var(--docs-text-secondary);
    margin-bottom: 24px;
    line-height: 1.65;
}

.docs-callout {
    background: rgba(102, 126, 234, 0.06);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: var(--docs-radius);
    padding: 16px 20px;
    margin: 24px 0;
}

.docs-callout-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--docs-text);
}

.docs-callout p:last-child {
    margin-bottom: 0;
}

.docs-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.docs-feature-card {
    background: var(--docs-bg);
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius);
    padding: 20px;
}

.docs-feature-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
}

.docs-feature-card p {
    font-size: 14px;
    color: var(--docs-text-secondary);
    margin: 0;
}

.docs-release-item {
    padding-bottom: 32px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--docs-border);
    scroll-margin-top: calc(var(--docs-header-height) + 16px);
}

.docs-release-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.docs-release-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
    margin-bottom: 8px;
}

.docs-release-title {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

.docs-release-version {
    color: var(--docs-accent);
    font-weight: 600;
    font-size: 14px;
}

.docs-release-badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(102, 126, 234, 0.1);
    color: var(--docs-accent);
}

.docs-release-date {
    font-size: 14px;
    color: var(--docs-text-secondary);
    margin: 0 0 12px;
}

.docs-release-content {
    color: var(--docs-text);
}

.docs-release-content p:last-child {
    margin-bottom: 0;
}

.docs-empty {
    color: var(--docs-text-secondary);
    text-align: center;
    padding: 32px 0;
}

.docs-standalone-layout {
    padding-top: var(--docs-header-height);
    min-height: 100vh;
}

.docs-standalone-main {
    padding: 40px 24px 80px;
}

.docs-standalone-main .docs-article {
    max-width: 720px;
    margin: 0 auto;
}

@media (min-width: 1248px) {
    .docs-standalone-main {
        border-left: 1px solid var(--docs-border);
        border-right: 1px solid var(--docs-border);
        background: var(--docs-surface);
    }
}

/* Table of contents */
.docs-toc {
    position: sticky;
    top: var(--docs-header-height);
    width: var(--docs-toc-width);
    flex-shrink: 0;
    height: calc(100vh - var(--docs-header-height));
    overflow-y: auto;
    padding: 24px 0 24px 16px;
    background: var(--docs-bg);
}

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

.docs-toc-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.docs-toc-nav a {
    display: block;
    padding: 4px 0 4px 12px;
    font-size: 13px;
    color: var(--docs-text-secondary);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    line-height: 1.4;
}

.docs-toc-nav a:hover {
    color: var(--docs-text);
}

.docs-toc-nav a.is-active {
    color: var(--docs-accent);
    border-left-color: var(--docs-accent);
}

.docs-toc-nav .toc-h3 a {
    padding-left: 24px;
    font-size: 12px;
}

/* Mobile overlay */
.docs-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 40;
}

.docs-overlay.is-visible {
    display: block;
}

/* Wide screens — visible side margins */
@media (min-width: 1248px) {
    .docs-layout-inner {
        border-left: 1px solid var(--docs-border);
        border-right: 1px solid var(--docs-border);
    }
}

/* Tablet */
@media (max-width: 1100px) {
    .docs-toc {
        display: none;
    }

    .docs-main {
        border-right: none;
    }
}

/* Mobile */
@media (max-width: 900px) {
    .docs-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .docs-mobile-toggle {
        display: flex;
    }

    .docs-header-nav {
        display: none;
    }

    .docs-layout-inner {
        display: block;
        border: none;
    }

    .docs-sidebar {
        position: fixed;
        top: var(--docs-header-height);
        left: 0;
        z-index: 50;
        width: 280px;
        max-width: 85vw;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: none;
        border-right: 1px solid var(--docs-border);
        background: var(--docs-surface);
        padding: 20px 16px;
    }

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

    .docs-main {
        padding: 24px 0 60px;
        min-height: auto;
        border-right: none;
    }

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