/*
 * CoD4 Tools
 * ---------------------------------------------------------------
 * Тема: "Aurora Noir".
 *   - тёмная сцена с тремя плавающими аур-пятнами;
 *   - стеклянные панели с многослойными тенями и бликом;
 *   - градиентные акценты (индиго → маджента → циан);
 *   - пружинные переходы, «дышащие» focus-ring'и;
 *   - светящиеся активные состояния и тонкие световые линии.
 * ---------------------------------------------------------------
 */

:root
{
	/* --- фон --- */
	--bg:            #07080d;
	--bg-2:          #0b0d15;
	--surface:       rgba(20, 23, 34, 0.72);
	--surface-2:     rgba(15, 18, 27, 0.60);
	--surface-3:     rgba(28, 32, 46, 0.88);
	--field:         rgba(12, 15, 23, 0.85);
	--field-hover:   rgba(18, 22, 33, 0.95);

	/* --- текст --- */
	--text:          #eef0f6;
	--text-soft:     #c6cbda;
	--muted:         #8b93ac;
	--muted-2:       #5d6480;

	/* --- границы --- */
	--border:        rgba(255, 255, 255, 0.06);
	--border-strong: rgba(255, 255, 255, 0.14);

	/* --- акценты (aurora-градиент) --- */
	--accent:        #818cf8;   /* индиго */
	--accent-hover:  #a5b4fc;
	--accent-2:      #f472b6;   /* маджента */
	--accent-3:      #22d3ee;   /* циан */
	--accent-soft:   rgba(129, 140, 248, 0.12);
	--accent-ring:   rgba(129, 140, 248, 0.22);
	--accent-text:   #07080d;

	--grad-1: linear-gradient(135deg, #818cf8 0%, #f472b6 100%);
	--grad-2: linear-gradient(135deg, #22d3ee 0%, #818cf8 100%);
	--grad-3: linear-gradient(135deg, #f472b6 0%, #22d3ee 100%);

	/* --- фокус --- */
	--focus:         #818cf8;
	--focus-ring:    rgba(129, 140, 248, 0.28);

	/* --- семантика --- */
	--red:           #f87171;
	--red-strong:    #fca5a5;
	--red-tint:      rgba(248, 113, 113, 0.10);
	--red-line:      rgba(248, 113, 113, 0.20);

	--orange:        #fbbf24;
	--orange-strong: #fcd34d;
	--orange-tint:   rgba(251, 191, 36, 0.10);
	--orange-line:   rgba(251, 191, 36, 0.20);

	--green:         #34d399;
	--green-strong:  #6ee7b7;
	--green-tint:    rgba(52, 211, 153, 0.10);

	/* --- тени (многослойные) --- */
	--shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.5);
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5),
	             0 3px 8px rgba(0, 0, 0, 0.4);
	--shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5),
	             0 10px 24px rgba(0, 0, 0, 0.45),
	             0 20px 48px rgba(0, 0, 0, 0.35);
	--shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.55),
	             0 24px 56px rgba(0, 0, 0, 0.45),
	             0 48px 96px rgba(0, 0, 0, 0.35);

	--shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.06);

	/* --- геометрия --- */
	--page-width: 1280px;
	--radius:    18px;
	--radius-sm: 12px;
	--radius-xs: 8px;

	/* --- переходы --- */
	--t-fast:   140ms cubic-bezier(0.4, 0, 0.2, 1);
	--t-base:   220ms cubic-bezier(0.4, 0, 0.2, 1);
	--t-spring: 460ms cubic-bezier(0.34, 1.56, 0.64, 1);

	/* --- шрифты --- */
	--sans: "Inter", "Manrope", ui-sans-serif, system-ui, -apple-system,
	        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular,
	        "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

