/* ==========================================================
   RESET
========================================================== */

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

:root {
	--bg-1: #fff7f0;

	--surface: #ffffff;
	--surface-soft: #fafbff;

	--border: #ececf5;
	--border-strong: #dfe0ee;

	--text: #1a1a2e;
	--text-muted: #6b6b8a;
	--text-dim: #9a9ab5;

	--pink: #ff5c8a;
	--pink-soft: #ffb3c8;
	--orange: #ff9d5c;
	--violet: #8b5cf6;
	--blue: #3b82f6;
	--green: #10b981;
	--red: #ef4444;

	--grad-warm: linear-gradient(135deg, #ff5c8a 0%, #ff9d5c 100%);
	--grad-cool: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
	--grad-full: linear-gradient(135deg, #ff5c8a 0%, #ff9d5c 50%, #8b5cf6 100%);

	--radius-sm: 10px;
	--radius: 14px;
	--radius-lg: 20px;

	--shadow-sm: 0 2px 8px rgba(50, 30, 90, .06);
	--shadow: 0 8px 24px -6px rgba(50, 30, 90, .1);
	--shadow-pink: 0 8px 24px -6px rgba(255, 92, 138, .35);
	--shadow-pop: 0 20px 50px -12px rgba(50, 30, 90, .25);
	--shadow-toast: 0 12px 36px -8px rgba(50, 30, 90, .22);

	--transition: .2s cubic-bezier(.4, 0, .2, 1);
}

html,
body {
	height: 100%;
	margin: 0;
	overflow: hidden;
}

body {
	font-family:
		"Inter",
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		Roboto,
		sans-serif;
	color: var(--text);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	background:
		radial-gradient(900px 600px at 0% 0%, #ffe4ec 0%, transparent 55%),
		radial-gradient(900px 600px at 100% 100%, #e0e7ff 0%, transparent 55%),
		radial-gradient(700px 500px at 100% 0%, #ffe9d6 0%, transparent 50%),
		radial-gradient(700px 500px at 0% 100%, #f5e1ff 0%, transparent 50%),
		var(--bg-1);
}

img,
canvas {
	max-width: 100%;
	display: block;
}

/* ==========================================================
   APP SHELL
========================================================== */

.app {
	height: 100vh;
	height: 100dvh;
	display: grid;
	grid-template-rows: auto 1fr;
	padding: 14px 20px 16px;
	gap: 12px;
	max-width: 1400px;
	margin: 0 auto;
}

/* ==========================================================
   HEADER
========================================================== */

.header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 8px 4px;
}

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

.brand-mark {
	width: 36px;
	height: 36px;
	border-radius: 12px;
	background: var(--grad-full);
	display: grid;
	place-items: center;
	font-size: 17px;
	color: white;
	box-shadow: var(--shadow-pink);
	transform: rotate(-6deg);
}

.brand-text {
	display: flex;
	flex-direction: column;
	line-height: 1.15;
}

.brand-title {
	font-size: 15px;
	font-weight: 800;
	letter-spacing: -.02em;
	background: var(--grad-full);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.brand-sub {
	font-size: 11px;
	color: var(--text-muted);
	font-weight: 500;
}

.stepper {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 5px;
	background: rgba(255, 255, 255, .7);
	backdrop-filter: blur(10px);
	border: 1px solid var(--border);
	border-radius: 999px;
	box-shadow: var(--shadow-sm);
}

.step {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 6px 14px;
	border-radius: 999px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--text-dim);
	transition: all var(--transition);
}

.step-num {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: #f0f0f8;
	font-size: 11px;
	font-weight: 800;
	color: var(--text-dim);
	transition: all var(--transition);
}

.step.active {
	background: var(--grad-warm);
	color: white;
	box-shadow: var(--shadow-pink);
}

.step.active .step-num {
	background: rgba(255, 255, 255, .3);
	color: white;
}

.step.done .step-num {
	background: var(--green);
	color: white;
}

.step.done {
	color: var(--green);
}

.step-divider {
	width: 14px;
	height: 2px;
	border-radius: 2px;
	background: var(--border-strong);
}

/* ==========================================================
   MAIN GRID
========================================================== */

.main {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	min-height: 0;
}

.panel {
	background: rgba(255, 255, 255, .85);
	backdrop-filter: blur(14px);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 16px;
	box-shadow: var(--shadow);
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-height: 0;
	overflow: hidden;
}

.panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-shrink: 0;
	position: relative;
	z-index: 5;
}

.panel-head-hasil {
	display: grid;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-shrink: 0;
	position: relative;
	z-index: 5;
}

.panel-title {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: 13.5px;
	font-weight: 700;
	letter-spacing: -.01em;
	color: var(--text);
}

.panel-icon {
	width: 26px;
	height: 26px;
	border-radius: 8px;
	display: grid;
	place-items: center;
	font-size: 13px;
	color: white;
}

.icon-warm  { background: var(--grad-warm); }
.icon-cool  { background: var(--grad-cool); }

.panel-body {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* ==========================================================
   TOMBOL RESET
========================================================== */

.reset-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	background: white;
	border: 1px solid var(--border-strong);
	font-family: inherit;
	font-size: 11.5px;
	font-weight: 700;
	color: var(--text-muted);
	cursor: pointer;
	transition: all var(--transition);
	white-space: nowrap;
}

.reset-btn:hover {
	color: var(--pink);
	border-color: var(--pink);
	transform: rotate(-2deg) scale(1.03);
}

.reset-btn:active {
	transform: rotate(0) scale(.98);
}

.reset-btn .reset-icon {
	font-size: 13px;
	transition: transform var(--transition);
}

.reset-btn:hover .reset-icon {
	transform: rotate(-180deg);
}

/* ==========================================================
   DROP ZONE
========================================================== */

.drop {
	flex: 1;
	min-height: 0;
	border-radius: var(--radius);
	border: 2px dashed var(--border-strong);
	background:
		linear-gradient(135deg, rgba(255, 92, 138, .04), rgba(139, 92, 246, .04)),
		var(--surface-soft);
	padding: 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	text-align: center;
	cursor: pointer;
	position: relative;
	transition: all var(--transition);
}

.drop:hover {
	border-color: var(--pink);
	background:
		linear-gradient(135deg, rgba(255, 92, 138, .08), rgba(139, 92, 246, .08)),
		var(--surface-soft);
}

.drop.dragover {
	border-color: var(--violet);
	border-style: solid;
	transform: scale(1.005);
}

.drop-icon {
	width: 64px;
	height: 64px;
	border-radius: 18px;
	background: var(--grad-full);
	display: grid;
	place-items: center;
	font-size: 26px;
	color: white;
	box-shadow: var(--shadow-pink);
	transition: transform var(--transition);
}

.drop:hover .drop-icon {
	transform: scale(1.08) rotate(-6deg);
}

.drop-title {
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -.01em;
	color: var(--text);
}

.drop-sub {
	font-size: 12.5px;
	color: var(--text-muted);
}

.drop-chips {
	display: flex;
	gap: 5px;
	flex-wrap: wrap;
	justify-content: center;
	margin-top: 2px;
}

.chip {
	font-size: 10.5px;
	font-weight: 700;
	padding: 3px 9px;
	border-radius: 999px;
	background: white;
	border: 1px solid var(--border);
	color: var(--text-muted);
	letter-spacing: .03em;
}

/* ==========================================================
   PREVIEW
========================================================== */

.preview {
	flex: 1;
	min-height: 0;
	border-radius: var(--radius);
	border: 1px solid var(--border);
	background:
		linear-gradient(135deg, rgba(255, 92, 138, .03), rgba(139, 92, 246, .03)),
		var(--surface-soft);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 10px;
	position: relative;
}

.preview img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 8px;
}

/* ==========================================================
   CANVAS
========================================================== */

.canvas-wrap {
	flex: 1;
	min-height: 0;
	border-radius: var(--radius);
	border: 1px solid var(--border);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 10px;
	position: relative;

	background-color: var(--surface-soft);
	background-image:
		linear-gradient(45deg, #e8e8f2 25%, transparent 25%),
		linear-gradient(-45deg, #e8e8f2 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #e8e8f2 75%),
		linear-gradient(-45deg, transparent 75%, #e8e8f2 75%);
	background-size: 20px 20px;
	background-position:
		0 0,
		0 10px,
		10px -10px,
		-10px 0;
}

.canvas-wrap.draggable {
	cursor: grab;
}

.canvas-wrap.dragging {
	cursor: grabbing;
}

.canvas-wrap.dragging #resultCanvas {
	user-select: none;
	-webkit-user-select: none;
}

#resultCanvas {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 8px;
	will-change: contents;
}

.drag-hint {
	position: absolute;
	bottom: 14px;
	left: 50%;
	transform: translateX(-50%);
	padding: 7px 14px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .7);
	color: white;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: .01em;
	pointer-events: none;
	opacity: 0;
	transition: opacity .3s;
	z-index: 5;
	white-space: nowrap;
	backdrop-filter: blur(6px);
}

.drag-hint.show {
	opacity: 1;
}

.reset-pos-btn {
	position: absolute;
	top: 14px;
	right: 14px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .95);
	border: 1px solid var(--border-strong);
	font-family: inherit;
	font-size: 11.5px;
	font-weight: 700;
	color: var(--text-muted);
	cursor: pointer;
	box-shadow: var(--shadow-sm);
	transition: all var(--transition);
	z-index: 5;
	opacity: 0;
	transform: translateY(-6px);
	pointer-events: none;
}

.reset-pos-btn.show {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.reset-pos-btn:hover {
	color: var(--violet);
	border-color: var(--violet);
}

/* ==========================================================
   BUTTONS
========================================================== */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	border: none;
	border-radius: var(--radius-sm);
	padding: 11px 18px;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 700;
	letter-spacing: -.005em;
	cursor: pointer;
	transition: all var(--transition);
	white-space: nowrap;
}

.btn-primary {
	background: var(--grad-warm);
	color: white;
	box-shadow: var(--shadow-pink);
}

.btn-primary:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 12px 28px -8px rgba(255, 92, 138, .5);
	filter: brightness(1.05);
}

.btn-primary:active:not(:disabled) {
	transform: translateY(0);
}

.btn-primary:disabled {
	opacity: .55;
	cursor: not-allowed;
	box-shadow: none;
}

.btn-violet {
	background: var(--grad-cool);
	box-shadow: 0 8px 24px -6px rgba(139, 92, 246, .4);
}

.btn-violet:hover:not(:disabled) {
	box-shadow: 0 12px 28px -8px rgba(139, 92, 246, .55);
}

.btn-ghost {
	background: white;
	color: var(--text);
	border: 1px solid var(--border-strong);
}

.btn-ghost:hover {
	border-color: var(--pink);
	color: var(--pink);
}

.btn-block {
	width: 100%;
}

.btn-icon {
	font-size: 15px;
	line-height: 1;
}

/* ==========================================================
   INFO BAR
========================================================== */

.info-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	border-radius: var(--radius-sm);
	background:
		linear-gradient(135deg, rgba(255, 92, 138, .06), rgba(139, 92, 246, .06));
	border: 1px solid var(--border);
	font-size: 12px;
	flex-shrink: 0;
}

