/* === Reset & Base === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --blue-600: #2563eb; --blue-700: #1d4ed8; --blue-500: #3b82f6;
    --blue-400: #60a5fa; --blue-50: #eff6ff;
    --green-500: #22c55e; --green-50: #f0fdf4;
    --orange-500: #f97316; --orange-50: #fff7ed;
    --red-500: #ef4444; --red-50: #fef2f2;
    --purple-500: #a855f7;
    --gray-50: #f8fafc; --gray-100: #f1f5f9; --gray-200: #e2e8f0;
    --gray-300: #cbd5e1; --gray-400: #94a3b8; --gray-500: #64748b;
    --gray-600: #475569; --gray-700: #334155; --gray-800: #1e293b;
    --gray-900: #0f172a; --gray-950: #020617;
    --radius: 12px; --radius-sm: 8px; --radius-lg: 16px;
    --sidebar-w: 272px; --topbar-h: 56px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--gray-700);
    line-height: 1.6;
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Topbar === */
.docs-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
    z-index: 50;
}

.docs-topbar-inner {
    max-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
}

.docs-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.docs-sidebar-toggle {
    display: none;
    background: none; border: none; cursor: pointer;
    color: var(--gray-600); padding: 4px;
}

.docs-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--gray-900);
    text-decoration: none;
}

.docs-logo:hover { text-decoration: none; }
.docs-logo-icon { width: 28px; height: 28px; }

.docs-label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--blue-600);
    background: var(--blue-50);
    padding: 2px 8px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.docs-search {
    flex: 1;
    max-width: 480px;
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 auto;
}

.docs-search-icon {
    position: absolute;
    left: 12px;
    color: var(--gray-400);
    pointer-events: none;
}

.docs-search input {
    width: 100%;
    padding: 8px 12px 8px 38px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-family: inherit;
    color: var(--gray-900);
    background: var(--gray-50);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.docs-search input:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
    background: #fff;
}

.docs-search kbd {
    position: absolute;
    right: 10px;
    font-size: .68rem;
    font-family: inherit;
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--gray-200);
    pointer-events: none;
}

.docs-topbar-right {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.docs-topbar-link {
    font-size: .82rem;
    font-weight: 500;
    color: var(--gray-500);
    text-decoration: none;
    transition: color .15s;
    white-space: nowrap;
}

.docs-topbar-link:hover { color: var(--gray-900); text-decoration: none; }

/* === Layout === */
.docs-layout {
    display: flex;
    padding-top: var(--topbar-h);
    min-height: 100vh;
}

/* === Sidebar === */
.docs-sidebar {
    width: var(--sidebar-w);
    position: fixed;
    top: var(--topbar-h);
    bottom: 0;
    left: 0;
    overflow-y: auto;
    border-right: 1px solid var(--gray-200);
    background: var(--gray-50);
    padding: 20px 0;
    z-index: 30;
}

.docs-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.docs-nav-section {
    padding: 0 16px;
    margin-bottom: 8px;
}

.docs-nav-title {
    font-size: .72rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 12px 8px 6px;
}

.docs-nav-link {
    display: block;
    padding: 7px 12px;
    font-size: .84rem;
    font-weight: 450;
    color: var(--gray-600);
    border-radius: 6px;
    transition: all .12s;
    text-decoration: none;
}

.docs-nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    text-decoration: none;
}

.docs-nav-link.active {
    background: var(--blue-50);
    color: var(--blue-700);
    font-weight: 600;
}

/* === Main === */
.docs-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

.docs-content {
    max-width: 780px;
    margin: 0 auto;
}

/* === Articles === */
.docs-article {
    display: none;
}

.docs-article.active {
    display: block;
}

/* Breadcrumb */
.docs-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: var(--gray-400);
    margin-bottom: 20px;
}

.docs-breadcrumb a {
    color: var(--gray-400);
    text-decoration: none;
}

.docs-breadcrumb a:hover { color: var(--blue-600); }
.docs-breadcrumb svg { flex-shrink: 0; }

/* Typography */
.docs-article h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -.02em;
    margin-bottom: 12px;
    line-height: 1.2;
}

.docs-lead {
    font-size: 1.1rem;
    color: var(--gray-500);
    line-height: 1.7;
    margin-bottom: 32px;
}

.docs-article h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-top: 40px;
    margin-bottom: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-100);
    letter-spacing: -.01em;
}

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

