* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-card: #ffffff;
    --text-primary: #1f2328;
    --text-secondary: #57606a;
    --text-muted: #6e7781;
    --accent: #0969da;
    --accent-hover: #0550ae;
    --border: #d0d7de;
    --success: #2ea44f;
    --warning: #9a6700;
    --code-bg: #f6f8fa;
    --shadow: 0 1px 3px rgba(27, 31, 36, 0.1);
    --sidebar-width: 280px;
    --toc-width: 220px;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}
.docs-container {
    display: flex;
    min-height: 100vh;
}
/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    padding: 32px 24px;
}
.sidebar-header {
    margin-bottom: 40px;
}
.sidebar-header p {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    padding-top: 15px;
    color: black;
}
.version {
    display: inline-block;
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-muted);
}
.nav-section {
    margin-bottom: 32px;
}
.nav-section h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 12px;
}
.nav-item {
    display: block;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}
.nav-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.nav-item.active {
    background: var(--accent);
    color: #ffffff;
    font-weight: 500;
}
.nav-item.external {
    color: var(--accent);
}
/* Main Content */
.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
}
.content-wrapper {
    flex: 1;
    padding: 64px;
    max-width: 960px;
    min-width: 0;
}
.doc-section {
    margin-bottom: 80px;
    scroll-margin-top: 100px;
}
h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}
h2 {
    font-size: 32px;
    font-weight: 600;
    margin: 64px 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
h3 {
    font-size: 22px;
    font-weight: 600;
    margin: 40px 0 16px;
}
h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 28px 0 12px;
    color: var(--text-secondary);
}
p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}
.lead {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 48px;
    font-weight: 400;
}
/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin: 48px 0;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}
.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(27, 31, 36, 0.12);
}
.feature-icon {
    font-size: 36px;
    margin-bottom: 16px;
    color: var(--accent);
}
.feature-card h3 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}
.feature-card p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}
/* Steps */
.step {
    display: flex;
    gap: 24px;
    margin: 40px 0;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.step-number {
    width: 48px;
    height: 48px;
    background: var(--accent);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
}
.step-content {
    flex: 1;
}
.step-content h3 {
    margin-top: 0;
    margin-bottom: 12px;
}
/* Download */
.download-button,
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent);
    color: #ffffff;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}
.download-button:hover,
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}
.download-icon {
    font-size: 18px;
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-secondary:hover {
    background: var(--bg-secondary);
}
.download-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
    margin: 48px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 48px;
    box-shadow: var(--shadow);
}
.download-info h3 {
    margin-top: 0;
    font-size: 22px;
}
.feature-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}
.feature-list li {
    padding: 6px 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 24px;
}
.feature-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}
.download-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 220px;
}
/* Code blocks */
pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: var(--shadow);
}
code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}
pre code {
    background: none;
    padding: 0;
}
/* Info box */
.info-box {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent);
    padding: 20px;
    border-radius: 8px;
    margin: 32px 0;
    box-shadow: var(--shadow);
}
.info-box.warning {
    border-left-color: var(--warning);
    background: #fff8c5;
}
.info-box i {
    margin-right: 10px;
    color: var(--accent);
}
.info-box.warning i {
    color: var(--warning);
}
.info-box strong {
    display: flex;
    align-items: center;
    color: var(--text-primary);
    font-size: 15px;
}
.info-box ul {
    margin: 16px 0 0 28px;
    padding-left: 0;
}
.info-box li {
    color: var(--text-secondary);
    margin: 6px 0;
}
/* Flow diagram */
.flow-diagram {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 32px;
    margin: 32px 0;
    overflow-x: auto;
    box-shadow: var(--shadow);
}
.flow-diagram pre {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
    box-shadow: none;
}
/* Method & Endpoint cards */
.method-card,
.endpoint-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: var(--shadow);
}
.method-card h3 {
    margin-top: 0;
    color: var(--accent);
    font-family: 'SF Mono', monospace;
    font-size: 17px;
}
.endpoint-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.method {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    color: #ffffff;
}
.method.get { background: var(--success); }
.method.post { background: var(--accent); }
.method.put { background: #9a6700; }
.method.delete { background: #cf222e; }
.endpoint-header code {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}
/* Parameter table */
.param-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 20px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.param-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.param-table tr:last-child td {
    border-bottom: none;
}
.param-table td:first-child {
    font-family: 'SF Mono', monospace;
    color: var(--accent);
    font-weight: 600;
    background: var(--bg-secondary);
}
.param-table td:nth-child(2) {
    color: var(--text-muted);
    font-style: italic;
    width: 100px;
}
/* Footer */
.doc-footer {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 20px;
}
.footer-links a {
    color: var(--accent);
    text-decoration: none;
    font-size: 15px;
}
.footer-links a:hover {
    text-decoration: underline;
}
.doc-footer p {
    font-size: 14px;
}
/* Table of Contents */
.toc {
    width: var(--toc-width);
    padding: 64px 32px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-left: 1px solid var(--border);
}
.toc h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 20px 0;
}
#toc-nav a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}
#toc-nav a:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}
.toc-sub {
    padding-left: 24px !important;
    font-size: 13px !important;
}
/* ====== Mobile Components (docs) ====== */

.docs-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 54px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    z-index: 998;
    box-shadow: 0 1px 4px rgba(27,31,36,.08);
    gap: 12px;
}