.info-bar .file-icon {
	width: 30px;
	height: 30px;
	border-radius: 9px;
	background: var(--grad-full);
	display: grid;
	place-items: center;
	font-size: 14px;
	color: white;
	flex-shrink: 0;
}

.info-bar .file-text {
	min-width: 0;
	flex: 1;
}

.info-bar .file-name {
	color: var(--text);
	font-weight: 700;
	font-size: 12.5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.info-bar .file-meta {
	color: var(--text-muted);
	font-size: 11px;
}

/* ==========================================================
   SEGMENTED CONTROL
========================================================== */

.segmented {
	display: inline-flex;
	padding: 3px;
	border-radius: 999px;
	background: var(--surface-soft);
	border: 1px solid var(--border);
	gap: 2px;
	align-items: center;
}

.segmented input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.segmented label {
	padding: 6px 11px;
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 700;
	color: var(--text-muted);
	cursor: pointer;
	transition: all var(--transition);
	user-select: none;
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.segmented label:hover {
	color: var(--text);
}

.segmented input[type="radio"]:checked + label {
	background: var(--grad-cool);
	color: white;
	box-shadow: 0 4px 12px -3px rgba(139, 92, 246, .4);
}

.segmented .color-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #ffffff;
	border: 2px solid rgba(255, 255, 255, .8);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .1);
	transition: transform var(--transition);
}

