:root {
	--bg: #ffffff;
	--fg: #24292f;
	--muted: #57606a;
	--accent: #0a5fa8;
	--border: #d0d7de;
	--code-bg: #f6f8fa;
	--warn-border: #4b8b3b;
	--warn-bg: #f4f9f0;
	--warn-label-bg: #dcedd3;
	--warn-label-fg: #2c5e22;
	--caution-border: #a83232;
	--caution-bg: #fbf2f2;
	--caution-label-bg: #f3d9d9;
	--caution-label-fg: #7d1f1f;
	--t-str: #1a7f37;
	--t-num: #953800;
	--t-bool: #8250df;
	--t-tbl: #9a6700;
	--t-func: #bf3989;
	--t-file: #0969da;
	--t-dir: #0a5fa8;
	--t-err: #cf222e;
	--t-arg: #4b8b3b;
	--t-multi: #b35900;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #14171a;
		--fg: #d4dae0;
		--muted: #8b949e;
		--accent: #58a6ff;
		--border: #30363d;
		--code-bg: #1d2126;
		--warn-border: #3f6f33;
		--warn-bg: #182117;
		--warn-label-bg: #2c4726;
		--warn-label-fg: #a4d99a;
		--caution-border: #8a3b3b;
		--caution-bg: #241717;
		--caution-label-bg: #4a2525;
		--caution-label-fg: #f0a8a8;
		--t-str: #7ee2a8;
		--t-num: #ffa657;
		--t-bool: #d2a8ff;
		--t-tbl: #e3b341;
		--t-func: #ff9bce;
		--t-file: #79c0ff;
		--t-dir: #58a6ff;
		--t-err: #ff7b72;
		--t-arg: #9ad89a;
		--t-multi: #f0883e;
	}
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: system-ui, sans-serif;
	line-height: 1.5;
}

header {
	border-bottom: 1px solid var(--border);
	padding: 0.6em 1em;
}

header nav a { font-weight: 600; }

main {
	max-width: 60em;
	margin: 0 auto;
	padding: 1em;
}

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

h1, h2, h3 { line-height: 1.25; }

table {
	border-collapse: collapse;
	width: 100%;
}
th, td {
	text-align: left;
	padding: 0.3em 0.75em 0.3em 0;
	border-bottom: 1px solid var(--border);
}
th { color: var(--muted); font-weight: 600; }
table.listing td.kind {
	font-family: monospace;
	color: var(--muted);
	width: 1.5em;
}
table.listing td.name { font-family: monospace; }
table.listing td .gitlink { color: var(--muted); }
table.repos .private {
	font-family: monospace;
	font-size: 0.85em;
	color: var(--muted);
	border: 1px solid var(--border);
	border-radius: 4px;
	padding: 0 0.3em;
}

code, pre {
	font-family: monospace;
	background: var(--code-bg);
	border-radius: 4px;
}
code { padding: 0.1em 0.3em; }
pre {
	padding: 0.75em 1em;
	overflow-x: auto;
}
pre code { padding: 0; background: none; }

img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 1rem auto;
}
img.small { max-width: 16rem; }
img.medium { max-width: 28rem; }

blockquote {
	margin: 0;
	padding-left: 1em;
	border-left: 3px solid var(--border);
	color: var(--muted);
}

.readme {
	margin-top: 2em;
	border-top: 1px solid var(--border);
}

.meta { color: var(--muted); }
.raw-link {
	float: right;
	margin-right: 0.8em;
	padding: 0.2em 0;
}

table.listing td.size, table.refs td.meta {
	text-align: right;
	font-family: monospace;
	color: var(--muted);
	white-space: nowrap;
	width: 6em;
}

details.switcher {
	float: right;
	position: relative;
}
details.switcher summary {
	cursor: pointer;
	font-family: monospace;
	color: var(--accent);
	padding: 0.2em 0.6em;
	border: 1px solid var(--border);
	border-radius: 4px;
	list-style-position: inside;
}
details.switcher ul {
	position: absolute;
	right: 0;
	z-index: 1;
	margin: 0.2em 0 0;
	padding: 0.3em 0;
	list-style: none;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 4px;
	max-height: 20em;
	overflow-y: auto;
	min-width: 12em;
}
details.switcher li {
	padding: 0.1em 0.8em;
	font-family: monospace;
	white-space: nowrap;
}
details.switcher li.group {
	color: var(--muted);
	font-family: system-ui, sans-serif;
	font-size: 0.85em;
	border-top: 1px solid var(--border);
	padding-top: 0.3em;
	margin-top: 0.3em;
}
details.switcher li.group:first-child {
	border-top: none;
	margin-top: 0;
}
details.switcher li.current a { font-weight: 700; }

