:root {
    --bg: #070709;
    --panel: #0b0b0f;
    --panel-soft: #121218;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f5f5f7;
    --muted: #a3a3ad;
    --dim: #73737e;
    --crimson: #b03a47;
    --burgundy: #5a1822;
    --accent: #d7a0a7;
    --radius: 16px;
    --radius-sm: 10px;
    --sidebar-width: 300px;
    --shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #fff; }

code, pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 40;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(11, 11, 15, 0.92);
    color: #fff;
    cursor: pointer;
}

.layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 18px 28px;
    border-right: 1px solid var(--border);
    background: #070709;
    overflow-y: auto;
}

.sidebar__brand { margin-bottom: 22px; }

.sidebar__lockup {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: #fff;
    text-decoration: none;
}

.sidebar__lockup img {
    width: 20px;
    height: 20px;
    display: block;
}

.sidebar__lockup span {
    font-family: Syne, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.35em;
    text-transform: lowercase;
}

.sidebar__brand h1 {
    margin: 0 0 8px;
    font-family: Syne, sans-serif;
    font-size: 1.65rem;
    letter-spacing: -0.04em;
}

.sidebar__brand p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.version-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 16px;
    padding: 5px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.version-switcher__btn {
    border: 0;
    border-radius: 8px;
    padding: 10px 8px;
    background: transparent;
    color: var(--muted);
    font: 600 13px Inter, sans-serif;
    cursor: pointer;
}

.version-switcher__btn.is-active {
    color: #fff;
    background: #8e2a36;
}

.sidebar__search { margin-bottom: 14px; }

.sidebar__search input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font: 500 13px Inter, sans-serif;
}

.sidebar__search input::placeholder { color: var(--dim); }
.sidebar__search input:focus {
    outline: none;
    border-color: rgba(176, 58, 71, 0.55);
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 20px;
}

.sidebar__nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.sidebar__nav a:hover {
    color: #fff;
    background: rgba(176, 58, 71, 0.12);
}

.sidebar__nav a.is-active {
    color: #fff;
    background: rgba(176, 58, 71, 0.2);
}

.nav-badge {
    flex-shrink: 0;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(176, 58, 71, 0.22);
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.sidebar__links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.sidebar__links a {
    color: var(--dim);
    font-size: 12px;
    font-weight: 600;
}

.sidebar__links a:hover { color: var(--accent); }

.content {
    min-width: 0;
    padding: 36px clamp(20px, 4vw, 48px) 80px;
}

.docs-content {
    width: min(920px, 100%);
}

.hero {
    display: grid;
    gap: 22px;
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.hero h2 {
    margin: 10px 0 12px;
    font-family: Syne, sans-serif;
    font-size: clamp(28px, 4vw, 40px);
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.hero p {
    margin: 0;
    max-width: 62ch;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero__meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.meta-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #0b0b0f;
}

.meta-card span {
    display: block;
    margin-bottom: 6px;
    color: var(--dim);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.meta-card strong {
    font-size: 14px;
    font-weight: 600;
}

.doc-section {
    margin-bottom: 40px;
    scroll-margin-top: 28px;
}

.doc-section h3,
.section-heading h3 {
    margin: 0 0 10px;
    font-family: Syne, sans-serif;
    font-size: 1.35rem;
    letter-spacing: -0.03em;
}

.doc-section h4 {
    margin: 18px 0 8px;
    font-size: 15px;
}

.doc-section p,
.doc-section li {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.doc-section p { margin: 0 0 12px; }

.doc-section ul,
.doc-section ol {
    margin: 0 0 14px;
    padding-left: 1.2em;
}

.doc-section code,
.panel code,
.meta-card code {
    padding: 1px 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    color: #f0d0d4;
    font-size: 0.92em;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.endpoint-card {
    padding: 22px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #0b0b0f;
}

.method {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.method--post {
    color: #fff;
    background: rgba(176, 58, 71, 0.85);
}

.endpoint-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    flex-wrap: wrap;
}

.endpoint-row code {
    word-break: break-all;
}

.callout {
    margin: 14px 0;
    padding: 14px 16px;
    border: 1px solid rgba(176, 58, 71, 0.35);
    border-radius: var(--radius-sm);
    background: rgba(176, 58, 71, 0.08);
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.callout strong { color: #fff; }

.feature-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    position: relative;
    padding-left: 16px;
}

.feature-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--crimson);
}

table {
    width: 100%;
    margin: 12px 0 16px;
    border-collapse: collapse;
    font-size: 13px;
}

th, td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--dim);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

td { color: var(--muted); }

.panel {
    margin: 12px 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.22);
}

.panel h4 {
    margin: 0 0 10px;
    color: #fff;
}

.panel pre,
.code-block pre {
    margin: 0;
    overflow-x: auto;
    color: #e8e8ec;
    font-size: 12.5px;
    line-height: 1.55;
}

.code-block {
    position: relative;
    margin: 12px 0 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #09090c;
}

.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font: 600 11px Inter, sans-serif;
    cursor: pointer;
}

.copy-button:hover,
.copy-button.is-copied {
    color: #fff;
    border-color: rgba(176, 58, 71, 0.5);
}

.two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 980px) {
    .hero__meta,
    .feature-list,
    .two-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }

    .layout { grid-template-columns: 1fr; }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 30;
        width: min(320px, 88vw);
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        box-shadow: var(--shadow);
    }

    .sidebar.is-open { transform: translateX(0); }

    .content { padding-top: 72px; }
}
