:root {
	color: #172024;
	font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-width: 320px;
	background: linear-gradient(90deg, rgba(32, 40, 45, 0.05) 1px, transparent 1px), linear-gradient(180deg, rgba(32, 40, 45, 0.04) 1px, transparent 1px), #f6f7f5;
	background-size: 32px 32px, 32px 32px, auto;
	color: #172024;
}

a {
	color: inherit;
}

.public-shell,
.reader-shell {
	width: min(1180px, calc(100% - 40px));
	margin: 0 auto;
	padding: 28px 0 72px;
}

.public-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	min-height: 56px;
	border-bottom: 1px solid #d8dddc;
}

.public-brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
}

.public-brand span {
	display: inline-grid;
	width: 38px;
	height: 38px;
	place-items: center;
	background: #172024;
	color: #f6f7f5;
	font-weight: 850;
}

.public-links {
	display: inline-flex;
	align-items: center;
	gap: 18px;
	font-weight: 800;
}

.public-links a,
.back-link {
	color: #344247;
	text-decoration: none;
}

.docs-index-head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
	align-items: end;
	gap: 32px;
	padding: 64px 0 36px;
}

.eyebrow,
.export-meta {
	margin: 0;
	color: #667477;
	font-size: 0.78rem;
	font-weight: 850;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

h1,
h2,
p {
	margin-top: 0;
}

h1 {
	max-width: 12ch;
	margin-bottom: 16px;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 4.25rem;
	line-height: 0.94;
	letter-spacing: 0;
}

.docs-index-head p:not(.eyebrow),
.reader-header p {
	max-width: 680px;
	color: #4a575b;
	font-size: 1.05rem;
	line-height: 1.6;
}

.docs-search {
	display: grid;
	gap: 8px;
}

.docs-search label {
	font-size: 0.88rem;
	font-weight: 850;
}

.docs-search div {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 10px;
}

.docs-search input {
	min-height: 48px;
	border: 1px solid #aab4b5;
	border-radius: 6px;
	padding: 0 13px;
	background: #fff;
	color: #172024;
	font: inherit;
}

.ui-button {
	min-height: 48px;
	border: 0;
	border-radius: 6px;
	padding: 0 18px;
	background: #b9382d;
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-weight: 850;
}

.docs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 16px;
}

.public-doc-card {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr);
	gap: 16px;
	min-height: 170px;
	border: 1px solid #d8dddc;
	border-radius: 8px;
	padding: 18px;
	background: rgba(255, 255, 255, 0.92);
	text-decoration: none;
	box-shadow: 0 12px 32px rgba(23, 32, 36, 0.08);
}

.public-doc-card[hidden] {
	display: none;
}

.doc-card-icon {
	display: grid;
	width: 48px;
	height: 48px;
	place-items: center;
	background: #edf1ef;
	color: #172024;
	font-weight: 850;
}

.doc-card-title-row,
.reader-kicker,
.reader-meta,
.doc-card-meta,
.tag-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
}

.doc-card-title-row h2 {
	min-width: 0;
	margin-bottom: 0;
	font-size: 1.2rem;
	line-height: 1.25;
}

.doc-card-body p,
.doc-card-meta,
.reader-meta {
	color: #5b686b;
	line-height: 1.5;
}

.doc-card-meta {
	font-size: 0.86rem;
	font-weight: 750;
}

.warn-text {
	color: #8a5b00;
}

.badge {
	display: inline-flex;
	align-items: center;
	min-height: 26px;
	border: 1px solid rgba(23, 32, 36, 0.12);
	border-radius: 999px;
	padding: 4px 10px;
	background: #fff;
	color: #4a575b;
	font-size: 0.76rem;
	font-weight: 850;
	text-transform: uppercase;
	white-space: nowrap;
}

.badge.good {
	background: #eaf5ef;
	color: #216244;
}

.badge.warn {
	background: #fff7df;
	color: #7b5700;
}

.badge.danger {
	background: #fff0ee;
	color: #9b2d25;
}

.reader-back {
	display: inline-flex;
	margin: 28px 0 18px;
	font-weight: 850;
}

.reader-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 290px;
	gap: 28px;
}

.reader-article,
.reader-sidebar section,
.public-stale-banner,
.empty-library {
	border: 1px solid #d8dddc;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.94);
	box-shadow: 0 14px 40px rgba(23, 32, 36, 0.08);
}

.reader-article {
	padding: clamp(24px, 4vw, 52px);
}

.reader-header {
	border-bottom: 1px solid #d8dddc;
	padding-bottom: 28px;
	margin-bottom: 30px;
}

.public-stale-banner {
	margin-bottom: 26px;
	border-left: 5px solid #d99700;
	padding: 16px 18px;
	background: #fff9e8;
}

.public-stale-banner p {
	margin: 6px 0 0;
	color: #634500;
}

.reader-content {
	color: #253136;
	font-size: 1.02rem;
	line-height: 1.72;
}

.reader-content :where(h1, h2, h3) {
	max-width: none;
	margin: 1.65em 0 0.55em;
	font-family: Georgia, "Times New Roman", serif;
	line-height: 1.1;
}

.reader-content :where(p, li) {
	max-width: 78ch;
}

.reader-content a {
	color: #a33027;
	font-weight: 800;
}

.reader-content code,
.reader-content pre {
	border-radius: 6px;
	background: #eef2f0;
	font-family: Menlo, Consolas, monospace;
}

.reader-content code {
	padding: 2px 5px;
}

.reader-content pre {
	overflow: auto;
	padding: 14px;
}

.reader-sidebar {
	display: grid;
	align-content: start;
	gap: 16px;
}

.reader-sidebar section {
	padding: 18px;
}

.reader-sidebar h2 {
	margin-bottom: 12px;
	font-size: 0.88rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.source-list {
	display: grid;
	gap: 10px;
}

.source-list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	border: 1px solid #d8dddc;
	border-radius: 6px;
	padding: 10px 12px;
	background: #fff;
	color: #253136;
	font-weight: 750;
	text-decoration: none;
	word-break: break-word;
}

.tag-list span {
	border: 1px solid #d8dddc;
	border-radius: 999px;
	padding: 5px 9px;
	background: #f6f7f5;
	font-size: 0.82rem;
	font-weight: 800;
}

.empty-library {
	grid-column: 1 / -1;
	padding: 48px;
	text-align: center;
}

@media (max-width: 760px) {
	.public-shell,
	.reader-shell {
		width: min(100% - 28px, 1180px);
		padding-top: 16px;
	}

	.docs-index-head,
	.reader-layout {
		grid-template-columns: 1fr;
	}

	h1 {
		font-size: 3rem;
	}

	.docs-search div {
		grid-template-columns: 1fr;
	}
}
