* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background: #ffffff;
    color: #0f172a;
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Progress bar */
#docs-progress {
    position: fixed; top: 0; left: 0; height: 4px;
    background: linear-gradient(90deg, #10b981, #6366f1);
    z-index: 1000; width: 0%; transition: width 0.1s linear;
}

/* ── Topbar (Full Width) ── */
#docs-topbar {
    position: fixed; top: 0; left: 0; right: 0; height: 64px;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(16px);
    border-bottom: 1px solid #e2e8f0; display: flex; align-items: center;
    justify-content: space-between; padding: 0 28px; z-index: 200;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.topbar-logo-mark { width: 34px; height: 34px; background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.25); border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 800; color: #10b981; }
.topbar-logo-text { font-size: 0.95rem; font-weight: 800; color: #0f172a; }

.topbar-breadcrumb { font-size: 0.85rem; color: #64748b; display: flex; gap: 8px; align-items: center; font-weight: 600; }
.topbar-home-link { color: #0f172a; font-weight: 700; text-decoration: none; }
.topbar-home-link:hover { color: #10b981; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-btn {
    padding: 7px 16px; border-radius: 8px; font-size: 0.82rem; font-weight: 700;
    text-decoration: none; transition: all 0.2s ease;
}
.topbar-btn-outline { background: #ffffff; color: #0f172a; border: 1px solid #cbd5e1; }
.topbar-btn-outline:hover { background: #f8fafc; border-color: #94a3b8; }
.topbar-btn-dark { background: #10b981; color: white; border: 1px solid #10b981; }
.topbar-btn-dark:hover { background: #059669; }

/* ── Sidebar (Fixed Left) ── */
#docs-sidebar {
    width: 270px; min-width: 270px; background: #f8fafc;
    border-right: 1px solid #e2e8f0; height: calc(100vh - 64px);
    position: fixed; top: 64px; left: 0; overflow-y: auto;
    padding-bottom: 40px; z-index: 100;
}
#docs-sidebar::-webkit-scrollbar { width: 4px; }
#docs-sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.sidebar-search { margin: 16px; position: relative; }
.sidebar-search input {
    width: 100%; padding: 9px 10px 9px 34px; border: 1px solid #cbd5e1;
    border-radius: 8px; font-size: 0.8rem; background: #ffffff; color: #0f172a;
    font-family: inherit; outline: none; transition: border-color 0.2s ease; font-weight: 500;
}
.sidebar-search input:focus { border-color: #10b981; }
.sidebar-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); }

.nav-group { padding: 8px 0; }
.nav-group-title {
    padding: 6px 20px; font-size: 0.68rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.08em; color: #64748b;
}
.nav-link {
    display: block; padding: 7px 20px; font-size: 0.84rem; color: #475569;
    text-decoration: none; border-left: 3px solid transparent;
    transition: all 0.15s ease; line-height: 1.4; font-weight: 600;
}
.nav-link:hover { color: #0f172a; background: #f1f5f9; }
.nav-link.active { color: #059669; border-left-color: #10b981; background: #d1fae5; font-weight: 800; }

/* ── Main content Area ── */
#docs-main {
    margin-left: 270px;
    margin-top: 64px;
    padding: 48px 48px 80px;
    width: calc(100% - 270px);
}
.docs-inner {
    max-width: 920px;
    width: 100%;
    margin: 0 auto;
}

/* ── Doc sections ── */
.doc-section { padding: 40px 0 32px; border-bottom: 1px solid #e2e8f0; scroll-margin-top: 80px; }
.doc-section:last-child { border-bottom: none; }

h1.doc-h1 { font-size: 2.2rem; font-weight: 800; color: #0f172a; margin-bottom: 12px; line-height: 1.2; letter-spacing: -0.02em; }
h2.doc-h2 { font-size: 1.5rem; font-weight: 800; color: #0f172a; margin: 32px 0 12px; border-bottom: 2px solid #f1f5f9; padding-bottom: 8px; }
h3.doc-h3 { font-size: 1.1rem; font-weight: 800; color: #0f172a; margin: 24px 0 8px; }
p.doc-p { font-size: 0.92rem; color: #334155; line-height: 1.75; margin-bottom: 16px; font-weight: 500; }
p.doc-lead { font-size: 1.05rem; color: #475569; line-height: 1.7; margin-bottom: 24px; max-width: 720px; font-weight: 500; }

/* ── Callout boxes ── */
.callout {
    border-radius: 12px; padding: 16px 20px; margin: 20px 0;
    font-size: 0.88rem; line-height: 1.6; display: flex; gap: 14px; align-items: flex-start;
}
.callout-tip { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.callout-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.callout-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.callout-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ── Tables ── */
.doc-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.88rem; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.doc-table th { background: #f8fafc; padding: 12px 16px; text-align: left; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: #475569; border-bottom: 1px solid #e2e8f0; }
.doc-table td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; color: #334155; vertical-align: top; line-height: 1.5; font-weight: 500; }
.doc-table tr:hover td { background: #f8fafc; }

/* ── Code ── */
code.inline {
    font-family: 'JetBrains Mono', monospace; font-size: 0.82rem;
    background: #f1f5f9; border: 1px solid #e2e8f0; color: #059669;
    padding: 2px 6px; border-radius: 4px; font-weight: 600;
}
pre.code-block {
    background: #0f172a; color: #f8fafc; font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem; padding: 20px; border-radius: 12px; overflow-x: auto;
    line-height: 1.7; margin: 16px 0;
}

/* ── FOOTER FIX FOR DOCS PAGE ── */
body.docs-page .lnav { display: none !important; }
body.docs-page .lfooter {
    margin-left: 270px;
    width: calc(100% - 270px);
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 48px 48px 32px;
}

@media (max-width: 840px) {
    #docs-sidebar { display: none; }
    #docs-topbar { left: 0; }
    #docs-main { margin-left: 0; width: 100%; padding: 24px; }
    body.docs-page .lfooter { margin-left: 0; width: 100%; padding: 32px 24px; }
}