/* Светлая тема — "Aurora Light": та же aurora, но днём. */
@media (prefers-color-scheme: light)
{
	:root
	{
		--bg:            #f2f3f8;
		--bg-2:          #eaeaf4;
		--surface:       rgba(255, 255, 255, 0.78);
		--surface-2:     rgba(255, 255, 255, 0.58);
		--surface-3:     rgba(255, 255, 255, 0.94);
		--field:         rgba(255, 255, 255, 0.9);
		--field-hover:   #ffffff;

		--text:          #0f1220;
		--text-soft:     #2d3348;
		--muted:         #5c6480;
		--muted-2:       #868da6;

		--border:        rgba(15, 18, 32, 0.07);
		--border-strong: rgba(15, 18, 32, 0.15);

		--accent:        #6366f1;
		--accent-hover:  #4f46e5;
		--accent-2:      #ec4899;
		--accent-3:      #06b6d4;
		--accent-soft:   rgba(99, 102, 241, 0.10);
		--accent-ring:   rgba(99, 102, 241, 0.20);
		--accent-text:   #ffffff;

		--grad-1: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
		--grad-2: linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
		--grad-3: linear-gradient(135deg, #ec4899 0%, #06b6d4 100%);

		--focus:         #6366f1;
		--focus-ring:    rgba(99, 102, 241, 0.20);

		--red:           #dc2626;
		--red-strong:    #b91c1c;
		--red-tint:      rgba(220, 38, 38, 0.06);
		--red-line:      rgba(220, 38, 38, 0.14);

		--orange:        #d97706;
		--orange-strong: #b45309;
		--orange-tint:   rgba(217, 119, 6, 0.07);
		--orange-line:   rgba(217, 119, 6, 0.16);

		--green:         #16a34a;
		--green-strong:  #15803d;
		--green-tint:    rgba(22, 163, 74, 0.07);

		--shadow-xs: 0 1px 2px rgba(15, 18, 32, 0.06);
		--shadow-sm: 0 1px 2px rgba(15, 18, 32, 0.06),
		             0 3px 8px rgba(15, 18, 32, 0.05);
		--shadow-md: 0 2px 6px rgba(15, 18, 32, 0.06),
		             0 10px 24px rgba(15, 18, 32, 0.08),
		             0 20px 48px rgba(15, 18, 32, 0.05);
		--shadow-lg: 0 8px 20px rgba(15, 18, 32, 0.08),
		             0 24px 48px rgba(15, 18, 32, 0.10),
		             0 48px 96px rgba(15, 18, 32, 0.06);

		--shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.8);
	}
}

/* ---------- сброс ---------- */

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

html
{
	overflow-y: scroll;
	-webkit-text-size-adjust: 100%;
	scrollbar-color: var(--border-strong) transparent;
	scrollbar-width: thin;
}

@supports (scrollbar-gutter: stable)
{
	html
	{
		overflow-y: auto;
		scrollbar-gutter: stable;
	}
}

::-webkit-scrollbar
{
	width: 10px;
	height: 10px;
}

::-webkit-scrollbar-track
{
	background: transparent;
}

