:root {
    --doc-bg: #f5f0eb;
    --doc-card: #ffffff;
    --doc-text: #1a1f2e;
    --doc-muted: #667085;
    --doc-border: #e8e4df;
    --doc-orange: #ff6709;
    --doc-orange-deep: #e55a00;
    --doc-orange-soft: #fff7f2;
    --doc-green: #15803d;
    --doc-blue: #2563eb;
    --doc-radius: 16px;
    --doc-sidebar-w: 280px;
    --doc-font: "Inter", system-ui, sans-serif;
    --doc-display: "Poppins", "Inter", system-ui, sans-serif;
}

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

html, body {
    margin: 0;
    min-height: 100%;
}

body.api-docs-page {
    font-family: var(--doc-font);
    color: var(--doc-text);
    background: var(--doc-bg);
    line-height: 1.5;
}

.api-docs-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--doc-border);
}

.api-docs-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.api-docs-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.api-docs-logo {
    height: 44px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.api-docs-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.api-docs-brand-text strong {
    font-family: var(--doc-display);
    font-size: 0.95rem;
}

.api-docs-brand-text small {
    font-size: 0.72rem;
    color: var(--doc-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.api-docs-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.api-docs-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.api-docs-btn-primary {
    background: var(--doc-orange);
    color: #fff;
}

.api-docs-btn-primary:hover {
    background: var(--doc-orange-deep);
    color: #fff;
}

.api-docs-btn-ghost {
    background: transparent;
    border-color: var(--doc-border);
    color: var(--doc-text);
}

.api-docs-btn-ghost:hover {
    border-color: var(--doc-orange);
    color: var(--doc-orange);
}

.api-docs-layout {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: var(--doc-sidebar-w) 1fr;
    gap: 0;
    min-height: calc(100vh - 64px);
}

.api-docs-sidebar {
    position: sticky;
    top: 64px;
    align-self: start;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 1rem 0.75rem 2rem 1.25rem;
    border-right: 1px solid var(--doc-border);
    background: rgba(255, 255, 255, 0.5);
}

.api-docs-search-wrap {
    margin-bottom: 0.75rem;
}

.api-docs-search {
    width: 100%;
    border: 1px solid var(--doc-border);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    font-size: 0.88rem;
    background: #fff;
    outline: none;
}

.api-docs-search:focus {
    border-color: var(--doc-orange);
    box-shadow: 0 0 0 3px rgba(255, 103, 9, 0.15);
}

.api-docs-nav a {
    display: block;
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
    color: var(--doc-muted);
    text-decoration: none;
    border-radius: 8px;
}

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

.api-docs-nav-group {
    margin-bottom: 0.65rem;
}

.api-docs-nav-group-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--doc-text);
    padding: 0.35rem 0.5rem 0.2rem;
}

.api-docs-sidebar-meta {
    margin: 1rem 0.5rem 0;
    font-size: 0.75rem;
    color: var(--doc-muted);
}

.api-docs-main {
    padding: 1.5rem 1.5rem 3rem;
    min-width: 0;
}

.api-docs-hero {
    margin-bottom: 1.25rem;
}

.api-docs-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--doc-orange);
}

.api-docs-hero h1 {
    font-family: var(--doc-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}

.api-docs-lead {
    margin: 0 0 1rem;
    color: var(--doc-muted);
    max-width: 52rem;
}

.api-docs-base-url {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    background: var(--doc-orange-soft);
    border: 1px solid rgba(255, 103, 9, 0.2);
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
}

.api-docs-base-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--doc-orange-deep);
}

.api-docs-base-url code {
    flex: 1;
    min-width: 200px;
    font-size: 0.82rem;
    word-break: break-all;
}

.api-docs-copy {
    border: 0;
    background: var(--doc-orange);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
}

.api-docs-copy:hover {
    background: var(--doc-orange-deep);
}

.api-docs-card {
    background: var(--doc-card);
    border: 1px solid var(--doc-border);
    border-radius: var(--doc-radius);
    padding: 1.15rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 18px rgba(26, 38, 71, 0.04);
}

.api-docs-card h2 {
    font-family: var(--doc-display);
    font-size: 1.1rem;
    margin: 0 0 0.85rem;
}

.api-docs-group-title {
    font-family: var(--doc-display);
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
    padding-top: 0.5rem;
    border-top: 2px solid var(--doc-orange);
}

.api-docs-dl {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.35rem 1rem;
    margin: 0;
    font-size: 0.9rem;
}

.api-docs-dl dt {
    font-weight: 600;
    color: var(--doc-muted);
}

.api-docs-dl dd {
    margin: 0;
}

.api-docs-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.9rem;
}

.api-docs-list li + li {
    margin-top: 0.35rem;
}

.api-docs-code {
    margin: 0.85rem 0 0;
    padding: 0.85rem 1rem;
    background: #1e2436;
    color: #e8ebf1;
    border-radius: 12px;
    overflow-x: auto;
    font-size: 0.78rem;
    line-height: 1.45;
}

.api-docs-endpoint {
    border: 1px solid var(--doc-border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.65rem;
    background: #fafbfc;
}

.api-docs-endpoint.is-hidden {
    display: none;
}

.api-docs-endpoint-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.api-docs-method {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    color: #fff;
}

.api-docs-method--GET { background: var(--doc-green); }
.api-docs-method--POST { background: var(--doc-blue); }

.api-docs-path {
    font-family: ui-monospace, "Cascadia Code", monospace;
    font-size: 0.88rem;
    font-weight: 600;
    word-break: break-all;
}

.api-docs-auth-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
}

.api-docs-auth-badge--public {
    background: #dcfce7;
    color: #166534;
}

.api-docs-endpoint-summary {
    margin: 0;
    font-size: 0.88rem;
    color: var(--doc-muted);
}

.api-docs-endpoint-detail {
    margin-top: 0.65rem;
    font-size: 0.82rem;
}

.api-docs-endpoint-detail p {
    margin: 0.25rem 0;
}

.api-docs-endpoint-detail code {
    background: #eef0f4;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.api-docs-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--doc-border);
    font-size: 0.82rem;
    color: var(--doc-muted);
}

.api-docs-footer a {
    color: var(--doc-orange);
}

.api-docs-footer-note {
    font-size: 0.78rem;
}

.api-docs-menu-toggle {
    display: none;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 50;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: var(--doc-orange);
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 8px 24px rgba(255, 103, 9, 0.35);
    cursor: pointer;
}

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

    .api-docs-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(300px, 88vw);
        z-index: 45;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.12);
    }

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

    .api-docs-menu-toggle {
        display: block;
    }

    .api-docs-main {
        padding: 1rem 1rem 3rem;
    }
}
