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

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	background: #1a1a2e;
	color: #e0e0e0;
	font-size: 14px;
}

#app {
	width: 100%;
	min-height: 100vh;
}

.sidebar {
	max-width: 640px;
	margin: 0 auto;
	padding: 20px;
}

.header {
	margin-bottom: 20px;
}

.header h1 {
	font-size: 24px;
	font-weight: 700;
	color: #fff;
	margin-bottom: 8px;
}

.status {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #999;
}

.dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	display: inline-block;
}

.dot.connected {
	background: #4caf50;
	box-shadow: 0 0 6px #4caf50;
}

.dot.disconnected {
	background: #666;
}

.actions {
	display: flex;
	gap: 10px;
	margin-bottom: 24px;
}

button {
	background: #2a2a4a;
	color: #e0e0e0;
	border: 1px solid #3a3a5a;
	padding: 8px 16px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
	transition: background 0.15s;
}

button:hover {
	background: #3a3a5a;
}

.section {
	margin-bottom: 24px;
}

.section-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.section h2 {
	font-size: 14px;
	font-weight: 600;
	color: #aaa;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 8px;
}

.section-header h2 {
	margin-bottom: 0;
}

.badge {
	background: #3a3a5a;
	color: #ccc;
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 10px;
}

.image-limit {
	font-size: 12px;
	color: #666;
	margin-bottom: 8px;
}

.thumbnail-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
	gap: 8px;
}

.thumbnail {
	aspect-ratio: 1;
	border-radius: 6px;
	overflow: hidden;
	border: 2px solid transparent;
	cursor: pointer;
	transition: border-color 0.15s;
}

.thumbnail:hover {
	border-color: #555;
}

.thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.empty-text {
	color: #555;
	font-size: 13px;
	grid-column: 1 / -1;
	padding: 16px 0;
}

.layout-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.layout-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px 8px;
}

.layout-btn svg {
	display: block;
}

.layout-btn.active {
	background: #6c7aff;
	border-color: #6c7aff;
	color: #fff;
}

.slot-preview {
	position: relative;
	aspect-ratio: 16 / 9;
	width: 100%;
	background: #12122a;
	border-radius: 8px;
	overflow: hidden;
}

.slot-cell {
	position: absolute;
	border: 2px dashed #3a3a5a;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.03);
	display: flex;
	align-items: center;
	justify-content: center;
	transition:
		border-color 0.15s,
		background 0.15s;
	overflow: hidden;
}

.slot-cell.filled {
	border-style: solid;
	border-color: transparent;
	cursor: grab;
}

.slot-cell.drag-over {
	border-color: #6c7aff;
	border-style: solid;
	background: rgba(108, 122, 255, 0.1);
}

.slot-cell.dragging {
	opacity: 0.4;
}

.slot-cell img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
}

.scale-toggle {
	position: absolute;
	bottom: 4px;
	right: 4px;
	padding: 2px 6px;
	font-size: 11px;
	background: rgba(0, 0, 0, 0.6);
	color: #ccc;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 4px;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.15s;
	pointer-events: auto;
}

.slot-cell:hover .scale-toggle {
	opacity: 1;
}

.scale-toggle:hover {
	background: rgba(0, 0, 0, 0.8);
	color: #fff;
}

.thumbnail {
	cursor: grab;
}

.thumbnail.dragging {
	opacity: 0.4;
}