a.log-link {
	float: right;
	margin-right: 0.8em;
	padding: 0.2em 0.6em;
	border: 1px solid var(--border);
	border-radius: 4px;
	font-family: monospace;
}

table.log td.sha { width: 6em; }
table.log td.sha code { background: none; }
table.log td.date, table.log td.meta {
	color: var(--muted);
	white-space: nowrap;
}
table.log td.date { font-family: monospace; }
p.pager { text-align: right; }

table.commit-meta th {
	color: var(--muted);
	font-weight: 600;
	width: 7em;
}
table.commit-meta code { background: none; }
pre.commit-msg { margin: 1em 0; }
table.commit-files td.status {
	font-family: monospace;
	font-weight: 700;
	width: 1.5em;
}
table.commit-files td.status.added { color: var(--t-arg); }
table.commit-files td.status.deleted { color: var(--t-err); }
table.commit-files td.status.modified { color: var(--t-tbl); }
table.commit-files td.name { font-family: monospace; }

/* Markdown extensions: fenced divs (::: name) and inline type
   classes (`x`{.str}) emitted by the bundled renderer. Type classes
   are scoped to code elements so they never collide with the UI's
   own .meta/.size helpers. */

div.warning, div.caution {
	position: relative;
	border: 1px solid var(--warn-border);
	border-radius: 6px;
	background: var(--warn-bg);
	padding: 1.2em 1em 0.4em;
	margin: 1.6em 0 1.2em;
}
div.caution {
	border-color: var(--caution-border);
	background: var(--caution-bg);
}
div.warning::before, div.caution::before {
	content: "Nota Bene";
	position: absolute;
	top: -0.8em;
	left: 0.8em;
	background: var(--warn-label-bg);
	color: var(--warn-label-fg);
	border: 1px solid var(--warn-border);
	border-radius: 4px;
	padding: 0.05em 0.5em;
	font-size: 0.8em;
	font-weight: 600;
}
div.caution::before {
	content: "Caveat Emptor";
	background: var(--caution-label-bg);
	color: var(--caution-label-fg);
	border-color: var(--caution-border);
}
div.warning code, div.caution code { background: var(--bg); }

div.function {
	border-left: 3px solid var(--border);
	border-radius: 0 4px 4px 0;
	padding: 0.5em 1em;
	margin: 0 0 1.2em;
}
div.function blockquote {
	font-family: monospace;
	border-left: none;
	margin: 0 0 0.7em;
	padding: 0.3em 0.6em;
	background: var(--code-bg);
	border-radius: 4px;
	color: var(--fg);
}

code.str, code.num, code.bool, code.tbl, code.fn, code.func,
code.file, code.dir, code.nil, code.err, code.arg, code.flag,
code.meta, code.neg, code.multi, code.status {
	font-weight: 600;
}
code.str { color: var(--t-str); }
code.num { color: var(--t-num); }
code.bool, code.flag { color: var(--t-bool); }
code.tbl { color: var(--t-tbl); }
code.fn, code.func { color: var(--t-func); }
code.file { color: var(--t-file); }
code.dir { color: var(--t-dir); }
code.nil, code.meta { color: var(--muted); }
code.err, code.neg { color: var(--t-err); }
code.arg, code.status { color: var(--t-arg); }
code.multi { color: var(--t-multi); }
code.req { border: 1px solid var(--border); }
code.def {
	color: var(--muted);
	font-size: 0.9em;
}

code.tbl::before, code.tbl::after,
code.fn::before, code.fn::after,
code.func::before, code.func::after,
code.or_nil::after, code.opt::after {
	font-size: 0.85em;
	opacity: 0.65;
	padding: 0 0.05em;
}
code.tbl::before { content: "{"; }
code.tbl::after { content: "}"; }
code.fn::before, code.func::before { content: "ƒ("; }
code.fn::after, code.func::after { content: ")"; }
code.or_nil::after, code.opt::after { content: "?"; }
code.tbl.or_nil::after, code.tbl.opt::after { content: "}?"; }
code.fn.or_nil::after, code.fn.opt::after,
code.func.or_nil::after, code.func.opt::after { content: ")?"; }

ul:has(li.task-item) {
	list-style: none;
	padding-left: 0.5em;
}
li.task-item {
	display: flex;
	align-items: baseline;
	gap: 0.5em;
}
li.task-item p { margin: 0; }
