/**
 * Shared embroidery tools UI chrome.
 */

.tool-panel {
	display: grid;
	gap: 1.5rem;
}

.tool-panel__grid {
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: 1.5rem;
}

.tool-panel__card {
	background: #fff;
	border: 1px solid rgba(36, 36, 36, 0.1);
	border-radius: 14px;
	padding: 1.25rem;
}

.tool-panel__card h2,
.tool-panel__card h3 {
	font-size: 1.35rem;
	margin-bottom: 1rem;
}

.tool-field {
	display: grid;
	gap: 0.4rem;
	margin-bottom: 1rem;
}

.tool-field label {
	font-weight: 600;
	font-size: 0.95rem;
}

.tool-field input,
.tool-field select,
.tool-field textarea {
	width: 100%;
	border: 1px solid rgba(36, 36, 36, 0.18);
	border-radius: 10px;
	padding: 0.75rem 0.9rem;
	font: inherit;
	background: #fff;
}

.tool-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 0.5rem;
}

.tool-status {
	min-height: 1.4em;
	margin: 0.5rem 0 0;
	font-size: 0.92rem;
	color: #6b655c;
}

.tool-status.is-loading {
	color: #556348;
}

.tool-status.is-error {
	color: #8a3b2d;
}

.tool-preview {
	min-height: 220px;
	border-radius: 14px;
	border: 1px dashed rgba(36, 36, 36, 0.18);
	background:
		linear-gradient(45deg, rgba(232, 224, 212, 0.65) 25%, transparent 25%),
		linear-gradient(-45deg, rgba(232, 224, 212, 0.65) 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, rgba(232, 224, 212, 0.65) 75%),
		linear-gradient(-45deg, transparent 75%, rgba(232, 224, 212, 0.65) 75%);
	background-size: 20px 20px;
	background-position: 0 0, 0 10px, 10px -10px, -10px 0;
	display: grid;
	place-items: center;
	overflow: hidden;
}

.tool-preview img,
.tool-preview canvas {
	max-width: 100%;
	max-height: 420px;
}

.tool-dropzone {
	border: 1.5px dashed rgba(107, 123, 90, 0.55);
	border-radius: 14px;
	padding: 2rem 1.25rem;
	text-align: center;
	background: #f8f6f1;
	cursor: pointer;
	transition: border-color 180ms ease, background 180ms ease;
}

.tool-dropzone.is-dragover {
	border-color: #556348;
	background: #efe9df;
}

.tool-dropzone__hint {
	margin: 0.35rem 0 0;
	color: #6b655c;
	font-size: 0.92rem;
}

.tool-panel,
.tool-panel__grid,
.tool-panel__card {
	min-width: 0;
}

.tool-field input,
.tool-field select,
.tool-field textarea {
	max-width: 100%;
	min-width: 0;
}

.tool-actions {
	flex-wrap: wrap;
	width: 100%;
}

.tool-actions .button {
	min-width: 0;
}

@media (max-width: 860px) {
	.tool-panel__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.tool-panel__card {
		padding: 1rem;
	}

	.tool-dropzone {
		padding: 1.25rem 0.85rem;
	}

	.tool-preview img,
	.tool-preview canvas,
	.etc-preview-frame canvas {
		max-width: 100%;
		height: auto;
	}

	.tool-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.tool-actions .button {
		width: 100%;
		justify-content: center;
	}
}

@media (max-width: 480px) {
	.tools-directory__filters {
		display: flex;
		gap: 0.45rem;
		overflow-x: auto;
		padding-bottom: 0.35rem;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.tools-directory__filters::-webkit-scrollbar {
		display: none;
	}

	.filter-chip {
		flex: 0 0 auto;
		white-space: nowrap;
	}
}
