/*
 * Панель мока. Ширины колонок и высоты строк заданы жёстко: статус меняется
 * каждые две секунды, и таблица не должна от этого дёргаться.
 */
:root {
	color-scheme: light dark;

	--bg: oklch(97% 0.003 264.5);
	--surface: oklch(100% 0 0);
	--line: oklch(92.7% 0.007 260.7);
	--fg: oklch(21% 0.032 264.7);
	--dim: oklch(48.2% 0 0);
	--accent: oklch(66.2% 0.206 37.3);
	--shadow: 0 1px 2px oklch(21% 0.032 264.7 / 0.06), 0 8px 24px oklch(21% 0.032 264.7 / 0.06);

	--paid: oklch(62% 0.15 155);
	--wait: oklch(60% 0.15 250);
	--expired: oklch(70% 0.15 70);
	--error: oklch(60% 0.2 25);
	--idle: oklch(60% 0 0);
}

:root[data-theme='dark'],
:root:not([data-theme='light']) {
	@media (prefers-color-scheme: dark) {
		--bg: oklch(21.7% 0.017 264.1);
		--surface: oklch(25.5% 0.017 259.8);
		--line: oklch(35% 0.015 260);
		--fg: oklch(96% 0.005 260);
		--dim: oklch(72% 0.012 260);
		--accent: oklch(68.2% 0.211 37.7);
		--shadow: 0 1px 2px oklch(0% 0 0 / 0.4), 0 10px 30px oklch(0% 0 0 / 0.35);
	}
}

:root[data-theme='dark'] {
	--bg: oklch(21.7% 0.017 264.1);
	--surface: oklch(25.5% 0.017 259.8);
	--line: oklch(35% 0.015 260);
	--fg: oklch(96% 0.005 260);
	--dim: oklch(72% 0.012 260);
	--accent: oklch(68.2% 0.211 37.7);
	--shadow: 0 1px 2px oklch(0% 0 0 / 0.4), 0 10px 30px oklch(0% 0 0 / 0.35);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0 auto;
	padding: 32px 20px 64px;
	max-width: 1120px;
	font:
		14px/1.5 ui-sans-serif,
		system-ui,
		sans-serif;
	color: var(--fg);
	background: var(--bg);
}

.head {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: flex-start;
	justify-content: space-between;
}

.head-side {
	display: flex;
	gap: 12px;
	align-items: center;
}

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

h2 {
	margin: 32px 0 2px;
	font-size: 15px;
}

.sub,
.hint,
.live {
	margin: 4px 0 0;
	color: var(--dim);
	font-size: 13px;
}

.live {
	font-variant-numeric: tabular-nums;
}

.dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 6px;
	border-radius: 50%;
	background: var(--paid);
	vertical-align: 1px;
	transition: background 0.2s ease;
}

.dot.off {
	background: var(--idle);
}

.theme {
	width: 32px;
	height: 32px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface);
	color: var(--fg);
	font-size: 14px;
	cursor: pointer;
	transition:
		border-color 0.2s ease,
		transform 0.15s ease;
}

.theme:hover {
	border-color: var(--accent);
}

.theme:active {
	transform: scale(0.94);
}

/* --- строки ------------------------------------------------------------- */

.rows {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 12px;
}

.row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 250px 208px;
	gap: 16px;
	align-items: center;
	min-height: 84px;
	padding: 14px 16px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--surface);
	box-shadow: var(--shadow);
	animation: appear 0.2s ease both;
	transition: border-color 0.2s ease;
}

.row:hover {
	border-color: color-mix(in oklab, var(--accent) 40%, var(--line));
}

@keyframes appear {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
}

.name {
	font-weight: 600;
}

.note,
.meta {
	margin-top: 2px;
	color: var(--dim);
	font-size: 12px;
	/* Две строки описания держат высоту: от смены статуса она не поедет. */
	min-height: 18px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

code {
	color: var(--dim);
	font-size: 12px;
}

.status {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.chip {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 6px;
	padding: 3px 10px;
	border: 1px solid color-mix(in oklab, currentcolor 35%, transparent);
	border-radius: 999px;
	background: color-mix(in oklab, currentcolor 12%, transparent);
	font-size: 12px;
	font-weight: 600;
	transition:
		color 0.25s ease,
		background 0.25s ease,
		border-color 0.25s ease;
}

.chip::before {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentcolor;
}

.chip.paid {
	color: var(--paid);
}

.chip.wait_pay {
	color: var(--wait);
}

.chip.expired {
	color: var(--expired);
}

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

.chip.select_method,
.chip.idle {
	color: var(--idle);
}

/* --- кнопки ------------------------------------------------------------- */

.acts {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
}

.acts button {
	padding: 5px 0;
	border: 1px solid var(--line);
	border-radius: 9px;
	background: transparent;
	color: var(--dim);
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition:
		color 0.2s ease,
		border-color 0.2s ease,
		background 0.2s ease,
		transform 0.12s ease;
}

.acts button:hover {
	color: var(--fg);
	border-color: var(--accent);
}

.acts button:active {
	transform: scale(0.96);
}

.acts button[aria-pressed='true'] {
	color: var(--surface);
	border-color: var(--accent);
	background: var(--accent);
}

.acts .reset {
	grid-column: 1 / -1;
}

/* --- ссылки ------------------------------------------------------------- */

.links {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	margin-top: 6px;
}

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

a:hover {
	text-decoration: underline;
}

details {
	margin-top: 32px;
}

summary {
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

@media (max-width: 720px) {
	.row {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		animation: none !important;
		transition: none !important;
	}
}
