
:root {
    --bg: #ffffff; --sidebar: #f7f8fb; --ink: #0f172a;
    --muted: #64748b; --muted-soft: #94a3b8; --border: #e2e8f0;
    --primary: #4f46e5; --primary-soft: #eef2ff; --code-bg: #f1f5f9;
    --success: #059669; --warn: #d97706;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: 'Inter', -apple-system, sans-serif; font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: 'JetBrains Mono', ui-monospace, monospace; }

.topbar { height: 56px; display: flex; align-items: center; gap: 1.5rem; padding: 0 1.5rem; border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 50; }
.topbar__brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.95rem; color: var(--ink); text-decoration: none; }
.topbar__brand img { height: 22px; width: auto; }
.topbar__brand:hover { text-decoration: none; }
.topbar__search { flex: 1; max-width: 480px; position: relative; }
.topbar__search input { width: 100%; height: 36px; padding: 0 0.75rem 0 2.25rem; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 0.875rem; background: var(--sidebar); color: var(--ink); }
.topbar__search input:focus { outline: none; border-color: var(--primary); background: var(--bg); }
.topbar__search::before { content: '⌕'; position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1rem; }
.docs-search__results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08); max-height: 70vh; overflow-y: auto; z-index: 60; }
.docs-search__results[hidden] { display: none; }
.docs-search__group { border-bottom: 1px solid var(--border); padding: 0.4rem 0; }
.docs-search__group:last-child { border-bottom: 0; }
.docs-search__page { display: block; padding: 0.5rem 0.875rem; font-weight: 600; font-size: 0.875rem; color: var(--ink); }
.docs-search__page:hover { background: var(--sidebar); text-decoration: none; }
.docs-search__hit { display: block; padding: 0.3rem 0.875rem 0.3rem 1.75rem; font-size: 0.8125rem; color: var(--muted); border-left: 2px solid transparent; line-height: 1.5; }
.docs-search__hit:hover { background: var(--sidebar); color: var(--ink); border-left-color: var(--primary); text-decoration: none; }
.docs-search__hit--body { padding: 0.45rem 0.875rem 0.45rem 1.75rem; color: var(--muted); white-space: normal; }
.docs-search__hit mark { background: #fef3c7; color: var(--ink); padding: 0 0.15rem; border-radius: 3px; font-weight: 600; }
mark.docs-flash { background: #fde68a; color: var(--ink); padding: 0 0.15rem; border-radius: 3px; box-shadow: 0 0 0 4px #fde68a; scroll-margin-top: 4.5rem; animation: docs-flash 2.4s ease-out; }
@keyframes docs-flash {
    0%   { background: #fbbf24; box-shadow: 0 0 0 8px #fbbf24; }
    20%  { background: #fbbf24; box-shadow: 0 0 0 8px #fbbf24; }
    100% { background: #fef3c7; box-shadow: 0 0 0 0 transparent; }
}
.docs-search__empty { padding: 0.875rem 1rem; font-size: 0.85rem; color: var(--muted); text-align: center; }
.topbar__nav { display: flex; gap: 1.25rem; font-size: 0.875rem; }
.topbar__nav a { color: var(--muted); font-weight: 500; }
.topbar__nav a:not(.topbar__cta) { line-height: 36px; }
.topbar__nav a:hover { color: var(--ink); text-decoration: none; }
.topbar__cta { background: var(--primary); color: #fff !important; padding: 0.4rem 0.875rem; border-radius: 6px; font-weight: 600; }
.topbar__cta:hover { background: #4338ca; text-decoration: none; }

.layout { display: grid; grid-template-columns: 260px 1fr 220px; min-height: calc(100vh - 56px); }

.sidebar { background: var(--sidebar); border-right: 1px solid var(--border); padding: 1.5rem 1rem; overflow-y: auto; }
.sidebar__group { margin-bottom: 1.5rem; }
.sidebar__group-title { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.5rem; padding: 0 0.5rem; }
.sidebar__link { display: block; padding: 0.4rem 0.625rem; border-radius: 5px; font-size: 0.875rem; color: var(--ink); text-decoration: none; margin-bottom: 0.125rem; }
.sidebar__link:hover { background: #fff; text-decoration: none; }
.sidebar__link--active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.content { padding: 2rem 3rem; max-width: 820px; overflow-wrap: break-word; }

.toc { padding: 2rem 1.25rem; border-left: 1px solid var(--border); position: sticky; top: 56px; align-self: start; max-height: calc(100vh - 56px); overflow-y: auto; }
.toc__title { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.75rem; }
.toc__list { list-style: none; }
.toc__list a { display: block; padding: 0.3rem 0.75rem; font-size: 0.8rem; color: var(--muted); text-decoration: none; border-left: 2px solid transparent; }
.toc__list a:hover { color: var(--ink); text-decoration: none; }

/* Prose */
.prose { font-family: 'Inter', sans-serif; }
.prose h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.5rem; line-height: 1.15; }
.prose h2 { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.01em; margin: 2.5rem 0 1rem; scroll-margin-top: 4.5rem; }
.prose h2::before { content: '#'; color: var(--muted-soft); margin-right: 0.5rem; font-weight: 400; }
.prose h3 { font-size: 1.0625rem; font-weight: 600; margin: 2rem 0 0.75rem; }
.prose h4 { font-size: 0.95rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.prose p { margin-bottom: 1rem; line-height: 1.7; }
.prose ul, .prose ol { margin: 0 0 1.25rem 1.5rem; }
.prose li { margin-bottom: 0.375rem; line-height: 1.65; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose code { background: var(--code-bg); padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.85em; }
.prose pre { background: #0f172a; color: #e2e8f0; padding: 1rem 1.25rem; border-radius: 8px; font-size: 0.85rem; line-height: 1.6; overflow-x: auto; margin: 1.25rem 0; }
.prose pre code { background: transparent; padding: 0; color: inherit; font-size: 1em; }
.prose blockquote { border-left: 3px solid var(--primary); background: var(--primary-soft); padding: 0.875rem 1.25rem; border-radius: 0 8px 8px 0; margin: 1.5rem 0; color: #374151; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.9rem; }
.prose th, .prose td { padding: 0.625rem 0.875rem; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { background: var(--sidebar); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.prose a { color: var(--primary); text-decoration: none; border-bottom: 1px solid transparent; }
.prose a:hover { border-bottom-color: var(--primary); text-decoration: none; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; margin: 1.5rem 0; }
.prose img:first-of-type { width: 150px; }

.doc-footer { margin-top: 4rem; padding: 1.75rem 0 0; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: 0.8125rem; color: var(--muted); }
.doc-footer a { color: var(--muted); }

@media (max-width: 960px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .toc { display: none; }
    .content { padding: 1.5rem; }
}
