.gex-upod-editor {
    --gex-blue: #2457d6;
    --gex-border: #d9dde7;
    margin: 1.5rem 0;
    padding: 1rem;
    border: 1px solid var(--gex-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(25, 32, 56, .06);
}

.gex-upod-manager-preview-form {
	width: 100%;
}

.gex-upod-manager-variation {
	display: grid;
	gap: .45rem;
	margin: 1.5rem 0 0;
	padding: 1rem;
	border: 1px solid #cbd8f6;
	border-radius: 12px;
	background: #f5f8ff;
}

.gex-upod-manager-variation label {
	font-weight: 800;
	color: #173f9e;
}

.gex-upod-manager-variation select {
	width: min(100%, 34rem);
	min-height: 46px;
	padding: .55rem .75rem;
	border: 1px solid #9dafd9;
	border-radius: 8px;
	background: #fff;
}

.gex-upod-editor__heading {
    margin: 0 0 .25rem;
    font-size: 1.25rem;
}

.gex-upod-editor__hint {
    margin: 0 0 1rem;
    color: #596174;
}

.gex-upod-editor__profile {
    margin: 0 0 1rem;
    padding: .65rem .8rem;
    border-radius: 9px;
    background: #f4f6fb;
    color: #455068;
    font-size: .92rem;
}

.gex-upod-editor__placements {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 1rem;
}

.gex-upod-editor__placements[hidden] {
    display: none;
}

.gex-upod-editor__placements button {
    position: relative;
    min-height: 38px;
    padding: .45rem .8rem;
    border: 1px solid var(--gex-border);
    border-radius: 999px;
    background: #fff;
    color: #30394d;
}

.gex-upod-editor__placements button[aria-pressed="true"] {
    border-color: var(--gex-blue);
    background: var(--gex-blue);
    color: #fff;
}

.gex-upod-editor__placements button.is-designed::after {
	content: "已設計";
	margin-left: .45rem;
	padding: 2px 5px;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-size: .68rem;
	font-weight: 800;
	line-height: 1.2;
}

.gex-upod-editor__placements button.is-blank::after {
	content: "保持素面";
	margin-left: .45rem;
	padding: 2px 5px;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-size: .68rem;
	font-weight: 800;
	line-height: 1.2;
}

.gex-upod-editor__blank-choice {
	display: grid;
	gap: .4rem;
	margin: 0 0 1rem;
	padding: .75rem;
	border: 1px solid #cbd8f6;
	border-radius: 10px;
	background: #f5f8ff;
}

.gex-upod-editor__blank-choice[hidden] {
	display: none;
}

.gex-upod-editor__blank-choice button {
	min-height: 44px;
}

.gex-upod-editor__blank-choice button[aria-pressed="true"] {
	border-color: #2457d6;
	background: #eaf0ff;
	color: #173f9e;
	font-weight: 800;
}

.gex-upod-editor__blank-choice small {
	color: #455068;
	line-height: 1.5;
}

.gex-upod-editor__placements button.is-conflict-blocked {
    border-style: dashed;
    color: #8a3b12;
    background: #fff7ed;
    cursor: not-allowed;
    opacity: .72;
}

.gex-upod-editor__steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .45rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
    counter-reset: gex-step;
}

.gex-upod-editor__steps li {
	display: block;
	min-height: 44px;
	padding: 0;
	border: 1px solid var(--gex-border);
    border-radius: 10px;
    background: #f8faff;
    color: #465168;
    font-size: .78rem;
    font-weight: 650;
    line-height: 1.25;
	counter-increment: gex-step;
}

.gex-upod-editor__steps a {
	display: flex;
	min-height: 44px;
	align-items: center;
	gap: .4rem;
	padding: .55rem .65rem;
	border-radius: inherit;
	color: inherit;
	text-decoration: none;
}

.gex-upod-editor__steps a:hover,
.gex-upod-editor__steps a:focus-visible {
	outline: 3px solid rgba(36, 87, 214, .2);
	outline-offset: 2px;
}

.gex-upod-editor__steps a[aria-current="step"] {
	box-shadow: inset 0 0 0 2px var(--gex-blue);
	color: #172033;
}

.gex-upod-editor__steps [data-gex-step-state]:not(:empty) {
	display: inline-flex;
	margin-left: auto;
	padding: 2px 5px;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-size: .68rem;
	font-weight: 800;
}

.gex-upod-editor__steps a::before {
    content: counter(gex-step);
    display: inline-grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    place-items: center;
    border-radius: 50%;
    background: var(--gex-blue);
    color: #fff;
    font-size: .72rem;
}

.gex-upod-editor__layout {
	display: grid;
	grid-template-columns: minmax(220px, 260px) minmax(480px, 1fr) minmax(280px, 340px);
	gap: clamp(14px, 2vw, 26px);
	align-items: start;
}

.gex-upod-editor__tools,
.gex-upod-editor__summary {
	display: grid;
	min-width: 0;
	gap: .8rem;
	align-content: start;
}

.gex-upod-editor__panel {
	min-width: 0;
}

.gex-upod-editor__tools .gex-upod-editor__panel,
.gex-upod-editor__summary {
	padding: .85rem;
	border: 1px solid var(--gex-border);
	border-radius: 12px;
	background: #fff;
}

.gex-upod-editor__panel > h3 {
	margin: 0 0 .55rem;
	color: #172033;
	font-size: 1rem;
	line-height: 1.35;
}

.gex-upod-editor__panel > p {
	margin: 0 0 .75rem;
	color: #596174;
	font-size: .84rem;
	line-height: 1.55;
}

