:root {
	--bg: #f2f5fa;
	--surface: #ffffff;
	--surface-soft: #f7f9fc;
	--text: #0f172a;
	--muted: #475569;
	--line: #d8deea;
	--brand: #0b4bc4;
	--brand-strong: #083b9a;
	--green-bg: #d8f2db;
	--green-text: #0f6f44;
	--red-bg: #f7d7d7;
	--red-text: #8d2424;
	--radius-md: 12px;
	--radius-lg: 18px;
	--shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.08);
	--shadow-md: 0 14px 30px rgba(15, 23, 42, 0.08);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
	color: var(--text);
	background:
		radial-gradient(circle at 10% -20%, #dae9ff 0%, transparent 45%),
		radial-gradient(circle at 90% 0%, #e7f0ff 0%, transparent 38%),
		var(--bg);
}

.hero {
	padding: clamp(1.2rem, 4vw, 2.2rem) 1rem 0.9rem;
	text-align: center;
}

.hero h1 {
	margin: 0;
	font-size: clamp(1.45rem, 3.4vw, 2.25rem);
	line-height: 1.15;
}

.subtitle {
	margin: 0.5rem 0 0;
	color: var(--muted);
	font-size: clamp(0.95rem, 2vw, 1.05rem);
}

.container {
	width: min(900px, 100% - 1.1rem);
	margin: 0 auto 1.25rem;
	padding: 1rem;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-md);
}

.status {
	margin: 0;
	color: var(--muted);
	font-size: 0.96rem;
}

.admin-link-wrap {
	margin: 1rem 0 1.35rem;
}

.admin-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--brand);
	color: #ffffff;
	text-decoration: none;
	font-weight: 700;
	font-size: 0.93rem;
	border-radius: 10px;
	padding: 0.58rem 0.88rem;
	box-shadow: var(--shadow-sm);
	transition: background 0.2s ease;
}

.admin-button:hover {
	background: var(--brand-strong);
}

.admin-button:focus-visible {
	outline: 3px solid rgba(11, 75, 196, 0.35);
	outline-offset: 2px;
}

.date-header {
	margin: 1.35rem 0 0.8rem;
	color: var(--muted);
	font-size: 1rem;
	font-weight: 700;
}

.message {
	border: 1px solid var(--line);
	border-radius: var(--radius-md);
	padding: 0.9rem;
	margin-bottom: 0.85rem;
	background: var(--surface-soft);
	box-shadow: var(--shadow-sm);
}

.meta {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	flex-wrap: wrap;
	margin-bottom: 0.65rem;
	color: var(--muted);
	font-size: 0.9rem;
}

.from {
	font-weight: 700;
}

.name {
	font-weight: 700;
	color: var(--text);
}

pre,
.preGreen,
.preRed {
	white-space: pre-wrap;
	word-break: break-word;
	border-radius: 10px;
	padding: 0.9rem;
	margin: 0;
	color: var(--text);
	font-family: "Menlo", "SFMono-Regular", "Consolas", monospace;
	font-size: 0.92rem;
	line-height: 1.45;
}

pre {
	background: #edf2f8;
}

.preGreen {
	background: var(--green-bg);
	color: var(--green-text);
}

.preRed {
	background: var(--red-bg);
	color: var(--red-text);
}

.connection-error {
	margin: 0.8rem 0;
	padding: 0.75rem 0.9rem;
	border: 1px solid #f0b4b4;
	background: #fdecec;
	color: #8d2424;
	border-radius: 10px;
	font-size: 0.92rem;
	font-weight: 600;
}

@media (max-width: 700px) {
	.container {
		width: calc(100% - 0.8rem);
		padding: 0.8rem;
		border-radius: 14px;
	}

	.admin-button {
		width: 100%;
	}

	.message {
		padding: 0.78rem;
	}

	.date-header {
		margin-top: 1.15rem;
		font-size: 0.96rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0b1220;
		--surface: #101a2d;
		--surface-soft: #162238;
		--text: #e6edf8;
		--muted: #a7b4c8;
		--line: #26344c;
		--brand: #6ea6ff;
		--brand-strong: #8ab8ff;
		--green-bg: #1d3c2d;
		--green-text: #a7ebc2;
		--red-bg: #47282a;
		--red-text: #f7b7b7;
		--shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
		--shadow-md: 0 16px 34px rgba(0, 0, 0, 0.45);
	}

	body {
		background:
			radial-gradient(circle at 10% -20%, #162746 0%, transparent 45%),
			radial-gradient(circle at 90% 0%, #1a2f50 0%, transparent 38%),
			var(--bg);
	}

	pre {
		background: #1b2a43;
	}

	.connection-error {
		border-color: #6f3b3b;
		background: #3b2021;
		color: #f6c4c4;
	}
}
