:root {
    --docs-bg: #f4f6fb;
    --docs-surface: rgba(255, 255, 255, 0.86);
    --docs-surface-strong: #ffffff;
    --docs-border: rgba(15, 23, 42, 0.08);
    --docs-shadow: 0 22px 46px rgba(15, 23, 42, 0.08);
    --docs-text: #0f172a;
    --docs-muted: #52607a;
    --docs-accent: #ea384c;
    --docs-accent-soft: rgba(234, 56, 76, 0.1);
    --docs-sidebar: rgba(255, 255, 255, 0.82);
    --docs-code: #0f172a;
    --docs-code-bg: #111827;
    --docs-code-text: #e5eefc;
    --docs-code-muted: #8aa1c0;
    --docs-code-border: rgba(148, 163, 184, 0.18);
    --docs-code-header: rgba(15, 23, 42, 0.38);
    --docs-grid: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,0));
}

body[data-theme="dark"] {
    --docs-bg: #09111f;
    --docs-surface: rgba(14, 22, 37, 0.84);
    --docs-surface-strong: #0d1728;
    --docs-border: rgba(148, 163, 184, 0.12);
    --docs-shadow: 0 24px 64px rgba(0, 0, 0, 0.34);
    --docs-text: #edf4ff;
    --docs-muted: #91a1bb;
    --docs-accent-soft: rgba(248, 113, 113, 0.12);
    --docs-sidebar: rgba(10, 17, 31, 0.9);
    --docs-code-bg: #020817;
    --docs-code-text: #dbeafe;
    --docs-code-muted: #7c93b4;
    --docs-code-border: rgba(148, 163, 184, 0.14);
    --docs-code-header: rgba(15, 23, 42, 0.58);
    --docs-grid: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0));
}

.api-docs-body {
    min-height: 100vh;
    margin: 0;
    color: var(--docs-text);
    background:
        radial-gradient(circle at top right, rgba(234, 56, 76, 0.1), transparent 24%),
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 26%),
        var(--docs-bg);
}

.api-docs-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 0;
    min-height: 100vh;
}

.api-docs-sidebar {
    min-width: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 18px;
    background: var(--docs-sidebar);
    border-left: 1px solid var(--docs-border);
    backdrop-filter: blur(22px);
    overflow-y: auto;
    z-index: 20;
}

.api-docs-sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.api-docs-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--docs-text);
    min-width: 0;
}

.api-docs-brand-logo {
    width: auto;
    height: 30px;
    display: block;
    flex: 0 0 auto;
}

.api-docs-brand > span {
    min-width: 0;
}

.api-docs-brand strong,
.api-docs-brand small {
    display: block;
    white-space: nowrap;
}

.api-docs-brand small {
    color: var(--docs-muted);
    margin-top: 2px;
    font-size: 12px;
}

.api-docs-sidebar-close,
.api-docs-menu-toggle,
.api-docs-theme-toggle,
.api-docs-code-head button {
    border: 1px solid var(--docs-border);
    background: var(--docs-surface);
    color: var(--docs-text);
    border-radius: 12px;
    cursor: pointer;
}

.api-docs-sidebar-close {
    display: none;
    width: 38px;
    height: 38px;
    font-size: 26px;
    line-height: 1;
}

.api-docs-search {
    position: relative;
    display: block;
    margin-bottom: 22px;
}

.api-docs-search svg {
    position: absolute;
    right: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--docs-muted);
    stroke-width: 1.9;
}

.api-docs-search input {
    width: 100%;
    height: 48px;
    border-radius: 14px;
    border: 1px solid var(--docs-border);
    background: var(--docs-surface);
    color: var(--docs-text);
    padding: 0 44px 0 14px;
    font: inherit;
}

.api-docs-nav-group + .api-docs-nav-group {
    margin-top: 20px;
}

.api-docs-nav-cta {
    margin-bottom: 18px;
    display: grid;
    gap: 10px;
}

.api-docs-nav-cta.is-footer {
    margin-top: 18px;
    margin-bottom: 0;
}

.api-docs-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-decoration: none;
    color: var(--docs-muted);
    padding: 9px 12px;
    border-radius: 12px;
    transition: .2s ease;
    font-size: 13px;
    min-height: 42px;
}

.api-docs-nav-link:hover {
    color: var(--docs-text);
    background: var(--docs-accent-soft);
}

.api-docs-nav-link .api-docs-inline-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex: 0 0 auto;
}

.api-docs-nav-link.is-github {
    margin-top: 2px;
}

.api-docs-nav-group h2 {
    font-size: 11px;
    color: var(--docs-muted);
    margin: 0 0 10px;
}

.api-docs-nav-items {
    display: grid;
    gap: 4px;
}

.api-docs-nav-items a {
    text-decoration: none;
    color: var(--docs-muted);
    padding: 9px 12px;
    border-radius: 12px;
    transition: .2s ease;
    font-size: 13px;
}

.api-docs-nav-items a:hover,
.api-docs-nav-items a.is-active {
    color: var(--docs-text);
    background: var(--docs-accent-soft);
}