.docs-article h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-top: 24px;
    margin-bottom: 8px;
}

.docs-article p {
    margin-bottom: 16px;
    line-height: 1.75;
    color: var(--gray-600);
}

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

.docs-article li {
    margin-bottom: 8px;
    line-height: 1.7;
    color: var(--gray-600);
}

.docs-article strong { color: var(--gray-800); }

.docs-article code {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: .85em;
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--gray-800);
}

/* === Callouts === */
.docs-callout {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-size: .9rem;
    line-height: 1.6;
}

.docs-callout strong { display: block; margin-bottom: 2px; }

.docs-callout-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.docs-callout.info {
    background: var(--blue-50);
    border: 1px solid rgba(37,99,235,.15);
    color: var(--gray-700);
}
.docs-callout.info .docs-callout-icon { color: var(--blue-600); }
.docs-callout.info strong { color: var(--blue-700); }

.docs-callout.warning {
    background: var(--orange-50);
    border: 1px solid rgba(249,115,22,.15);
    color: var(--gray-700);
}
.docs-callout.warning .docs-callout-icon { color: var(--orange-500); }
.docs-callout.warning strong { color: #c2410c; }

.docs-callout.success {
    background: var(--green-50);
    border: 1px solid rgba(34,197,94,.15);
    color: var(--gray-700);
}
.docs-callout.success .docs-callout-icon { color: var(--green-500); }
.docs-callout.success strong { color: #15803d; }

/* === Code Blocks === */
.docs-code-block {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--gray-200);
}

.docs-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-size: .78rem;
    font-weight: 600;
    color: var(--gray-500);
}

.docs-code-copy {
    font-size: .75rem;
    font-weight: 600;
    color: var(--blue-600);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background .15s;
}

.docs-code-copy:hover { background: var(--blue-50); }

.docs-code-block pre {
    padding: 16px 20px;
    background: var(--gray-950);
    overflow-x: auto;
}

.docs-code-block code {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: .82rem;
    color: #e2e8f0;
    line-height: 1.7;
    background: none;
    padding: 0;
    border-radius: 0;
}

/* === Step Cards === */
.docs-steps-visual {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.docs-step-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}

.docs-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--blue-600);
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.docs-step-card strong {
    display: block;
    font-size: .92rem;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.docs-step-card p {
    font-size: .84rem;
    color: var(--gray-500);
    margin-bottom: 0;
}

/* === Tables === */
.docs-table-wrap {
    overflow-x: auto;
    margin-bottom: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.docs-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .04em;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.docs-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-600);
}

.docs-table code {
    font-size: .82em;
}

.docs-rec {
    font-weight: 600;
    font-size: .82rem;
}

.docs-rec.yes { color: var(--green-500); }
.docs-rec.optional { color: var(--orange-500); }

.docs-method {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: .02em;
}

.docs-method.get { background: var(--green-50); color: var(--green-500); }
.docs-method.post { background: var(--blue-50); color: var(--blue-600); }
.docs-method.delete { background: var(--red-50); color: var(--red-500); }

/* === Next/Prev === */
.docs-next-prev {
    display: flex;
    justify-content: space-between;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
    gap: 16px;
}

.docs-next, .docs-prev {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 20px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    transition: all .15s;
    text-decoration: none;
    max-width: 50%;
}

.docs-next { text-align: right; margin-left: auto; }

.docs-next span, .docs-prev span {
    font-size: .75rem;
    color: var(--gray-400);
    font-weight: 500;
}

.docs-next strong, .docs-prev strong {
    font-size: .92rem;
    color: var(--blue-600);
}

.docs-next:hover, .docs-prev:hover {
    border-color: var(--blue-600);
    background: var(--blue-50);
    text-decoration: none;
}

/* === Responsive === */
@media (max-width: 1024px) {
    .docs-topbar-right { display: none; }
    .docs-search kbd { display: none; }
}

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

    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform .25s cubic-bezier(.4,0,.2,1);
        box-shadow: none;
    }

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

    .docs-main {
        margin-left: 0;
        padding: 24px 16px;
    }

    .docs-article h1 { font-size: 1.5rem; }
    .docs-article h2 { font-size: 1.15rem; }
    .docs-lead { font-size: 1rem; }

    .docs-search { max-width: 100%; }

    .docs-next-prev { flex-direction: column; }
    .docs-next, .docs-prev { max-width: 100%; }
    .docs-next { text-align: left; }
}
