:root {
	--wiki-canvas: #f6f8fa;
	--wiki-surface: #ffffff;
	--wiki-border: #d0d7de;
	--wiki-text: #1f2328;
	--wiki-muted: #59636e;
	--wiki-link: #0969da;
	--wiki-link-hover: #0550ae;
	--wiki-code-bg: #f6f8fa;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	min-height: 100%;
	background-color: var(--wiki-canvas);
	color: var(--wiki-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
	line-height: 1.55;
}

body {
	display: flex;
	flex-direction: column;
}

a {
	color: var(--wiki-link);
	text-decoration: none;
}

a:hover {
	color: var(--wiki-link-hover);
	text-decoration: underline;
}

.main-header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	background-color: var(--wiki-surface);
	border-bottom: 1px solid var(--wiki-border);
	position: sticky;
	top: 0;
	z-index: 10;
}

.title-text {
	margin-right: auto;
}

.main-header h2 {
	margin: 0;
	cursor: pointer;
	padding: 7px 10px;
	border-radius: 6px;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--wiki-muted);
	transition: background-color 120ms ease, color 120ms ease;
}

.main-header h2:hover {
	background-color: var(--wiki-canvas);
	color: var(--wiki-text);
}

.main-header .ascii-small {
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	display: block;
	padding: 7px 10px;
	border-radius: 6px;
	color: var(--wiki-text);
	transition: background-color 120ms ease;
}

.main-header .ascii-small:hover {
	background-color: var(--wiki-canvas);
	text-decoration: none;
}

.left-subsections {
	position: fixed;
	left: 0;
	top: 58px;
	height: calc(100vh - 58px);
	height: calc(100dvh - 58px);
	z-index: 9;
	width: 320px;
	border-right: 1px solid var(--wiki-border);
	background-color: var(--wiki-surface);
	overflow: hidden;
}

.left-subsections details {
	display: flex;
	flex-direction: column;
	height: auto;
	min-height: 100%;
}

.left-subsections details > :not(summary) {
	display: block;
}

.left-subsections summary {
	display: none;
}

.left-subsections summary::after {
	display: none;
}

.left-subsections summary::-webkit-details-marker {
	display: none;
}

.left-subsections-panel {
	display: block;
	flex: 0 0 auto;
	width: 100%;
	height: calc(100vh - 58px);
	height: calc(100dvh - 58px);
	max-height: calc(100vh - 58px);
	max-height: calc(100dvh - 58px);
	overflow-y: auto;
	overflow-x: hidden;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	background-color: var(--wiki-surface);
	padding: 12px 0 22px;
}

.left-subsections-panel .sidebar-tree,
.left-subsections-panel .sidebar-group-links {
	list-style: none;
	margin: 0;
	padding: 0;
}

.left-subsections-panel .sidebar-group,
.left-subsections-panel .sidebar-root-link {
	margin: 0;
}

.left-subsections-panel .sidebar-group {
	margin-top: 8px;
}

.left-subsections-panel .sidebar-group-title {
	display: block;
	padding: 10px 20px 6px;
	border-left: 4px solid transparent;
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wiki-muted);
	text-decoration: none;
	transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.left-subsections-panel .sidebar-group-title:hover,
.left-subsections-panel .sidebar-group-title:focus-visible,
.left-subsections-panel .sidebar-group-title.is-section-active {
	background-color: var(--wiki-canvas);
	color: var(--wiki-link);
	border-left-color: var(--wiki-link);
	text-decoration: none;
	outline: none;
}

.left-subsections-panel .sidebar-group-link {
	padding: 6px 20px 6px 34px;
	font-size: 0.92rem;
}

.left-subsections-panel a {
	display: block;
	padding: 8px 20px;
	margin: 0;
	border-left: 4px solid transparent;
	font-size: 0.96rem;
	font-weight: 500;
	line-height: 1.35;
	color: var(--wiki-text);
	text-decoration: none;
	transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.left-subsections-panel a:hover,
.left-subsections-panel a:focus-visible {
	background-color: var(--wiki-canvas);
	color: var(--wiki-link);
	border-left-color: var(--wiki-link);
	text-decoration: none;
	outline: none;
}

.left-subsections-panel a.is-active,
.left-subsections-panel a[aria-current="page"] {
	background-color: var(--wiki-canvas);
	color: var(--wiki-link);
	border-left-color: var(--wiki-link);
	font-weight: 600;
	text-decoration: none;
}

.left-subsections-panel .wiki-hub-link {
	display: block;
	padding: 12px 20px;
	margin: 0 0 12px 0;
	border-left: 4px solid transparent;
	font-size: 0.92rem;
	font-weight: 600;
	color: var(--wiki-link);
	background-color: #f0f8ff;
	border-bottom: 2px solid var(--wiki-border);
	transition: all 120ms ease;
}

.left-subsections-panel .wiki-hub-link:hover {
	background-color: var(--wiki-canvas);
	border-left-color: var(--wiki-link);
	box-shadow: inset 0 -2px 0 var(--wiki-link);
}

.wiki-main {
	flex: 1;
	padding: 28px 18px 40px 18px;
}

.left-subsections + .wiki-main {
	padding-left: 338px;
}

.wiki-container {
	max-width: 1000px;
	margin: 0 auto;
	background-color: var(--wiki-surface);
	border: 1px solid var(--wiki-border);
	border-radius: 8px;
	padding: 30px;
}

h1,
h2,
h3 {
	margin: 0 0 12px;
	line-height: 1.25;
	font-weight: 600;
	color: var(--wiki-text);
}

h1 {
	font-size: 2rem;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--wiki-border);
	margin-bottom: 14px;
}

