:root {
    --bg: #0f0f14;
    --bg2: #16161e;
    --bg3: #1e1e2a;
    --surface: #1a1a28;
    --surface2: #22223a;
    --text: #e8e8f0;
    --muted: #9b9bb0;
    --dim: #6b6b82;
    --purple: #8b5cf6;
    --blue: #3b82f6;
    --cyan: #06b6d4;
    --green: #22c55e;
    --orange: #f59e0b;
    --pink: #ec4899;
    --red: #ef4444;
    --border: rgba(255,255,255,0.06);
    --font: 'Inter', -apple-system, sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

html.light {
    --bg: #f5f5f7; --bg2: #ffffff; --bg3: #eeeef2;
    --surface: #f0f0f5; --surface2: #e5e5ee;
    --text: #1a1a2e; --muted: #555570; --dim: #8888a0;
    --purple: #7c3aed; --blue: #2563eb; --cyan: #0891b2;
    --green: #16a34a; --orange: #d97706; --pink: #db2777;
    --red: #dc2626; --border: rgba(0,0,0,0.08);
}

.theme-toggle-btn {
    display:flex;align-items:center;justify-content:center;width:34px;height:34px;
    border-radius:8px;border:1px solid var(--border);background:var(--surface);
    color:var(--dim);cursor:pointer;transition:all 0.2s;font-size:16px;
    line-height:1;flex-shrink:0;margin:8px 16px;
}
.theme-toggle-btn:hover{background:var(--surface2);border-color:var(--purple);color:var(--text);transform:scale(1.1);}

.sidebar-theme-btn {
    margin: 0;
}

/* ── Hamburger Button (hidden on desktop) ──── */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.hamburger-btn:hover {
    background: var(--surface2);
    border-color: var(--purple);
}
.hamburger-line {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--muted);
    border-radius: 1px;
    transition: all 0.25s ease;
}
/* Animate to X when open */
.nav-open .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
    background: var(--purple);
}
.nav-open .hamburger-line:nth-child(2) {
    opacity: 0;
}
.nav-open .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    background: var(--purple);
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}

/* ── Section Hero (branding inside quickstart) */
.section-hero {
    text-align: center;
    padding: 56px 24px 48px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.section-hero-icon {
    font-size: 64px;
    filter: drop-shadow(0 0 32px rgba(139,92,246,0.45));
    animation: float 3s ease-in-out infinite;
    display: block;
    margin-bottom: 16px;
}

@keyframes float {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.section-hero-title {
    font-size: 48px;
    font-weight: 800;
    margin: 0 0 14px;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.section-hero-desc {
    color: var(--muted);
    font-size: 17px;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ── Docs Layout (Sidebar + Main) ───────── */
.docs-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────── */
.sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 20;
    scrollbar-width: thin;
    scrollbar-color: var(--surface2) transparent;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    font-weight: 700;
}

.sidebar-logo {
    font-size: 20px;
    filter: drop-shadow(0 0 8px rgba(139,92,246,0.6));
}

.sidebar-title {
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 0;
    border-left: 3px solid transparent;
    transition: all 0.18s ease;
    position: relative;
}

.nav-item .nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.18s;
}

.nav-item:hover {
    color: var(--text);
    background: rgba(139,92,246,0.07);
    border-left-color: rgba(139,92,246,0.4);
}

.nav-item:hover .nav-icon {
    opacity: 1;
}

.nav-item.active {
    color: var(--purple);
    background: rgba(139,92,246,0.12);
    border-left-color: var(--purple);
    font-weight: 600;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.sidebar-footer {
    padding: 16px 18px;
    font-size: 11px;
    color: var(--dim);
    border-top: 1px solid var(--border);
    text-align: center;
}

/* ── Docs Main (scrollable content area) ─── */
.docs-main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

/* ── Docs Footer ────────────────────────── */
.docs-footer {
    text-align: center;
    padding: 40px 24px;
    color: var(--dim);
    font-size: 13px;
    border-top: 1px solid var(--border);
}


/* ── Container ──────────────────────────── */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ── Section ────────────────────────────── */
section {
    padding: 60px 0;
    border-bottom: 1px solid var(--border);
}

section:last-child {
    border-bottom: none;
}

h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

h2 .section-icon {
    font-size: 32px;
}

.section-subtitle {
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 32px;
}

h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 12px;
    color: var(--cyan);
}

h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 8px;
    color: var(--purple);
}

p {
    margin-bottom: 16px;
    color: var(--muted);
}

strong { color: var(--text); }

/* ── Cards ──────────────────────────────── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
    border-color: rgba(139,92,246,0.3);
    transform: translateY(-2px);
}

.card-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.card h4 {
    margin: 0 0 6px;
    color: var(--text);
}

.card p {
    font-size: 13px;
    margin: 0;
}

.card .tag-row {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.tag {
    font-size: 11px;
    font-family: var(--mono);
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--surface2);
    color: var(--cyan);
}

/* ── Flow Diagram ───────────────────────── */
.flow-diagram {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 24px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow-x: auto;
    margin: 16px 0;
}

.flow-step {
    text-align: center;
    padding: 16px 20px;
    min-width: 140px;
    flex-shrink: 0;
}

.flow-step .icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.flow-step .label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.flow-step .sublabel {
    font-size: 11px;
    color: var(--dim);
    margin-top: 3px;
}

.flow-arrow {
    font-size: 28px;
    color: var(--purple);
    flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%,100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ── Code Block ─────────────────────────── */
.code-block {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 16px 0;
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-family: var(--mono);
    color: var(--muted);
}

.code-block pre {
    padding: 16px;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
}

.code-block .key { color: var(--cyan); }
.code-block .string { color: var(--green); }
.code-block .number { color: var(--orange); }
.code-block .comment { color: var(--dim); font-style: italic; }

/* ── Step List ──────────────────────────── */
.steps {
    list-style: none;
    margin: 20px 0;
}

.steps li {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.steps li:last-child {
    border-bottom: none;
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), #6d28d9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.step-content h4 {
    margin: 0 0 4px;
    color: var(--text);
}

.step-content p {
    margin: 0;
    font-size: 14px;
}

.step-content code {
    font-family: var(--mono);
    background: var(--surface2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--cyan);
}

/* ── Table ──────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-weight: 600;
    color: var(--cyan);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px 16px;
    border: 1px solid var(--border);
    color: var(--muted);
}

.data-table code {
    font-family: var(--mono);
    font-size: 12px;
    background: var(--surface2);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--purple);
}

/* ── Info Box ───────────────────────────── */
.info-box {
    padding: 16px 20px;
    border-radius: 10px;
    margin: 16px 0;
    border-left: 4px solid;
}

.info-box.tip {
    background: rgba(34,197,94,0.08);
    border-color: var(--green);
}

.info-box.warning {
    background: rgba(245,158,11,0.08);
    border-color: var(--orange);
}

.info-box.info {
    background: rgba(59,130,246,0.08);
    border-color: var(--blue);
}

.info-box strong {
    display: block;
    margin-bottom: 4px;
}

.info-box p { margin: 0; font-size: 14px; }

/* ── Horizontal Step Cards ──────────────── */
.step-cards {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 24px 0;
}

.step-card {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: border-color 0.2s, transform 0.2s;
}

.step-card:hover {
    border-color: rgba(139,92,246,0.3);
    transform: translateY(-3px);
}

.step-card .step-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), #6d28d9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    margin: 0 auto 14px;
}

