:root {
	--bg: #0a0a0a;
	--bg-subtle: #111;
	--bg-surface: #161616;
	--border: #262626;
	--text: #e5e5e5;
	--text-muted: #737373;
	--primary: #3b82f6;
	--primary-hover: #2563eb;
	--success: #22c55e;
	--error: #ef4444;
	--warning: #eab308;
}

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

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

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

a:hover {
	text-decoration: underline;
}

.container {
	width: 100%;
	max-width: 72rem;
	margin: 0 auto;
	padding: 0 1rem;
}

.container-narrow {
	max-width: 40rem;
}

.nav {
	background: var(--bg-subtle);
	border-bottom: 1px solid var(--border);
	padding: 0.75rem 0;
}

.nav-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.nav-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 1.25rem;
	font-weight: 800;
	color: var(--text);
	text-decoration: none;
}

.nav-brand:hover {
	text-decoration: none;
}

.nav-brand-accent {
	color: var(--primary);
}

.logo-mark {
	width: 1.5rem;
	height: 1.5rem;
	flex: 0 0 auto;
	display: inline-block;
}

.nav-user {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.nav-links {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.nav-links a {
	color: var(--text-muted);
	padding: 0.5rem 0.75rem;
	border-radius: 0.375rem;
}

.nav-links a:hover {
	color: var(--text);
	background: var(--bg-surface);
	text-decoration: none;
}

.nav-links a.logout {
	color: var(--error);
}

.inbox-display {
	display: none;
	font-family: monospace;
	font-size: 0.75rem;
	background: var(--bg);
	border: 1px solid var(--border);
	padding: 0.375rem 0.75rem;
	border-radius: 0.375rem;
	color: var(--text-muted);
	max-width: 14rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

@media (min-width: 768px) {
	.inbox-display {
		display: block;
		max-width: none;
	}
}

.avatar {
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: var(--primary);
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 0.875rem;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.625rem 1.25rem;
	font-size: 0.875rem;
	font-weight: 500;
	border-radius: 0.375rem;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	background: var(--bg-surface);
	color: var(--text);
	transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
	background: var(--border);
	text-decoration: none;
}

.btn-primary {
	background: var(--primary);
	color: white;
}

.btn-primary:hover {
	background: var(--primary-hover);
}

.btn-ghost {
	background: transparent;
}

.btn-ghost:hover {
	background: var(--bg-surface);
}

.btn-outline {
	background: transparent;
	border-color: var(--border);
}

.btn-outline:hover {
	background: var(--bg-surface);
}

.btn-sm {
	padding: 0.375rem 0.75rem;
	font-size: 0.8125rem;
}

.btn-lg {
	padding: 0.875rem 1.75rem;
	font-size: 1rem;
}

.btn-error {
	color: var(--error);
}

.btn:disabled, .btn-disabled {
	opacity: 0.5;
	pointer-events: none;
}

.card {
	background: var(--bg-surface);
	border: 1px solid var(--border);
	border-radius: 0.5rem;
}

.card-body {
	padding: 1.5rem;
}

.card-title {
	font-size: 1.125rem;
	font-weight: 600;
	margin: 0 0 0.5rem 0;
}

.card-subtitle {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--text);
	margin: 0 0 0.25rem 0;
}

.card-link {
	display: block;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.15s;
}

.card-link:hover {
	border-color: var(--primary);
	text-decoration: none;
}

.form-group {
	margin-bottom: 1.25rem;
}

.form-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	margin-bottom: 0.375rem;
}

.form-hint {
	font-size: 0.75rem;
	color: var(--text-muted);
	margin-top: 0.25rem;
}

.form-input, .form-select, .form-textarea {
	width: 100%;
	padding: 0.625rem 0.875rem;
	font-size: 0.875rem;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 0.375rem;
	color: var(--text);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
	outline: none;
	border-color: var(--primary);
}

.form-textarea {
	resize: vertical;
	min-height: 6rem;
	font-family: monospace;
}

.badge {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.625rem;
	font-size: 0.75rem;
	font-weight: 500;
	border-radius: 9999px;
	background: var(--border);
	color: var(--text-muted);
}

.badge-primary {
	background: var(--primary);
	color: white;
}

.badge-success {
	background: rgba(34, 197, 94, 0.15);
	color: var(--success);
}

.badge-warning {
	background: rgba(234, 179, 8, 0.15);
	color: var(--warning);
}

.badge-ghost {
	background: var(--bg-surface);
}

.alert {
	padding: 1rem;
	border-radius: 0.375rem;
	margin-bottom: 1rem;
}

.alert-success {
	background: rgba(34, 197, 94, 0.1);
	border: 1px solid rgba(34, 197, 94, 0.3);
	color: var(--success);
}

.alert-error {
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.3);
	color: var(--error);
}

.alert-warning {
	background: rgba(234, 179, 8, 0.1);
	border: 1px solid rgba(234, 179, 8, 0.3);
	color: var(--warning);
}

.stats-grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
}

@media (min-width: 768px) {
	.stats-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.stat {
	background: var(--bg-surface);
	border-radius: 0.5rem;
	padding: 1.25rem;
}

.stat-title {
	font-size: 0.875rem;
	color: var(--text-muted);
	margin-bottom: 0.25rem;
}

.stat-value {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--primary);
}

