/**
 * Etchwell personalisation fields.
 *
 * Falls back to the brand values if the theme is ever swapped out, but prefers
 * the Kadence palette variables so the fields follow the site.
 */

.etchwell-personalise {
	--ewp-copper: var(--global-palette1, #c27a4a);
	--ewp-graphite: var(--global-palette3, #232428);
	--ewp-body: var(--global-palette4, #33353a);
	--ewp-mid: var(--global-palette5, #5e6067);
	--ewp-subtle: var(--global-palette6, #8b8d94);
	--ewp-stone: var(--global-palette7, #e4ddd3);
	--ewp-offwhite: var(--global-palette8, #f4f2ee);
	--ewp-white: var(--global-palette9, #ffffff);
	--ewp-radius: 4px;

	margin: 0 0 28px;
	padding: 24px;
	background: var(--ewp-white);
	border: 1px solid var(--ewp-stone);
	border-radius: var(--ewp-radius);
}

.etchwell-personalise__intro {
	margin-bottom: 20px;
}

.etchwell-personalise__eyebrow {
	display: block;
	margin-bottom: 8px;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ewp-copper);
}

.etchwell-personalise__note {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--ewp-mid);
}

/* ------------------------------------------------------------------ Fields */

.etchwell-field {
	margin-bottom: 20px;
}

.etchwell-field:last-child {
	margin-bottom: 0;
}

.etchwell-field__label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--ewp-graphite);
}

.etchwell-field__optional {
	margin-left: 6px;
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ewp-subtle);
}

.etchwell-required {
	border: 0;
	text-decoration: none;
	color: var(--ewp-copper);
}

.etchwell-field__help {
	margin: 0 0 8px;
	font-size: 13px;
	line-height: 1.55;
	color: var(--ewp-mid);
}

.etchwell-field__input {
	width: 100%;
	padding: 12px 14px;
	font-size: 16px; /* Keeps iOS from zooming the page on focus. */
	color: var(--ewp-body);
	background: var(--ewp-white);
	border: 1px solid var(--ewp-stone);
	border-radius: var(--ewp-radius);
}

.etchwell-field__input:focus {
	border-color: var(--ewp-copper);
	outline: none;
	box-shadow: 0 0 0 3px rgba(194, 122, 74, 0.14);
}

.etchwell-field__counter {
	margin: 6px 0 0;
	font-size: 12px;
	letter-spacing: 0.04em;
	color: var(--ewp-subtle);
}

.etchwell-field__counter.is-low {
	color: var(--ewp-copper);
}

.etchwell-field__error {
	margin: 8px 0 0;
	font-size: 13px;
	color: var(--global-palette13, #a33224);
}

.etchwell-field.is-invalid .etchwell-dropzone {
	border-color: var(--global-palette13, #a33224);
}

/* --------------------------------------------------------------- Dropzone */

.etchwell-dropzone {
	position: relative;
	border: 1px dashed var(--ewp-stone);
	border-radius: var(--ewp-radius);
	background: var(--ewp-offwhite);
	transition: border-color 0.18s ease, background-color 0.18s ease;
}

.etchwell-dropzone.is-dragging {
	border-color: var(--ewp-copper);
	background: var(--ewp-white);
}

.etchwell-dropzone.has-file {
	border-style: solid;
	background: var(--ewp-white);
}

/* The real input covers the zone so clicking anywhere opens the picker, and
   keyboard focus still lands on a genuine form control. */
.etchwell-dropzone__input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.etchwell-dropzone.has-file .etchwell-dropzone__input {
	/* Leave the remove button clickable once a file is chosen. */
	right: 120px;
}

.etchwell-dropzone__input:focus-visible + .etchwell-dropzone__empty {
	outline: 2px solid var(--ewp-copper);
	outline-offset: 2px;
	border-radius: var(--ewp-radius);
}

.etchwell-dropzone__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	min-height: 110px;
	padding: 20px;
	text-align: center;
}

.etchwell-dropzone__action {
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ewp-graphite);
	border-bottom: 1px solid var(--ewp-copper);
	padding-bottom: 2px;
}

.etchwell-dropzone__hint {
	font-size: 12px;
	letter-spacing: 0.04em;
	color: var(--ewp-subtle);
}

.etchwell-dropzone__preview {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px;
}

.etchwell-dropzone__thumb {
	flex: 0 0 auto;
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: var(--ewp-radius);
	background: var(--ewp-stone);
}

.etchwell-dropzone__meta {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.etchwell-dropzone__filename {
	font-size: 14px;
	color: var(--ewp-graphite);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.etchwell-dropzone__filesize {
	font-size: 12px;
	color: var(--ewp-subtle);
}

.etchwell-dropzone__remove {
	position: relative;
	z-index: 1;
	flex: 0 0 auto;
	padding: 8px 14px;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ewp-mid);
	background: transparent;
	border: 1px solid var(--ewp-stone);
	border-radius: var(--ewp-radius);
	cursor: pointer;
}

.etchwell-dropzone__remove:hover,
.etchwell-dropzone__remove:focus-visible {
	color: var(--ewp-graphite);
	border-color: var(--ewp-graphite);
	background: transparent;
}

/* ---------------------------------------------------------------- Tickbox */

.etchwell-check {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	background: var(--ewp-offwhite);
	border: 1px solid var(--ewp-stone);
	border-radius: var(--ewp-radius);
	cursor: pointer;
}

.etchwell-check input[type="checkbox"] {
	flex: 0 0 auto;
	margin: 3px 0 0;
	width: 16px;
	height: 16px;
	accent-color: var(--ewp-copper);
}

.etchwell-check__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.etchwell-check__label {
	font-size: 14px;
	font-weight: 500;
	color: var(--ewp-graphite);
}

.etchwell-check__price {
	margin-left: 8px;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ewp-copper);
}

.etchwell-check__help {
	font-size: 13px;
	line-height: 1.5;
	color: var(--ewp-mid);
}

/* ------------------------------------------------ Cart and checkout thumbs */

/* WooCommerce renders custom item data as a definition list. Stack it so the
   labels and photos read as rows rather than running together inline. */
.woocommerce dl.variation {
	margin: 8px 0 0;
	display: grid;
	gap: 4px 10px;
	font-size: 14px;
}

.woocommerce dl.variation dt {
	margin: 0;
	font-weight: 500;
	color: var(--global-palette5, #5e6067);
}

.woocommerce dl.variation dd {
	margin: 0 0 8px;
	padding: 0;
	color: var(--global-palette4, #33353a);
}

.woocommerce dl.variation dd:last-child {
	margin-bottom: 0;
}

.woocommerce dl.variation dd p {
	margin: 0;
}

.etchwell-thumb {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 2px;
}

.etchwell-thumb__img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border: 1px solid var(--global-palette7, #e4ddd3);
	border-radius: 4px;
	background: var(--global-palette7, #e4ddd3);
}

.etchwell-thumb__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.08em;
	color: var(--global-palette5, #5e6067);
	background: var(--global-palette7, #e4ddd3);
	border-radius: 4px;
}

.etchwell-thumb__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.etchwell-thumb__name {
	font-size: 13px;
	color: var(--global-palette4, #33353a);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 22ch;
}

.etchwell-thumb__size {
	font-size: 12px;
	color: var(--global-palette6, #8b8d94);
}

@media (max-width: 480px) {
	.etchwell-personalise {
		padding: 18px;
	}

	.etchwell-dropzone__preview {
		flex-wrap: wrap;
	}

	.etchwell-dropzone.has-file .etchwell-dropzone__input {
		right: 0;
		bottom: 52px;
		height: auto;
	}

	.etchwell-dropzone__remove {
		width: 100%;
	}
}

/* -------------------------------------------------------------------------- */
/* Live designer                                                               */
/* -------------------------------------------------------------------------- */

/*
 * Leads the left column on personalised products. The customer's photo sits in
 * the etch window of a blank product shot, where it can be moved and zoomed,
 * and the engraving text appears in place. The window is set per product with
 * custom properties (width, height, centre x, centre y as percentages).
 */
.etchwell-stage {
	--ewp-copper: var(--global-palette1, #c27a4a);
	--ewp-graphite: var(--global-palette3, #232428);
	--ewp-mid: var(--global-palette5, #5e6067);
	--ewp-subtle: var(--global-palette6, #8b8d94);
	--ewp-stone: var(--global-palette7, #e4ddd3);
	--ewp-offwhite: var(--global-palette8, #f4f2ee);
	--ewp-white: var(--global-palette9, #ffffff);
	--ewp-radius: 4px;

	--ewp-etch-w: 34%;
	--ewp-etch-h: 40%;
	--ewp-etch-x: 50%;
	--ewp-etch-y: 41%;

	/* How the engraving reads on this surface. */
	--ewp-ink: rgba(70, 74, 82, 0.85);
	--ewp-blend: multiply;
	--ewp-photo-opacity: 0.75;

	margin-bottom: 24px;
	padding: 16px;
	background: var(--ewp-white);
	border: 1px solid var(--ewp-stone);
	border-radius: var(--ewp-radius);
}

.etchwell-stage--slate,
.etchwell-stage--metal {
	--ewp-ink: rgba(238, 234, 226, 0.92);
	--ewp-blend: screen;
	--ewp-photo-opacity: 0.9;
}

.etchwell-stage[hidden],
.etchwell-stage [hidden] {
	display: none !important;
}

.etchwell-stage__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.etchwell-stage__label {
	font-family: var(--global-body-font-family);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ewp-copper);
}

.etchwell-stage__mode {
	padding: 0;
	font: inherit;
	font-size: 13px;
	color: var(--ewp-mid);
	background: none;
	border: 0;
	border-bottom: 1px solid currentColor;
	cursor: pointer;
}

.etchwell-stage__mode:hover,
.etchwell-stage__mode:focus-visible {
	color: var(--ewp-graphite);
}

.etchwell-stage__frame {
	position: relative;
	overflow: hidden;
	border-radius: var(--ewp-radius);
	background: var(--ewp-stone);
	touch-action: none;
}

.etchwell-stage__crystal {
	display: block;
	width: 100%;
	height: auto;
	border: 0;
	border-radius: 0;
	user-select: none;
}

/* The etch window. A size container, so the text can scale with its height. */
.etchwell-stage__etch {
	position: absolute;
	top: var(--ewp-etch-y);
	left: var(--ewp-etch-x);
	width: var(--ewp-etch-w);
	height: var(--ewp-etch-h);
	transform: translate(-50%, -50%);
	overflow: hidden;
	container-type: size;
	outline: 1px dashed transparent;
	outline-offset: -1px;
	transition: outline-color 0.2s ease;
}

.etchwell-stage.has-photo .etchwell-stage__etch {
	cursor: grab;
}

.etchwell-stage.has-photo .etchwell-stage__frame:hover .etchwell-stage__etch,
.etchwell-stage.is-dragging .etchwell-stage__etch {
	outline-color: rgba(194, 122, 74, 0.7);
}

.etchwell-stage.is-dragging .etchwell-stage__etch {
	cursor: grabbing;
}

.etchwell-stage__layer {
	position: absolute;
	inset: 0;
	transform-origin: 50% 50%;
	will-change: transform;
}

.etchwell-stage__photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	border: 0;
	border-radius: 0;
	pointer-events: none;
	user-select: none;
}

.etchwell-stage.is-etched .etchwell-stage__photo {
	opacity: var(--ewp-photo-opacity);
	filter: grayscale(1) contrast(1.15) brightness(1.05);
	mix-blend-mode: var(--ewp-blend);
}

.etchwell-stage__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	text-align: center;
	font-size: 12px;
	line-height: 1.4;
	color: var(--ewp-ink);
	border: 1px dashed currentColor;
	border-radius: 2px;
	opacity: 0.7;
	pointer-events: none;
}

/* Engraving text. Each line is placed by the script from one layout spec, so
   the preview and the picture sent with the order always agree. */
.etchwell-stage__text {
	position: absolute;
	inset: 0;
	font-family: "DM Serif Display", Georgia, serif;
	color: var(--ewp-ink);
	text-align: center;
	pointer-events: none;
}

.etchwell-stage__line {
	position: absolute;
	top: 50%;
	left: 6%;
	right: 6%;
	display: block;
	font-size: 10cqh;
	line-height: 1;
	white-space: nowrap;
	transform: translateY(-50%);
}

.etchwell-stage__line:empty {
	display: none;
}

/* Sign ornaments, drawn as SVG in the ink colour. */
.etchwell-stage__ornament {
	position: absolute;
	inset: 0;
	color: var(--ewp-ink);
	pointer-events: none;
}

.etchwell-stage__ornament svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* Background removal in progress. */
.etchwell-stage__busy {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 24px;
	text-align: center;
	font-size: 14px;
	color: var(--ewp-graphite);
	background: rgba(244, 242, 238, 0.82);
	backdrop-filter: blur(2px);
}

.etchwell-spinner {
	width: 28px;
	height: 28px;
	border: 2px solid var(--ewp-stone);
	border-top-color: var(--ewp-copper);
	border-radius: 50%;
	animation: etchwell-spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
	.etchwell-spinner {
		animation-duration: 2.4s;
	}
}

/* Zoom, rotate, reset. */
.etchwell-stage__tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin-top: 12px;
}

.etchwell-stage__zoom {
	display: flex;
	flex: 1 1 180px;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	color: var(--ewp-mid);
}

.etchwell-stage__zoom input[type="range"] {
	flex: 1;
	accent-color: var(--ewp-copper);
}

.etchwell-stage__tool {
	min-height: 36px;
	padding: 6px 14px;
	font: inherit;
	font-size: 13px;
	color: var(--ewp-graphite);
	background: var(--ewp-white);
	border: 1px solid var(--ewp-stone);
	border-radius: var(--ewp-radius);
	cursor: pointer;
}

.etchwell-stage__tool:hover,
.etchwell-stage__tool:focus-visible {
	border-color: var(--ewp-graphite);
}

.etchwell-stage__note {
	margin: 12px 0 0;
	font-size: 12px;
	line-height: 1.5;
	color: var(--ewp-subtle);
}

/* Lettering style picker. */
.etchwell-fonts {
	margin: 0;
	padding: 0;
	border: 0;
}

.etchwell-fonts__options {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
}

.etchwell-font {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 10px 6px;
	background: var(--ewp-white, #fff);
	border: 1px solid var(--ewp-stone, #e4ddd3);
	border-radius: var(--ewp-radius, 4px);
	cursor: pointer;
}

.etchwell-font input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.etchwell-font__sample {
	font-size: 24px;
	line-height: 1.1;
	color: var(--ewp-graphite, #232428);
}

.etchwell-font__name {
	font-size: 12px;
	color: var(--ewp-mid, #5e6067);
}

.etchwell-font:has(input:checked) {
	border-color: var(--ewp-copper, #c27a4a);
	box-shadow: inset 0 0 0 1px var(--ewp-copper, #c27a4a);
}

.etchwell-font:has(input:focus-visible) {
	outline: 2px solid var(--ewp-copper, #c27a4a);
	outline-offset: 2px;
}

/* The heart and diamond placeholders have a narrower etch area. */
.postid-63 .etchwell-stage {
	--ewp-etch-w: 28%;
	--ewp-etch-h: 30%;
	--ewp-etch-y: 42%;
}

.postid-68 .etchwell-stage {
	--ewp-etch-w: 26%;
	--ewp-etch-h: 26%;
	--ewp-etch-y: 40%;
}

/* The theme styles every input as a text box; the zoom slider should not be. */
.etchwell-stage__zoom input[type="range"] {
	height: 24px;
	min-height: 0;
	padding: 0;
	background: transparent;
	border: 0;
	box-shadow: none;
}

.etchwell-stage__line {
	text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}

/* Sign layout picker. */
.etchwell-templates {
	margin: 0;
	padding: 0;
	border: 0;
}

.etchwell-templates__options {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
	gap: 8px;
}

.etchwell-template {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 8px;
	background: var(--ewp-white, #fff);
	border: 1px solid var(--ewp-stone, #e4ddd3);
	border-radius: var(--ewp-radius, 4px);
	cursor: pointer;
}

.etchwell-template input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.etchwell-template__icon svg {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 2px;
}

.etchwell-template__name {
	font-size: 13px;
	font-weight: 500;
	color: var(--ewp-graphite, #232428);
}

.etchwell-template__hint {
	font-size: 11px;
	line-height: 1.3;
	color: var(--ewp-mid, #5e6067);
}

.etchwell-template:has(input:checked) {
	border-color: var(--ewp-copper, #c27a4a);
	box-shadow: inset 0 0 0 1px var(--ewp-copper, #c27a4a);
}

.etchwell-template:has(input:focus-visible) {
	outline: 2px solid var(--ewp-copper, #c27a4a);
	outline-offset: 2px;
}

/* Ready-made designs: text glows white near the base, like the etching above it. */
.etchwell-stage--design {
	--ewp-ink: rgba(252, 249, 243, 0.95);
}

.etchwell-stage--design .etchwell-stage__line {
	text-shadow: 0 0 6px rgba(255, 236, 205, 0.85), 0 0 1px rgba(255, 255, 255, 0.9);
}

/* The engraving text can be dragged into place. */
.etchwell-stage__line:not(:empty) {
	pointer-events: auto;
	cursor: move;
	touch-action: none;
}

.etchwell-stage.is-moving-text .etchwell-stage__line:not(:empty) {
	outline: 1px dashed rgba(194, 122, 74, 0.8);
	outline-offset: 4px;
}

@media (hover: hover) {
	.etchwell-stage__line:not(:empty):hover {
		outline: 1px dashed rgba(194, 122, 74, 0.6);
		outline-offset: 4px;
	}
}

/* "We kept your design" note when a saved design is restored. */
.etchwell-restored {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	margin: 0 0 16px;
	padding: 10px 14px;
	border-left: 3px solid var(--ewp-copper, #c27a4a);
	border-radius: var(--ewp-radius, 4px);
	background: rgba(194, 122, 74, 0.08);
	font-size: 14px;
}

.etchwell-restored__reset {
	padding: 0;
	font: inherit;
	color: var(--ewp-graphite, #232428);
	background: none;
	border: 0;
	border-bottom: 1px solid currentColor;
	cursor: pointer;
}

/* Ready-made artwork in the preview. */
.etchwell-stage__motif {
	position: absolute;
	left: 50%;
	top: 50%;
	color: var(--ewp-ink);
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.etchwell-stage__motif svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* Artwork picker. */
.etchwell-motifs {
	margin: 0;
	padding: 0;
	border: 0;
}

.etchwell-motifs__options {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
	gap: 8px;
}

.etchwell-motif {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 8px 4px;
	border: 1px solid var(--ewp-stone, #e4ddd3);
	border-radius: var(--ewp-radius, 4px);
	background: #fff;
	cursor: pointer;
	text-align: center;
}

.etchwell-motif input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.etchwell-motif__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--ewp-graphite, #232428);
	font-size: 22px;
	line-height: 1;
}

.etchwell-motif__icon svg {
	width: 100%;
	height: 100%;
}

.etchwell-motif__name {
	font-size: 12px;
	line-height: 1.2;
}

.etchwell-motif:hover {
	border-color: rgba(194, 122, 74, 0.6);
}

.etchwell-motif:has(input:checked) {
	border-color: var(--ewp-copper, #c27a4a);
	box-shadow: inset 0 0 0 1px var(--ewp-copper, #c27a4a);
}

.etchwell-motif:has(input:focus-visible) {
	outline: 2px solid var(--ewp-copper, #c27a4a);
	outline-offset: 2px;
}

/* Per-product ink, after the material defaults so it wins. */
.etchwell-stage--ink-light {
	--ewp-ink: rgba(238, 234, 226, 0.92);
}

.etchwell-stage--ink-dark {
	--ewp-ink: rgba(70, 74, 82, 0.85);
}

.etchwell-stage--design {
	--ewp-ink: rgba(252, 249, 243, 0.95);
}

/* "Drag to move" hint, shown once there is something to move, until it has been moved. */
.etchwell-stage__drag {
	position: absolute;
	left: 50%;
	bottom: 10px;
	z-index: 3;
	display: none;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	font-size: 12px;
	line-height: 1;
	white-space: nowrap;
	color: var(--ewp-white);
	background: rgba(35, 36, 40, 0.82);
	border-radius: 999px;
	transform: translateX(-50%);
	pointer-events: none;
	animation: etchwell-drag-hint 2.4s ease-in-out infinite;
}

.etchwell-stage.has-photo:not(.has-moved) .etchwell-stage__drag,
.etchwell-stage.has-text:not(.has-moved) .etchwell-stage__drag {
	display: inline-flex;
}

@keyframes etchwell-drag-hint {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
	.etchwell-stage__drag {
		animation: none;
	}
}

.etchwell-stage {
	scroll-margin-top: 96px;
}

/* Phones: the preview sits just above the form; a plain photo leads the page. */
.etchwell-cover {
	margin: 0 0 16px;
	overflow: hidden;
	border-radius: var(--ewp-radius, 4px);
	background: var(--global-palette7, #e4ddd3);
}

.etchwell-cover[hidden] {
	display: none;
}

.etchwell-cover img {
	display: block;
	width: 100%;
	height: auto;
}

.etchwell-stage.is-inline {
	margin: 0 0 16px;
}

.etchwell-stage.is-inline .etchwell-stage__frame {
	max-width: 420px;
	margin-inline: auto;
	touch-action: pan-y;
}

.etchwell-stage.is-inline.has-photo .etchwell-stage__etch,
.etchwell-stage.is-inline.has-text .etchwell-stage__etch {
	touch-action: none;
}

/* A drawn slider track, so it shows on every phone browser. */
.etchwell-stage__zoom input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
}

.etchwell-stage__zoom input[type="range"]::-webkit-slider-runnable-track {
	height: 4px;
	background: var(--ewp-stone);
	border-radius: 2px;
}

.etchwell-stage__zoom input[type="range"]::-moz-range-track {
	height: 4px;
	background: var(--ewp-stone);
	border-radius: 2px;
}

.etchwell-stage__zoom input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	margin-top: -8px;
	background: var(--ewp-copper);
	border: 0;
	border-radius: 50%;
}

.etchwell-stage__zoom input[type="range"]::-moz-range-thumb {
	width: 20px;
	height: 20px;
	background: var(--ewp-copper);
	border: 0;
	border-radius: 50%;
}

.etchwell-stage.is-inline .etchwell-stage__zoom {
	flex-basis: 100%;
}

/* Layouts: the photo or logo sits in its own slot within the engraving area. */
.etchwell-stage__slot {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.etchwell-stage__slot[hidden] {
	display: none;
}

/* An empty fixed slot shows where the image will go. */
.etchwell-stage__slot.is-fixed {
	outline: 1px dashed color-mix(in srgb, var(--ewp-ink) 55%, transparent);
	outline-offset: -1px;
}

.etchwell-stage.has-photo .etchwell-stage__slot.is-fixed {
	outline-color: transparent;
}

.etchwell-stage__slot.is-fixed::after {
	content: attr(data-label);
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	font-family: Jost, "Helvetica Neue", Arial, sans-serif;
	font-size: clamp(10px, 9cqh, 14px);
	text-align: center;
	color: var(--ewp-ink);
	opacity: 0.75;
	pointer-events: none;
}

.etchwell-stage.has-photo .etchwell-stage__slot.is-fixed::after {
	content: none;
}

/* Fixed layouts keep the words where the layout puts them. */
.etchwell-stage.is-text-locked .etchwell-stage__line:not(:empty) {
	pointer-events: none;
	cursor: default;
}

.etchwell-stage.is-text-locked:not(.has-photo) .etchwell-stage__drag {
	display: none;
}

[data-etchwell-line-row][hidden],
[data-etchwell-upload-field][hidden],
.etchwell-field[hidden] {
	display: none;
}

.etchwell-template__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 60px;
}

.etchwell-template__icon svg {
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 60px;
}

/* "The preview is a guide" notes. */
.etchwell-stage__disclaimer,
.etchwell-personalise__disclaimer {
	margin: 8px 0 0;
	font-size: 12px;
	line-height: 1.45;
	color: var(--ewp-mid, #5e6067);
}

.etchwell-personalise__disclaimer {
	margin-top: 16px;
	padding: 10px 12px;
	background: var(--ewp-stone-soft, rgba(228, 221, 211, 0.45));
	border-radius: var(--ewp-radius, 4px);
}