.step-card h4 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 16px;
}

.step-card p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
}

.step-card code {
    font-family: var(--mono);
    background: var(--surface2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--cyan);
}

.step-card-arrow {
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 28px;
    color: var(--purple);
    flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}

/* ── Section loading spinner ───────────── */
.section-loader {
    text-align: center;
    padding: 40px;
    color: var(--dim);
}

/* ── FAQ Accordion ──────────────────────── */
.faq-list {
    margin: 8px 0;
}

.faq-group-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--dim);
    padding: 20px 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 4px;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: color 0.18s;
}

.faq-question:hover {
    color: var(--purple);
}

.faq-chevron {
    font-size: 11px;
    color: var(--dim);
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.faq-item.open .faq-question {
    color: var(--purple);
}

.faq-item.open .faq-chevron {
    transform: rotate(180deg);
    color: var(--purple);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 4px;
}

.faq-item.open .faq-answer {
    max-height: 600px;
    padding: 0 4px 18px;
}

.faq-answer p {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 10px;
}

.faq-answer p:last-child { margin-bottom: 0; }

/* ── Responsive ─────────────────────────── */
@media (max-width: 1024px) {
    .sidebar { width: 200px; }
}

@media (max-width: 768px) {
    .docs-layout { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: sticky;
        top: 0;
        z-index: 50;
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow: visible;
    }
    .sidebar-header {
        padding: 10px 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: var(--bg2);
        border-bottom: 1px solid var(--border);
    }
    .hamburger-btn {
        display: flex;
    }
    /* Nav hidden by default, shown on toggle */
    .sidebar-nav {
        flex-direction: column;
        padding: 0;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background: var(--bg2);
        border-bottom: 1px solid transparent;
    }
    .nav-open .sidebar-nav {
        max-height: 600px;
        padding: 6px 0;
        border-bottom-color: var(--border);
    }
    .nav-item {
        border-left: 3px solid transparent;
        border-bottom: none;
        border-radius: 0;
        padding: 10px 18px;
        font-size: 13px;
    }
    .nav-item .nav-icon {
        display: inline;
        font-size: 14px;
    }
    .nav-item.active {
        border-left-color: var(--purple);
        border-bottom: none;
        background: rgba(139,92,246,0.08);
    }
    .sidebar-footer { display: none; }
    .step-cards { flex-direction: column; }
    .step-card-arrow { transform: rotate(90deg); }
    .flow-diagram { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 600px) {
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 15px; }
    h2 { font-size: 22px; }
    .card-grid { grid-template-columns: 1fr; }
    .container { padding: 0 12px; }
    .section-hero { padding: 36px 16px 28px; }
    .section-hero-icon { font-size: 44px; }
    .section-hero-title { font-size: 28px; }
    .section-hero-desc { font-size: 14px; }
    section { padding: 36px 0; }
    .data-table { font-size: 12px; display: block; overflow-x: auto; }
    .data-table th,
    .data-table td { padding: 8px 10px; white-space: nowrap; }
    .code-block pre { font-size: 11px; padding: 12px; }
    .sidebar-header { padding: 10px 14px; }
}