.segmented .image-icon {
	font-size: 11px;
	line-height: 1;
}

/* ==========================================================
   POPOVER (shared)
========================================================== */

.pop {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	width: 268px;
	padding: 12px;
	background: white;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-pop);
	z-index: 50;
	opacity: 0;
	transform: translateY(-6px) scale(.97);
	pointer-events: none;
	transition: opacity var(--transition), transform var(--transition);
}

.pop.open {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.pop::before {
	content: "";
	position: absolute;
	top: -5px;
	right: 24px;
	width: 10px;
	height: 10px;
	background: white;
	border-top: 1px solid var(--border);
	border-left: 1px solid var(--border);
	transform: rotate(45deg);
	border-radius: 2px 0 0 0;
}

/* ==========================================================
   POPOVER WARNA
========================================================== */

.color-tabs {
	display: flex;
	gap: 3px;
	padding: 3px;
	margin-bottom: 12px;
	border-radius: 999px;
	background: var(--surface-soft);
	border: 1px solid var(--border);
}

.color-tab {
	flex: 1;
	padding: 6px 8px;
	border-radius: 999px;
	background: transparent;
	border: none;
	font-family: inherit;
	font-size: 11.5px;
	font-weight: 700;
	color: var(--text-muted);
	cursor: pointer;
	transition: all var(--transition);
}

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

.color-tab.active {
	background: var(--grad-cool);
	color: white;
	box-shadow: 0 4px 10px -3px rgba(139, 92, 246, .4);
}

.color-pane {
	display: none;
}

.color-pane.active {
	display: block;
}

.color-grid {
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 5px;
}

.color-cell {
	aspect-ratio: 1;
	border-radius: 8px;
	border: 2px solid transparent;
	cursor: pointer;
	transition: all var(--transition);
	padding: 0;
	position: relative;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05);
}

