:root {
    --bg: #060a14;
    --bg-elevated: #0d1526;
    --bg-card: #10192e;
    --bg-code: #090f1d;
    --border: rgba(148, 163, 184, 0.16);
    --border-strong: rgba(148, 163, 184, 0.30);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --accent: #38bdf8;
    --accent-strong: #0ea5e9;
    --accent-soft: rgba(56, 189, 248, 0.12);
    --violet: #818cf8;
    --emerald: #34d399;
    --amber: #fbbf24;
    --rose: #fb7185;
    --radius: 12px;
    --header-h: 64px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 20px);
    overflow-x: clip;
}

body {
    margin: 0;
    background:
        radial-gradient(960px 420px at 70% -120px, rgba(14, 165, 233, 0.12), transparent 70%),
        var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

body.drawer-open {
    overflow: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 150ms ease;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: rgba(148, 163, 184, 0.12);
    color: #f8fafc;
    padding: 0.15em 0.42em;
    border-radius: 6px;
    word-break: break-word;
}

/* ─── Top Bar ─── */
.docs-header {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--header-h);
    background: rgba(6, 10, 20, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.docs-header-inner {
    max-width: 1440px;
    margin: 0 auto;
    height: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 9px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 150ms ease, background 150ms ease;
}
.sidebar-toggle:hover {
    border-color: var(--accent);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.015em;
    min-width: 0;
}
.brand-link:hover {
    text-decoration: none;
}

.brand-title-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-emblem {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 4px 12px rgba(14, 165, 233, 0.22);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.search-box {
    position: relative;
}

.search-box input,
.mobile-search-box input {
    width: 240px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: var(--font-sans);
    font-size: 13px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
.search-box input:focus,
.mobile-search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    min-height: 36px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--bg-elevated);
    white-space: nowrap;
    transition: border-color 150ms ease, background 150ms ease;
}
.nav-pill:hover {
    text-decoration: none;
    border-color: var(--accent);
}
.nav-pill-primary {
    background: linear-gradient(135deg, var(--accent-strong), #6366f1);
    border-color: transparent;
    color: #ffffff;
}
.nav-pill-primary:hover {
    opacity: 0.94;
    border-color: transparent;
}

.docs-backdrop {
    display: none;
}

/* ─── 3-column Shell ─── */
.docs-shell {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr) 230px;
    gap: 32px;
    padding: 28px 24px 64px;
}

.docs-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
    padding-right: 8px;
}

.sidebar-drawer-header,
.mobile-search-box,
.drawer-quick-links {
    display: none;
}

.drawer-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.nav-group {
    margin-bottom: 24px;
}

.nav-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin: 0 0 8px 10px;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    min-height: 38px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-muted);
    border-left: 2px solid transparent;
    transition: all 0.15s ease;
}
.nav-link:hover {
    color: #fff;
    background: rgba(148, 163, 184, 0.08);
    text-decoration: none;
}
.nav-link.is-active {
    color: var(--accent);
    background: var(--accent-soft);
    border-left-color: var(--accent);
    font-weight: 600;
}
.nav-link.is-hidden {
    display: none;
}

/* ─── Main Article & Hero ─── */
.docs-main {
    min-width: 0;
}

.docs-article {
    max-width: 82ch;
}

.breadcrumb {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 10px;
    font-weight: 500;
}

.hub-hero {
    background:
        radial-gradient(480px 200px at 90% 0%, rgba(129, 140, 248, 0.14), transparent 70%),
        linear-gradient(180deg, rgba(14, 165, 233, 0.07), rgba(16, 25, 46, 0.4));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 26px;
    margin-bottom: 28px;
}

.hub-hero-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.hub-hero-emblem {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25), 0 8px 24px rgba(14, 165, 233, 0.24);
}

.hub-hero .lead {
    margin-bottom: 20px;
}

.hub-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    min-height: 42px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: transform 150ms ease, border-color 150ms ease, opacity 150ms ease;
}
.hero-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}
.hero-btn-primary {
    background: linear-gradient(135deg, var(--accent-strong), #6366f1);
    color: #ffffff;
}
.hero-btn-secondary {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
    color: var(--text);
}
.hero-btn-secondary:hover {
    border-color: var(--accent);
}

.docs-article h1 {
    margin: 0 0 12px;
    font-size: clamp(24px, 3.2vw, 34px);
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: #ffffff;
}

.lead {
    font-size: clamp(15px, 1.8vw, 17px);
    color: var(--text-muted);
    margin: 0 0 28px;
}

.docs-article h2 {
    margin: 40px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    font-size: clamp(19px, 2.2vw, 22px);
    color: #ffffff;
    letter-spacing: -0.015em;
}

.docs-article h3 {
    margin: 26px 0 10px;
    font-size: 17px;
    color: #f8fafc;
}

.docs-article p {
    margin: 0 0 14px;
}

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

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

/* Mobile On This Page Accordion */
.mobile-toc {
    display: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 20px;
}
.mobile-toc-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    list-style: none;
}
.mobile-toc-summary::-webkit-details-marker {
    display: none;
}
.mobile-toc[open] .mobile-toc-summary svg {
    transform: rotate(180deg);
}
.mobile-toc-list {
    list-style: none;
    margin: 0;
    padding: 0 14px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 10px;
}