::-webkit-scrollbar-thumb
{
	background: var(--border-strong);
	border: 2px solid transparent;
	background-clip: padding-box;
	border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover
{
	background: var(--accent);
	background-clip: padding-box;
}

body
{
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	color: var(--text);
	font-family: var(--sans);
	font-size: 15px;
	line-height: 1.55;
	font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;

	background-color: var(--bg);
	background-image:
		radial-gradient(900px 700px at 8% 0%,    rgba(129, 140, 248, 0.16), transparent 60%),
		radial-gradient(900px 700px at 92% 12%,  rgba(244, 114, 182, 0.14), transparent 62%),
		radial-gradient(800px 600px at 50% 100%, rgba(34, 211, 238, 0.12), transparent 65%),
		linear-gradient(180deg, var(--bg), var(--bg-2));
	background-attachment: fixed;
	position: relative;
	overflow-x: hidden;
}

/* Живое «дыхание» aurora — вторая неподвижная сцена под контентом. */
body::before
{
	content: "";
	position: fixed;
	inset: -20%;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(700px 500px at 25% 20%, rgba(129, 140, 248, 0.14), transparent 60%),
		radial-gradient(700px 500px at 75% 70%, rgba(244, 114, 182, 0.10), transparent 60%),
		radial-gradient(600px 400px at 50% 50%, rgba(34, 211, 238, 0.08), transparent 60%);
	filter: blur(40px);
	animation: aurora 28s ease-in-out infinite alternate;
}

@keyframes aurora
{
	0%   { transform: translate3d(-3%, -2%, 0) scale(1); }
	50%  { transform: translate3d(3%, 2%, 0) scale(1.06); }
	100% { transform: translate3d(-2%, 3%, 0) scale(1.02); }
}

a
{
	color: var(--accent);
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
	text-decoration-color: rgba(129, 140, 248, 0.35);
	transition: color var(--t-fast), text-decoration-color var(--t-fast);
}

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

:focus-visible
{
	outline: 2px solid var(--focus);
	outline-offset: 3px;
	border-radius: var(--radius-xs);
	animation: focusPulse 2.4s ease-in-out infinite;
}

@keyframes focusPulse
{
	0%, 100% { box-shadow: 0 0 0 0 var(--focus-ring); }
	50%      { box-shadow: 0 0 0 6px rgba(129, 140, 248, 0); }
}

::selection
{
	background: var(--accent-ring);
	color: var(--text);
}

.visually-hidden
{
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------- layout ---------- */

.wrap
{
	width: 100%;
	max-width: var(--page-width);
	margin: 0 auto;
	padding: 56px 24px 56px;
}

.header
{
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 32px;
}

.brand
{
	flex: 0 0 auto;
	display: block;
	width: 46px;
	height: 46px;
	padding: 10px;
	border-radius: 14px;
	background-image: var(--grad-1);
	color: #fff;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.35) inset,
		0 10px 26px rgba(129, 140, 248, 0.40),
		0 4px 10px rgba(244, 114, 182, 0.25);
}

.header h1
{
	margin: 0;
	font-size: 28px;
	font-weight: 700;
	letter-spacing: -0.03em;
	color: var(--text);
}

.lede
{
	margin: 0 0 28px;
	color: var(--muted);
	font-size: 14px;
	max-width: 78ch;
}

/* ---------- tabs ---------- */

.tabs
{
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 28px;
	padding: 5px;
	border: 1px solid var(--border);
	border-radius: 16px;
	background-color: var(--surface-2);
	backdrop-filter: blur(20px) saturate(180%);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	box-shadow: var(--shadow-md);
	width: fit-content;
	max-width: 100%;
}

.tab
{
	position: relative;
	padding: 10px 18px;
	border: 0;
	border-radius: 12px;
	background: none;
	color: var(--muted);
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.4;
	cursor: pointer;
	white-space: nowrap;
	transition: color var(--t-fast), background-color var(--t-fast),
	            box-shadow var(--t-spring), transform var(--t-spring);
}

.tab:hover
{
	color: var(--text);
	background-color: var(--surface-3);
}

.tab.is-active
{
	color: var(--text);
	background-color: var(--surface-3);
	box-shadow:
		var(--shadow-sm),
		var(--shadow-inset),
		0 0 0 1px rgba(129, 140, 248, 0.20);
	transform: translateY(-1px);
	font-weight: 600;
}

/* Неоновая полоска под активной вкладкой */
.tab.is-active::after
{
	content: "";
	position: absolute;
	left: 16%;
	right: 16%;
	bottom: -2px;
	height: 2px;
	border-radius: 2px;
	background-image: var(--grad-1);
	box-shadow: 0 0 12px rgba(129, 140, 248, 0.65);
}

.panel:focus
{
	outline: 0;
}

/* ---------- карточки-контейнеры (glass) ---------- */

.card,
.kf-out,
.rc-group,
.sb-group,
.sb-presets,
.dv-list
{
	position: relative;
	background-color: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-md);
	backdrop-filter: blur(22px) saturate(170%);
	-webkit-backdrop-filter: blur(22px) saturate(170%);
	overflow: hidden;
}

/* Верхний «блик стекла». */
.card::before,
.kf-out::before,
.rc-group::before,
.sb-group::before,
.sb-presets::before,
.dv-list::before
{
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 1px;
	background: linear-gradient(90deg,
		transparent,
		rgba(255, 255, 255, 0.55) 50%,
		transparent);
	opacity: 0.6;
	pointer-events: none;
}

@media (prefers-color-scheme: light)
{
	.card::before,
	.kf-out::before,
	.rc-group::before,
	.sb-group::before,
	.sb-presets::before,
	.dv-list::before
	{
		background: linear-gradient(90deg,
			transparent,
			rgba(255, 255, 255, 0.9) 50%,
			transparent);
		opacity: 0.9;
	}
}

/* Цветной aurora-кант снизу активных элементов. */
.card::after
{
	content: "";
	position: absolute;
	inset: auto 0 0 0;
	height: 1px;
	background: linear-gradient(90deg,
		transparent 0%,
		rgba(129, 140, 248, 0.35) 25%,
		rgba(244, 114, 182, 0.35) 55%,
		rgba(34, 211, 238, 0.35) 85%,
		transparent 100%);
	pointer-events: none;
	opacity: 0.9;
}

/* ---------- killfeed colours ---------- */

.kf-rows
{
	display: flex;
	flex-direction: column;
}

.kf-bind
{
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--border);
	background-color: var(--surface-2);
}

.kf-bind-label
{
	flex: 0 0 auto;
	color: var(--muted);
	font-family: var(--mono);
	font-size: 12px;
	letter-spacing: 0.02em;
}

.kf-row
{
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--border);
	transition: background-color var(--t-fast);
}

.kf-row:last-child
{
	border-bottom: 0;
}

.kf-row:hover
{
	background-color: var(--surface-2);
}

.kf-color
{
	flex: 0 0 auto;
	width: 44px;
	height: 32px;
	padding: 0;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	background: none;
	cursor: pointer;
	transition: border-color var(--t-fast), box-shadow var(--t-fast),
	            transform var(--t-spring);
}

.kf-color:hover
{
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-ring);
	transform: scale(1.04);
}

.kf-color::-webkit-color-swatch-wrapper
{
	padding: 3px;
}

.kf-color::-webkit-color-swatch
{
	border: 0;
	border-radius: 6px;
}

/* Единый стиль полей ввода */

.kf-dvar,
.kf-value,
.kf-hex,
.kf-key,
.kf-action,
.sb-value,
.fq-key,
.dv-search,
textarea
{
	font-family: var(--mono);
	background-color: var(--field);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	transition: border-color var(--t-fast), background-color var(--t-fast),
	            box-shadow var(--t-fast);
}

