:root {
	color-scheme: light dark;
	--bg: #fff;
	--fg: #1a1a1a;
	--link: #2563eb;
	--muted: #555;
	--border: #ccc;
	--code-bg: #f4f4f4;
	--surface: #f9fafb;
	--accent-bg: #f0f9ff;
	--accent-border: #2563eb;
	--btn-bg: #2563eb;
	--btn-fg: #fff;
	--btn-hover: #1d4ed8;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #141414;
		--fg: #e8e8e8;
		--link: #7cb3ff;
		--muted: #9a9a9a;
		--border: #3a3a3a;
		--code-bg: #222;
		--surface: #1c1c1c;
		--accent-bg: #1a2332;
		--accent-border: #7cb3ff;
		--btn-bg: #3b82f6;
		--btn-fg: #fff;
		--btn-hover: #2563eb;
	}
}

body {
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	max-width: 40rem;
	margin: 3rem auto;
	padding: 0 1rem;
	line-height: 1.6;
	background: var(--bg);
	color: var(--fg);
}

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

a:hover {
	text-decoration: underline;
}

hr {
	border: none;
	border-top: 1px solid var(--border);
}

small {
	color: var(--muted);
}

/* Archiver run section (landing page, fed by /runs/status via app.js) */
.run-phase {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 0;
}

.run-meta {
	font-size: 0.85rem;
	color: var(--muted);
}

.run-stats {
	display: flex;
	gap: 0.75rem;
	margin: 1rem 0;
}

.run-stat {
	flex: 1;
	background: var(--surface);
	border-radius: 6px;
	padding: 0.9rem 0.5rem;
	text-align: center;
}

.run-stat .v {
	font-family: ui-monospace, monospace;
	font-size: 1.7rem;
	font-weight: 700;
	line-height: 1.2;
}

.run-stat .l {
	font-size: 0.7rem;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--muted);
}

.run-stat.bad .v {
	color: #b3174b;
}

.run-badge {
	display: inline-block;
	padding: 0.15rem 0.5rem;
	border-radius: 4px;
	font-size: 0.8rem;
	font-weight: 600;
	vertical-align: 0.15em;
}

.run-badge.running {
	background: #e3f6ee;
	color: #00704f;
}

.run-badge.idle {
	background: var(--code-bg);
	color: var(--muted);
}

.run-badge.error {
	background: #fde8ef;
	color: #b3174b;
}

.run-lastline {
	font-family: ui-monospace, monospace;
	font-size: 0.85rem;
	color: var(--muted);
	background: var(--surface);
	border-radius: 6px;
	padding: 0.75rem 1rem;
	white-space: pre-wrap;
	word-break: break-word;
	min-height: 1.4em;
}
