:root {
	--docs-sidebar-w: 260px;
	--docs-toc-w: 220px;
	--docs-topbar-h: 56px;
	--docs-border: #e5e7eb;
	--docs-bg: #ffffff;
	--docs-bg-alt: #f8fafc;
	--docs-text: #1f2328;
	--docs-text-muted: #6b7280;
	--docs-accent: #2563eb;
	--docs-code-bg: #f3f4f6;
	--docs-max-width: 780px;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--docs-text);
	background: var(--docs-bg);
	line-height: 1.65;
}

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

/* Topbar */
.docs-topbar {
	position: sticky;
	top: 0;
	z-index: 50;
	height: var(--docs-topbar-h);
	background: var(--docs-bg);
	border-bottom: 1px solid var(--docs-border);
}
.docs-topbar-inner {
	display: flex;
	align-items: center;
	gap: 16px;
	height: 100%;
	padding: 0 16px;
}
.docs-logo {
	font-weight: 700;
	font-size: 16px;
	color: var(--docs-text);
	white-space: nowrap;
}
.docs-sidebar-toggle {
	display: none;
	flex-direction: column;
	gap: 4px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
}
.docs-sidebar-toggle span {
	width: 20px;
	height: 2px;
	background: var(--docs-text);
	display: block;
}
.docs-search {
	position: relative;
	flex: 1;
	max-width: 420px;
}
.docs-search input {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid var(--docs-border);
	border-radius: 6px;
	font-size: 14px;
}
.docs-search-results {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: var(--docs-bg);
	border: 1px solid var(--docs-border);
	border-radius: 6px;
	margin-top: 4px;
	max-height: 340px;
	overflow-y: auto;
	box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.docs-search-results a {
	display: block;
	padding: 10px 12px;
	color: var(--docs-text);
	border-bottom: 1px solid var(--docs-border);
	font-size: 14px;
}
.docs-search-results a:hover { background: var(--docs-bg-alt); text-decoration: none; }
.docs-search-results .no-results { padding: 10px 12px; color: var(--docs-text-muted); font-size: 14px; }
.docs-topbar-menu ul { list-style: none; display: flex; gap: 16px; margin: 0; padding: 0; }

/* Shell layout */
.docs-shell {
	display: flex;
	max-width: 1400px;
	margin: 0 auto;
}

/* Sidebar */
.docs-sidebar {
	width: var(--docs-sidebar-w);
	flex-shrink: 0;
	position: sticky;
	top: var(--docs-topbar-h);
	height: calc(100vh - var(--docs-topbar-h));
	overflow-y: auto;
	padding: 24px 12px;
	border-right: 1px solid var(--docs-border);
}
.docs-nav-list {
	list-style: none;
	margin: 0;
	padding-left: 0;
	border-left: 1px solid var(--docs-border);
	margin-left: 11px;
}
.docs-nav-root { border-left: none; margin-left: 0; }
.docs-nav-root > .docs-nav-item.docs-nav-section { margin-bottom: 2px; }

.docs-nav-row {
	display: flex;
	align-items: flex-start;
	gap: 2px;
	border-radius: 6px;
	position: relative;
}
.docs-nav-row:hover { background: var(--docs-bg-alt); }

.docs-nav-toggle,
.docs-nav-spacer {
	flex-shrink: 0;
	width: 20px;
	height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.docs-nav-toggle {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	color: var(--docs-text-muted);
}
.docs-nav-toggle span {
	display: inline-block;
	width: 0;
	height: 0;
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
	border-left: 5px solid currentColor;
	transition: transform .15s ease;
}
.docs-nav-item.is-open > .docs-nav-row > .docs-nav-toggle span { transform: rotate(90deg); }

.docs-nav-row > a {
	display: block;
	flex: 1;
	min-width: 0;
	padding: 6px 8px 6px 2px;
	color: var(--docs-text);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.4;
	white-space: normal;
	overflow-wrap: break-word;
}
.docs-nav-row > a:hover { text-decoration: none; }

/* Top-level items (Parts, glossary categories, Home) read as section labels */
.docs-nav-section > .docs-nav-row > a {
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: var(--docs-text-muted);
}
.docs-nav-section.is-current > .docs-nav-row > a,
.docs-nav-section:hover > .docs-nav-row > a { color: var(--docs-text); }

/* Current page: accent left rule + bold, like a typical docs "active" state */
.docs-nav-item.is-current > .docs-nav-row {
	background: var(--docs-bg-alt);
}
.docs-nav-item.is-current > .docs-nav-row::before {
	content: "";
	position: absolute;
	left: -1px;
	top: 4px;
	bottom: 4px;
	width: 2px;
	background: var(--docs-accent);
}
.docs-nav-item:not(.docs-nav-section).is-current > .docs-nav-row > a {
	color: var(--docs-accent);
	font-weight: 500;
}

.docs-nav-item > .docs-nav-list { display: none; }
.docs-nav-item.is-open > .docs-nav-list { display: block; }

/* Content area */
.docs-content-area { flex: 1; min-width: 0; }
.docs-main {
	display: flex;
	gap: 32px;
	padding: 32px 24px;
	align-items: flex-start;
}
.docs-article { flex: 1; max-width: var(--docs-max-width); min-width: 0; }

.docs-shell.no-sidebar .docs-main { justify-content: center; }
.docs-shell.no-sidebar .docs-article { max-width: 720px; margin: 0 auto; }

.docs-breadcrumbs { font-size: 13px; color: var(--docs-text-muted); margin-bottom: 12px; }
.docs-breadcrumbs .sep { margin: 0 4px; }
.docs-breadcrumbs .current { color: var(--docs-text); }

.docs-article-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	flex-wrap: wrap;
}
.docs-title { font-size: 32px; margin: 0 0 8px; }

.docs-description-box {
	font-size: 17px;
	line-height: 1.6;
	color: var(--docs-text);
	background: #f0f6ff;
	border-radius: 6px;
	padding: 14px 18px;
	margin-bottom: 20px;
}

.docs-strip {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	background: #f3f4f6;
	border: 1px solid #ececec;
	border-radius: 6px;
	padding: 6px 10px;
	margin-bottom: 24px;
}
.docs-actions { display: flex; gap: 6px; flex-shrink: 0; }
.docs-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	padding: 3px 8px;
	border: 1px solid #e2e2e2;
	background: transparent;
	color: var(--docs-text-muted);
	border-radius: 4px;
	cursor: pointer;
	font-weight: 400;
}
.docs-btn i { font-size: 11px; }
.docs-btn:hover { background: #eaeaea; color: var(--docs-text); }
.docs-btn.is-success { border-color: #16a34a; color: #16a34a; }

.docs-meta {
	display: flex;
	gap: 12px;
	font-size: 11px;
	color: #9ca3af;
	flex-wrap: wrap;
}

.docs-content { font-size: 16px; }
.docs-content h2, .docs-content h3, .docs-content h4 { scroll-margin-top: 80px; position: relative; }
.docs-content h2 .heading-anchor, .docs-content h3 .heading-anchor { opacity: 0; margin-left: 6px; font-size: 0.85em; }
.docs-content h2:hover .heading-anchor, .docs-content h3:hover .heading-anchor { opacity: 1; }
.docs-content pre {
	background: var(--docs-code-bg);
	padding: 16px;
	border-radius: 8px;
	overflow-x: auto;
	position: relative;
}
.docs-content code {
	background: var(--docs-code-bg);
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 0.9em;
}
.docs-content pre code { background: none; padding: 0; }
.docs-copy-code {
	position: absolute;
	top: 8px;
	right: 8px;
	font-size: 12px;
	padding: 4px 8px;
	border: 1px solid var(--docs-border);
	background: var(--docs-bg);
	border-radius: 4px;
	cursor: pointer;
}
.docs-content table { border-collapse: collapse; width: 100%; }
.docs-content th, .docs-content td { border: 1px solid var(--docs-border); padding: 8px 12px; text-align: left; }
.docs-content img { max-width: 100%; height: auto; border-radius: 6px; }
.docs-content iframe {
	max-width: 100%;
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
	border-radius: 6px;
	border: none;
}

/* Prev/Next */
.docs-prev-next {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin-top: 48px;
	padding-top: 24px;
	border-top: 1px solid var(--docs-border);
}
.docs-prev-next a {
	display: flex;
	flex-direction: column;
	max-width: 48%;
	padding: 12px 16px;
	border: 1px solid var(--docs-border);
	border-radius: 8px;
	color: var(--docs-text);
}
.docs-prev-next a:hover { background: var(--docs-bg-alt); text-decoration: none; }
.docs-prev-next .label { font-size: 12px; color: var(--docs-text-muted); }
.docs-prev-next .title { font-weight: 600; font-size: 14px; }
.docs-next { margin-left: auto; text-align: right; align-items: flex-end; }

/* TOC */
.docs-toc {
	width: var(--docs-toc-w);
	flex-shrink: 0;
	position: sticky;
	top: calc(var(--docs-topbar-h) + 32px);
	align-self: flex-start;
}
.docs-toc-title { font-size: 12px; text-transform: uppercase; color: var(--docs-text-muted); font-weight: 600; margin: 0 0 8px; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--docs-border); }
.docs-toc li { margin: 0; }
.docs-toc a {
	display: block;
	padding: 4px 12px;
	font-size: 13px;
	color: var(--docs-text-muted);
	border-left: 2px solid transparent;
	margin-left: -1px;
}
.docs-toc a:hover { color: var(--docs-text); text-decoration: none; }
.docs-toc a.is-active { color: var(--docs-accent); border-left-color: var(--docs-accent); }
.docs-toc .toc-h3 { padding-left: 24px; }

/* Blog post */
.blog-post-meta {
	display: flex;
	align-items: center;
	gap: 16px;
	font-size: 13px;
	color: var(--docs-text-muted);
	margin-bottom: 8px;
}
.blog-author { display: flex; align-items: center; gap: 8px; }
.blog-author img { border-radius: 50%; }
.blog-categories a { color: var(--docs-accent); }
.blog-featured-image { margin: 20px 0; }
.blog-featured-image img { width: 100%; border-radius: 10px; }
.blog-post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.blog-tag {
	font-size: 12px;
	padding: 4px 10px;
	border: 1px solid var(--docs-border);
	border-radius: 999px;
	color: var(--docs-text-muted);
}
.blog-tag:hover { background: var(--docs-bg-alt); text-decoration: none; }
.blog-comments { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--docs-border); }

.docs-footer {
	text-align: center;
	padding: 24px;
	font-size: 13px;
	color: var(--docs-text-muted);
	border-top: 1px solid var(--docs-border);
}

/* Responsive */
@media (max-width: 1100px) {
	.docs-toc { display: none; }
}
@media (max-width: 860px) {
	.docs-sidebar-toggle { display: flex; }
	.docs-sidebar {
		position: fixed;
		left: 0;
		top: var(--docs-topbar-h);
		height: calc(100vh - var(--docs-topbar-h));
		background: var(--docs-bg);
		z-index: 40;
		transform: translateX(-100%);
		transition: transform .2s ease;
		box-shadow: 2px 0 12px rgba(0,0,0,.08);
	}
	.docs-sidebar.is-open { transform: translateX(0); }
	.docs-main { flex-direction: column; padding: 20px 16px; }
	.docs-topbar-menu { display: none; }
}