.kf-dvar,
.kf-value,
.kf-hex,
.kf-key,
.kf-action
{
	height: 32px;
	padding: 0 10px;
	font-size: 13px;
}

.kf-dvar:hover,
.kf-value:hover,
.kf-hex:hover,
.kf-key:hover,
.kf-action:hover,
.sb-value:hover,
.fq-key:hover
{
	border-color: var(--border-strong);
	background-color: var(--field-hover);
}

.kf-dvar:focus,
.kf-value:focus,
.kf-hex:focus,
.kf-key:focus,
.kf-action:focus,
.sb-value:focus,
.fq-key:focus,
.dv-search:focus,
textarea:focus
{
	outline: 0;
	border-color: var(--accent);
	background-color: var(--field);
	box-shadow: 0 0 0 4px var(--focus-ring);
}

.kf-dvar
{
	flex: 1 1 auto;
	min-width: 0;
}

.kf-value
{
	flex: 0 0 auto;
	width: 180px;
}

.kf-key
{
	flex: 0 0 auto;
	width: 88px;
	text-align: center;
}

.kf-action
{
	flex: 1 1 auto;
	min-width: 0;
}

.kf-hex
{
	flex: 0 0 auto;
	width: 110px;
	text-transform: lowercase;
}

.kf-dvar[readonly]
{
	border-color: transparent;
	background-color: transparent;
	color: var(--text);
	font-weight: 600;
	cursor: default;
}

.kf-dvar[readonly]:hover,
.kf-dvar[readonly]:focus
{
	border-color: transparent;
	background-color: transparent;
	box-shadow: none;
}

.kf-value.is-invalid,
.kf-hex.is-invalid
{
	border-color: var(--red);
	color: var(--red-strong);
	background-color: var(--red-tint);
	box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.18);
}

.kf-out
{
	margin-top: 14px;
}

.kf-out-head
{
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 12px 10px 18px;
	border-bottom: 1px solid var(--border);
	background-color: var(--surface-2);
}

.kf-out-title
{
	color: var(--text-soft);
	font-size: 13px;
	font-weight: 600;
}

.btn-sm
{
	padding: 5px 12px;
	font-size: 13px;
}

.kf-output
{
	display: block;
	margin: 0;
	padding: 16px 18px;
	border: 0;
	background: none;
	color: var(--text);
	font-family: var(--mono);
	font-size: 13px;
	line-height: 1.7;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.kf-output.is-empty
{
	color: var(--muted);
}

.kf-feed
{
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	padding: 18px;
	background-color: #3d3b34;
	background-image:
		radial-gradient(115% 85% at 22% 28%, rgba(151, 148, 126, 0.55) 0%, rgba(151, 148, 126, 0) 58%),
		radial-gradient(85% 70% at 68% 58%, rgba(88, 88, 74, 0.55) 0%, rgba(88, 88, 74, 0) 62%),
		radial-gradient(70% 60% at 92% 18%, rgba(120, 116, 96, 0.35) 0%, rgba(120, 116, 96, 0) 70%),
		radial-gradient(140% 130% at 45% 45%, rgba(20, 20, 14, 0) 42%, rgba(20, 20, 14, 0.55) 100%);
}

.kf-line
{
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
}

.kf-nick
{
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.kf-weapon
{
	flex: 0 0 auto;
	width: 34px;
	height: 12px;
	fill: #e6e6e6;
	filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.85));
}

/* ---------- scoreboard generator ---------- */

.sb-grid
{
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 16px;
	margin-bottom: 16px;
}

.sb-group
{
	padding: 18px;
}

.sb-group .rc-title
{
	margin-bottom: 12px;
}

.sb-field
{
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	padding: 5px 0;
}

.sb-label
{
	flex: 1 1 60px;
	min-width: 0;
	color: var(--muted);
	font-family: var(--sans);
	font-size: 12px;
}

.sb-value
{
	flex: 0 0 auto;
	width: calc(27ch + 18px);
	min-width: 0;
	height: 30px;
	padding: 0 10px;
	font-size: 12px;
}

.sb-colorwrap
{
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 6px;
}

.sb-colorwrap .kf-color
{
	flex: 0 0 34px;
	width: 34px;
	height: 30px;
}

.sb-slot
{
	font-family: var(--mono);
	font-size: 12px;
	flex: 0 0 calc(27ch + 18px);
}

.sb-check
{
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--accent);
	cursor: pointer;
}

.sb-ladder
{
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px dashed var(--border);
}

.sb-step
{
	display: flex;
	align-items: flex-end;
	gap: 10px;
	padding: 4px 0;
}

.sb-step-ping,
.sb-step-value
{
	color: var(--muted);
	font-family: var(--mono);
	font-size: 11px;
	line-height: 16px;
}

