/* Docs layout */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #fff;
    color: #1a1a1a;
}

/* ── Header ─────────────────────────────── */
.docs-header {
    height: 56px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 100;
    gap: 0.5rem;
}

.docs-header a {
    text-decoration: none;
    color: #111827;
    font-weight: 600;
    font-size: 0.95rem;
}

.docs-header .sep { color: #d1d5db; }

.docs-header .section {
    color: #6b7280;
    font-weight: 400;
}

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

/* ── Sidebar ─────────────────────────────── */
.docs-sidebar {
    width: 240px;
    flex-shrink: 0;
    border-right: 1px solid #e5e7eb;
    padding: 1.5rem 0;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}

.docs-nav-section {
    margin-bottom: 1.75rem;
}

.docs-nav-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    padding: 0 1.25rem;
    margin-bottom: 0.35rem;
    display: block;
}

.docs-sidebar a {
    display: block;
    padding: 0.4rem 1.25rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    border-left: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    line-height: 1.4;
}

.docs-sidebar a:hover { color: #f97316; }

.docs-sidebar a.active {
    color: #f97316;
    border-left-color: #f97316;
    background: #fff7ed;
    font-weight: 500;
}

/* ── Content ─────────────────────────────── */
.docs-content {
    flex: 1;
    padding: 2.5rem 3rem;
    max-width: 760px;
    min-width: 0;
}

/* Anchor offset for sticky header */
.docs-content [id] {
    scroll-margin-top: 72px;
}

.docs-content h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.docs-content h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #111827;
    margin: 2.5rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #f3f4f6;
}

.docs-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 1.5rem 0 0.5rem;
}

.docs-content p {
    line-height: 1.75;
    color: #374151;
    margin: 0 0 1rem;
}

.docs-content ul, .docs-content ol {
    padding-left: 1.5rem;
    margin: 0 0 1rem;
}

.docs-content li {
    line-height: 1.75;
    color: #374151;
    margin-bottom: 0.35rem;
}

.docs-content a { color: #f97316; text-decoration: none; }
.docs-content a:hover { text-decoration: underline; }

.docs-content strong { color: #111827; font-weight: 600; }

.docs-content code {
    background: #f3f4f6;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: "SF Mono", Monaco, Consolas, monospace;
    font-size: 0.875em;
    color: #1f2937;
}

.docs-content pre {
    background: #1f2937;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 1.25rem 0;
}

.docs-content pre code {
    background: none;
    color: #e5e7eb;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.65;
}

.docs-content blockquote {
    border-left: 3px solid #f97316;
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    background: #fff7ed;
    border-radius: 0 6px 6px 0;
}

.docs-content blockquote p { margin: 0; color: #92400e; }

.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.9rem;
}

.docs-content th {
    background: #f9fafb;
    text-align: left;
    padding: 0.6rem 1rem;
    border: 1px solid #e5e7eb;
    font-weight: 600;
    color: #374151;
}

.docs-content td {
    padding: 0.6rem 1rem;
    border: 1px solid #e5e7eb;
    color: #374151;
}

/* ── Mobile ──────────────────────────────── */
@media (max-width: 768px) {
    .docs-layout { flex-direction: column; }

    .docs-sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding: 1rem 0;
        display: flex;
        flex-wrap: wrap;
        gap: 0;
    }

    .docs-nav-section { margin-bottom: 0; }
    .docs-nav-label { display: none; }

    .docs-sidebar a {
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .docs-sidebar a.active {
        border-bottom-color: #f97316;
        border-left: none;
        background: none;
    }

    .docs-content { padding: 1.5rem; }
}
