/* Public API Documentation page */

.docs-page {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: start;
}

.docs-header {
    grid-column: 1 / -1;
    margin-bottom: 8px;
}
.docs-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 6px 0;
}
.docs-header h1 i { margin-right: 10px; color: #4a6cf7; }
.docs-header .lead { color: #5e6675; margin: 0; font-size: 14px; }

/* --- TOC sidebar --- */
.docs-toc {
    position: sticky;
    top: 24px;
    align-self: start;
    background: #fafbfc;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 13px;
}
.docs-toc strong {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #889;
    margin-bottom: 8px;
}
.docs-toc ul { list-style: none; padding: 0; margin: 0; }
.docs-toc li { margin: 2px 0; }
.docs-toc a {
    display: block;
    padding: 5px 8px;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    line-height: 1.3;
}
.docs-toc a:hover { background: #eef2ff; color: #4a6cf7; }

/* --- Body --- */
.docs-body { min-width: 0; }
.docs-body section {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.docs-body section > h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef0f3;
    color: #1f2937;
}
.docs-body section h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 18px 0 8px 0;
    color: #1f2937;
}
.docs-body p { line-height: 1.6; color: #333; margin: 8px 0; }
.docs-body ul, .docs-body ol { line-height: 1.6; padding-left: 22px; }
.docs-body li { margin: 4px 0; }

/* --- Code --- */
.docs-body code {
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    color: #c0392b;
}
.docs-body pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 14px 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
    margin: 10px 0;
}
.docs-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
}
.docs-body pre .c-comment { color: #94a3b8; }
.docs-body pre .c-key { color: #93c5fd; }
.docs-body pre .c-str { color: #fcd34d; }

/* --- Tables --- */
.docs-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
}
.docs-body th, .docs-body td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #eef0f3;
    vertical-align: top;
}
.docs-body th {
    background: #fafbfc;
    font-weight: 600;
    color: #555;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.docs-body tbody tr:hover { background: #fbfcfd; }

/* --- Callout / notes --- */
.docs-body .docs-note {
    background: #f0f4ff;
    border-left: 3px solid #4a6cf7;
    border-radius: 4px;
    padding: 10px 14px;
    margin: 10px 0;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
}
.docs-body .docs-note i { color: #4a6cf7; margin-right: 6px; }

.docs-body .docs-warn {
    background: #fff7ed;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    padding: 10px 14px;
    margin: 10px 0;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
}
.docs-body .docs-warn i { color: #f59e0b; margin-right: 6px; }

/* --- Status pills --- */
.docs-body .status-pill {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .03em;
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    background: #f1f3f5;
    color: #444;
}
.docs-body .status-pill.ok      { background: #e6f7ec; color: #1a8c4a; }
.docs-body .status-pill.warn    { background: #fff3cd; color: #856404; }
.docs-body .status-pill.err     { background: #fdeaea; color: #c0392b; }

/* --- Top-level API tabs --- */
.api-tabs {
    grid-column: 1 / -1;
    display: flex;
    gap: 6px;
    border-bottom: 2px solid #eef0f3;
    margin-bottom: 16px;
}
.api-tab-btn {
    background: none;
    border: none;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #5e6675;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}
.api-tab-btn:hover { color: #4a6cf7; }
.api-tab-btn.active {
    color: #4a6cf7;
    border-bottom-color: #4a6cf7;
}
.api-tab-btn i { margin-right: 6px; }

/* Each tab pane reuses the parent .docs-page grid via display:contents,
   so its inner toc + body land in the same two-column layout as before.
   Hide the inactive pane entirely. */
.api-tab-pane { display: contents; }
.api-tab-pane:not(.active) { display: none; }

/* --- Responsive --- */
@media (max-width: 900px) {
    .docs-page { grid-template-columns: 1fr; }
    .docs-toc { position: static; }
}
