.model-viewer {
	display: flex;
	flex-direction: column;
	background: var(--viewer-bg);
	border: 1px solid var(--viewer-border);
	border-radius: 8px;
	overflow: hidden;
	transition: all 0.3s ease;
}

.model-viewer.fullscreen {
	position: fixed;
	inset: 60px 0 0 0;
	z-index: 100;
	border-radius: 0;
	border: none;
}

.viewer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.5rem 0.75rem;
	background: color-mix(in srgb, var(--viewer-bg) 80%, black);
	border-bottom: 1px solid var(--viewer-border);
}

.header-left {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--viewer-primary);
	font-size: 0.85rem;
	font-weight: 500;
}

.header-controls {
	display: flex;
	gap: 0.25rem;
}

.control-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 4px;
	color: var(--viewer-muted);
	cursor: pointer;
	transition: all 0.2s ease;
}

.control-btn:hover {
	background: var(--viewer-border);
	color: var(--viewer-text);
	border-color: var(--viewer-border);
}

.control-btn.active {
	background: var(--viewer-primary);
	color: var(--viewer-bg);
	border-color: var(--viewer-primary);
}

.control-btn.small {
	width: 24px;
	height: 24px;
}

/* Extended controls panel */
.controls-panel {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	padding: 0.5rem 0.75rem;
	background: color-mix(in srgb, var(--viewer-bg) 90%, black);
	border-bottom: 1px solid var(--viewer-border);
}

.control-group {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.control-label {
	font-size: 0.7rem;
	color: var(--viewer-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.control-buttons {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.control-value {
	font-size: 0.7rem;
	color: var(--viewer-text);
	min-width: 2.5rem;
	text-align: center;
	font-family: 'JetBrains Mono', monospace;
}

.canvas-container {
	flex: 1;
	min-height: 300px;
	position: relative;
	background: radial-gradient(
		circle at center,
		color-mix(in srgb, var(--viewer-primary) 5%, transparent),
		transparent 70%
	);
	outline: none;
}

.canvas-container:focus {
	box-shadow: inset 0 0 0 2px var(--viewer-primary);
}

.canvas-container :global(canvas) {
	display: block;
}

.loading-overlay,
.error-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	color: var(--viewer-muted);
	font-size: 0.9rem;
}

.error-overlay {
	color: #f38ba8;
}

:global(.spin) {
	animation: spin 1s linear infinite;
}

@keyframes spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

.viewer-footer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.5rem;
	padding: 0.5rem;
	background: color-mix(in srgb, var(--viewer-bg) 80%, black);
	border-top: 1px solid var(--viewer-border);
}

.hint {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	color: var(--viewer-muted);
	font-size: 0.75rem;
}