.gex-upod-editor__stage {
	position: relative;
	min-width: 0;
}

.gex-upod-editor__mobile-progress,
.gex-upod-editor__mobile-navigation {
	display: none;
}

.gex-upod-editor__noscript {
	margin: 0 0 1rem;
	padding: .8rem;
	border: 2px solid #9b1c1c;
	border-radius: 10px;
	background: #ffeded;
	color: #761515;
	font-weight: 700;
	line-height: 1.55;
}

.gex-upod-editor__turntable {
    margin-top: .85rem;
    padding: .75rem;
    overflow: hidden;
    border: 1px solid var(--gex-border);
    border-radius: 12px;
    background: radial-gradient(circle at 50% 42%, #fff 0, #f4f6fb 68%, #e8ebf2 100%);
}

.gex-upod-editor__turntable-scene {
    max-width: 360px;
    margin: 0 auto;
    perspective: 900px;
}

.gex-upod-editor__turntable canvas {
    cursor: default;
    box-shadow: 0 18px 35px rgba(25, 32, 56, .16);
    transform-style: preserve-3d;
    animation: gex-upod-turntable 6s ease-in-out infinite alternate;
}

.gex-upod-editor__turntable.is-paused canvas {
    animation-play-state: paused;
}

.gex-upod-editor__turntable-caption {
    display: flex;
    gap: .65rem;
    align-items: center;
    justify-content: space-between;
    margin-top: .65rem;
    color: #596174;
    font-size: .82rem;
}

.gex-upod-editor__turntable-caption button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: .35rem .65rem;
    font-size: .82rem;
}

@keyframes gex-upod-turntable {
    from { transform: rotateX(2deg) rotateY(-13deg) translateY(0); }
    to { transform: rotateX(2deg) rotateY(13deg) translateY(-3px); }
}

.gex-upod-editor canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    background: #f4f4f4;
    touch-action: none;
    cursor: move;
}

.gex-upod-editor__controls {
    display: grid;
    gap: .8rem;
    align-content: start;
}

.gex-upod-editor__row,
.gex-upod-editor__button-row {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.gex-upod-editor__row--stack {
    display: grid;
    gap: .35rem;
}

.gex-upod-editor__image-tools {
    display: grid;
    gap: .55rem;
    margin: 0;
    padding: .85rem;
    border: 1px solid var(--gex-border);
    border-radius: 12px;
    background: #fbfcff;
}

.gex-upod-editor__image-tools legend {
    padding: 0 .35rem;
    color: #26324a;
    font-weight: 750;
}

.gex-upod-editor__image-tools label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .25rem .6rem;
    align-items: center;
    font-size: .86rem;
}

.gex-upod-editor__image-tools input[type="range"] {
    grid-column: 1 / -1;
}

.gex-upod-editor__image-tools small {
    color: #657087;
    line-height: 1.5;
}

.gex-upod-editor__history button:disabled,
.gex-upod-editor button:disabled {
    cursor: not-allowed;
    opacity: .48;
}

.gex-upod-editor label {
    font-weight: 600;
}

.gex-upod-editor input[type="text"],
.gex-upod-editor input[type="range"] {
    width: 100%;
}

.gex-upod-editor button,
.gex-upod-editor__upload {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: .65rem .8rem;
    border: 1px solid var(--gex-border);
    border-radius: 9px;
    background: #fff;
    color: #1d2433;
    font-weight: 650;
    cursor: pointer;
}

.gex-upod-editor__upload {
    color: #fff;
    background: var(--gex-blue);
    border-color: var(--gex-blue);
}

.gex-upod-editor__upload input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.gex-upod-editor__quality,
.gex-upod-editor__status {
    padding: .65rem .75rem;
    border-radius: 9px;
    background: #f4f6fb;
    font-size: .92rem;
}

.gex-upod-editor [data-level="ok"] {
    color: #12643a;
    background: #eaf8f0;
}

.gex-upod-editor [data-level="warning"] {
    color: #7b4e00;
    background: #fff4d8;
}

.gex-upod-editor [data-level="error"] {
    color: #9b1c1c;
    background: #ffeded;
}

.gex-upod-editor__approval {
    display: flex;
    gap: .55rem;
    align-items: flex-start;
    font-size: .9rem;
    font-weight: 400 !important;
}

.gex-upod-editor__catalog-media {
    display: grid;
    gap: .65rem;
    padding: 1rem;
    border: 1px solid #b9c9ec;
    border-radius: 12px;
    background: #f1f6ff;
}

.gex-upod-editor__catalog-media > strong {
    color: #172033;
    font-size: 1rem;
}

.gex-upod-editor__catalog-media p {
    margin: 0;
    color: #4a5872;
    font-size: .86rem;
    line-height: 1.6;
}

.gex-upod-editor__catalog-media-status:not(:empty) {
    padding: .65rem .75rem;
    border-radius: 9px;
    background: #fff;
    color: #455068;
    font-size: .88rem;
    line-height: 1.5;
}

.gex-upod-editor__catalog-media-status[data-level="working"] {
    background: #eaf1ff;
    color: #244b96;
}

.gex-upod-editor__catalog-media-status[data-level="ok"] {
    background: #eaf8f0;
    color: #12643a;
}

.gex-upod-editor__catalog-media-status[data-level="error"] {
    background: #ffeded;
    color: #9b1c1c;
}

.gex-upod-editor__original-design {
    display: grid;
    gap: .65rem;
    padding: 1rem;
    border: 1px solid #b7d7c2;
    border-radius: 12px;
    background: #f3fbf6;
}

.gex-upod-editor__original-design p {
    margin: 0;
    color: #365746;
    font-size: .86rem;
    line-height: 1.6;
}

