:root {
	--bg: #fff;
	--surface: #f0f0f0;
	--text: #676767;
	--heading: #444;
	--muted: #57606a;
	--link: #3555ff;
	--field: #f1f1f1;
	--field-text: #555;
	--button: #3555ff;
	--button-hover: #2440d6;
	--border: #e6e6e6;
	--error: #b00;
	--diff-add: #e6ffec;
	--diff-remove: #ffebe9;
	color-scheme: light dark;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.6;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #1c1c1c;
		--surface: #2a2a2a;
		--text: #c8c8c8;
		--heading: #eee;
		--muted: #9aa3ad;
		--link: #8c9dff;
		--field: #2e2e2e;
		--field-text: #ddd;
		--button: #4a63ff;
		--button-hover: #6b80ff;
		--border: #3a3a3a;
		--error: #f66;
		--diff-add: #1f3a28;
		--diff-remove: #4a2125;
	}
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	max-width: 60rem;
	margin: 0 auto;
	padding: 1.5rem 1rem;
	background: var(--bg);
	color: var(--text);
	overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	color: var(--heading);
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 0.5rem;
}

h1 {
	font-size: 2.25rem;
}

h2 {
	font-size: 1.75rem;
}

h3 {
	font-size: 1.375rem;
}

h4 {
	font-size: 1.125rem;
}

a {
	color: var(--link);
	text-decoration: none;
	transition: color 0.3s;
}

a:hover {
	color: inherit;
}

nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	list-style: none;
	padding: 0;
}

nav [aria-current="page"] {
	font-weight: 600;
}

img,
video {
	max-width: 100%;
	height: auto;
}

pre,
code {
	font-family: ui-monospace, "Andale Mono", Courier, monospace;
	font-size: 0.9375rem;
}

pre {
	background: var(--surface);
	padding: 1rem;
	overflow: auto;
}

blockquote {
	margin: 0 0 1rem;
	padding-left: 1rem;
	border-left: 4px solid var(--border);
}

form {
	margin-bottom: 1rem;
}

form > div,
fieldset {
	margin-bottom: 1rem;
}

label {
	display: block;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea {
	width: 100%;
	padding: 0.625rem;
	font: inherit;
	color: var(--field-text);
	background: var(--field);
	border: none;
}

input:focus,
textarea:focus {
	outline: 2px solid var(--link);
}

input + button {
	margin-top: 1rem;
}

button {
	padding: 0.9rem 1.375rem;
	font: inherit;
	font-weight: 600;
	color: #fff;
	background: var(--button);
	border: none;
	border-radius: 2px;
	cursor: pointer;
	transition: background-color 0.45s;
}

button:hover {
	background: var(--button-hover);
}

table {
	border-collapse: collapse;
	width: 100%;
}

th,
td {
	text-align: left;
	padding: 0.25rem 0.5rem;
	border-bottom: 1px solid var(--border);
}

[role="alert"] {
	border: 1px solid var(--error);
	padding: 0.5rem 1rem;
}

@media (max-width: 690px) {
	body {
		padding: 1rem;
	}

	h1 {
		font-size: 1.75rem;
	}

	h2 {
		font-size: 1.375rem;
	}

	main button {
		width: 100%;
	}

	table {
		display: block;
		overflow-x: auto;
	}
}

.changelog-entry {
	border-bottom: 1px solid var(--border);
	padding: 0.5rem 0;
}

.changelog-entry summary {
	cursor: pointer;
}

.diff {
	font-family: ui-monospace, monospace;
	overflow-x: auto;
	padding: 0.5rem;
	border: 1px solid var(--border);
}

.diff span {
	display: block;
	white-space: pre;
}

.diff-add {
	background: var(--diff-add);
}

.diff-remove {
	background: var(--diff-remove);
}

.diff-hunk,
.diff-note {
	color: var(--muted);
}

.letter-meta ul {
	list-style: none;
	padding: 0;
}

a.button {
	display: inline-block;
	padding: 0.9rem 1.375rem;
	font-weight: 600;
	color: #fff;
	background: var(--button);
	border-radius: 2px;
	transition: background-color 0.45s;
}

a.button:hover {
	color: #fff;
	background: var(--button-hover);
}

.page-footer {
	position: sticky;
	bottom: 0;
	padding: 1rem 0;
	background: var(--bg);
	border-top: 1px solid var(--border);
}

.page-footer p {
	margin: 0.5rem 0 0;
	color: var(--muted);
	font-size: 0.875rem;
}

.sign-options {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: 1rem;
	margin-bottom: 1rem;
}

.sign-option {
	padding: 1rem;
	border: 1px solid var(--border);
	border-radius: 2px;
	background: var(--surface);
}

.sign-option summary {
	cursor: pointer;
}

.sign-option summary span {
	color: var(--muted);
}

.sign-instructions {
	white-space: pre-line;
}

.trace-note {
	margin: 0.5rem 0 0;
	color: var(--muted);
	font-size: 0.875rem;
}

tr.erased {
	color: var(--muted);
}

.hp {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