.color-cell:hover {
	transform: scale(1.12);
	z-index: 2;
}

.color-cell.selected {
	border-color: var(--violet);
	box-shadow:
		0 0 0 2px white,
		0 0 0 4px var(--violet);
}

.color-cell.white-cell {
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

.custom-wrap {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

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

.custom-preview-swatch {
	width: 42px;
	height: 42px;
	border-radius: 12px;
	border: 2px solid white;
	box-shadow:
		0 0 0 1px var(--border),
		0 4px 10px -3px rgba(50, 30, 90, .15);
	flex-shrink: 0;
}

.custom-info {
	flex: 1;
	min-width: 0;
}

.custom-info-label {
	font-size: 10.5px;
	font-weight: 700;
	color: var(--text-dim);
	letter-spacing: .05em;
	text-transform: uppercase;
}

.custom-info-hex {
	font-size: 14px;
	font-weight: 800;
	color: var(--text);
	font-family: "SF Mono", Menlo, Consolas, monospace;
	letter-spacing: .02em;
}

.custom-actions {
	display: flex;
	gap: 6px;
}

.custom-actions .btn {
	flex: 1;
	padding: 8px 10px;
	font-size: 12px;
}

.native-picker {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
	border: none;
	padding: 0;
}

/* ==========================================================
   POPOVER GAMBAR
========================================================== */

.image-pop {
	width: 280px;
}

.image-pop-title {
	font-size: 11px;
	font-weight: 700;
	color: var(--text-dim);
	letter-spacing: .05em;
	text-transform: uppercase;
	margin-bottom: 8px;
}

.image-preview {
	width: 100%;
	height: 130px;
	border-radius: var(--radius-sm);
	background: var(--surface-soft);
	border: 1px solid var(--border);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	margin-bottom: 10px;
	position: relative;
	background-image:
		linear-gradient(45deg, #e8e8f2 25%, transparent 25%),
		linear-gradient(-45deg, #e8e8f2 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #e8e8f2 75%),
		linear-gradient(-45deg, transparent 75%, #e8e8f2 75%);
	background-size: 16px 16px;
	background-position:
		0 0,
		0 8px,
		8px -8px,
		-8px 0;
}

.image-preview img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 6px;
}

.image-preview-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	color: var(--text-dim);
	font-size: 11.5px;
}

.image-preview-empty .icon {
	font-size: 22px;
	opacity: .5;
}

.image-fit {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 4px;
	padding: 3px;
	border-radius: 999px;
	background: var(--surface-soft);
	border: 1px solid var(--border);
	margin-bottom: 10px;
}

.image-fit button {
	padding: 5px 6px;
	border-radius: 999px;
	background: transparent;
	border: none;
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	color: var(--text-muted);
	cursor: pointer;
	transition: all var(--transition);
}

.image-fit button:hover {
	color: var(--text);
}

.image-fit button.active {
	background: var(--grad-cool);
	color: white;
	box-shadow: 0 4px 10px -3px rgba(139, 92, 246, .4);
}

.image-actions {
	display: flex;
	gap: 6px;
}

.image-actions .btn {
	flex: 1;
	padding: 8px 10px;
	font-size: 12px;
}

/* ==========================================================
   POPOVER PRESET
========================================================== */

.preset-pop {
	width: 300px;
	max-height: 440px;
	overflow-y: auto;
	padding: 14px;
}

/* Custom scrollbar */
.preset-pop::-webkit-scrollbar {
	width: 6px;
}

.preset-pop::-webkit-scrollbar-thumb {
	background: var(--border-strong);
	border-radius: 3px;
}

.preset-pop::-webkit-scrollbar-thumb:hover {
	background: var(--text-dim);
}

.preset-group {
	margin-bottom: 16px;
}

.preset-group:last-child {
	margin-bottom: 0;
}

.preset-group-title {
	font-size: 10.5px;
	font-weight: 800;
	color: var(--text-dim);
	letter-spacing: .08em;
	text-transform: uppercase;
	margin-bottom: 8px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.preset-group-title::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--border);
}

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

.preset-item {
	aspect-ratio: 1;
	border-radius: var(--radius-sm);
	border: 2px solid transparent;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	padding: 0;
	background: var(--surface-soft);
	transition: all var(--transition);
	box-shadow:
		inset 0 0 0 1px rgba(0, 0, 0, .06),
		0 2px 6px -2px rgba(50, 30, 90, .1);
}

.preset-item:hover {
	transform: translateY(-2px) scale(1.03);
	box-shadow:
		inset 0 0 0 1px rgba(0, 0, 0, .06),
		0 8px 16px -4px rgba(50, 30, 90, .2);
}

.preset-item.selected {
	border-color: var(--violet);
	box-shadow:
		0 0 0 2px white,
		0 0 0 4px var(--violet),
		0 8px 16px -4px rgba(139, 92, 246, .4);
}

.preset-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.preset-item .preset-name {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 4px 6px;
	background: linear-gradient(to top, rgba(0, 0, 0, .75), transparent);
	color: white;
	font-size: 9.5px;
	font-weight: 700;
	text-align: center;
	letter-spacing: .02em;
	text-overflow: ellipsis;
	overflow: hidden;
	white-space: nowrap;
}

/* Loading state */
.preset-item.loading::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
	animation: presetShimmer 1.2s infinite;
}

@keyframes presetShimmer {
	0%   { transform: translateX(-100%); }
	100% { transform: translateX(100%); }
}

.preset-item.error {
	background:
		repeating-linear-gradient(
			45deg,
			#f5f5f8,
			#f5f5f8 6px,
			#e8e8f0 6px,
			#e8e8f0 12px
		);
}

.preset-item.error::before {
	content: "⚠";
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: var(--text-dim);
	font-size: 18px;
}

/* ==========================================================
   TOAST STACK
========================================================== */

.toast-stack {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 9999;
	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: 12px;
	padding: 13px 15px;
	background: white;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-toast);
	min-width: 280px;
	position: relative;
	overflow: hidden;
	opacity: 0;
	transform: translateX(120%) scale(.95);
	transition:
		opacity .3s cubic-bezier(.4, 0, .2, 1),
		transform .3s cubic-bezier(.4, 0, .2, 1);
}

