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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--topbar-h) + 12px);
}

body {
    font-family: var(--font-sans);
    background: var(--doc-bg);
    color: var(--doc-text);
    line-height: 1.65;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
}

h1 { font-size: 1.85rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.4rem; margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--doc-border); }
h3 { font-size: 1.08rem; font-weight: 600; margin-top: 1.1rem; margin-bottom: 0.5rem; color: #1e3a8a; }
h4 { font-size: 1rem; font-weight: 600; margin-top: 0.9rem; margin-bottom: 0.4rem; }

p { color: var(--doc-muted); font-size: 0.94rem; margin-bottom: 0.85rem; }

a {
    color: var(--doc-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--doc-accent-hover);
}

ul, ol {
    padding-left: 1.35rem;
    margin-bottom: 1rem;
    color: var(--doc-muted);
    font-size: 0.94rem;
}

li { margin-bottom: 0.4rem; }

code {
    font-family: var(--font-mono);
    background: var(--chip-bg);
    color: #1e40af;
    border-radius: var(--radius-sm);
    padding: 0.12rem 0.38rem;
    font-size: 0.82em;
}

pre {
    background: var(--code-bg);
    color: #e2e8f0;
    border-radius: var(--radius-md);
    padding: 0.9rem 1rem;
    overflow-x: auto;
    margin-bottom: 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.5;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
}

img {
    max-width: 100%;
    height: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input, textarea, select {
    font-family: inherit;
}

::selection {
    background: var(--doc-accent);
    color: #fff;
}