.api-docs-main {
    min-width: 0;
    padding: 26px 34px 60px;
    background-image: var(--docs-grid);
}

.api-docs-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 24px;
    min-width: 0;
}

.api-docs-menu-toggle {
    display: none;
    width: 46px;
    height: 46px;
    padding: 0;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.api-docs-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
}

.api-docs-kicker,
.api-docs-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--docs-accent);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.api-docs-topbar h1 {
    margin: 8px 0 10px;
    font-size: clamp(28px, 3.2vw, 42px);
    line-height: 1.05;
}

.api-docs-topbar p {
    margin: 0;
    max-width: 760px;
    color: var(--docs-muted);
    font-size: 15px;
    line-height: 1.8;
    word-break: break-word;
}

.api-docs-theme-toggle {
    display: inline-flex;
    padding: 6px;
    gap: 6px;
    white-space: nowrap;
}

.api-docs-theme-toggle span {
    padding: 10px 14px;
    border-radius: 10px;
}

body[data-theme="light"] .api-docs-theme-toggle .theme-light,
body[data-theme="dark"] .api-docs-theme-toggle .theme-dark {
    background: var(--docs-surface-strong);
    box-shadow: var(--docs-shadow);
}

.api-docs-hero-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.api-docs-hero-card,
.api-docs-info-card,
.api-docs-section,
.api-docs-code-card {
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
    box-shadow: var(--docs-shadow);
    backdrop-filter: blur(20px);
}

.api-docs-hero-card {
    border-radius: 24px;
    padding: 22px;
}

.api-docs-hero-card h2 {
    margin: 0 0 10px;
    font-size: 16px;
}

.api-docs-hero-card p {
    margin: 0;
    color: var(--docs-muted);
    font-size: 14px;
    line-height: 1.9;
}

.api-docs-content {
    display: grid;
    gap: 26px;
}

.api-docs-section {
    border-radius: 28px;
    padding: 30px;
    scroll-margin-top: 24px;
    min-width: 0;
}

.api-docs-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-top: 8px;
    min-width: 0;
}

.api-docs-section h2 {
    margin: 0 0 12px;
    font-size: 23px;
}

.api-docs-section p {
    margin: 0;
    color: var(--docs-muted);
    font-size: 14px;
    line-height: 1.9;
}

.api-docs-section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.api-docs-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid var(--docs-border);
    background: var(--docs-surface-strong);
    color: var(--docs-text);
    text-decoration: none;
    box-shadow: var(--docs-shadow);
    transition: .2s ease;
}

.api-docs-action-btn:hover {
    transform: translateY(-1px);
}

.api-docs-action-btn.is-purple {
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    border-color: rgba(109, 40, 217, 0.42);
    color: #fff;
    box-shadow: 0 16px 36px rgba(109, 40, 217, 0.28);
}

.api-docs-endpoint-badge {
    min-width: 280px;
    max-width: 100%;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--docs-surface-strong);
    border: 1px solid var(--docs-border);
}

.api-docs-endpoint-badge span {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.api-docs-endpoint-badge code {
    direction: ltr;
    display: block;
    white-space: normal;
    word-break: break-word;
    color: var(--docs-text);
    font-size: 13px;
}

.api-docs-endpoint-badge.is-get span { background: #0f9d7a; }
.api-docs-endpoint-badge.is-post span { background: #2563eb; }
.api-docs-endpoint-badge.is-patch span { background: #c67c14; }
.api-docs-endpoint-badge.is-delete span { background: #dc2626; }

.api-docs-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.api-docs-card-grid.is-single-centered {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
}

.api-docs-info-card {
    border-radius: 18px;
    padding: 18px;
}

.api-docs-info-card.is-centered {
    width: min(100%, 300px);
    text-align: center;
}

.api-docs-info-card strong {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
}

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

.api-docs-card-cta {
    margin-top: 14px;
    width: 100%;
}

.api-docs-info-card.is-centered .api-docs-card-cta {
    width: auto;
    min-width: 240px;
    margin: 14px auto 0;
}

.api-docs-card-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.api-docs-inline-link {
    min-height: 42px;
    padding: 0 14px;
    gap: 8px;
}

.api-docs-inline-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex: 0 0 auto;
}

.api-docs-code-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.api-docs-code-card {
    border-radius: 20px;
    overflow: hidden;
    background: var(--docs-code-bg);
    border: 1px solid var(--docs-code-border);
    box-shadow: 0 24px 56px rgba(2, 6, 23, 0.2);
    backdrop-filter: none;
}

.api-docs-code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--docs-code-border);
    background: var(--docs-code-header);
    direction: ltr;
}

.api-docs-code-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
}

.api-docs-code-tab {
    border: 1px solid transparent;
    background: transparent;
    color: #95a7c5;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.api-docs-code-tab.is-active {
    color: var(--docs-code-text);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(148, 163, 184, 0.22);
}

.api-docs-code-tabs.is-static {
    pointer-events: none;
}

.api-docs-code-panel {
    display: none;
}

.api-docs-code-panel.is-active {
    display: block;
    min-width: 0;
}

.api-docs-code-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
    flex: 0 0 auto;
}

