/* Reader 3-column layout */
.docs-layout {
	display: grid;
	grid-template-columns: var(--docs-sidebar-width) minmax(0, 1fr) var(--docs-toc-width);
	align-items: start;
	max-width: 100%;
}

.docs-sidebar {
	position: sticky;
	top: var(--docs-topbar-height);
	height: calc(100vh - var(--docs-topbar-height));
	overflow-y: auto;
	border-right: 1px solid var(--docs-border);
	background: var(--docs-bg);
	padding: 20px 16px 40px;
}

.docs-sidebar-inner {
	max-width: var(--docs-sidebar-width);
}

.docs-sidebar-header {
	margin-bottom: 16px;
}

.docs-sidebar-guide {
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--docs-text);
	display: block;
	margin-bottom: 6px;
}

.docs-sidebar-guide:hover {
	text-decoration: none;
	color: var(--docs-accent);
}

.docs-sidebar-desc {
	margin: 0 0 12px;
	color: var(--docs-muted);
	font-size: 0.85rem;
}

.docs-sidebar-progress {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 16px;
}

.docs-progress-label {
	font-size: 0.8rem;
	color: var(--docs-muted);
	white-space: nowrap;
}

.docs-nav-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.docs-nav-item {
	margin-bottom: 2px;
}

.docs-nav-item a {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: 7px 10px;
	border-radius: var(--docs-radius-sm);
	color: var(--docs-muted);
	font-size: 0.92rem;
}

.docs-nav-item a:hover {
	background: var(--docs-surface-2);
	color: var(--docs-text);
	text-decoration: none;
}

.docs-nav-item.is-current a {
	background: var(--docs-accent-soft);
	color: var(--docs-accent);
	font-weight: 600;
}

.docs-nav-num {
	font-size: 0.75rem;
	font-family: "SFMono-Regular", Consolas, Menlo, monospace;
	opacity: 0.7;
	min-width: 20px;
}

/* Main content */
.docs-main {
	min-width: 0;
	padding: 0 32px 48px;
}

.docs-article {
	max-width: var(--docs-content-width);
	margin: 0 auto;
	padding-top: 28px;
}

.docs-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-bottom: 16px;
	font-size: 0.85rem;
	color: var(--docs-muted);
}

.docs-breadcrumb a {
	color: var(--docs-muted);
}

.docs-breadcrumb-sep {
	color: var(--docs-border);
}

.docs-article-header {
	margin-bottom: 24px;
	border-bottom: 1px solid var(--docs-border);
	padding-bottom: 20px;
}

.docs-article-title {
	margin: 0 0 10px;
	font-size: 2.1rem;
	letter-spacing: -0.02em;
}

.docs-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	color: var(--docs-muted);
	font-size: 0.85rem;
}

/* Right TOC */
.docs-toc {
	position: sticky;
	top: var(--docs-topbar-height);
	height: calc(100vh - var(--docs-topbar-height));
	overflow-y: auto;
	padding: 28px 16px 40px;
	border-left: 1px solid var(--docs-border);
	font-size: 0.85rem;
}

.docs-toc-heading {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--docs-muted);
	margin: 0 0 12px;
}

.docs-toc-list,
.docs-toc-children {
	list-style: none;
	margin: 0;
	padding: 0;
}

.docs-toc-item a {
	display: block;
	padding: 4px 8px;
	border-left: 2px solid transparent;
	color: var(--docs-muted);
}

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

.docs-toc-item.is-active a {
	border-left-color: var(--docs-accent);
	color: var(--docs-accent);
}

.docs-toc-level-2 a {
	padding-left: 8px;
}

.docs-toc-children .docs-toc-item a {
	padding-left: 16px;
}

/* Prev / next */
.docs-prev-next {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	max-width: var(--docs-content-width);
	margin: 40px auto 0;
	padding-top: 24px;
	border-top: 1px solid var(--docs-border);
}

.docs-prev-next-link {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 16px;
	border: 1px solid var(--docs-border);
	border-radius: var(--docs-radius-md);
	background: var(--docs-surface);
	color: var(--docs-text);
}

.docs-prev-next-link:hover {
	border-color: var(--docs-accent);
	text-decoration: none;
}

.docs-next {
	text-align: right;
}

.docs-prev-next-label {
	font-size: 0.78rem;
	color: var(--docs-muted);
}

.docs-prev-next-title {
	font-weight: 600;
}

/* Guide landing (single guide) */
.docs-guide-landing {
	max-width: 900px;
	margin: 0 auto;
	padding: 40px 20px 80px;
}

.docs-guide-hero {
	text-align: center;
	padding: 24px 0 32px;
}

.docs-guide-cover {
	max-height: 260px;
	object-fit: cover;
	border-radius: var(--docs-radius-lg);
	margin-bottom: 20px;
}

.docs-guide-category {
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--docs-accent);
}

.docs-guide-title {
	margin: 8px 0;
	font-size: 2.4rem;
	letter-spacing: -0.02em;
}

.docs-guide-desc {
	color: var(--docs-muted);
	font-size: 1.1rem;
	max-width: 640px;
	margin: 0 auto 24px;
}

.docs-guide-progress {
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 320px;
	margin: 20px auto 0;
}

.docs-guide-progress .docs-progress-track {
	flex: 1;
	height: 8px;
	border-radius: 999px;
	background: var(--docs-surface-2);
	overflow: hidden;
}

.docs-guide-progress .docs-progress-fill {
	display: block;
	height: 100%;
	background: var(--docs-accent);
	border-radius: 999px;
	transition: width 0.3s ease;
}

.docs-guide-chapters {
	margin: 40px 0;
}

.docs-guide-chapter-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--docs-border);
}

.docs-guide-chapter a {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 12px;
	border-bottom: 1px solid var(--docs-border);
	color: var(--docs-text);
}

.docs-guide-chapter a:hover {
	background: var(--docs-surface);
	text-decoration: none;
}

.docs-guide-chapter-num {
	font-weight: 700;
	color: var(--docs-accent);
	min-width: 34px;
}

.docs-guide-chapter-file {
	margin-left: auto;
	color: var(--docs-muted);
	font-size: 0.8rem;
}

.docs-guide-body {
	max-width: 720px;
}

/* Mobile drawer */
.docs-drawer-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.5);
	z-index: 90;
}

.docs-drawer {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: min(320px, 86vw);
	background: var(--docs-bg);
	z-index: 95;
	overflow-y: auto;
	padding: 16px;
	transform: translateX(0);
	transition: transform 0.25s ease;
}

.docs-drawer[aria-hidden="true"] {
	transform: translateX(-100%);
}

.docs-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.docs-mobile-toc-toggle {
	display: none;
}

/* Completion */
.docs-complete-row {
	margin-top: 32px;
	padding-top: 20px;
	border-top: 1px solid var(--docs-border);
}

.docs-btn-complete.is-complete {
	background: var(--docs-success);
	border-color: var(--docs-success);
	color: #fff;
}

/* Footer */
.docs-footer {
	border-top: 1px solid var(--docs-border);
	padding: 24px 20px;
}

.docs-footer-inner {
	max-width: 1080px;
	margin: 0 auto;
	display: flex;
	justify-content: space-between;
	color: var(--docs-muted);
	font-size: 0.85rem;
}