.toast.show {
	opacity: 1;
	transform: translateX(0) scale(1);
}

.toast.hide {
	opacity: 0;
	transform: translateX(120%) scale(.95);
	pointer-events: none;
}

.toast-icon {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-size: 15px;
	color: white;
	flex-shrink: 0;
	margin-top: 1px;
}

.toast-info .toast-icon {
	background: var(--grad-cool);
}

.toast-success .toast-icon {
	background: linear-gradient(135deg, #10b981, #059669);
}

.toast-error .toast-icon {
	background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast-warning .toast-icon {
	background: linear-gradient(135deg, #f59e0b, #d97706);
}

.toast-body {
	flex: 1;
	min-width: 0;
	padding-top: 3px;
}

.toast-title {
	font-size: 13px;
	font-weight: 700;
	color: var(--text);
	letter-spacing: -.01em;
	margin-bottom: 2px;
}

.toast-message {
	font-size: 12.5px;
	color: var(--text-muted);
	line-height: 1.45;
	word-break: break-word;
}

.toast-close {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: transparent;
	border: none;
	color: var(--text-dim);
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	display: grid;
	place-items: center;
	transition: all var(--transition);
	flex-shrink: 0;
	margin-top: 3px;
}

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

.toast-progress {
	position: absolute;
	bottom: 0;
	left: 0;
	height: 3px;
	width: 100%;
	background: var(--border);
	border-radius: 0 0 var(--radius) var(--radius);
	overflow: hidden;
}

.toast-progress-bar {
	height: 100%;
	width: 100%;
	transform-origin: left;
	animation: toastProgress linear forwards;
}

.toast-info .toast-progress-bar {
	background: var(--grad-cool);
}

.toast-success .toast-progress-bar {
	background: linear-gradient(90deg, #10b981, #059669);
}

.toast-error .toast-progress-bar {
	background: linear-gradient(90deg, #ef4444, #dc2626);
}

.toast-warning .toast-progress-bar {
	background: linear-gradient(90deg, #f59e0b, #d97706);
}

@keyframes toastProgress {
	from { transform: scaleX(1); }
	to   { transform: scaleX(0); }
}

/* ==========================================================
   MODAL CONFIRM
========================================================== */

.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(20, 15, 40, .45);
	backdrop-filter: blur(6px);
	z-index: 9000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	pointer-events: none;
	transition: opacity .22s ease;
}

.modal-overlay.open {
	opacity: 1;
	pointer-events: auto;
}

.modal {
	width: 100%;
	max-width: 400px;
	background: white;
	border-radius: var(--radius-lg);
	box-shadow: 0 30px 70px -20px rgba(50, 30, 90, .4);
	padding: 24px;
	transform: scale(.94) translateY(10px);
	opacity: 0;
	transition:
		transform .25s cubic-bezier(.4, 0, .2, 1),
		opacity .25s ease;
}

.modal-overlay.open .modal {
	transform: scale(1) translateY(0);
	opacity: 1;
}

.modal-icon {
	width: 50px;
	height: 50px;
	border-radius: 15px;
	background: var(--grad-full);
	display: grid;
	place-items: center;
	font-size: 22px;
	color: white;
	box-shadow: var(--shadow-pink);
	margin-bottom: 14px;
}

.modal-title {
	font-size: 17px;
	font-weight: 800;
	letter-spacing: -.02em;
	color: var(--text);
	margin: 0 0 8px;
}

.modal-desc {
	font-size: 13.5px;
	color: var(--text-muted);
	line-height: 1.5;
	margin: 0 0 22px;
}

.modal-actions {
	display: flex;
	gap: 10px;
}

.modal-actions .btn {
	flex: 1;
	padding: 12px 16px;
}

/* ==========================================================
   EMPTY STATE
========================================================== */

.empty {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	text-align: center;
	color: var(--text-dim);
	font-size: 12.5px;
	padding: 20px;
}

.empty-icon {
	font-size: 40px;
	opacity: .55;
	margin-bottom: 4px;
}

.empty-title {
	font-size: 13.5px;
	font-weight: 700;
	color: var(--text-muted);
}

/* ==========================================================
   HIDDEN
========================================================== */

.hidden {
	display: none !important;
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 860px) {
	html, body {
		overflow: auto;
	}

	.app {
		height: auto;
		min-height: 100vh;
		min-height: 100dvh;
		padding: 12px;
	}

	.main {
		grid-template-columns: 1fr;
	}

	.panel {
		min-height: 340px;
	}

	.drop, .preview, .canvas-wrap {
		min-height: 220px;
	}

	.brand-sub {
		display: none;
	}

	.step-label {
		display: none;
	}

	.step.active .step-label {
		display: inline;
	}

	.pop {
		width: 240px;
	}

	.preset-pop {
		width: min(300px, calc(100vw - 40px));
	}

	.toast-stack {
		top: auto;
		bottom: 12px;
		right: 12px;
		left: 12px;
		max-width: none;
	}
}

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