:root {
	color-scheme: light dark;
	--bg: light-dark(#fafafa, #0d0d0d);
	--surface: light-dark(#ffffff, #141414);
	--fg: light-dark(#111111, #f0f0f0);
	--muted: light-dark(#555555, #999999);
	--border: light-dark(#cccccc, #2e2e2e);
	--accent: light-dark(#000000, #ffffff);
	--positive: light-dark(#0a7c38, #2ecc71);
	--negative: light-dark(#b91c1c, #ff5555);
	--font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

* {
	box-sizing: border-box;
}

html {
	height: 100%;
}

body {
	margin: 0;
	padding: 1rem;
	min-height: 100%;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font-mono);
	font-size: 14px;
	line-height: 1.5;
	max-width: 960px;
	margin-inline: auto;
	overflow-wrap: anywhere;
	word-break: break-word;
}

body.home-route .site-header {
	display: none;
}

body.home-route #app-root {
	display: flex;
	flex-direction: column;
	flex: 1;
	width: 100%;
}

x-home {
	display: flex;
	flex-direction: column;
	margin: auto;
	align-items: center;
	text-align: center;
	width: 100%;
}

x-home h1 {
	margin: 0 0 0.5rem 0;
	font-size: 1.75rem;
	letter-spacing: -0.02em;
}

x-home h2 {
	margin: 0 0 1rem 0;
	font-size: 1.05rem;
	font-weight: normal;
}

x-home #mcp-url {
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	border: 1px solid var(--border);
	background: var(--surface);
	display: inline-block;
	max-width: 100%;
}

x-home p {
	margin: 0.25rem 0 0 0;
}

a {
	color: var(--fg);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.site-header {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.75rem;
	border-bottom: 1px solid var(--border);
	padding-bottom: 1rem;
	margin-bottom: 1.5rem;
}

.brand a {
	text-decoration: none;
}

.brand h1 {
	margin: 0;
	font-size: 1.15rem;
	letter-spacing: -0.02em;
}

x-nav nav {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
}

.narrow-panel {
	max-width: 26rem;
	width: 100%;
	margin: 2rem auto;
}

.panel {
	background: var(--surface);
	border: 1px solid var(--border);
	padding: 1rem;
	margin-bottom: 1rem;
}

.panel h2,
.panel h3 {
	margin-top: 0;
	margin-bottom: 0.75rem;
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin-bottom: 0.85rem;
}

label {
	font-size: 0.8rem;
	color: var(--muted);
	text-transform: uppercase;
}

input,
select,
textarea {
	font-family: var(--font-mono);
	font-size: 16px;
	padding: 0.5rem 0.65rem;
	background: var(--bg);
	color: var(--fg);
	border: 1px solid var(--border);
	border-radius: 0;
	width: 100%;
	max-width: 100%;
}

button {
	font-family: var(--font-mono);
	font-size: 0.9rem;
	padding: 0.5rem 0.65rem;
	background: var(--fg);
	color: var(--bg);
	border: 1px solid var(--fg);
	border-radius: 0;
	cursor: pointer;
	font-weight: 600;
}

button.secondary {
	background: transparent;
	color: var(--fg);
	border-color: var(--border);
}

button.danger {
	background: transparent;
	color: var(--negative);
	border-color: var(--negative);
}

.row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.section-header {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.section-header h2 {
	margin: 0;
}

.divider {
	border: 0;
	border-top: 1px solid var(--border);
	margin: 1rem 0;
}

#mfa-form {
	margin-top: 1rem;
}

.input-short {
	width: 6rem;
}

.input-code {
	width: 9rem;
}

.flex-1 {
	flex: 1 1 10rem;
}

.badge {
	display: inline-block;
	padding: 0.1rem 0.4rem;
	border: 1px solid var(--border);
	font-size: 0.75rem;
	color: var(--muted);
}

.score-pos {
	color: var(--positive);
	font-weight: 600;
}

.score-neg {
	color: var(--negative);
	font-weight: 600;
}

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

.error-msg {
	color: var(--negative);
	border: 1px solid var(--negative);
	padding: 0.5rem 0.75rem;
	margin-bottom: 0.75rem;
}

.ok-msg {
	color: var(--positive);
	border: 1px solid var(--positive);
	padding: 0.5rem 0.75rem;
	margin-bottom: 0.75rem;
}

table,
tbody,
tr,
td {
	display: block;
	width: 100%;
}

table {
	border-collapse: collapse;
	font-size: 0.85rem;
}

thead {
	display: none;
}

tr {
	border-bottom: 1px solid var(--border);
	padding: 0.65rem 0;
}

tr:first-child {
	border-top: 1px solid var(--border);
}

td {
	padding: 0.2rem 0;
	text-align: left;
	vertical-align: top;
	overflow-wrap: anywhere;
	word-break: break-word;
}

td[data-label]::before {
	content: attr(data-label) ": ";
	color: var(--muted);
	text-transform: uppercase;
	font-size: 0.75rem;
	font-weight: 600;
}

td.row {
	display: flex;
	padding-top: 0.35rem;
}

td.row::before {
	display: none;
}

th {
	color: var(--muted);
	text-transform: uppercase;
	font-size: 0.75rem;
	text-align: left;
	padding: 0.5rem;
	border-bottom: 1px solid var(--border);
}

pre,
code {
	font-family: var(--font-mono);
	background: var(--bg);
	overflow-wrap: anywhere;
	word-break: break-word;
}

pre {
	padding: 0.75rem;
	border: 1px solid var(--border);
	overflow-x: auto;
}

@media (min-width: 640px) {
	body {
		padding: 2rem;
	}
	table {
		display: table;
	}
	thead {
		display: table-header-group;
	}
	tbody {
		display: table-row-group;
	}
	tr {
		display: table-row;
		border-bottom: none;
		padding: 0;
	}
	tr:first-child {
		border-top: none;
	}
	td {
		display: table-cell;
		width: auto;
		padding: 0.5rem;
		border-bottom: 1px solid var(--border);
	}
	td[data-label]::before {
		content: none;
	}
	td.row {
		display: table-cell;
		padding: 0.5rem;
	}
	td.row > button {
		margin-right: 0.35rem;
		margin-bottom: 0.25rem;
	}
}