.stat-value-sm {
	font-size: 1rem;
}

.stat-desc {
	font-size: 0.75rem;
	color: var(--text-muted);
	margin-top: 0.25rem;
}

.table-wrap {
	overflow-x: auto;
}

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

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

th {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	color: var(--text-muted);
}

td {
	font-size: 0.875rem;
}

tr:hover td {
	background: var(--bg-subtle);
}

.td-truncate {
	max-width: 20rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.grid-cards {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
}

@media (min-width: 640px) {
	.grid-cards {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.grid-cards {
		grid-template-columns: repeat(3, 1fr);
	}
}

.hero {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 2rem 1rem;
	background-image: radial-gradient(circle at 1px 1px, rgba(59, 130, 246, 0.08) 1px, transparent 0);
	background-size: 32px 32px;
}

.hero-content {
	max-width: 40rem;
}

.hero-title {
	font-size: 3rem;
	font-weight: 800;
	margin: 0 0 1rem 0;
	letter-spacing: -0.025em;
}

@media (min-width: 640px) {
	.hero-title {
		font-size: 3.75rem;
	}
}

.hero-title span {
	color: var(--primary);
}

.hero-subtitle {
	font-size: 1.125rem;
	color: var(--text-muted);
	margin-bottom: 2rem;
	line-height: 1.7;
}

.hero-features {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1.5rem;
	margin-top: 3rem;
	color: var(--text-muted);
	font-size: 0.875rem;
}

.hero-feature {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.hero-notice {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 2rem;
	padding: 0.75rem 1.25rem;
	background: rgba(59, 130, 246, 0.1);
	border: 1px solid rgba(59, 130, 246, 0.2);
	border-radius: 0.5rem;
	font-size: 0.875rem;
	color: var(--text-muted);
}

.hero-notice svg {
	color: var(--primary);
	flex-shrink: 0;
}

.page-header {
	margin-bottom: 2rem;
}

.page-title {
	font-size: 1.875rem;
	font-weight: 700;
	margin: 0 0 0.25rem 0;
}

.page-subtitle {
	color: var(--text-muted);
	margin: 0;
}

.page-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1rem;
}

@media (min-width: 640px) {
	.page-header-row {
		display: flex;
		align-items: flex-start;
		justify-content: space-between;
		gap: 1rem;
	}

	.page-header-row .page-actions {
		margin-top: 0;
	}
}

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

.text-primary {
	color: var(--primary);
}

.text-success {
	color: var(--success);
}

.text-error {
	color: var(--error);
}

.text-sm {
	font-size: 0.875rem;
}

.text-xs {
	font-size: 0.75rem;
}

.text-center {
	text-align: center;
}

.font-mono {
	font-family: monospace;
}

.font-semibold {
	font-weight: 600;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.back-link {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	color: var(--text-muted);
	font-size: 0.875rem;
	margin-bottom: 1rem;
}

.back-link:hover {
	color: var(--text);
}

.divider {
	display: flex;
	align-items: center;
	gap: 1rem;
	color: var(--text-muted);
	font-size: 0.75rem;
	margin: 1.5rem 0;
}

.divider::before, .divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--border);
}

.list-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem;
	border-bottom: 1px solid var(--border);
	color: inherit;
	text-decoration: none;
}

.list-item:last-child {
	border-bottom: none;
}

.list-item:hover {
	background: var(--bg-subtle);
	text-decoration: none;
}

.summary-date {
	font-size: 0.875rem;
	color: var(--text-muted);
}

.empty-state {
	text-align: center;
	padding: 3rem 1rem;
	color: var(--text-muted);
}

.empty-icon {
	width: 4rem;
	height: 4rem;
	margin: 0 auto 1rem;
	opacity: 0.3;
}

.pagination {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 1.5rem;
}

pre {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 0.375rem;
	padding: 1rem;
	overflow-x: auto;
	font-family: monospace;
	font-size: 0.875rem;
	white-space: pre-wrap;
	word-wrap: break-word;
}

ol.steps {
	padding-left: 1.5rem;
	color: var(--text-muted);
}

ol.steps li {
	margin-bottom: 0.75rem;
}

.tip {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 0.375rem;
	padding: 1rem;
	margin-top: 1.5rem;
}

.tip-title {
	font-weight: 600;
	margin-bottom: 0.25rem;
}

.tip-text {
	font-size: 0.875rem;
	color: var(--text-muted);
}

.icon {
	width: 1.25rem;
	height: 1.25rem;
	flex-shrink: 0;
}

.icon-sm {
	width: 1rem;
	height: 1rem;
}

.icon-lg {
	width: 1.5rem;
	height: 1.5rem;
}

.login-card {
	width: 100%;
	max-width: 24rem;
}

.toggle-row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.5rem 0;
	cursor: pointer;
}

.toggle-row input[type="checkbox"] {
	width: 1.25rem;
	height: 1.25rem;
	accent-color: var(--primary);
}

.inbox-box {
	font-family: monospace;
	font-size: 0.875rem;
	padding: 0.75rem 1rem;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 0.375rem;
	overflow-x: auto;
	word-break: break-all;
}
