.toolhub-background {
	--thub-checker-a: #eef1f5;
	--thub-checker-b: #ffffff;
}

.toolhub-background__status {
	min-height: 1.55em;
	margin: 0 0 1rem;
	color: var(--thub-muted);
	font-weight: 650;
}

.toolhub-background__status.is-working::before {
	display: inline-block;
	width: 0.72rem;
	height: 0.72rem;
	margin-right: 0.48rem;
	border: 2px solid #b8c2d1;
	border-top-color: var(--thub-accent);
	border-radius: 50%;
	content: "";
	vertical-align: -0.08rem;
	animation: toolhub-background-spin 0.8s linear infinite;
}

.toolhub-background__dropzone {
	display: flex;
	min-height: 150px;
	padding: 1.2rem;
	border: 2px dashed #9ba8ba;
	border-radius: 12px;
	background: var(--thub-surface-alt);
	color: var(--thub-muted);
	cursor: pointer;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	transition: border-color 120ms ease, background-color 120ms ease;
}

.toolhub-background__dropzone:hover,
.toolhub-background__dropzone.is-dragging {
	border-color: var(--thub-accent);
	background: var(--thub-accent-soft);
}

.toolhub-background__dropzone:focus-visible,
.toolhub-background input[type="range"]:focus-visible,
.toolhub-background input[type="color"]:focus-visible {
	outline: 3px solid rgba(23, 105, 224, 0.28);
	outline-offset: 2px;
}

.toolhub-background__drop-title {
	color: var(--thub-text);
	font-size: 1.04rem;
	font-weight: 750;
}

.toolhub-background__file-details {
	margin-top: 1rem;
}

.toolhub-background__fieldset {
	min-width: 0;
	margin: 1.25rem 0 0;
	padding: 0;
	border: 0;
}

.toolhub-background__backgrounds {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	width: 100%;
}

.toolhub-background__backgrounds label {
	text-align: center;
}

.toolhub-background__color {
	margin-top: 0.8rem;
}

.toolhub-background input[type="color"] {
	width: 64px;
	height: 44px;
	padding: 3px;
	border: 1px solid #b8c2d1;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
}

.toolhub-background__refinement .toolhub-label:not(:first-child) {
	margin-top: 0.85rem;
}

.toolhub-background input[type="range"] {
	display: block;
	width: 100%;
	margin: 0;
	accent-color: var(--thub-accent);
}

.toolhub-background__previews {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
	margin-bottom: 1rem;
}

.toolhub-background__previews figure {
	min-width: 0;
	margin: 0;
}

.toolhub-background__previews figcaption {
	margin-bottom: 0.4rem;
	font-size: 0.88rem;
	font-weight: 700;
}

.toolhub-background__preview {
	display: grid;
	min-height: 220px;
	overflow: hidden;
	border: 1px solid var(--thub-border);
	border-radius: 10px;
	background: var(--thub-surface-alt);
	place-items: center;
}

.toolhub-background__preview--checker {
	background-color: var(--thub-checker-b);
	background-image: linear-gradient(45deg, var(--thub-checker-a) 25%, transparent 25%), linear-gradient(-45deg, var(--thub-checker-a) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--thub-checker-a) 75%), linear-gradient(-45deg, transparent 75%, var(--thub-checker-a) 75%);
	background-position: 0 0, 0 8px, 8px -8px, -8px 0;
	background-size: 16px 16px;
}

.toolhub-background__preview span {
	padding: 1rem;
	color: var(--thub-muted);
	font-size: 0.88rem;
	text-align: center;
}

.toolhub-background__preview img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	max-height: 430px;
	object-fit: contain;
}

@keyframes toolhub-background-spin {
	to { transform: rotate(360deg); }
}

@media (max-width: 620px) {
	.toolhub-background__backgrounds {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.toolhub-background__previews {
		grid-template-columns: minmax(0, 1fr);
	}

	.toolhub-background__preview {
		min-height: 180px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.toolhub-background__status.is-working::before {
		animation: none;
	}
}
