.api-spec-page { max-width: 100%; }
.api-spec-section { overflow-x: hidden; }
.api-spec-section .api-anchor {
    display: block;
    position: relative;
    top: -80px;
    visibility: hidden;
}

.api-spec-section .module-group__title { margin: 0 0 18px; }
.api-spec-section .api-section-title {
    margin: 28px 0 14px;
    font-size: var(--font-size-section-title);
    line-height: 1.2;
    font-weight: var(--font-weight-section-title);
}
.api-spec-section .api-subtitle {
    margin: 24px 0 10px;
    font-size: clamp(17px, 1.5vw, 21px);
    line-height: 1.3;
    font-weight: 700;
}
.api-spec-section ul,
.api-spec-section ol {
    margin: 12px 0 0;
    padding-inline-start: 22px;
    line-height: 1.7;
}
.api-spec-section li + li { margin-top: 6px; }
.api-spec-section .toc {
    padding: 16px 16px 16px 34px;
    background: var(--color-soft-bg, #f5f7fa);
    border-radius: var(--content-block-radius);
}
.api-spec-section .toc ul { margin-top: 8px; }
.api-spec-section .api-code {
    margin: 16px 0;
    padding: 16px;
    max-width: 100%;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #f4f7fb;
    background: #111820;
    border-radius: var(--content-block-radius);
}
.api-spec-section code,
.api-spec-section .api-code {
    font-family: Consolas, Monaco, "Courier New", monospace;
}
.api-spec-section code { font-size: 0.95em; }
.api-spec-section .api-code code { white-space: pre; }
.api-spec-section b { font-weight: 700; }

.api-reference-intro p:first-child { margin-top: 0; }

.api-note,
.api-warning {
    margin: 16px 0;
    padding: 14px 16px;
    line-height: 1.6;
    background: var(--color-soft-bg, #f5f7fa);
    border-radius: var(--content-block-radius);
}
.api-warning { border-left: 4px solid currentColor; }

/*
 * One visual block = one API method, resource, or documented unit.
 * The anchor is kept inside the block so a hash link lands at its beginning.
 */
.api-item-block {
    margin: 18px 0 0;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.025);
    border-left: 3px solid rgba(0, 0, 0, 0.14);
    border-radius: 4px;
}

.api-item-block .api-subtitle {
    margin-top: 0;
}

.api-item-block > :last-child {
    margin-bottom: 0;
}

/* Keep RPC / Resource / Data Model labels as lightweight group headings. */
.api-spec-section > .api-section-title {
    margin-top: 28px;
}


@media (max-width: 700px) {
    .api-spec-section .api-code { font-size: 13px; }
}