/* WDS Custom Box designer */
.wdscb {
	--wdscb-panel: #c99a66;
	--wdscb-mark: #3a2414;
	--wdscb-accent: #111;
	margin: 0 0 1.5em;
	padding: 1.25em;
	border: 1px solid #e4e0da;
	border-radius: 10px;
	background: #fbfaf8;
	font-size: 15px;
}
.wdscb[hidden] { display: none !important; }
.wdscb [hidden] { display: none !important; }

.wdscb-area-label { margin-bottom: .75em; }

/* Preview */
.wdscb-stage { margin-bottom: 1em; }
.wdscb-mockup {
	position: relative;
	width: 100%;
	max-width: 520px;
	margin: 0 auto;
	border-radius: 8px;
	overflow: hidden;
}
.wdscb-mockup-img { display: block; width: 100%; height: auto; }
.wdscb-mockup.is-plain {
	background-color: var(--wdscb-panel);
	background-image:
		repeating-linear-gradient(92deg, rgba(0,0,0,.035) 0 2px, transparent 2px 9px),
		repeating-linear-gradient(88deg, rgba(255,255,255,.05) 0 1px, transparent 1px 13px),
		linear-gradient(180deg, rgba(255,255,255,.12), rgba(0,0,0,.08));
	box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.wdscb-area { position: absolute; }
.wdscb-mockup:not(.is-plain) .wdscb-area { outline: 1px dashed rgba(255,255,255,.7); }
.wdscb-area-art, .wdscb-art { position: absolute; inset: 0; }
.wdscb-art {
	background: var(--wdscb-mark);
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	mix-blend-mode: multiply;
	opacity: .92;
}
.wdscb-empty {
	position: absolute; inset: 8%;
	display: flex; align-items: center; justify-content: center; text-align: center;
	border: 2px dashed rgba(0,0,0,.25); border-radius: 6px;
	color: rgba(0,0,0,.55); font-size: 14px; padding: .5em;
}
.wdscb-area-text {
	position: absolute; left: 4%; right: 4%; bottom: 0;
	display: flex; align-items: center; justify-content: center;
	white-space: nowrap; overflow: hidden;
	color: var(--wdscb-mark); mix-blend-mode: multiply; line-height: 1;
}

/* Tabs */
.wdscb-tabs { display: flex; gap: .5em; margin-bottom: .75em; }
.wdscb-tab {
	flex: 1; padding: .7em .8em; border: 1px solid #d9d4cc; border-radius: 8px;
	background: #fff; color: #333; cursor: pointer; font-weight: 600;
}
.wdscb-tab.is-active { background: var(--wdscb-accent); border-color: var(--wdscb-accent); color: #fff; }

.wdscb-panel { margin-bottom: .75em; }
.wdscb-drop {
	display: flex; flex-direction: column; align-items: center; gap: .3em;
	padding: 1.4em 1em; border: 2px dashed #cfc8bd; border-radius: 8px;
	background: #fff; text-align: center; cursor: pointer;
}
.wdscb-drop.is-over { border-color: var(--wdscb-accent); background: #f4f1ec; }
.wdscb-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.wdscb-drop span { font-weight: 600; }
.wdscb-drop small { color: #666; }
.wdscb-upload-tools { display: flex; flex-wrap: wrap; gap: .75em; align-items: center; margin-top: .75em; }
.wdscb-slider { display: flex; align-items: center; gap: .5em; font-size: 13px; color: #555; }

.wdscb-label { display: block; font-weight: 600; margin: .4em 0 .3em; }
.wdscb-prompt, .wdscb-text input, .wdscb-text select { width: 100%; box-sizing: border-box; }
.wdscb-ideas { display: flex; flex-wrap: wrap; gap: .4em; margin: .5em 0 .75em; }
.wdscb-idea {
	padding: .3em .7em; border: 1px solid #d9d4cc; border-radius: 999px;
	background: #fff; font-size: 13px; cursor: pointer;
}
.wdscb-hint { font-size: 13px; color: #666; margin: .5em 0 0; }

/* Variants */
.wdscb-variants { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .6em; margin: .5em 0; }
.wdscb-variant {
	position: relative; aspect-ratio: 1; padding: 0; border: 2px solid #e4e0da; border-radius: 8px;
	background: #fff; cursor: pointer; overflow: hidden;
}
.wdscb-variant.is-selected { border-color: var(--wdscb-accent); box-shadow: 0 0 0 2px var(--wdscb-accent); }
.wdscb-variant-art {
	position: absolute; inset: 8%; background: #111;
	-webkit-mask-size: contain; mask-size: contain;
	-webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
	-webkit-mask-position: center; mask-position: center;
}
.wdscb-variant-label { position: absolute; left: 0; right: 0; bottom: 4px; font-size: 11px; color: #555; }
.wdscb-variant.is-loading { background: linear-gradient(90deg, #f1eee9 25%, #faf8f5 50%, #f1eee9 75%); background-size: 200% 100%; animation: wdscb-shimmer 1.2s infinite linear; cursor: default; }
@keyframes wdscb-shimmer { to { background-position: -200% 0; } }

.wdscb-status { min-height: 1.2em; margin: .5em 0; font-size: 14px; }
.wdscb-status.is-error { color: #b42318; }
.wdscb-status.is-warn { color: #9a5b00; }
.wdscb-status.is-ok { color: #1f6f3f; }
.wdscb.is-busy .wdscb-status::before {
	content: ""; display: inline-block; width: .9em; height: .9em; margin-right: .4em; vertical-align: -2px;
	border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
	animation: wdscb-spin .8s linear infinite;
}
@keyframes wdscb-spin { to { transform: rotate(360deg); } }

.wdscb-text { margin: .75em 0; }
.wdscb-approve { display: flex; gap: .6em; align-items: flex-start; font-size: 14px; margin-top: .75em; cursor: pointer; }
.wdscb-approve input { margin-top: .2em; flex: none; }
.wdscb-approve input:disabled + span { opacity: .5; }

@media (prefers-reduced-motion: reduce) {
	.wdscb-variant.is-loading, .wdscb.is-busy .wdscb-status::before { animation: none; }
}

/* Theme-proof buttons (WoodMart and others style every <button>) */
#wdscb button.wdscb-tab,
#wdscb button.wdscb-idea,
#wdscb button.wdscb-variant {
	min-height: 0; margin: 0; line-height: 1.3; text-transform: none; letter-spacing: normal;
	box-shadow: none; text-shadow: none; transform: none;
	background: #fff; color: #333; border-style: solid;
}
#wdscb button.wdscb-tab { border: 1px solid #d9d4cc; padding: .7em .8em; font-size: 15px; font-weight: 600; }
#wdscb button.wdscb-tab.is-active,
#wdscb button.wdscb-tab.is-active:hover { background: var(--wdscb-accent); border-color: var(--wdscb-accent); color: #fff; }
#wdscb button.wdscb-tab:not(.is-active):hover { background: #f4f1ec; }
#wdscb button.wdscb-idea { border: 1px solid #d9d4cc; padding: .3em .7em; font-size: 13px; font-weight: 400; border-radius: 999px; }
#wdscb button.wdscb-idea:hover { background: #f4f1ec; }
#wdscb button.wdscb-variant { border: 2px solid #e4e0da; padding: 0; border-radius: 8px; }
#wdscb button.wdscb-variant.is-selected { border-color: var(--wdscb-accent); box-shadow: 0 0 0 2px var(--wdscb-accent); }
#wdscb .wdscb-variant.is-loading { background: linear-gradient(90deg, #f1eee9 25%, #faf8f5 50%, #f1eee9 75%); background-size: 200% 100%; }
#wdscb input.wdscb-threshold { padding: 0; border: 0; box-shadow: none; background: transparent; width: 140px; }

/* "Use your own AI" helper */
#wdscb .wdscb-own-ai { margin-top: .75em; font-size: 14px; }
#wdscb .wdscb-own-ai summary { cursor: pointer; font-weight: 600; }
#wdscb .wdscb-own-ai p { margin: .5em 0; color: #555; }
#wdscb .wdscb-own-prompt { width: 100%; box-sizing: border-box; font-size: 13px; background: #fff; }
#wdscb .wdscb-copy { margin-top: .4em; }

/* Rules and own-AI steps */
#wdscb .wdscb-rules { margin: 0 0 1em; padding: .8em 1em; border-left: 3px solid var(--wdscb-accent); background: #fff; border-radius: 0 6px 6px 0; font-size: 14px; }
#wdscb .wdscb-rules ul { margin: .35em 0 .35em 1.2em; padding: 0; }
#wdscb .wdscb-rules li { margin: .15em 0; }
#wdscb .wdscb-rules small { color: #666; }
#wdscb .wdscb-step { display: inline-flex; align-items: center; justify-content: center; width: 1.5em; height: 1.5em; margin-right: .3em; border-radius: 50%; background: var(--wdscb-accent); color: #fff; font-size: 12px; }
#wdscb .wdscb-own .wdscb-label { margin-top: .9em; }
#wdscb .wdscb-own-actions { display: flex; flex-wrap: wrap; gap: .6em 1em; align-items: center; margin-top: .5em; }
#wdscb .wdscb-ext { font-weight: 600; text-decoration: underline; }
