:root {
    --bg: #ffffff;
    --bg-soft: #f7f8fa;
    --bg-code: #0f172a;
    --border: #e5e7eb;
    --text: #111827;
    --text-soft: #4b5563;
    --text-muted: #6b7280;
    --primary: #4f46e5;
    --primary-soft: #eef2ff;
    --accent: #0ea5e9;
    --success: #16a34a;
    --warn: #d97706;
    --danger: #dc2626;
    --radius: 8px;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--bg-soft);
    border-right: 1px solid var(--border);
    padding: 24px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar .brand {
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
    display: block;
    margin-bottom: 4px;
}

.sidebar .brand-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.sidebar h4 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 22px 0 8px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li a {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--text-soft);
    font-size: 14px;
}

.sidebar li a:hover {
    background: #fff;
    text-decoration: none;
    color: var(--text);
}

.sidebar li a.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

/* Main content */
.content {
    padding: 48px 56px 96px;
    max-width: 880px;
}

.content h1 {
    font-size: 32px;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.content .lede {
    font-size: 17px;
    color: var(--text-soft);
    margin: 0 0 36px;
}

.content h2 {
    font-size: 22px;
    margin: 40px 0 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    letter-spacing: -0.01em;
}

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

.content h3 {
    font-size: 17px;
    margin: 24px 0 8px;
    color: var(--text);
}

.content p { margin: 0 0 14px; }
.content ul, .content ol { margin: 0 0 16px; padding-left: 22px; }
.content li { margin-bottom: 4px; }

.content code {
    font-family: var(--mono);
    font-size: 13px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 4px;
    color: #be185d;
}

.content pre {
    background: var(--bg-code);
    color: #e5e7eb;
    padding: 16px 18px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.55;
    margin: 12px 0 18px;
}

.content pre code {
    background: transparent;
    border: 0;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* Tables */
.content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin: 8px 0 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.content th, .content td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.content th {
    background: var(--bg-soft);
    font-weight: 600;
    color: var(--text);
    font-size: 13px;
}

.content tr:last-child td { border-bottom: 0; }

/* Callouts */
.note, .warn, .tip {
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 16px 0;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    font-size: 14px;
}

.note { border-left: 4px solid var(--accent); }
.warn { border-left: 4px solid var(--warn); background: #fffbeb; }
.tip  { border-left: 4px solid var(--success); background: #f0fdf4; }

.note strong, .warn strong, .tip strong { display: block; margin-bottom: 2px; }

/* Badges */
.badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge.get    { background: #dcfce7; color: #166534; }
.badge.post   { background: #dbeafe; color: #1e40af; }
.badge.put    { background: #fef3c7; color: #92400e; }
.badge.patch  { background: #fde68a; color: #92400e; }
.badge.delete { background: #fee2e2; color: #991b1b; }
.badge.gray   { background: #e5e7eb; color: #374151; }

.endpoint {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 13px;
    padding: 8px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin: 6px 0;
}

/* Cards (home page) */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 16px 0 32px;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    background: #fff;
    transition: border-color .15s, transform .15s;
}

.card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    text-decoration: none;
}

.card h3 {
    margin: 0 0 4px;
    font-size: 15px;
    color: var(--text);
}

.card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

/* Footer */
.footer {
    margin-top: 48px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Figures &amp; image placeholders */
.figure {
    margin: 18px 0 24px;
}

.figure img {
    display: block;
    max-width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-soft);
}

.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    min-height: 240px;
    padding: 24px;
    background:
        repeating-linear-gradient(
            45deg,
            #f9fafb,
            #f9fafb 10px,
            #f3f4f6 10px,
            #f3f4f6 20px
        );
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.5;
}

.placeholder .label {
    max-width: 480px;
}

.placeholder .label strong {
    display: block;
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    margin-bottom: 4px;
}

.placeholder .label .hint {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #94a3b8;
}

.figure figcaption {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

/* Step lists */
.steps {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 16px 0 24px;
}

.steps &gt; li {
    counter-increment: step;
    position: relative;
    padding: 14px 16px 14px 56px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.steps &gt; li::before {
    content: counter(step);
    position: absolute;
    left: 14px;
    top: 14px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    font-family: var(--sans);
}

.steps &gt; li &gt; strong:first-child {
    display: block;
    margin-bottom: 4px;
}

/* Responsive */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
    .content { padding: 24px 20px 64px; }
}
