* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-primary: #060b14;
    --bg-secondary: #0a1220;
    --bg-card: #0f1a2e;
    --bg-code: #080e1a;
    --text-primary: #f0f4f8;
    --text-secondary: #8899aa;
    --text-dim: #546478;
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --accent-glow: rgba(6, 182, 212, 0.12);
    --navy: #0c2340;
    --green: #22c55e;
    --amber: #f59e0b;
    --red: #ef4444;
    --border: rgba(255, 255, 255, 0.07);
    --border-accent: rgba(34, 211, 238, 0.2);
    --sidebar-width: 260px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header: see /static/header.css */
/* Docs overrides for header-inner max-width */
.header-inner { max-width: 1400px; }

/* Layout */
.docs-layout {
    display: flex;
    padding-top: 73px;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 73px;
    left: 0;
    bottom: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 24px 0;
    z-index: 100;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-section {
    margin-bottom: 8px;
}

.sidebar-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    padding: 8px 24px 6px;
}

.sidebar-link {
    display: block;
    padding: 6px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 400;
    transition: all 0.15s;
    border-left: 2px solid transparent;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-link.active {
    color: var(--accent-light);
    border-left-color: var(--accent);
    background: var(--accent-glow);
}

.sidebar-link.page-link {
    font-weight: 500;
}

.sidebar-link.sub {
    padding-left: 40px;
    font-size: 0.8rem;
}

/* Mobile menu toggle */
.mobile-menu-btn {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    align-items: center;
    gap: 8px;
}

.hamburger {
    width: 18px;
    height: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all 0.2s;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 73px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 90;
}

/* Main content */
.docs-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    max-width: 860px;
    padding: 48px 48px 80px;
}

/* Typography */
.docs-content h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.docs-content h1 .gradient {
    background: linear-gradient(135deg, #22d3ee, #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.docs-content .subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 48px;
    line-height: 1.7;
}

.docs-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-top: 64px;
    margin-bottom: 16px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    scroll-margin-top: 90px;
}

.docs-content h2:first-of-type {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.docs-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 36px;
    margin-bottom: 12px;
    color: var(--text-primary);
    scroll-margin-top: 90px;
}

.docs-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 28px;
    margin-bottom: 10px;
    color: var(--text-primary);
    scroll-margin-top: 90px;
}

.docs-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
    line-height: 1.7;
}

.docs-content a {
    color: var(--accent-light);
    text-decoration: none;
}

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

.docs-content strong { color: var(--text-primary); font-weight: 600; }

.docs-content ul, .docs-content ol {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
    padding-left: 24px;
    line-height: 1.7;
}

.docs-content li { margin-bottom: 6px; }

.docs-content code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-code);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82em;
    color: var(--accent-light);
}

.docs-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 48px 0;
}

/* Code blocks */
.code-block {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
}

.code-lang {
    font-size: 0.72rem;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-copy {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    color: var(--text-dim);
    font-size: 0.72rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.code-copy:hover {
    border-color: var(--border-accent);
    color: var(--accent-light);
}

.code-copy.copied {
    border-color: var(--green);
    color: var(--green);
}

.code-body {
    padding: 16px 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre;
    color: var(--text-secondary);
}

.code-body::-webkit-scrollbar { height: 4px; }
.code-body::-webkit-scrollbar-track { background: transparent; }
.code-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Syntax colors */
.code-body .ck { color: #22d3ee; }  /* keyword */
.code-body .cs { color: #2dd4bf; }  /* string */
.code-body .cc { color: #3e5468; }  /* comment */
.code-body .cf { color: #67e8f9; }  /* function */
.code-body .cp { color: #a5f3fc; }  /* property */
.code-body .cn { color: #f59e0b; }  /* number */
.code-body .co { color: #8899aa; }  /* operator */
.code-body .cv { color: #cdd8e4; }  /* variable */

/* Tables */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.88rem;
}

.docs-table th {
    text-align: left;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.docs-table td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: top;
}

.docs-table td code {
    font-size: 0.78em;
    white-space: nowrap;
}

.docs-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Capability badges */
.cap {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-right: 3px;
    white-space: nowrap;
}

.cap-audio-in { background: rgba(6, 182, 212, 0.15); color: var(--accent-light); }
.cap-audio-out { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.cap-read { background: rgba(245, 158, 11, 0.15); color: var(--amber); }
.cap-write { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.cap-typing { background: rgba(255, 255, 255, 0.06); color: var(--text-dim); }

/* Info/tip callouts */
.callout {
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.callout p { margin-bottom: 0; font-size: 0.9rem; }
.callout p + p { margin-top: 8px; }

.callout-label {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.callout-tip {
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
}
.callout-tip .callout-label { color: var(--accent-light); }

.callout-warn {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.callout-warn .callout-label { color: var(--amber); }

.callout-note {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
}
.callout-note .callout-label { color: #818cf8; }

/* HTTP method badges */
.method {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.03em;
    margin-right: 6px;
    vertical-align: middle;
}

.method-get { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.method-post { background: rgba(6, 182, 212, 0.15); color: var(--accent-light); }
.method-delete { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.method-ws { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }

.endpoint-path {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    color: var(--text-primary);
    vertical-align: middle;
}

/* Conversation example */
.conversation {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.conv-line {
    padding: 8px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
}

.conv-line + .conv-line {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.conv-speaker {
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
    min-width: 50px;
}

.conv-speaker.user { color: var(--accent-light); }
.conv-speaker.agent { color: var(--green); }
.conv-speaker.tool { color: var(--amber); }

/* Steps */
.steps {
    counter-reset: step;
    margin-bottom: 20px;
}

.step {
    counter-increment: step;
    padding: 12px 0 12px 40px;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.step::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 12px;
    width: 26px;
    height: 26px;
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-light);
}

.step + .step {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* Pricing table */
.pricing-row-highlight {
    background: var(--accent-glow);
}

/* Footer */
footer {
    padding: 40px 24px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    margin-left: var(--sidebar-width);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    max-width: 860px;
}

.footer-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--text-primary); }

/* Responsive */
@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .docs-content {
        margin-left: 0;
        padding: 32px 24px 80px;
    }

    footer {
        margin-left: 0;
    }

    .header-nav a:not(.btn-primary):not(.active) {
        display: none;
    }
}

@media (max-width: 640px) {
    .docs-content h1 { font-size: 1.5rem; }
    .docs-content h2 { font-size: 1.25rem; }

    .docs-table {
        font-size: 0.8rem;
    }

    .docs-table th, .docs-table td {
        padding: 8px 10px;
    }

    .code-body {
        font-size: 0.72rem;
        padding: 12px 14px;
    }

    .header-nav {
        gap: 16px;
    }

    .integration-cards {
        /* Already vertical by default; kept for any future mobile-only tweaks */
    }
}

/* Integration cards (quickstart)
 *
 * Always stacked vertically: the code blocks inside these cards contain
 * real config snippets that are too wide to fit a horizontal 3-column
 * layout on any practical screen width without horizontal scrolling or
 * ugly wrapping.
 */
.integration-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 24px 0;
}

.integration-cards .card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: border-color 0.2s;
}

.integration-cards .card:hover {
    border-color: var(--border-accent);
}

.integration-cards .card h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.integration-cards .card p {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.integration-cards .card p:last-child {
    margin-bottom: 0;
}

.integration-cards .card p:last-child a {
    color: var(--accent);
    font-weight: 500;
}

.integration-cards .card .code-block {
    margin-bottom: 12px;
}