/* ─── Cards & Grids ─── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 22px 0 28px;
}

.doc-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color 0.15s ease, transform 0.15s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.doc-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.doc-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
    color: #ffffff;
}
.doc-card p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0 0 14px;
}
.doc-card-link {
    font-size: 14px;
    font-weight: 600;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 10px;
    width: fit-content;
}
.badge-sky {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(56, 189, 248, 0.3);
}
.badge-emerald {
    background: rgba(52, 211, 153, 0.12);
    color: var(--emerald);
    border: 1px solid rgba(52, 211, 153, 0.3);
}
.badge-amber {
    background: rgba(251, 191, 36, 0.12);
    color: var(--amber);
    border: 1px solid rgba(251, 191, 36, 0.3);
}
.badge-muted {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* ─── Callouts ─── */
.callout {
    border-radius: var(--radius);
    padding: 15px 18px;
    margin: 20px 0;
    border: 1px solid var(--border);
    border-left-width: 4px;
    background: var(--bg-elevated);
}
.callout-info { border-left-color: var(--accent); }
.callout-warn { border-left-color: var(--amber); }
.callout-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    color: #ffffff;
}

/* ─── Code Blocks ─── */
.code-block {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 16px 0 22px;
    overflow: hidden;
}
.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(15, 23, 42, 0.92);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.copy-btn {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 11px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}
.copy-btn:hover {
    border-color: var(--accent);
    color: #ffffff;
}
.code-block pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.55;
    color: #e2e8f0;
}
.code-block pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    word-break: normal;
}

/* ─── Tables ─── */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 16px 0 24px;
    background: rgba(16, 25, 46, 0.55);
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 540px;
}
th, td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
th {
    background: var(--bg-elevated);
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}
tr:last-child td {
    border-bottom: none;
}

.method-pill {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
}
.method-get {
    background: rgba(56, 189, 248, 0.14);
    color: var(--accent);
}
.method-post {
    background: rgba(52, 211, 153, 0.14);
    color: var(--emerald);
}

/* ─── Stepper ─── */
.step-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 20px 0 28px;
}
.step-item {
    display: flex;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    align-items: flex-start;
}
.step-num {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(56, 189, 248, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

/* ─── Sign-in Button Live Preview ─── */
.button-preview-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin: 18px 0 24px;
}
.wb-signin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 18px;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid #334155;
    background: #0f172a;
    color: #ffffff;
    transition: transform 0.12s ease, border-color 0.15s ease;
}
.wb-signin-btn:hover {
    text-decoration: none;
    border-color: var(--accent);
    transform: translateY(-1px);
}
.wb-signin-btn-light {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}
.wb-signin-btn-purple {
    background: #7c3aed;
    color: #ffffff;
    border-color: #8b5cf6;
}
.wb-signin-btn-purple:hover {
    background: #6d28d9;
    border-color: #a78bfa;
}
.wb-signin-logo {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.wb-signin-logo svg {
    width: 20px;
    height: 20px;
    display: block;
    border-radius: 5px;
}
.wb-signin-btn-purple .wb-signin-logo svg {
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.35);
}

/* ─── Right ToC ─── */
.docs-toc {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
    border-left: 1px solid var(--border);
    padding-left: 16px;
}
.toc-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin: 0 0 10px;
}
.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.toc-link {
    font-size: 13px;
    color: var(--text-muted);
    display: block;
    line-height: 1.4;
}
.toc-link-h3 {
    padding-left: 12px;
    font-size: 12px;
}
.toc-link.is-active {
    color: var(--accent);
    font-weight: 600;
}

/* ─── Page Footer Pager & Site Footer ─── */
.docs-pager {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 44px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}
.pager-link {
    display: block;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    min-width: 180px;
    flex: 1;
}
.pager-link:hover {
    text-decoration: none;
    border-color: var(--accent);
}
.pager-dir {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 2px;
}
.pager-label {
    font-weight: 600;
    color: #ffffff;
}

.docs-footer {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 24px 36px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    color: var(--text-dim);
}
.docs-footer-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

/* ─── Responsive Breakpoints ─── */
@media (max-width: 1140px) {
    .docs-shell {
        grid-template-columns: 248px minmax(0, 1fr);
        gap: 24px;
    }
    .docs-toc {
        display: none;
    }
    .mobile-toc {
        display: block;
    }
}

@media (max-width: 860px) {
    .docs-header-inner {
        padding: 0 16px;
    }
    .sidebar-toggle {
        display: inline-flex;
    }
    .search-box,
    .nav-pill-account {
        display: none;
    }
    .docs-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(3, 6, 14, 0.72);
        backdrop-filter: blur(3px);
        z-index: 50;
        opacity: 0;
        pointer-events: none;
        transition: opacity 200ms ease;
    }
    .docs-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }
    .docs-shell {
        grid-template-columns: 1fr;
        padding: 20px 16px 48px;
    }
    .docs-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(86vw, 310px);
        max-height: 100dvh;
        background: var(--bg-elevated);
        border-right: 1px solid var(--border);
        padding: 18px 16px 28px;
        z-index: 60;
        transform: translateX(-105%);
        transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
        box-shadow: 16px 0 40px rgba(0, 0, 0, 0.55);
    }
    .docs-sidebar.is-open {
        transform: translateX(0);
    }
    .sidebar-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 14px;
        margin-bottom: 14px;
        border-bottom: 1px solid var(--border);
    }
    .mobile-search-box {
        display: block;
        margin-bottom: 18px;
    }
    .mobile-search-box input {
        width: 100%;
        font-size: 16px;
    }
    .drawer-quick-links {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 20px;
        padding-top: 16px;
        border-top: 1px solid var(--border);
    }
    .docs-pager {
        flex-direction: column;
    }
    .docs-footer {
        padding: 18px 16px 32px;
    }
}

@media (max-width: 540px) {
    .hub-hero {
        padding: 18px;
    }
    .hub-hero-head {
        flex-direction: column;
        gap: 12px;
    }
    .hub-hero-actions .hero-btn {
        width: 100%;
    }
    .button-preview-box {
        padding: 16px;
    }
    .wb-signin-btn {
        width: 100%;
    }
    .docs-header .brand-title-text {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