.sb-step-ping
{
	flex: 0 0 92px;
}

.sb-step-value
{
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sb-step-bars
{
	display: flex;
	flex: 0 0 auto;
	align-items: flex-end;
	gap: 1px;
	height: 16px;
}

.sb-step-bar
{
	width: 4px;
	background: var(--border);
	border-radius: 1px;
}

/* ---------- colour presets ---------- */

.sb-presets
{
	margin-bottom: 16px;
}

.sb-presets-head
{
	padding: 14px 18px;
	color: var(--text);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	gap: 8px;
	transition: background-color var(--t-fast), color var(--t-fast);
}

.sb-presets-head::before
{
	content: "";
	width: 0;
	height: 0;
	border-left: 5px solid var(--accent);
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
	transition: transform var(--t-spring);
}

.sb-presets[open] .sb-presets-head::before
{
	transform: rotate(90deg);
}

.sb-presets-head::-webkit-details-marker
{
	display: none;
}

.sb-presets-head:hover
{
	background-color: var(--surface-2);
	color: var(--accent);
}

.sb-presets[open] .sb-presets-head
{
	border-bottom: 1px solid var(--border);
}

.sb-presets-head:focus-visible
{
	outline: 2px solid var(--focus);
	outline-offset: -2px;
}

.sb-preset-list
{
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 12px;
}

.sb-preset
{
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 20px;
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background-color: var(--surface-2);
	color: inherit;
	font-family: inherit;
	text-align: left;
	cursor: pointer;
	transition: border-color var(--t-fast), background-color var(--t-fast),
	            box-shadow var(--t-fast), transform var(--t-spring);
}

.sb-preset:hover
{
	border-color: var(--border-strong);
	background-color: var(--surface-3);
	box-shadow: var(--shadow-sm);
	transform: translateY(-1px);
}

.sb-preset.is-active
{
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--focus-ring);
}

.sb-preset-name
{
	flex: 0 0 var(--sb-name-width, 150px);
	white-space: nowrap;
	font-size: 13px;
	font-weight: 600;
}

.sb-part
{
	display: flex;
	align-items: center;
	gap: 7px;
}

.sb-swatch
{
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	border: 1px solid var(--border-strong);
	border-radius: 5px;
}

.sb-part-label
{
	flex: 0 0 78px;
	color: var(--muted);
	font-size: 11px;
}

.sb-preview
{
	position: relative;
	overflow: hidden;
	background-color: #6d6a58;
	background-image: url("../img/preview-bg.png");
	background-position: center;
	background-size: cover;
}

.sb-screen
{
	position: absolute;
	top: 0;
	left: 0;
	width: 640px;
	height: 480px;
	transform-origin: top left;
}

.sb-icon
{
	position: absolute;
	fill: rgba(255, 255, 255, 0.85);
}

.sb-rect
{
	position: absolute;
}

.sb-text
{
	position: absolute;
	white-space: nowrap;
	overflow: hidden;
	font-family: var(--sans);
	text-shadow: 0.5px 0.5px 0 rgba(0, 0, 0, 0.7);
}

/* ---------- rcon reference ---------- */

.rc-group
{
	margin-bottom: 18px;
	padding: 18px;
}

.rc-title
{
	margin: 0 0 2px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--text);
}

.rc-note
{
	margin: 0 0 14px;
	color: var(--muted);
	font-size: 13px;
}

.rc-title + .rc-items,
.rc-title + .rc-grid,
.rc-title + .rc-tokens
{
	margin-top: 12px;
}

