.api-docs-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f5f7fb;
    color: #1a2e52;
}

.api-docs-page .login-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(120deg, #4f46e5, #6b63ea);
}

.api-docs-page :target {
    scroll-margin-top: 90px;
}

.api-docs-shell {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 16px;
    box-sizing: border-box;
}

.api-docs-toc {
    position: sticky;
    top: calc(74px + 1rem);
    align-self: start;
    max-height: calc(100vh - 74px - 2rem);
    overflow-y: auto;
    font-size: 0.875rem;
}

.api-docs-toc-title {
    margin: 0 0 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.75rem;
}

.api-docs-toc ul {
    list-style: none;
    margin: 0;
    padding-left: 0.75rem;
}

.api-docs-toc > .toc > ul {
    padding-left: 0;
}

.api-docs-toc li {
    margin: 0.25rem 0;
}

.api-docs-toc a {
    color: #1f4d8f;
    text-decoration: none;
}

.api-docs-toc a:hover {
    text-decoration: underline;
}

.api-docs-content {
    min-width: 0;
    padding: 2rem clamp(16px, 3vw, 40px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 30, 60, 0.08);
    line-height: 1.6;
}

.api-docs-content h1 {
    margin-top: 0;
    color: #102a53;
}

.api-docs-content h2 {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e3e8f0;
    color: #102a53;
}

.api-docs-content h3,
.api-docs-content h4 {
    margin-top: 1.75rem;
    color: #102a53;
}

.api-docs-content code {
    padding: 0.1em 0.35em;
    background: #eef2f8;
    border-radius: 4px;
    font-size: 0.9em;
}

.api-docs-content pre {
    overflow-x: auto;
    padding: 1rem;
    background: #0f1f3a;
    color: #e6edf7;
    border-radius: 10px;
}

.api-docs-content pre code {
    padding: 0;
    background: none;
    color: inherit;
}

.api-docs-content table {
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.api-docs-content th,
.api-docs-content td {
    padding: 0.45rem 0.75rem;
    border: 1px solid #dbe2ec;
    text-align: left;
    vertical-align: top;
}

.api-docs-content th {
    background: #eef2f8;
}

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

    .api-docs-toc {
        position: static;
        max-height: none;
    }
}