.docs-hamburger {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 18px;
    padding: 8px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.docs-hamburger:hover { background: var(--bg-secondary); color: var(--text-primary); }

.docs-mobile-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.docs-mobile-console {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    transition: background 0.15s;
}
.docs-mobile-console:hover { background: var(--bg-secondary); }

/* Sidebar overlay */
.docs-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(27, 31, 36, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.docs-overlay.active { opacity: 1; pointer-events: auto; }

/* Close button + top row inside sidebar */
.docs-sidebar-top {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.docs-sidebar-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 16px;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.docs-sidebar-close:hover { background: var(--bg-secondary); color: var(--text-primary); }
.docs-hide-mobile { display: none; } /* kept for safety */

/* Responsive */
@media (max-width: 1400px) {
    .toc {
        display: none;
    }
}
@media (max-width: 768px) {
    /* Show mobile header and overlay */
    .docs-mobile-header { display: flex; }
    .docs-overlay { display: block; pointer-events: none; }
    .docs-sidebar-top { display: flex; }

    /* Hide inline Console button — mobile header has a Console link instead */
    .docs-sidebar-console { display: none; }

    /* Content pushed below fixed header */
    .content {
        margin-left: 0;
        margin-top: 54px;
        width: 100%;
        max-width: 100%;
    }
    .content-wrapper {
        padding: 28px 20px;
        max-width: 100%;
    }

    /* Sidebar: fixed off-screen drawer */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100dvh;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(.4, 0, .2, 1);
        overflow-y: auto;
        padding: 20px;
        width: min(var(--sidebar-width), 85vw);
    }
    .sidebar.open {
        transform: translateX(0);
    }

    /* Responsive content pieces */
    h1 { font-size: 28px; }
    h2 { font-size: 22px; margin: 40px 0 16px; }
    h3 { font-size: 18px; }
    .lead { font-size: 16px; }

    .feature-grid { grid-template-columns: 1fr; }

    .download-card {
        flex-direction: column;
        text-align: center;
        gap: 24px;
        padding: 28px 20px;
    }
    .download-actions { min-width: auto; width: 100%; }

    .step {
        flex-direction: column;
        padding: 24px 20px;
    }

    /* Horizontally scrollable code blocks */
    pre {
        font-size: 13px;
        padding: 16px;
        overflow-x: auto;
    }
    .flow-diagram {
        padding: 20px 16px;
        overflow-x: auto;
    }

    .param-table { overflow-x: auto; display: block; }

    .endpoint-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    .endpoint-header code { font-size: 14px; word-break: break-all; }

    .footer-links { flex-direction: column; align-items: center; gap: 16px; }
}

@media (max-width: 400px) {
    .content-wrapper { padding: 20px 14px; }
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
}
