:root {

	--bg: #0b0b12;
	--fg: #e9e9ef;
	--muted: rgba(235, 235, 245, 0.72);
	--muted-weak: rgba(235, 235, 245, 0.6);

	--panel: rgba(255, 255, 255, 0.045);
	--panel-2: rgba(255, 255, 255, 0.055);

	--border: rgba(255, 255, 255, 0.1);
	--border-2: rgba(255, 255, 255, 0.16);

	--accent: #5d7cff;
	--accent-2: #6f88ff;
	--accent-3: #8da1ff;

	--ok: #65f5a7;
	--warn: #ff9c6a;
	--danger: #ff6a6a;

	--pill-bg: rgba(255, 255, 255, 0.06);
	--focus: 0 0 0 3px rgba(99, 102, 241, 0.45);

	--shadow-1: 0 2px 10px rgba(0, 0, 0, 0.35);
	--shadow-2: 0 12px 40px rgba(0, 0, 0, 0.45);
	--shadow-3: 0 24px 64px rgba(0, 0, 0, 0.55);
	--glass: blur(10px) saturate(160%);
}

@media (prefers-contrast: more) {
	:root {
		--border: rgba(255, 255, 255, 0.22);
		--border-2: rgba(255, 255, 255, 0.3);
		--muted: rgba(235, 235, 245, 0.86);
	}
}

* {
	box-sizing: border-box;
}

html,
body {
	height: 100%;
}

html {
	color-scheme: dark;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font: 14px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
	color: var(--fg);
	background:
		radial-gradient(1200px 900px at 70% -120px, rgba(90, 120, 255, 0.14), transparent 42%),
		radial-gradient(900px 700px at 10% 0%, rgba(20, 220, 180, 0.08), transparent 55%),
		var(--bg);
	background-repeat: no-repeat;
	background-attachment: fixed;
	background-size: cover;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: no-preference) {
	body .card {
		animation: float-up 420ms cubic-bezier(.2, .8, .2, 1) both;
	}

	@keyframes float-up {
		from {
			opacity: 0;
			transform: translateY(8px);
		}

		to {
			opacity: 1;
			transform: translateY(0);
		}
	}
}

.wrap {
	display: flex;
	justify-content: center;
	padding: 24px 16px 40px;
}

.card {
	width: 100%;
	max-width: 1200px;
}

h1 {
	margin: 0 0 8px;
	font-size: 32px;
	font-weight: 750;
	letter-spacing: 0.2px;
	line-height: 1.2;
	background: linear-gradient(to right, var(--accent-2), var(--accent-3));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.h2 {
	font-size: 18px;
	margin: 0 0 10px;
	font-weight: 700;
	letter-spacing: .2px;
	color: var(--accent-2);
}

.sub,
.hint {
	color: var(--muted);
}

.hint {
	font-size: 12px;
}

.section {
	margin: 18px 0;
}

.row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.row.tight {
	gap: 8px;
}

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

.row.between {
	justify-content: space-between;
}

.panel {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 14px 16px;
	backdrop-filter: var(--glass);
	box-shadow: var(--shadow-1);
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.panel:active,
.visual-box:active {
	transform: none;
}

.visual-box {
	background: var(--panel-2);
	border: 1px solid rgba(255, 255, 255, 0.09);
	border-radius: 16px;
	padding: 12px;
	backdrop-filter: var(--glass);
	box-shadow: var(--shadow-1);
	transition: box-shadow .2s ease, transform .2s ease;
}

.visual-title {
	font-size: 13px;
	color: var(--muted);
	margin: 2px 0 8px;
}

.pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--pill-bg);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 999px;
	padding: 6px 10px;
	font-size: 12px;
	color: #f3f4ff;
	line-height: 1;
	white-space: nowrap;
}

.pill.warn {
	border-color: var(--warn);
	color: #ffd4c1;
}

.pill.ok {
	border-color: var(--ok);
	color: #d7ffe9;
}