.api-docs-copy-button {
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.06);
    color: var(--docs-code-text);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.api-docs-copy-button:hover {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.26);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.api-docs-copy-button:active,
.api-docs-copy-button.is-copied {
    transform: scale(0.97);
}

.api-docs-copy-button svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.api-docs-copy-button span {
    font-size: 12px;
    line-height: 1;
}

.api-docs-code-block {
    margin: 0;
    padding: 18px 20px 22px;
    background: var(--docs-code-bg);
    color: var(--docs-code-text);
    overflow: auto;
    direction: ltr;
    text-align: left;
    font-size: 13px;
    line-height: 1.9;
    -webkit-overflow-scrolling: touch;
}

.api-docs-code-block code {
    font-family: "JetBrains Mono", "Fira Code", "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    white-space: pre;
    display: block;
    min-width: max-content;
}

.api-docs-code-block .token-keyword,
.api-docs-code-block .token-boolean,
.api-docs-code-block .token-null {
    color: #c4b5fd;
}

.api-docs-code-block .token-string {
    color: #86efac;
}

.api-docs-code-block .token-number {
    color: #fbbf24;
}

.api-docs-code-block .token-property,
.api-docs-code-block .token-function {
    color: #7dd3fc;
}

.api-docs-code-block .token-comment {
    color: var(--docs-code-muted);
}

.api-docs-note-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.api-docs-note {
    padding: 16px 18px;
    border-radius: 16px;
    background: var(--docs-accent-soft);
    border: 1px solid rgba(234, 56, 76, 0.12);
    color: var(--docs-text);
    font-size: 13px;
}

.api-docs-step-list {
    display: grid;
    gap: 10px;
    margin: 20px 0 0;
    padding: 0 22px 0 0;
    color: var(--docs-text);
    font-size: 13px;
    line-height: 1.9;
}

.api-docs-step-list li {
    padding-right: 6px;
}

html {
    scroll-behavior: smooth;
}

@media (max-width: 1360px) {
    .api-docs-shell {
        grid-template-columns: 288px minmax(0, 1fr);
    }

    .api-docs-main {
        padding: 24px 26px 52px;
    }
}

@media (max-width: 1180px) {
    .api-docs-shell {
        grid-template-columns: 1fr;
    }

    .api-docs-sidebar {
        position: fixed;
        right: 0;
        top: 0;
        transform: translateX(100%);
        transition: transform .25s ease;
        width: min(360px, 92vw);
        border-left: 0;
        border-right: 1px solid var(--docs-border);
        box-shadow: var(--docs-shadow);
    }

    .api-docs-sidebar.is-open {
        transform: translateX(0);
    }

    .api-docs-sidebar-close,
    .api-docs-menu-toggle {
        display: inline-flex;
    }

    .api-docs-main {
        padding: 22px 18px 52px;
    }

    .api-docs-hero-grid,
    .api-docs-card-grid,
    .api-docs-code-grid {
        grid-template-columns: 1fr;
    }

    .api-docs-section-head {
        flex-direction: column;
    }

    .api-docs-endpoint-badge {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 920px) {
    .api-docs-topbar {
        flex-wrap: wrap;
    }

    .api-docs-theme-toggle {
        order: 3;
    }

    .api-docs-hero-grid,
    .api-docs-card-grid {
        grid-template-columns: 1fr;
    }

    .api-docs-section {
        padding: 24px 20px;
    }

    .api-docs-section h2 {
        font-size: 21px;
    }
}

@media (max-width: 720px) {
    .api-docs-main {
        padding: 18px 14px 44px;
    }

    .api-docs-sidebar {
        width: min(100vw, 320px);
        padding: 18px 14px;
    }

    .api-docs-topbar h1 {
        font-size: 25px;
    }

    .api-docs-section {
        padding: 20px 16px;
        border-radius: 22px;
    }

    .api-docs-endpoint-badge {
        padding: 10px 12px;
    }

    .api-docs-endpoint-badge code {
        font-size: 12px;
    }

    .api-docs-code-head {
        flex-direction: column;
        align-items: stretch;
    }

    .api-docs-code-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .api-docs-code-tabs::-webkit-scrollbar {
        display: none;
    }

    .api-docs-code-tab {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .api-docs-code-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .api-docs-code-block {
        padding: 16px;
        font-size: 12px;
    }

    .api-docs-note {
        padding: 14px 15px;
    }
}

@media (max-width: 480px) {
    .api-docs-brand {
        gap: 10px;
    }

    .api-docs-brand-logo {
        height: 24px;
    }

    .api-docs-brand strong {
        font-size: 14px;
    }

    .api-docs-brand small {
        font-size: 11px;
    }

    .api-docs-topbar h1 {
        font-size: 22px;
        line-height: 1.2;
    }

    .api-docs-topbar p,
    .api-docs-section p,
    .api-docs-hero-card p,
    .api-docs-info-card p,
    .api-docs-note {
        font-size: 13px;
    }

    .api-docs-theme-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .api-docs-theme-toggle span {
        flex: 1 1 0;
        text-align: center;
    }

    .api-docs-hero-card,
    .api-docs-info-card {
        padding: 18px;
    }
}