h2 {
	font-size: 1.4rem;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--wiki-border);
}

h3 {
	font-size: 1.05rem;
}

p,
li,
th,
td {
	font-size: 1rem;
}

.subtitle {
	color: var(--wiki-muted);
	margin: -2px 0 22px;
}

.wiki-card,
.wiki-section,
.wiki-infobox {
	background-color: var(--wiki-surface);
	border: 1px solid var(--wiki-border);
	border-radius: 6px;
	padding: 18px;
	margin-bottom: 18px;
}

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

.page-list li {
	border-bottom: 1px solid var(--wiki-border);
	padding: 12px 0;
}

.page-list li:last-child {
	border-bottom: none;
}

.page-description {
	margin: 6px 0 0;
	color: var(--wiki-muted);
}

.breadcrumb {
	margin: 0 0 16px;
	font-size: 0.92rem;
	color: var(--wiki-muted);
}

.wiki-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 280px;
	gap: 20px;
	align-items: start;
}

.wiki-article {
	min-width: 0;
}

.wiki-infobox {
	position: sticky;
	top: 78px;
}

.wiki-infobox h3 {
	margin-bottom: 10px;
	font-size: 1rem;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--wiki-border);
}

.wiki-infobox table {
	width: 100%;
	border-collapse: collapse;
}

.wiki-infobox th,
.wiki-infobox td {
	text-align: left;
	vertical-align: top;
	padding: 8px 0;
	border-bottom: 1px solid var(--wiki-border);
}

.wiki-infobox th {
	width: 44%;
	font-weight: 600;
	color: var(--wiki-muted);
}

.wiki-infobox tr:last-child th,
.wiki-infobox tr:last-child td {
	border-bottom: none;
}

.wiki-section ul,
.wiki-section ol {
	margin: 0;
	padding-left: 22px;
}

.wiki-section li {
	margin: 6px 0;
}

.code-block {
	background-color: var(--wiki-code-bg);
	border: 1px solid var(--wiki-border);
	border-radius: 6px;
	padding: 12px 14px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	font-size: 0.88rem;
	line-height: 1.45;
	white-space: pre;
	overflow-x: auto;
}

.footer {
	text-align: center;
	padding: 12px 10px;
	background-color: var(--wiki-surface);
	border-top: 1px solid var(--wiki-border);
	color: var(--wiki-muted);
	font-size: 0.85rem;
}

@media (max-width: 900px) {
	.main-header {
		flex-wrap: wrap;
		justify-content: flex-start;
		gap: 6px;
	}

	.title-text {
		width: 100%;
		margin-right: 0;
	}

	.wiki-main {
		padding: 16px;
	}

	.left-subsections {
		position: static;
		top: auto;
		bottom: auto;
		height: auto;
		width: 100%;
		border-right: none;
		border-bottom: 1px solid var(--wiki-border);
		overflow: visible;
	}

	.left-subsections details {
		height: auto;
	}

	.left-subsections summary {
		padding: 12px 16px 10px;
	}

	.left-subsections-panel {
		width: 100%;
		height: auto;
		min-height: 0;
		max-height: none;
		padding: 6px 0 14px;
		overflow: visible;
	}

	.left-subsections-panel a {
		padding: 8px 16px;
		border-left-width: 3px;
	}

	.left-subsections-panel .sidebar-group-title {
		padding: 10px 16px 6px;
		border-left-width: 3px;
	}

	.left-subsections-panel .sidebar-group-link {
		padding: 6px 16px 6px 28px;
	}

	.wiki-container {
		padding: 18px;
	}

	.wiki-layout {
		grid-template-columns: 1fr;
	}

	.wiki-infobox {
		position: static;
	}
}