.rc-sub
{
	margin: 18px 0 8px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.10em;
	text-transform: uppercase;
	background-image: var(--grad-1);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.rc-items
{
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.rc-item
{
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 11px 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background-color: var(--surface-2);
	transition: border-color var(--t-fast), background-color var(--t-fast),
	            box-shadow var(--t-fast), transform var(--t-spring);
}

.rc-item:hover
{
	border-color: var(--border-strong);
	background-color: var(--surface-3);
	box-shadow: var(--shadow-sm);
	transform: translateY(-1px);
}

.rc-item-text
{
	min-width: 0;
}

.rc-code
{
	display: block;
	font-family: var(--mono);
	font-size: 13px;
	line-height: 1.5;
	color: var(--accent);
	overflow-wrap: anywhere;
}

.rc-desc
{
	margin: 3px 0 0;
	color: var(--muted);
	font-size: 13px;
}

.rc-copy
{
	flex: 0 0 auto;
}

.rc-copy.is-copied
{
	border-color: var(--green);
	color: var(--green-strong);
	background-color: var(--green-tint);
}

.rc-tokens
{
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 8px 18px;
	margin: 0 0 14px;
	font-size: 13px;
}

.rc-tokens dt
{
	font-family: var(--mono);
	font-weight: 600;
	color: var(--accent);
}

.rc-tokens dd
{
	margin: 0;
	color: var(--muted);
}

.rc-grid
{
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 8px;
}

.rc-cell
{
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background-color: var(--surface-2);
	transition: border-color var(--t-fast), background-color var(--t-fast),
	            box-shadow var(--t-fast), transform var(--t-spring);
}

.rc-cell:hover
{
	border-color: var(--border-strong);
	background-color: var(--surface-3);
	box-shadow: var(--shadow-sm);
	transform: translateY(-1px);
}

.rc-cell-name
{
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--text);
}

.rc-cell .rc-code
{
	color: var(--muted);
	font-size: 12.5px;
}

/* ---------- dvar reference ---------- */

.dv-bar
{
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.dv-search
{
	flex: 1 1 260px;
	min-width: 0;
	height: 42px;
	padding: 0 14px;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	background-color: var(--surface);
	font-size: 14px;
	box-shadow: var(--shadow-xs);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.dv-search::placeholder
{
	color: var(--muted);
}

.dv-count
{
	flex: 0 0 auto;
	color: var(--muted);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}

.dv-empty
{
	margin: 0 0 12px;
	color: var(--muted);
	font-size: 14px;
}

.dv-list
{
	overflow: hidden;
}

.dv-row
{
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 16px;
	padding: 11px 18px;
	border-bottom: 1px solid var(--border);
	transition: background-color var(--t-fast);
}

.dv-row:nth-child(even)
{
	background-color: var(--surface-2);
}

.dv-row:hover
{
	background-color: var(--surface-3);
}

.dv-row:last-child
{
	border-bottom: 0;
}

.dv-row[hidden]
{
	display: none;
}

.dv-name
{
	flex: 0 0 auto;
	width: 47ch;
	font-family: var(--mono);
	font-size: 13px;
	font-weight: 600;
	color: var(--accent);
	white-space: nowrap;
}

@media (max-width: 720px)
{
	.dv-name
	{
		width: auto;
		max-width: 100%;
		white-space: normal;
		overflow-wrap: anywhere;
	}
}

.dv-body
{
	flex: 1 1 260px;
	min-width: 0;
}

.dv-desc
{
	margin: 0;
	color: var(--text-soft);
	font-size: 13px;
	line-height: 1.5;
}

.dv-meta
{
	margin: 3px 0 0;
	color: var(--muted);
	font-family: var(--mono);
	font-size: 12px;
	line-height: 1.5;
}

.dv-meta b
{
	color: var(--text);
	font-weight: 600;
}

.dv-values b
{
	color: var(--accent-2);
	opacity: 0.95;
}

.dv-type
{
	color: var(--accent-3);
	opacity: 0.9;
}

/* ---------- form ---------- */

.card
{
	overflow: hidden;
}

.editor
{
	display: flex;
	align-items: stretch;
	background-color: var(--field);
	border-bottom: 1px solid var(--border);
}

.gutter-box
{
	position: relative;
	flex: 0 0 auto;
	width: calc(2ch + 24px);
	border-right: 1px solid var(--border);
	overflow: hidden;
}

.gutter
{
	position: absolute;
	top: 16px;
	right: 10px;
	color: var(--muted-2);
	font-family: var(--mono);
	font-size: 13px;
	line-height: 1.7;
	text-align: right;
	white-space: pre;
	-webkit-user-select: none;
	user-select: none;
}

.input-wrap
{
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
}

.highlights
{
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 0;
	padding-top: 16px;
	overflow: hidden;
	pointer-events: none;
}

.highlights-inner
{
	display: inline-block;
	min-width: 100%;
	color: transparent;
	font-family: var(--mono);
	font-size: 13px;
	line-height: 1.7;
	tab-size: 4;
	white-space: pre;
}

.highlights-inner div
{
	padding: 0 16px;
}

.highlights-inner .hl-red
{
	background-color: var(--red-line);
}

.highlights-inner .hl-orange
{
	background-color: var(--orange-line);
}

textarea
{
	position: relative;
	z-index: 1;
	flex: 1 1 auto;
	display: block;
	width: 100%;
	min-width: 0;
	min-height: 300px;
	margin: 0;
	padding: 16px;
	border: 0;
	border-radius: 0;
	background-color: transparent;
	color: var(--text);
	font-family: var(--mono);
	font-size: 13px;
	line-height: 1.7;
	tab-size: 4;
	white-space: pre;
	overflow: auto;
	resize: vertical;
}

textarea::placeholder
{
	color: var(--muted);
	opacity: 0.6;
}

textarea:focus-visible
{
	outline: 0;
	box-shadow: none;
	animation: none;
}

.editor:focus-within
{
	background-color: var(--field-hover);
	box-shadow: inset 0 0 0 1px var(--accent-ring);
}

.actions
{
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 14px;
	background-color: var(--surface-2);
}

.tools
{
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.hint
{
	margin: 12px 2px 0;
	color: var(--muted);
	font-size: 13px;
	min-height: 1.55em;
}

.hint.is-error
{
	color: var(--red-strong);
}

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

.btn
{
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 9px 18px;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	background-color: var(--surface-3);
	color: var(--text);
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	cursor: pointer;
	box-shadow: var(--shadow-xs), var(--shadow-inset);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	transition: background-color var(--t-fast), border-color var(--t-fast),
	            box-shadow var(--t-fast), transform var(--t-spring), color var(--t-fast);
}

.btn:hover
{
	background-color: var(--surface);
	border-color: var(--accent);
	color: var(--text);
	box-shadow: var(--shadow-md), var(--shadow-inset);
	transform: translateY(-1px);
}

.btn:active
{
	transform: translateY(1px) scale(0.99);
	box-shadow: var(--shadow-xs);
}

.btn[hidden]
{
	display: none;
}

.btn-primary
{
	position: relative;
	border-color: transparent;
	background-image: var(--grad-1);
	color: #fff;
	font-weight: 600;
	padding-inline: 24px;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.25) inset,
		0 8px 22px rgba(129, 140, 248, 0.40),
		0 4px 12px rgba(244, 114, 182, 0.25);
}

.btn-primary:hover
{
	color: #fff;
	transform: translateY(-1px);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.35) inset,
		0 12px 30px rgba(129, 140, 248, 0.50),
		0 6px 18px rgba(244, 114, 182, 0.35);
	filter: brightness(1.05);
}

.btn-primary:active
{
	transform: translateY(1px) scale(0.99);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.20) inset,
		0 4px 12px rgba(129, 140, 248, 0.35);
	filter: brightness(0.98);
}

/* ---------- results ---------- */

#violations
{
	margin: 22px 0 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

#violations[hidden]
{
	display: none;
}

#violations li
{
	padding: 14px 16px;
	border: 1px solid var(--border);
	border-left: 3px solid var(--border-strong);
	border-radius: var(--radius-sm);
	background-color: var(--surface);
	font-size: 14px;
	box-shadow: var(--shadow-xs);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

#violations li.red
{
	border-left-color: var(--red);
	background-color: var(--red-tint);
}

#violations li.orange
{
	border-left-color: var(--orange);
	background-color: var(--orange-tint);
}

#violations li.green
{
	border-left-color: var(--green);
	background-color: var(--green-tint);
}

#violations em
{
	font-family: var(--mono);
	font-size: 13px;
	font-style: normal;
	font-weight: 600;
}

li.red em
{
	color: var(--red-strong);
}

li.orange em
{
	color: var(--orange-strong);
}

pre
{
	display: block;
	margin: 8px 0 0;
	padding: 10px 12px;
	border-radius: var(--radius-sm);
	background-color: var(--surface-2);
	border: 1px solid var(--border);
	color: var(--text-soft);
	font-family: var(--mono);
	font-size: 12.5px;
	line-height: 1.6;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.line-actions
{
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	margin-top: 10px;
}

.line-action
{
	color: var(--muted);
	font-size: 13px;
	text-decoration: underline;
	text-decoration-color: var(--border-strong);
	transition: color var(--t-fast), text-decoration-color var(--t-fast);
}

.line-action:hover
{
	color: var(--accent);
	text-decoration-color: currentColor;
}

/* ---------- footer ---------- */

.footer
{
	margin-top: auto;
	padding: 0 24px 32px;
	max-width: var(--page-width);
	width: 100%;
	margin-left: auto;
	margin-right: auto;
	color: var(--muted);
	font-size: 12px;
}

.footer::before
{
	content: "";
	display: block;
	margin-bottom: 24px;
	border-top: 1px solid var(--border);
}

.footer-gh
{
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--muted);
	text-decoration: none;
	transition: color var(--t-fast);
}

.footer-gh:hover
{
	color: var(--accent);
}

.footer-gh-name
{
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
}

.footer-gh svg
{
	display: block;
	fill: currentColor;
}

/* ---------- small screens ---------- */

@media (max-width: 560px)
{
	.wrap
	{
		padding: 32px 16px 32px;
	}

	.header h1
	{
		font-size: 22px;
	}

	.actions
	{
		flex-direction: column;
		align-items: stretch;
	}

	.tools
	{
		width: 100%;
	}

	.tools .btn
	{
		flex: 1 1 auto;
	}

	.btn-primary
	{
		width: 100%;
	}

	.gutter
	{
		padding-left: 10px;
	}

	.kf-row
	{
		flex-wrap: wrap;
	}

	.kf-value
	{
		order: 2;
		flex: 1 1 55%;
		width: auto;
		min-width: 0;
	}

	.kf-hex
	{
		order: 3;
		flex: 1 1 30%;
		width: auto;
		min-width: 0;
	}

	.dv-name
	{
		width: auto;
		flex: 1 1 100%;
	}
}

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

/* ---------- FAQ ---------- */

.fq-group[hidden]
{
	display: none;
}

.fq-item
{
	padding: 16px 0;
	border-top: 1px solid var(--border);
}

.fq-item:first-of-type
{
	padding-top: 4px;
	border-top: 0;
}

.fq-item[hidden]
{
	display: none;
}

.fq-q
{
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: -0.005em;
	color: var(--text);
}

.fq-a
{
	margin: 0 0 10px;
	max-width: 78ch;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.6;
}

.fq-cmd
{
	--fq-copy-w: 96px;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 6px;
}

.fq-kind
{
	flex: 0 0 64px;
	text-align: left;
	padding-top: 7px;
	color: var(--muted);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.fq-steps,
.fq-substeps
{
	margin: 0 0 10px;
	padding-left: 20px;
	max-width: 78ch;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.65;
}

.fq-steps > li
{
	margin-bottom: 5px;
}

.fq-substeps
{
	margin: 4px 0 0;
	list-style: disc;
}

.fq-link
{
	font-family: var(--mono);
	font-size: 12px;
	color: var(--accent);
}

.fq-link:hover
{
	color: var(--accent-hover);
}

.fq-key
{
	flex: 0 0 64px;
	width: 64px;
	min-width: 0;
	height: 32px;
	padding: 6px 8px;
	font-size: 12.5px;
	line-height: 1.55;
	text-align: center;
}

.fq-desc
{
	flex: 0 0 140px;
	padding-top: 7px;
	font-size: 12px;
	color: var(--text-soft);
}

.fq-code
{
	flex: 1 1 auto;
	min-width: 0;
	padding: 7px 10px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background-color: var(--surface-2);
	color: var(--accent);
	font-family: var(--mono);
	font-size: 12.5px;
	line-height: 1.55;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.fq-copy,
.fq-copy-space
{
	flex: 0 0 var(--fq-copy-w);
}

.fq-copy
{
	padding: 7px 12px;
	font-size: 12.5px;
	line-height: 1.55;
}

.fq-note
{
	margin: 10px 0 0;
	max-width: 78ch;
	color: var(--muted);
	font-size: 12px;
	line-height: 1.6;
}
/* ---------- иконки в табах ---------- */

.tab
{
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.tab-icon
{
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	opacity: 0.75;
	transition: opacity var(--t-fast), transform var(--t-spring);
}

.tab:hover .tab-icon
{
	opacity: 1;
}

.tab.is-active .tab-icon
{
	opacity: 1;
	transform: scale(1.08);
	color: var(--accent);
}

/* ---------- fade-in панели при переключении ---------- */

@keyframes panelIn
{
	from
	{
		opacity: 0;
		transform: translateY(6px) scale(0.995);
	}
	to
	{
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.panel.is-entering
{
	animation: panelIn 320ms cubic-bezier(0.2, 0.6, 0.2, 1) both;
}

@media (prefers-reduced-motion: reduce)
{
	.panel.is-entering
	{
		animation: none;
	}
}

/* ---------- тосты ---------- */

.toasts
{
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	gap: 10px;
	pointer-events: none;
	max-width: min(380px, calc(100vw - 40px));
}

.toast
{
	pointer-events: auto;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid var(--border);
	background-color: var(--surface);
	color: var(--text);
	font-size: 13.5px;
	line-height: 1.5;
	box-shadow: var(--shadow-md);
	backdrop-filter: blur(16px) saturate(160%);
	-webkit-backdrop-filter: blur(16px) saturate(160%);
	opacity: 0;
	transform: translateY(8px) scale(0.98);
	transition: opacity 220ms cubic-bezier(0.2, 0.6, 0.2, 1),
	            transform 220ms cubic-bezier(0.2, 0.6, 0.2, 1);
}

.toast.is-visible
{
	opacity: 1;
	transform: translateY(0) scale(1);
}

.toast.is-leaving
{
	opacity: 0;
	transform: translateY(6px) scale(0.98);
}

.toast-icon
{
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	margin-top: 2px;
	border-radius: 50%;
	background-color: var(--accent);
	position: relative;
}

.toast-icon::before
{
	content: "";
	position: absolute;
	inset: 4px;
	border-radius: 50%;
	background-color: var(--surface);
}

.toast.is-error .toast-icon
{
	background-color: var(--red);
}

.toast.is-success .toast-icon
{
	background-color: var(--green);
}

.toast-text
{
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
}

.toast-close
{
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--muted);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	transition: background-color var(--t-fast), color var(--t-fast);
}

.toast-close:hover
{
	background-color: var(--surface-2);
	color: var(--text);
}

@media (max-width: 560px)
{
	.toasts
	{
		right: 12px;
		left: 12px;
		bottom: 12px;
		max-width: none;
	}
}