.cp-app {
	min-height: 100vh;
}

.is-hidden {
	display: none !important;
}

.cp-hero {
	max-width: var(--it-max);
	margin: 0 auto;
	padding: 40px 24px 24px;
}

.cp-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(300px, 1.1fr);
	gap: 24px 40px;
	align-items: stretch;
	min-height: min(46vh, 400px);
}

.cp-hero__copy {
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.cp-hero__preview {
	position: relative;
	min-height: min(44vh, 380px);
	display: flex;
	align-items: stretch;
	justify-content: center;
}

.cp-hero-preview {
	display: flex;
	flex-direction: column;
	width: 100%;
	min-height: min(44vh, 380px);
	overflow: hidden;
	border-radius: 4px;
}

.cp-hero-preview__image {
	position: relative;
	flex: 1;
	min-height: min(34vh, 300px);
	background: linear-gradient(145deg, #264653 0%, #2a9d8f 28%, #e9c46a 52%, #f4a261 72%, #e76f51 100%);
	overflow: hidden;
}

.cp-hero-preview__scan {
	position: absolute;
	left: 0;
	right: 0;
	height: 3px;
	background: rgba(255, 255, 255, 0.9);
	box-shadow: 0 0 16px rgba(255, 255, 255, 0.6);
	opacity: 0;
	animation: cp-hero-palette-scan 2.6s ease-in-out infinite;
}

.cp-hero-preview__dropper {
	position: absolute;
	width: 18px;
	height: 18px;
	border: 2px solid #fff;
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
	opacity: 0;
	animation: cp-hero-palette-dropper 2.6s ease-in-out infinite;
}

.cp-hero-preview__swatches {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	height: clamp(64px, 9vh, 96px);
	flex-shrink: 0;
}

.cp-hero-preview__swatch {
	background: color-mix(in srgb, var(--c) 35%, #1a1a1a);
	transition: background 0.2s ease;
}

.cp-hero-preview__swatch:nth-child(1) { animation: cp-hero-palette-sample 2.6s ease-in-out infinite; }
.cp-hero-preview__swatch:nth-child(2) { animation: cp-hero-palette-sample 2.6s ease-in-out infinite 0.12s; }
.cp-hero-preview__swatch:nth-child(3) { animation: cp-hero-palette-sample 2.6s ease-in-out infinite 0.24s; }
.cp-hero-preview__swatch:nth-child(4) { animation: cp-hero-palette-sample 2.6s ease-in-out infinite 0.36s; }
.cp-hero-preview__swatch:nth-child(5) { animation: cp-hero-palette-sample 2.6s ease-in-out infinite 0.48s; }

.cp-hero__preview:hover .cp-hero-preview__scan,
.cp-hero__preview:hover .cp-hero-preview__dropper,
.cp-hero__preview:hover .cp-hero-preview__swatch {
	animation-duration: 2s;
}

@keyframes cp-hero-palette-scan {
	0%, 8% { top: 0%; opacity: 0; }
	12% { opacity: 1; }
	68% { top: 100%; opacity: 1; }
	72%, 100% { top: 100%; opacity: 0; }
}

@keyframes cp-hero-palette-dropper {
	0%, 8% { top: 8%; left: 12%; opacity: 0; }
	12% { opacity: 1; }
	68% { top: 88%; left: 72%; opacity: 1; }
	72%, 100% { top: 88%; left: 72%; opacity: 0; }
}

@keyframes cp-hero-palette-sample {
	0%, 20% { background: color-mix(in srgb, var(--c) 35%, #1a1a1a); transform: scaleY(1); }
	28%, 72% { background: var(--c); transform: scaleY(1.06); }
	80%, 100% { background: color-mix(in srgb, var(--c) 35%, #1a1a1a); transform: scaleY(1); }
}

.cp-hero__eyebrow {
	margin: 0 0 10px;
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--it-muted);
}

.cp-hero__title {
	margin: 0 0 8px;
	font-size: clamp(1.65rem, 3vw, 2.25rem);
	font-weight: 600;
	letter-spacing: -0.03em;
}

.cp-hero__lead {
	margin: 0;
	max-width: 40rem;
	color: var(--it-muted);
	line-height: 1.6;
	font-size: 0.95rem;
}

@media (max-width: 768px) {
	.cp-hero__grid {
		grid-template-columns: 1fr;
		min-height: 0;
	}

	.cp-hero__preview {
		order: -1;
		min-height: min(38vh, 320px);
	}

	.cp-hero-preview {
		min-height: min(38vh, 320px);
	}

	.cp-hero-preview__image {
		min-height: min(28vh, 240px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cp-hero-preview__scan,
	.cp-hero-preview__dropper,
	.cp-hero-preview__swatch {
		animation: none !important;
		opacity: 1;
	}

	.cp-hero-preview__scan {
		top: 50%;
	}

	.cp-hero-preview__dropper {
		top: 72%;
		left: 68%;
	}

	.cp-hero-preview__swatch {
		background: var(--c);
		transform: none;
	}
}

.cp-stage {
	max-width: var(--it-max);
	margin: 0 auto;
	padding: 12px 24px 72px;
}

.cp-stage__sheet {
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 4px;
	background:
		linear-gradient(rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
		radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0);
	background-size: auto, 18px 18px;
	overflow: hidden;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.cp-stage__upload {
	position: relative;
	min-height: min(52vh, 460px);
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

.cp-upload__toolbar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	padding: 16px 20px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(0, 0, 0, 0.18);
}

.cp-upload__toolbar-hint {
	font-size: 0.8rem;
	color: var(--it-muted);
}

.cp-upload__input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.cp-upload__empty,
.cp-upload__preview {
	width: 100%;
}

.cp-upload__empty {
	flex: 1;
	min-height: min(44vh, 400px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 24px;
	cursor: pointer;
	outline: none;
}

.cp-upload__dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: min(100%, 420px);
	padding: 40px 32px;
	border: 1.5px dashed rgba(255, 255, 255, 0.16);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.02);
	text-align: center;
	transition:
		border-color 0.2s ease,
		background 0.2s ease,
		transform 0.2s ease,
		box-shadow 0.2s ease;
}

.cp-upload__empty:hover .cp-upload__dropzone,
.cp-upload__empty:focus-visible .cp-upload__dropzone {
	border-color: rgba(255, 255, 255, 0.28);
	background: rgba(255, 255, 255, 0.04);
}

.cp-upload__empty:focus-visible .cp-upload__dropzone {
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.cp-stage__upload.is-dragover .cp-upload__dropzone {
	border-color: rgba(255, 255, 255, 0.45);
	background: rgba(255, 255, 255, 0.06);
	transform: scale(1.01);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 40px rgba(0, 0, 0, 0.35);
}

.cp-upload__icon {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	margin-bottom: 20px;
	color: var(--it-muted);
}

.cp-upload__icon-arrow {
	width: 40px;
	height: 40px;
	animation: cp-upload-bounce 1.6s cubic-bezier(0.34, 1.4, 0.64, 1) infinite;
}

@keyframes cp-upload-bounce {
	0%, 100% { transform: translateY(0); }
	40% { transform: translateY(-10px); }
	55% { transform: translateY(2px); }
	70% { transform: translateY(-4px); }
	82% { transform: translateY(0); }
}

.cp-stage__upload.is-dragover .cp-upload__icon-arrow {
	animation-duration: 0.9s;
	color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
	.cp-upload__icon-arrow {
		animation: none;
		opacity: 1;
	}
}

.cp-upload__title {
	margin: 0 0 6px;
	font-size: 1.1rem;
	font-weight: 600;
	letter-spacing: -0.02em;
}

.cp-upload__hint {
	margin: 0 0 18px;
	font-size: 0.875rem;
	color: var(--it-muted);
}

.cp-upload__preview {
	position: relative;
	flex: 1;
	min-height: 280px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 24px;
	background: rgba(0, 0, 0, 0.22);
}

.cp-stage__upload.is-dragover .cp-upload__preview,
.cp-stage__upload.is-dragover .cp-upload__dropzone {
	background: rgba(255, 255, 255, 0.04);
}

.cp-upload__img {
	max-width: 100%;
	max-height: min(40vh, 360px);
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

.cp-upload__action {
	padding: 8px 12px;
	border-radius: 6px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: rgba(10, 11, 13, 0.72);
	color: var(--it-text);
	font: inherit;
	font-size: 0.8rem;
	cursor: pointer;
	backdrop-filter: blur(8px);
	transition: border-color 0.15s ease, background 0.15s ease;
	display: inline-flex;
	align-items: center;
}

.cp-upload__action:hover {
	border-color: rgba(var(--it-accent-rgb), 0.35);
	background: rgba(10, 11, 13, 0.88);
}

.cp-stage__rule {
	height: 1px;
	background: rgba(255, 255, 255, 0.1);
}

.cp-stage__palette {
	padding: 24px 0 0;
	min-height: 220px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	overflow: visible;
}

.cp-palette__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding: 0 32px;
}

.cp-palette__meta {
	margin: 0;
	font-size: 0.8rem;
	color: var(--it-muted);
	letter-spacing: 0.02em;
}

.cp-palette__controls {
	display: flex;
	align-items: center;
	gap: 12px;
}

.cp-stepper {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 4px 6px 4px 12px;
	border-radius: 999px;
	border: 1px solid var(--it-border);
	background: rgba(255, 255, 255, 0.04);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cp-stepper__label {
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--it-muted);
	white-space: nowrap;
}

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

.cp-stepper__btn {
	width: 28px;
	height: 28px;
	border: 1px solid var(--it-accent);
	border-radius: 50%;
	background: var(--it-accent);
	color: #041018;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	display: grid;
	place-items: center;
	padding: 0;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.cp-stepper__btn:hover:not(:disabled) {
	background: var(--it-accent-hover);
	border-color: var(--it-accent-hover);
	transform: translateY(-1px);
}

.cp-stepper__btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
	border-color: rgba(var(--it-accent-rgb), 0.25);
	background: rgba(var(--it-accent-rgb), 0.12);
	color: var(--it-muted);
}

.cp-stepper__value {
	min-width: 1.1rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--it-text);
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.cp-copy-all {
	padding: 8px 14px;
	border-radius: 999px;
	border: 1px solid rgba(var(--it-accent-rgb), 0.28);
	background: rgba(var(--it-accent-rgb), 0.08);
	color: var(--it-accent);
	font: inherit;
	font-size: 0.75rem;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.cp-copy-all:hover {
	background: rgba(var(--it-accent-rgb), 0.14);
	border-color: rgba(var(--it-accent-rgb), 0.45);
	transform: translateY(-1px);
}

.cp-palette__empty {
	display: grid;
	place-items: center;
	min-height: 140px;
	margin: 0 32px 32px;
	border: 1px dashed rgba(255, 255, 255, 0.08);
	color: var(--it-muted);
	font-size: 0.875rem;
	text-align: center;
	padding: 24px;
}

.cp-board {
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow: visible;
}

.cp-board__hero {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	min-height: 220px;
	overflow: visible;
}

.cp-board__hero-side {
	display: grid;
	grid-template-rows: 1fr 1fr;
	min-height: 220px;
	overflow: visible;
}

.cp-board__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	overflow: visible;
}

.cp-board__grid--solo {
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.cp-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	width: 100%;
	min-height: 110px;
	padding: 18px 20px;
	border: none;
	border-radius: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	overflow: hidden;
	transform: scale(1);
	transform-origin: center center;
	transition: transform 0.22s ease, filter 0.15s ease, box-shadow 0.22s ease;
}

.cp-tile--hero {
	min-height: 220px;
	padding: 22px 24px;
}

.cp-tile--half {
	min-height: 110px;
}

.cp-tile:hover,
.cp-tile:focus-visible {
	transform: scale(1.04);
	filter: brightness(1.06);
	box-shadow:
		inset 0 0 0 2px rgba(255, 255, 255, 0.22),
		0 10px 24px rgba(0, 0, 0, 0.28);
	z-index: 3;
}

.cp-tile__name,
.cp-tile__specs {
	position: relative;
	z-index: 1;
}

.cp-tile__copy {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 14px;
	opacity: 0;
	transform: translate(-50%, -50%) scale(0.88);
	pointer-events: none;
	transition: opacity 0.15s ease, transform 0.15s ease;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.cp-tile__copy svg {
	width: 100%;
	height: 100%;
}

.cp-tile--hero .cp-tile__copy {
	width: 16px;
	height: 16px;
}

.cp-tile:hover .cp-tile__copy,
.cp-tile:focus-visible .cp-tile__copy {
	opacity: 0.92;
	transform: translate(-50%, -50%) scale(1.08);
}

.cp-tile__name {
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.cp-tile--hero .cp-tile__name {
	font-size: 1.35rem;
}

.cp-tile__specs {
	display: flex;
	flex-direction: column;
	gap: 3px;
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: 0.68rem;
	font-weight: 400;
	line-height: 1.45;
	letter-spacing: 0.01em;
	opacity: 0.96;
}

.cp-tile--hero .cp-tile__specs {
	font-size: 0.72rem;
}

.cp-toast {
	position: fixed;
	left: 50%;
	bottom: 28px;
	transform: translateX(-50%) translateY(12px);
	padding: 10px 16px;
	border-radius: 999px;
	background: rgba(10, 11, 13, 0.92);
	border: 1px solid rgba(var(--it-accent-rgb), 0.35);
	color: var(--it-text);
	font-size: 0.875rem;
	font-weight: 500;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: 50;
}

.cp-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
	.cp-palette__toolbar,
	.cp-palette__empty {
		padding-left: 16px;
		padding-right: 16px;
	}

	.cp-palette__empty {
		margin-left: 16px;
		margin-right: 16px;
	}

	.cp-board__hero {
		grid-template-columns: 1fr;
		min-height: auto;
	}

	.cp-board__hero-side {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: 1fr;
		min-height: 120px;
	}

	.cp-tile--hero {
		min-height: 160px;
	}

	.cp-board__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 480px) {
	.cp-board__hero-side {
		grid-template-columns: 1fr;
		grid-template-rows: repeat(2, minmax(0, 1fr));
	}

	.cp-stage__upload,
	.cp-upload__empty,
	.cp-upload__preview {
		min-height: 280px;
	}
}