.pill.danger {
	border-color: var(--danger);
	color: #ffd7d7;
}

.btn {
	appearance: none;
	border: 1px solid var(--border-2);
	background: rgba(255, 255, 255, 0.06);
	color: #f7f7fb;
	padding: 8px 12px;
	border-radius: 12px;
	cursor: pointer;
	transition: transform .04s ease, background .15s ease, border-color .15s ease, opacity .15s ease, box-shadow .15s ease;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.btn:hover {
	background: rgba(255, 255, 255, 0.1);
}

.btn:active {
	transform: translateY(1px);
}

.btn.primary {
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	border-color: transparent;
	color: #fff;
	font-weight: 650;
	box-shadow: 0 6px 20px rgba(93, 124, 255, 0.35);
}

.btn.primary:hover {
	transform: translateY(-1px) scale(1.02);
	box-shadow: 0 10px 28px rgba(93, 124, 255, 0.5);
	background: linear-gradient(135deg, var(--accent-2), #5a76ff);
}

.btn.ghost {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.18);
	color: #e9e9ef;
}

.btn.small {
	padding: 6px 10px;
	border-radius: 10px;
	font-size: 12px;
}

.btn.in {
	background: rgba(0, 0, 0, 0.35);
	border-color: var(--border-2);
	padding: 8px 10px;
	min-width: 96px;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.btn.in:focus-within {
	box-shadow: var(--focus);
}

.btn.in.mini {
	min-width: 56px;
	width: 60px;
	padding: 6px 8px;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.btn.in.mini:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

label>input[type="checkbox"],
label>input[type="radio"] {
	margin-right: 6px;
	transform: translateY(1px);
}

:focus-visible {
	outline: none;
	box-shadow: var(--focus);
	border-radius: 12px;
}

.extras label {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.09);
	padding: 6px 8px;
	border-radius: 10px;
	font-size: 12px;
	transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.extras label:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.16);
}

.nn-raycast {
	fill: transparent;
}

svg#nnSvg,
svg#raysSvg {
	border-radius: 14px;
	background: linear-gradient(to bottom right, rgba(30, 30, 50, 0.3), rgba(10, 10, 20, 0.1));
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 22px rgba(0, 0, 0, 0.4);
}

svg#raysSvg line,
svg#nnSvg line {
	transition: stroke .2s ease, stroke-width .2s ease, opacity .2s ease;
}

svg#raysSvg circle,
svg#nnSvg circle {
	transition: r .2s ease, opacity .2s ease, transform .2s ease;
}

.swatch {
	width: 18px;
	height: 18px;
	border-radius: 6px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	display: inline-block;
}

.split-2 {
	display: grid;
	grid-template-columns: 1fr 1.1fr;
	gap: 16px;
	align-items: start;
	margin-top: 12px;
}

.split-2 .col>.panel,
.split-2 .col>.visual-box {
	width: 100%;
}

@media (max-width:980px) {
	.split-2 {
		grid-template-columns: 1fr;
	}
}

.foot {
	margin-top: 16px;
	color: var(--muted-weak);
	font-size: 12px;
	text-align: center;
	opacity: .85;
}

hr {
	height: 1px;
	border: 0;
	background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
	margin: 12px 0;
}

#cStatus {
	transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

#outputPreview {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
	font-size: 12.5px;
	line-height: 1.45;
	white-space: pre-wrap;
	max-height: 380px;
	overflow: auto;
	background: rgba(0, 0, 0, 0.38);
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

#devForm {
	transition: opacity .2s ease, filter .2s ease;
}

#devForm[style*="pointer-events: none"] {
	filter: grayscale(.1);
}

.extras-summary {
	display: flex;
	align-items: center;
	gap: 6px;
	user-select: none;
}

.extras-summary .arrow {
	display: inline-block;
	width: 0;
	height: 0;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 6px solid var(--accent-2);
	transition: transform .2s ease;
}

details[open]>.extras-summary .arrow {
	transform: rotate(180deg);
}

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