:root {
	color-scheme: light dark;
	--text: #1c1c1e;
	--muted: #6b6b70;
	--page: #f5f5f7;
	--card: #ffffff;
	--line: #d9d9de;
	--accent: #2463eb;
	--allowed: #1e8e4e;
	--blocked: #d13438;
}

@media (prefers-color-scheme: dark) {
	:root {
		--text: #f2f2f4;
		--muted: #a0a0a8;
		--page: #151517;
		--card: #232326;
		--line: #3a3a3f;
		--accent: #5b8cff;
		--allowed: #3fbf76;
		--blocked: #f0646a;
	}
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--page);
	color: var(--text);
	font: 16px/1.4 system-ui, sans-serif;
}

main {
	max-width: 560px;
	margin: 0 auto;
	padding: 16px;
}

button,
input {
	font: inherit;
}

button {
	min-height: 40px;
	padding: 6px 14px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--card);
	color: var(--text);
	cursor: pointer;
}

button.primary {
	background: var(--accent);
	border-color: var(--accent);
	color: white;
}

button:disabled {
	opacity: 0.6;
	cursor: default;
}

.top-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

h1 {
	margin: 0;
	font-size: 22px;
}

.card {
	padding: 4px 16px;
	overflow-x: auto;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 12px;
}

.access {
	width: 100%;
	border-collapse: collapse;
}

.access th,
.access td {
	padding: 12px 8px;
	text-align: center;
}

.access th:first-child {
	padding-left: 0;
	text-align: left;
}

.access thead th {
	color: var(--muted);
	font-size: 14px;
	font-weight: 500;
}

.access tbody tr {
	border-top: 1px solid var(--line);
}

.access tbody th {
	font-weight: 600;
}

.switch-cell {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	cursor: pointer;
}

.state {
	font-size: 13px;
	color: var(--blocked);
}

.state.is-allowed {
	color: var(--allowed);
}

input[role="switch"] {
	appearance: none;
	position: relative;
	width: 52px;
	height: 32px;
	margin: 0;
	border-radius: 16px;
	background: var(--blocked);
	cursor: pointer;
	transition: background 0.15s;
}

input[role="switch"]::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: white;
	transition: transform 0.15s;
}

input[role="switch"]:checked {
	background: var(--allowed);
}

input[role="switch"]:checked::after {
	transform: translateX(20px);
}

input[role="switch"]:disabled {
	opacity: 0.6;
	cursor: default;
}

input[role="switch"]:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.sign-in {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
}

.sign-in h1 {
	margin-bottom: 4px;
}

.sign-in label {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.sign-in input {
	min-height: 44px;
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--page);
	color: var(--text);
}

.error {
	margin: 12px 0;
	color: var(--blocked);
}

.message {
	padding: 12px 0;
	margin: 0;
}