@media (max-width: 767px) {
	.gex-upod-editor__steps {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x proximity;
	}

	.gex-upod-editor__steps li {
		min-width: 154px;
		flex: 0 0 154px;
		scroll-snap-align: start;
	}

	.gex-upod-editor__layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.gex-upod-editor__button-row {
		flex-wrap: wrap;
	}

	.gex-upod-editor[data-gex-step-enhanced="true"] .gex-upod-editor__mobile-progress {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: .75rem;
		margin: 0 0 .8rem;
		padding: .75rem .85rem;
		border: 1px solid #b9c9ec;
		border-radius: 10px;
		background: #f1f6ff;
		color: #243759;
	}

	.gex-upod-editor[data-gex-step-enhanced="true"] [data-gex-step-panel][hidden] {
		display: none !important;
	}

	.gex-upod-editor[data-gex-step-enhanced="true"] .gex-upod-editor__mobile-navigation {
		position: sticky;
		bottom: max(8px, env(safe-area-inset-bottom));
		z-index: 4;
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: .65rem;
		margin-top: 1rem;
		padding: .7rem;
		border: 1px solid var(--gex-border);
		border-radius: 12px;
		background: rgba(255, 255, 255, .96);
		box-shadow: 0 8px 24px rgba(25, 32, 56, .14);
	}

	.gex-upod-editor[data-gex-step-enhanced="true"] .gex-upod-editor__mobile-navigation button {
		min-height: 48px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gex-upod-editor__turntable canvas {
		animation: none;
		transform: none;
	}

	.gex-upod-editor *,
	.gex-upod-editor *::before,
	.gex-upod-editor *::after {
		scroll-behavior: auto !important;
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
	}
}

/* 0.8.0: keep WooCommerce's cart form intact while presenting it as one full-width workbench. */
.single-product div.product form.cart.gex-upod-workbench-form {
    clear: both;
    float: none;
    display: block;
    width: 100%;
    max-width: none;
    margin: clamp(28px, 5vw, 60px) 0 0;
    padding: 0;
}

.single-product div.product form.cart.gex-upod-workbench-form::before {
    content: "選擇尺寸與顏色";
    display: block;
    margin: 0 0 12px;
    color: #172033;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.single-product div.product form.cart.gex-upod-workbench-form .variations,
.single-product div.product form.cart.gex-upod-workbench-form .single_variation_wrap {
    width: 100%;
    max-width: 100%;
}

.single-product div.product form.cart.gex-upod-workbench-form .variations {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid #dfe4ee;
    border-radius: 14px;
    background: #f8faff;
}

.gex-upod-workbench-form .gex-upod-editor {
    --gex-blue: #2457d6;
    --gex-border: #dce2ed;
    width: 100%;
    max-width: none;
    margin: 18px 0;
    padding: clamp(16px, 2.8vw, 30px);
    overflow: visible;
    border-radius: 22px;
    background: linear-gradient(145deg, #fff 0%, #f7f9fd 100%);
    box-shadow: 0 20px 55px rgba(25, 42, 74, .1);
}

.gex-upod-workbench-form .gex-upod-editor__heading {
    color: #172033;
    font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.gex-upod-workbench-form .gex-upod-editor__profile {
    border: 1px solid #dce5f7;
    background: #f2f6ff;
}

.gex-upod-workbench-form .gex-upod-editor__layout {
	grid-template-columns: minmax(220px, 260px) minmax(480px, 1fr) minmax(280px, 340px);
	gap: clamp(16px, 3vw, 34px);
	align-items: start;
}

.gex-upod-workbench-form .gex-upod-editor__stage,
.gex-upod-workbench-form .gex-upod-editor__tools,
.gex-upod-workbench-form .gex-upod-editor__summary {
	min-width: 0;
}

.gex-upod-workbench-form .gex-upod-editor__summary {
	position: sticky;
	top: 24px;
    padding: 18px;
    border: 1px solid #e0e5ef;
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 12px 28px rgba(25, 42, 74, .07);
}

.gex-upod-workbench-form .gex-upod-editor input,
.gex-upod-workbench-form .gex-upod-editor select,
.gex-upod-workbench-form .gex-upod-editor button {
    max-width: 100%;
}

.gex-upod-editor__official-proof {
	border-color: #c7d7ff;
	background: linear-gradient(145deg, #f6f9ff 0%, #eef4ff 100%);
}

.gex-upod-editor__official-proof > button {
	width: 100%;
	font-weight: 800;
}

.gex-upod-editor__official-proof-result[hidden] {
	display: none;
}

.gex-upod-editor__official-proof-result > p {
	margin: 12px 0;
	font-weight: 800;
	color: #173f91;
}

.gex-upod-editor__official-proof-mockups {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 12px;
}

.gex-upod-editor__official-proof-mockups figure {
	margin: 0;
	padding: 8px;
	border: 1px solid #dce5f7;
	border-radius: 10px;
	background: #fff;
}

.gex-upod-editor__official-proof-mockups img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 7px;
}

.gex-upod-editor__official-proof-mockups figcaption {
	margin-top: 6px;
	font-size: 12px;
	font-weight: 700;
}

.gex-upod-editor__official-proof-receipt {
	margin-top: 12px;
}

.gex-upod-editor__official-proof-receipt dl {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: 4px 10px;
}

.gex-upod-editor__official-proof-receipt dt {
	font-weight: 700;
}

.gex-upod-editor__official-proof-receipt dd {
	margin: 0;
	overflow-wrap: anywhere;
}

@media (max-width: 767px) {
	.gex-upod-workbench-form .gex-upod-editor__layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.gex-upod-workbench-form .gex-upod-editor__summary {
		position: static;
	}
}

@media (max-width: 480px) {
    .single-product div.product form.cart.gex-upod-workbench-form {
        margin-top: 26px;
    }

    .gex-upod-workbench-form .gex-upod-editor {
        padding: 14px;
        border-radius: 16px;
    }

	.gex-upod-workbench-form .gex-upod-editor__tools .gex-upod-editor__panel,
	.gex-upod-workbench-form .gex-upod-editor__summary {
		padding: 13px;
	}

    .gex-upod-workbench-form .gex-upod-editor__row,
    .gex-upod-workbench-form .gex-upod-editor__button-row,
    .gex-upod-workbench-form .gex-upod-editor__turntable-caption {
        align-items: stretch;
        flex-direction: column;
    }

    .gex-upod-workbench-form .gex-upod-editor button,
    .gex-upod-workbench-form .gex-upod-editor__upload {
        width: 100%;
    }
}

/* Block themes keep the buyer form inside a column instead of a classic summary. */
.single-product form.cart.gex-upod-workbench-form[data-gex-upod-workbench-layout="contained"] {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
form.gex-upod-workbench-form[data-gex-upod-workbench-layout="contained"] .variations,
form.gex-upod-workbench-form[data-gex-upod-workbench-layout="contained"] .single_variation_wrap,
form.gex-upod-workbench-form[data-gex-upod-workbench-layout="contained"] .gex-upod-editor {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
form.gex-upod-workbench-form[data-gex-upod-workbench-layout="contained"] .gex-upod-editor__layout {
    grid-template-columns: minmax(0, 1fr);
}
form.gex-upod-workbench-form[data-gex-upod-workbench-layout="contained"] .gex-upod-editor__summary {
    position: static;
}

/* Woo block variation forms also grid their inner add-to-cart wrapper. */
.single-product form.cart.gex-upod-workbench-form[data-gex-upod-workbench-layout="contained"] .woocommerce-variation-add-to-cart {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* The editor button display rule must not reveal an inactive retry control. */
[data-gex-v2-render-check-retry][hidden] { display: none !important; }

/* Exact private saved artwork; checkerboard is display-only transparency context. */
.gex-upod-saved-artwork[hidden] { display: none !important; }
.gex-upod-saved-artwork { margin: 12px 0; }
.gex-upod-saved-artwork h4 { margin: 0 0 8px; }
.gex-upod-saved-artwork details { margin: 10px 0; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px; }
.gex-upod-saved-artwork summary { cursor: pointer; font-weight: 600; }
.gex-upod-saved-artwork figure { margin: 8px 0 0; }
.gex-upod-saved-artwork img { display: block; width: 100%; height: auto; object-fit: contain; background: repeating-conic-gradient(#e2e8f0 0% 25%,#fff 0% 50%) 0 0 / 20px 20px; }
.gex-upod-saved-artwork img[hidden] { display: none !important; }
.gex-upod-saved-artwork figcaption { margin-top: 6px; font-size: 13px; }

/* Keep the actual design visible while mobile position controls are in use. */
@media (max-width: 767px) {
	.gex-upod-editor[data-gex-step-enhanced="true"][data-gex-workflow-step="3"] .gex-upod-editor__stage {
		order: -1;
	}
	.gex-upod-editor[data-gex-step-enhanced="true"][data-gex-workflow-step="3"] .gex-upod-editor__turntable {
		display: none;
	}
}

/* The original Woo block follows product columns without replacing its form. */
.single-product .gex-upod-workbench-block,
.single-product form.cart.gex-upod-workbench-form[data-gex-upod-workbench-layout="full"] {
    display: block;
    width: 100%;
    max-width: none;
    min-width: 0;
    clear: both;
    box-sizing: border-box;
}
@media (max-width: 1100px) {
    form.gex-upod-workbench-form[data-gex-upod-workbench-layout="full"] .gex-upod-editor__layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Full-width Woo block wrappers must not retain the inner three-column cart grid. */
form.gex-upod-workbench-form[data-gex-upod-workbench-layout="full"] .single_variation_wrap,
form.gex-upod-workbench-form[data-gex-upod-workbench-layout="full"] .woocommerce-variation-add-to-cart,
form.gex-upod-workbench-form[data-gex-upod-workbench-layout="full"] .gex-upod-editor {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Compact native product options; preserve Woo variation matching and editor wiring. */
.single-product div.product form.cart.gex-upod-workbench-form { margin-top: 20px; }
.single-product div.product form.cart.gex-upod-workbench-form .variations { width: auto; max-width: 100%; padding: 8px 12px; margin-bottom: 10px; }
.single-product div.product form.cart.gex-upod-workbench-form .variations td,
.single-product div.product form.cart.gex-upod-workbench-form .variations th { padding: 4px 8px; }
.single-product div.product form.cart.gex-upod-workbench-form .variations select { width: 180px; min-width: 0; max-width: 100%; padding: 6px 10px; min-height: 36px; }

/* Buyer visual hierarchy: real product before selection, calibrated canvas afterwards. */
.gex-designer-help { margin: 8px 0; padding: 8px 0; font-size: 14px; }
.gex-designer-help > summary { cursor: pointer; font-weight: 600; color: #26364d; }
.gex-designer-help > p { margin: 10px 0; line-height: 1.6; }
.gex-upod-workbench-form .gex-upod-editor { padding: 16px; border-radius: 12px; box-shadow: none; }
.gex-upod-workbench-form .gex-upod-editor__heading { font-size: 20px; }
.gex-upod-workbench-form .gex-upod-editor__steps { display: none; }
.gex-upod-workbench-form .gex-upod-editor__layout { grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 18px; }
.gex-upod-workbench-form .gex-upod-editor__stage { grid-column: 1; grid-row: 1; }
.gex-upod-workbench-form .gex-upod-editor__tools { grid-column: 2; grid-row: 1; }
.gex-upod-workbench-form .gex-upod-editor__summary { grid-column: 1 / -1; grid-row: 2; position: static; padding: 12px; box-shadow: none; }
.gex-upod-workbench-form .gex-upod-editor__panel { padding: 12px; }
.gex-upod-workbench-form .gex-upod-editor__panel h3 { font-size: 16px; margin: 0 0 10px; }
.gex-upod-workbench-form .gex-upod-editor__tools .gex-upod-editor__panel > p { font-size: 13px; margin: 6px 0; }
.gex-designer-product-photo { margin: 0; text-align: center; }
.gex-designer-product-photo img { display: block; width: 100%; height: 330px; object-fit: contain; background: #fff; }
.gex-designer-product-photo figcaption { padding: 8px; font-size: 14px; font-weight: 600; }
.gex-designer-product-photo small { display: block; margin-top: 6px; font-weight: 400; color: #596174; }
[data-gex-upod-editor][data-gex-profile-ready="true"] .gex-designer-product-photo { display: none; }
[data-gex-upod-editor]:not([data-gex-profile-ready="true"]) [data-gex-canvas],
[data-gex-upod-editor]:not([data-gex-profile-ready="true"]) .gex-designer-rotation,
[data-gex-upod-editor]:not([data-gex-profile-ready="true"]) .gex-upod-editor__tools,
[data-gex-upod-editor]:not([data-gex-profile-ready="true"]) .gex-upod-editor__quality,
[data-gex-upod-editor]:not([data-gex-profile-ready="true"]) .gex-upod-editor__approval,
[data-gex-upod-editor]:not([data-gex-profile-ready="true"]) .gex-upod-editor__summary > .gex-designer-help { display: none; }
.gex-upod-workbench-form .gex-upod-editor:not([data-gex-profile-ready="true"]) .gex-upod-editor__stage { grid-column: 1 / -1; }
.gex-upod-workbench-form .gex-upod-editor__stage > canvas { max-height: 520px; object-fit: contain; }
.gex-upod-workbench-form { scroll-margin-top: 130px; }
@media (max-width: 767px) {
 .gex-upod-workbench-form .gex-upod-editor__layout { display: flex; flex-direction: column; gap: 12px; }
 .gex-upod-workbench-form .gex-upod-editor__stage { order: -1; width: 100%; box-sizing: border-box; }
 .gex-upod-workbench-form .gex-upod-editor__tools, .gex-upod-workbench-form .gex-upod-editor__summary { width: 100%; box-sizing: border-box; }
 .gex-designer-product-photo img { height: 230px; }
 .gex-upod-workbench-form .gex-upod-editor__stage > canvas { max-height: 320px; }
}

/* Keep product and native choices together in the first screen. */
.single-product div.product form.cart[data-gex-visual-designer="true"]::before { display: none; }
form[data-gex-visual-designer="true"] .gex-upod-editor__stage,
form[data-gex-visual-designer="true"] .gex-upod-editor:not([data-gex-profile-ready="true"]) .gex-upod-editor__stage { grid-column: 1; grid-row: 1 / span 2; }
form[data-gex-visual-designer="true"] .gex-designer-choices { grid-column: 2; grid-row: 1; }
form[data-gex-visual-designer="true"] .gex-upod-editor__tools { grid-column: 2; grid-row: 2; }
form[data-gex-visual-designer="true"] .gex-upod-editor__summary { grid-row: 3; }
.gex-designer-choices h3 { font-size: 16px; margin: 0 0 10px; }
.single-product div.product .gex-designer-choices table.variations { width: 100%; margin: 0; }
@media (max-width: 767px) {
 .gex-designer-choices { order: -2; width: 100%; }
 .gex-upod-editor:not([data-gex-profile-ready="true"]) .gex-upod-editor__mobile-progress,
 .gex-upod-editor:not([data-gex-profile-ready="true"]) .gex-upod-editor__mobile-navigation { display: none; }
}

/* Single-screen buyer workspace. Original form controls and validation remain in place. */
form[data-gex-simple-designer="true"] .gex-upod-editor { max-width: 1120px; margin: 12px auto; padding: 16px; }
form[data-gex-simple-designer="true"] .gex-upod-editor__layout { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 12px 24px; }
form[data-gex-simple-designer="true"] .gex-upod-editor__heading { margin: 0 0 16px; }
[data-gex-simple-designer="true"] .gex-upod-editor__mobile-progress,
[data-gex-simple-designer="true"] .gex-upod-editor__mobile-navigation,
[data-gex-simple-designer="true"] [data-gex-step-panel="1"] > p,
[data-gex-simple-designer="true"] [data-gex-step-panel="3"] > h3,
[data-gex-simple-designer="true"] [data-gex-step-panel="3"] > p,
[data-gex-simple-designer="true"] .gex-designer-product-photo figcaption { display: none !important; }
form[data-gex-simple-designer="true"] .gex-upod-editor__tools,
form[data-gex-simple-designer="true"] .gex-upod-editor:not([data-gex-profile-ready="true"]) .gex-upod-editor__tools { display: grid; gap: 12px; }
form[data-gex-simple-designer="true"] .gex-upod-editor__tools .gex-upod-editor__panel { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
form[data-gex-simple-designer="true"] .gex-upod-editor__stage { padding: 0; border: 0; background: #f7f8fb; border-radius: 12px; overflow: hidden; }
form[data-gex-simple-designer="true"] .gex-upod-editor__stage > h3 { padding: 12px 16px 0; }
form[data-gex-simple-designer="true"] .gex-upod-editor__stage > canvas { display: block; width: min(100%, 430px); height: auto; max-height: none; margin: 0 auto; touch-action: none; }
[data-gex-simple-designer="true"] .gex-designer-product-photo img { height: 360px; }
.gex-simple-toolbar { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; padding: 8px; }
.gex-simple-toolbar button { min-height: 36px; padding: 6px 12px; font-size: 13px; border-radius: 7px; border: 1px solid #d9dde7; color: #26364d; background: #fff; }
.gex-simple-toolbar button:disabled { opacity: .4; }
.gex-simple-hint { margin: 0; padding: 0 12px 12px; text-align: center; color: #596174; font-size: 13px; line-height: 1.5; }
.gex-simple-alert { margin: 0; padding: 8px; background: #fff5e7; font-size: 13px; }
.gex-simple-alert:empty { display: none; }
[data-gex-simple-designer="true"] .gex-upod-editor__upload { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border-radius: 8px; background: #2457d6; color: white; font-weight: 700; }
[data-gex-simple-designer="true"] .gex-upod-editor__upload:has(input:disabled) { opacity: .45; }
[data-gex-simple-designer="true"] [data-gex-replace] { font-size: 12px; padding: 6px 8px; }
[data-gex-simple-designer="true"] .gex-upod-editor__row--stack { margin-top: 12px; }
[data-gex-simple-designer="true"] [data-gex-text] { min-width: 0; width: 100%; }
[data-gex-simple-designer="true"] [data-gex-color] { width: 38px; min-width: 38px; height: 38px; padding: 3px; }
.gex-simple-advanced { border-top: 1px solid #e4e7ed; margin: 0; padding-top: 12px; }
.gex-simple-review { grid-column: 1 / -1; grid-row: 3; min-width: 0; }
.gex-simple-review > summary { list-style: none; cursor: pointer; width: fit-content; margin-left: auto; padding: 12px 24px; border-radius: 8px; color: #fff; background: #2457d6; font-size: 15px; font-weight: 700; text-align: center; }
.gex-simple-review > summary::-webkit-details-marker { display: none; }
.gex-simple-review > summary:focus-visible { outline: 3px solid #8aa9f7; outline-offset: 3px; }
.gex-simple-review[open] > summary { margin-bottom: 12px; background: #f0f4fd; color: #2457d6; }
form[data-gex-simple-designer="true"]:not([data-gex-review-open="true"]) .woocommerce-variation-add-to-cart > :is(.quantity, .single_add_to_cart_button) { display: none !important; }
.single-product div.product form[data-gex-simple-designer="true"] .variations { padding: 0; }
.single-product div.product form[data-gex-simple-designer="true"] .variations th { width: 48px; min-width: 48px; white-space: nowrap; padding: 5px 8px 5px 0; }
.single-product div.product form[data-gex-simple-designer="true"] .variations td { padding: 5px 0; }
.single-product div.product form[data-gex-simple-designer="true"] .variations select { width: 100%; font-size: 14px; }
@media (max-width: 767px) {
 form[data-gex-simple-designer="true"] .gex-upod-editor { padding: 10px; }
 form[data-gex-simple-designer="true"] .gex-upod-editor__layout { display: flex; gap: 12px; }
 form[data-gex-simple-designer="true"] .gex-designer-choices { order: -2; }
 form[data-gex-simple-designer="true"] .gex-upod-editor__stage { order: -1; }
 form[data-gex-simple-designer="true"] .gex-upod-editor__stage > canvas { width: min(100%, 300px); max-height: none; }
 [data-gex-simple-designer="true"] .gex-designer-product-photo img { height: 240px; }
 .gex-simple-review > summary { width: auto; margin: 0; }
 [data-gex-simple-designer="true"] .gex-upod-editor__row { flex-wrap: wrap; }
 [data-gex-simple-designer="true"] [data-gex-text] { flex: 1 1 150px; }
}

[data-gex-simple-designer="true"][data-gex-multiple-placements="false"] [data-gex-step-panel="1"] { display: none; }
[data-gex-simple-designer="true"][data-gex-object-selected="false"] .gex-simple-toolbar :is([data-gex-center], [data-gex-delete]) { display: none; }
[data-gex-simple-designer="true"] .gex-upod-editor__stage :is([data-gex-status], [data-gex-resolution]) { margin: 0 12px 12px; padding: 8px; font-size: 13px; }
[data-gex-simple-designer="true"]:not([data-gex-profile-ready="true"]) .gex-upod-editor__stage [data-gex-status]:not([data-level="warning"]):not([data-level="error"]) { display: none; }

[data-gex-simple-designer="true"] .gex-upod-editor__row > button { flex: 0 0 auto; white-space: nowrap; min-height: 38px; padding: 7px 12px; }
[data-gex-simple-designer="true"] .gex-upod-editor__row > [data-gex-text] { flex: 1 1 140px; width: auto; }
[data-gex-simple-designer="true"] .gex-upod-editor__upload { font-size: 14px; }

.gex-simple-variation-warning { font-size: 12px; color: #865214; margin: 6px 0; }
[data-gex-has-history="false"] .gex-simple-variation-warning { display: none; }
.gex-simple-rotation-note { display: none; color: #596174; font-size: 12px; }
[data-gex-object-selected="true"] label:has([data-gex-rotation]:disabled) .gex-simple-rotation-note { display: block; }
[data-gex-simple-designer="true"][data-gex-object-selected="false"] .gex-simple-advanced > label,
[data-gex-simple-designer="true"] .gex-upod-editor__image-tools:has([data-gex-crop]:disabled) { display: none; }
@media (max-width: 767px) {
 form[data-gex-simple-designer="true"] .gex-upod-editor__stage { order: -2; }
 form[data-gex-simple-designer="true"] .gex-designer-choices { order: -1; }
}

.gex-simple-review { width: 100%; box-sizing: border-box; }
@media (max-width: 767px) {
 form[data-gex-simple-designer="true"] .gex-upod-editor .gex-upod-editor__stage { order: -2; }
 form[data-gex-simple-designer="true"] .gex-simple-toolbar button { display: inline-flex; justify-content: center; width: auto; flex: 0 1 auto; min-width: 0; min-height: 36px; font-size: 12px; padding: 6px 9px; }
}

[data-gex-simple-designer="true"], [data-gex-simple-designer="true"] * { box-sizing: border-box; }
@media (max-width: 767px) {
 form.cart[data-gex-simple-designer="true"] .gex-upod-editor[data-gex-simple-designer="true"] .gex-upod-editor__stage { order: -2; }
 form[data-gex-simple-designer="true"] .gex-upod-editor__row--stack > .gex-upod-editor__row { flex-direction: row; align-items: center; }
 form[data-gex-simple-designer="true"] .gex-upod-editor [data-gex-add-text] { width: auto; }
}

/* Keep the product and its actual print-resolution result visible beside long controls. */
[data-gex-simple-designer="true"] .gex-upod-editor__stage [data-gex-resolution] {
 display: block; line-height: 1.45; border: 1px solid #cbd5e1; border-radius: 8px;
}
[data-gex-simple-designer="true"] .gex-upod-editor__stage [data-gex-resolution][data-level="ok"] {
 color: #14532d; background: #edf9f0; border-color: #96cba5;
}
@media (min-width: 768px) {
 form[data-gex-simple-designer="true"] .gex-upod-editor__stage {
  position: sticky; top: var(--gex-preview-top, 152px); align-self: start;
  max-height: none; overflow: visible;
 }
 form[data-gex-simple-designer="true"] .gex-upod-editor__stage > canvas {
  width: min(100%, 480px, var(--gex-preview-size, 240px));
  height: auto; max-height: none;
 }
 [data-gex-simple-designer="true"] .gex-designer-product-photo img {
  height: min(360px, var(--gex-preview-size, 240px));
 }
}

.gex-simple-settings { min-width: 0; }
.gex-simple-settings .gex-designer-choices { margin-bottom: 20px; }
@media (min-width: 768px) {
 form[data-gex-simple-designer="true"] .gex-simple-settings {
  grid-column: 2; grid-row: 1 / span 2;
  max-height: calc(100dvh - var(--gex-preview-top, 152px) - 12px);
  overflow-y: auto; overscroll-behavior-y: contain; padding-right: 8px;
  scrollbar-gutter: stable; scroll-padding: 8px;
 }
}
@media (max-width: 767px) {
 form[data-gex-simple-designer="true"] .gex-simple-settings { order: -1; width: 100%; }
}

.gex-upod-editor__image-tools .gex-crop-help { margin: 2px 0 12px; color: #536174; font-size: 13px; line-height: 1.5; }
.gex-upod-editor__image-tools label:has(input:disabled) { color: #64748b; }
.gex-upod-editor__image-tools input:disabled { cursor: not-allowed; opacity: .55; }

/* Local image tools: checkerboard is CSS-only, never a drawn/exported layer. */
.gex-image-tools { width:min(900px,94vw); max-height:90dvh; overflow:auto; border:1px solid #cdd5e5; border-radius:16px; padding:20px; color:#152034; background:#fff; }
.gex-image-tools::backdrop { background:#111827a8; }
.gex-image-tools h2 { margin:0 0 8px; font-size:24px; }
.gex-image-tools p { font-size:14px; line-height:1.5; }
.gex-image-tools label { display:block; margin:12px 0; }
.gex-image-tools select { max-width:100%; }
.gex-image-tools__compare { display:grid; grid-template-columns:1fr 1fr; gap:16px; position:sticky; top:0; z-index:2; background:#fff; padding-bottom:8px; }
.gex-image-tools__compare figure { margin:0; min-width:0; }
.gex-image-tools__compare figcaption { margin:8px 0; font-weight:700; }
.gex-image-tools canvas { display:block; width:auto; max-width:100%; height:auto; max-height:26dvh; background:repeating-conic-gradient(#eef0f4 0 25%,#fff 0 50%) 0/16px 16px; }
.gex-image-tools [data-before] { cursor:crosshair; }
.gex-image-tools button,.gex-image-tools__actions a { padding:8px 12px; margin:4px; border:1px solid #bcc8df; border-radius:8px; background:#fff; font-size:14px; cursor:pointer; }
.gex-image-tools [data-swatches] button { border-width:4px; }
.gex-image-tools button:disabled { opacity:.5; cursor:not-allowed; }
.gex-image-tools [data-apply] { background:#2453df; color:#fff; }
.gex-image-tools__actions { display:flex; flex-wrap:wrap; align-items:center; }
@media(max-width:600px) { .gex-image-tools { padding:12px; } .gex-image-tools__compare { gap:8px; } }

/* Simple background preview: primary path is compare then apply. */
.gex-image-tools__heading p { margin:4px 0 12px; }
.gex-image-tools__advanced { margin:12px 0; padding:8px 0; border-top:1px solid #dde3ed; }
.gex-image-tools__advanced summary { cursor:pointer; font-size:14px; color:#536174; }
.gex-image-tools__actions { position:sticky; bottom:0; z-index:3; justify-content:flex-end; background:#fff; padding:8px 0; border-top:1px solid #dde3ed; }
.gex-image-tools .gex-image-tools__footnote { margin:0; font-size:12px; color:#536174; }
.gex-image-tools__compare canvas { cursor:default; }
.gex-image-tools:has(.gex-image-tools__advanced[open]) [data-before] { cursor:crosshair; }

/* Desktop preview uses the available height; controls share its row instead of pushing it down. */
@media (min-width: 768px) {
 form[data-gex-simple-designer="true"] .gex-upod-editor__stage {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 0;
 }
 form[data-gex-simple-designer="true"] .gex-upod-editor__stage > h3 {
  grid-column: 1 / -1; grid-row: 1; margin: 0; padding: 6px 12px; font-size: 15px; line-height: 1.4;
 }
 form[data-gex-simple-designer="true"] .gex-upod-editor__stage [data-gex-resolution] {
  grid-column: 1 / -1; grid-row: 2; margin: 0 8px 4px; padding: 4px 6px;
 }
 form[data-gex-simple-designer="true"] .gex-upod-editor__stage > :is(canvas, .gex-designer-product-photo) {
  grid-column: 1; grid-row: 3; align-self: center; min-width: 0;
 }
 form[data-gex-simple-designer="true"] .gex-simple-toolbar {
  grid-column: 2; grid-row: 3; flex-direction: column; flex-wrap: nowrap; justify-content: center;
  align-self: center; padding: 4px 8px 4px 0;
 }
 form[data-gex-simple-designer="true"] .gex-simple-toolbar button { padding: 6px 8px; }
 form[data-gex-simple-designer="true"] .gex-simple-hint {
  grid-column: 1 / -1; grid-row: 4; margin: 0; padding: 4px 8px; text-align: center;
 }
 form[data-gex-simple-designer="true"] .gex-upod-editor__stage [data-gex-status] {
  grid-column: 1 / -1; grid-row: 5; margin: 0 8px 4px; padding: 4px 6px;
 }
}

/* Preview backgrounds never alter canvas pixels or exported artwork. */
.gex-image-tools[data-preview-ground="light"] canvas { background:#fff; }
.gex-image-tools[data-preview-ground="dark"] canvas { background:#172033; }
.gex-image-tools__grounds { display:flex; align-items:center; flex-wrap:wrap; gap:4px; }
.gex-image-tools__grounds button[aria-pressed="true"] { background:#2453df; border-color:#2453df; color:#fff; }

/* Confirmation follows the editor: a sticky preview must not cover consent or quote controls. */
@media (min-width: 768px) {
 form[data-gex-simple-designer="true"] .gex-upod-editor__layout:has(> .gex-simple-review[open]) > .gex-upod-editor__stage {
  position: static;
 }
}

/* Mobile controls keep the same preview visible without changing canvas pixels. */
@media (max-width: 767px) {
 form[data-gex-simple-designer="true"] .gex-upod-editor__stage {
  position: sticky; top: var(--gex-preview-top, 116px); z-index: 5;
  align-self: stretch; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 6px; padding: 6px; background: #f6f7fb;
 }
 form[data-gex-simple-designer="true"] .gex-upod-editor__stage > h3 {
  grid-column: 1 / -1; margin: 0; padding: 2px 4px; font-size: 14px;
 }
 form[data-gex-simple-designer="true"] .gex-upod-editor__stage [data-gex-resolution] {
  grid-column: 1 / -1; margin: 0 0 4px; padding: 4px; font-size: 11px;
 }
 form[data-gex-simple-designer="true"] .gex-upod-editor__stage > :is(canvas, .gex-designer-product-photo) {
  grid-column: 1; grid-row: 3; justify-self: center; align-self: center;
  width: min(100%, 22dvh, 180px); height: auto; min-width: 0;
 }
 form[data-gex-simple-designer="true"] .gex-designer-product-photo img { height: auto; max-height: 22dvh; }
 form[data-gex-simple-designer="true"] .gex-simple-toolbar {
  grid-column: 2; grid-row: 3; display: flex; flex-direction: column;
  align-self: center; gap: 4px; padding: 0;
 }
 form[data-gex-simple-designer="true"] .gex-simple-toolbar button { margin: 0; }
 form[data-gex-simple-designer="true"] .gex-simple-hint {
  grid-column: 1 / -1; margin: 0; padding: 4px; font-size: 11px;
 }
 form[data-gex-simple-designer="true"] .gex-upod-editor__stage [data-gex-status] {
  grid-column: 1 / -1; margin: 0; padding: 4px; font-size: 11px;
 }
 form[data-gex-simple-designer="true"] .gex-simple-settings :is(input,select,button,summary) {
  scroll-margin-top: calc(var(--gex-preview-top, 116px) + 300px);
 }
 form[data-gex-simple-designer="true"] .gex-upod-editor__layout:has(> .gex-simple-review[open]) > .gex-upod-editor__stage {
  position: static;
 }
}

/* Reserve the closed confirmation row inside the sticky containing block.
   The adjacent settings offset preserves the existing flow spacing. */
@media (max-width: 767px) {
 form[data-gex-simple-designer="true"] .gex-upod-editor__stage { margin-bottom: 64px; }
 form[data-gex-simple-designer="true"] .gex-simple-settings { margin-top: -64px; }
 form[data-gex-simple-designer="true"] .gex-simple-review > summary { min-height: 52px; }
}
