@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@400;500;600;700&display=swap');

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	--bg: #09090b;
	--surface: #18181b;
	--border: #27272a;
	--text: #fafafa;
	--text-muted: #71717a;
	--accent: #f59e0b;
	--radius: 8px;
}

body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
	background: var(--bg);
	color: var(--text);
	min-height: 100vh;
}

#app {
	max-width: 1400px;
	margin: 0 auto;
	padding: 16px 24px;
	height: 100vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--border);
}

header h1 {
	font-family: 'JetBrains Mono', monospace;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.02em;
}

header h1 span {
	color: var(--accent);
}

.header-links {
	display: flex;
	gap: 16px;
	align-items: center;
}

.header-links a {
	color: var(--text-muted);
	text-decoration: none;
	font-size: 13px;
	transition: color 0.15s;
}

.header-links a:hover {
	color: var(--text);
}

.subtitle {
	display: none;
}

.layout {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 20px;
	flex: 1;
	min-height: 0;
	overflow: hidden;
}

.controls {
	display: flex;
	flex-direction: column;
	gap: 14px;
	overflow-y: auto;
	min-height: 0;
}

.control-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.control-group label {
	font-size: 11px;
	font-family: 'JetBrains Mono', monospace;
	font-weight: 500;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.control-group label span {
	color: var(--text);
	font-variant-numeric: tabular-nums;
}

input[type="text"] {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 10px 12px;
	color: var(--text);
	font-family: 'JetBrains Mono', monospace;
	font-size: 14px;
	font-weight: 500;
	outline: none;
	transition: border-color 0.15s;
}

input[type="text"]:focus {
	border-color: var(--accent);
}

input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 4px;
	background: var(--border);
	border-radius: 2px;
	outline: none;
}

input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--accent);
	cursor: pointer;
	border: 2px solid var(--bg);
}

.toggle-group {
	display: flex;
	gap: 2px;
	background: var(--surface);
	border-radius: var(--radius);
	padding: 2px;
	border: 1px solid var(--border);
}

.toggle {
	flex: 1;
	padding: 6px 10px;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: var(--text-muted);
	font-family: 'JetBrains Mono', monospace;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s;
}

.toggle.active {
	background: var(--accent);
	color: #09090b;
	font-weight: 600;
}

.theme-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 4px;
}

.theme-swatch {
	aspect-ratio: 1;
	border-radius: 6px;
	border: 2px solid transparent;
	cursor: pointer;
	transition: all 0.15s;
	position: relative;
	overflow: hidden;
}

.theme-swatch.active {
	border-color: var(--accent);
}

.theme-swatch:hover {
	transform: scale(1.08);
}

.theme-swatch .swatch-top {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 33%;
}

.theme-swatch .swatch-front {
	position: absolute;
	top: 33%;
	left: 0;
	right: 0;
	height: 33%;
}

.theme-swatch .swatch-side {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 34%;
}

.checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--text);
	cursor: pointer;
}

input[type="checkbox"] {
	width: 14px;
	height: 14px;
	accent-color: var(--accent);
}

.presets {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.preset-btn {
	padding: 4px 10px;
	border: 1px solid var(--border);
	border-radius: 20px;
	background: var(--surface);
	color: var(--text-muted);
	font-family: 'JetBrains Mono', monospace;
	font-size: 11px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s;
	text-transform: capitalize;
}

.preset-btn:hover {
	color: var(--text);
	border-color: var(--accent);
}

.file-info {
	font-family: 'JetBrains Mono', monospace;
	font-size: 11px;
	color: var(--text-muted);
	font-variant-numeric: tabular-nums;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: auto;
	padding-top: 12px;
}

.actions button {
	flex: 1;
	padding: 8px 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text);
	font-family: 'JetBrains Mono', monospace;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s;
}

.actions button:hover {
	background: var(--border);
}

#download-btn {
	background: var(--accent);
	border-color: var(--accent);
	color: #09090b;
	font-weight: 600;
}

#download-btn:hover {
	opacity: 0.9;
}

#share-btn {
	flex-basis: 100%;
}

.preview {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	overflow: hidden;
	position: relative;
	min-height: 0;
}

.svg-container {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px;
}

.svg-container svg {
	max-width: 100%;
	max-height: 100%;
	transition: opacity 0.2s;
}

.svg-container.loading svg {
	opacity: 0.3;
}

@media (max-width: 768px) {
	.layout {
		grid-template-columns: 1fr;
	}
	.preview {
		min-height: 400px;
		order: -1;
	}
}
