:root {
	--bg: #f6f8fb;
	--panel: #ffffff;
	--text: #0b0d10;
	--muted: #5b6b7b;
	--accent: #3766d6;
	--accent-2: #0fa37f;
	--border: #e6ebf2;
	--danger: #d43d3d;
	--ok: #1a9d72;
}

* { box-sizing: border-box; }
html, body {
	margin: 0;
	padding: 0;
	background: radial-gradient(1200px 600px at 10% 0%, rgba(15, 163, 127, 0.08), transparent 60%),
	            radial-gradient(1200px 600px at 90% 10%, rgba(55, 102, 214, 0.12), transparent 60%),
	            var(--bg);
	color: var(--text);
	font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.app {
	max-width: 1100px;
	margin: 32px auto 80px;
	padding: 0 20px;
}

.app-header {
	text-align: center;
	margin-bottom: 24px;
}
.app-header h1 {
	margin: 0 0 8px;
	font-weight: 700;
	letter-spacing: 0.3px;
}
.app-header p {
	margin: 0;
	color: var(--muted);
}

.panel {
	background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.01));
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 20px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.6);
	margin-bottom: 20px;
}

.dropzone {
	border: 2px dashed rgba(0,0,0,0.12);
	border-radius: 16px;
	padding: 28px;
	text-align: center;
	transition: 0.2s border-color, 0.2s background;
}
.dropzone.dragover {
	border-color: var(--accent);
	background: rgba(55, 102, 214, 0.08);
}
.drop-content .icon {
	font-size: 28px;
	margin-bottom: 8px;
}
.drop-content .title {
	font-size: 16px;
	margin: 4px 0;
}
.drop-content .subtitle {
	margin: 0 0 12px;
	color: var(--muted);
	font-size: 13px;
}

.grid.two-col {
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	gap: 16px;
}
@media (max-width: 960px) {
	.grid.two-col { grid-template-columns: 1fr; }
}

.controls h2, .preview h2 {
	margin: 0 0 12px;
	font-size: 18px;
}

.field {
	margin-bottom: 14px;
}
.field label {
	display: block;
	margin-bottom: 6px;
	color: var(--muted);
	font-size: 13px;
}
.field select, .field input[type="number"], .field input[type="text"] {
	width: 100%;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid var(--border);
	background: #ffffff;
	color: var(--text);
	outline: none;
}
.size-row {
	display: grid;
	grid-template-columns: 1fr 24px 1fr;
	align-items: center;
	gap: 8px;
}
.size-row .x {
	text-align: center;
	color: var(--muted);
}
.checkbox {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	user-select: none;
	margin-top: 6px;
	color: var(--muted);
}
.range-row {
	display: grid;
	grid-template-columns: 1fr 36px;
	align-items: center;
	gap: 8px;
}
.range-row input[type="range"] { width: 100%; }

.actions {
	display: flex;
	gap: 10px;
	margin-top: 8px;
}
.btn {
	padding: 10px 14px;
	border-radius: 10px;
	border: 1px solid var(--border);
	background: #ffffff;
	color: var(--text);
	cursor: pointer;
	transition: 0.15s transform, 0.15s background, 0.15s border-color, 0.15s opacity;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary {
	background: linear-gradient(180deg, rgba(15, 163, 127, 0.12), rgba(55, 102, 214, 0.12));
	border-color: rgba(55, 102, 214, 0.35);
}
.btn.ghost {
	background: transparent;
}

.tips {
	margin-top: 10px;
	color: var(--muted);
	font-size: 13px;
}
.tips ul {
	margin: 6px 0 0 18px;
	padding: 0;
}

.file-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 10px;
}
.file-item {
	display: grid;
	grid-template-rows: auto 1fr auto;
	gap: 8px;
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 10px;
	background: #ffffff;
}
.thumb {
	height: 140px;
	border-radius: 8px;
	background: #f2f5fb;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border: 1px solid rgba(0,0,0,0.05);
}
.thumb img, .thumb canvas {
	max-width: 100%;
	max-height: 100%;
	display: block;
}
.meta {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 6px;
	font-size: 12px;
	color: var(--muted);
}
.status {
	font-size: 12px;
}
.badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	background: rgba(15, 163, 127, 0.08);
	border: 1px solid rgba(15, 163, 127, 0.25);
	color: #0fa37f;
	font-size: 11px;
}
.badge.error {
	background: rgba(212, 61, 61, 0.08);
	border-color: rgba(212, 61, 61, 0.25);
	color: #d43d3d;
}
.actions-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 6px;
}
.small {
	font-size: 12px;
	color: var(--muted);
}
.link {
	color: var(--accent);
	cursor: pointer;
	text-decoration: underline dotted;
}

.app-footer {
	text-align: center;
	color: var(--muted);
	font-size: 12px;
	margin-top: 10px;
}

.toast {
	position: fixed;
	left: 50%;
	transform: translateX(-50%);
	bottom: 24px;
	background: #ffffff;
	border: 1px solid var(--border);
	color: var(--text);
	padding: 10px 14px;
	border-radius: 10px;
	opacity: 0;
	pointer-events: none;
	transition: 0.2s opacity, 0.2s transform;
	box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.toast.show {
	opacity: 1;
	transform: translateX(-50%) translateY(-4px);
}


