/**
 * StitchPress — customer capture modal.
 *
 * Brand-neutral by design. Every colour, radius and spacing value is a custom
 * property with a sane default, so a shop or theme overrides the look by
 * redefining a handful of variables rather than fighting selectors:
 *
 *   .stp-capture { --stp-accent: #c8102e; --stp-radius: 2px; }
 *
 * Everything is namespaced under .stp-capture (and .stp-capture-launcher on the
 * product page) — no bare element selectors escape into the theme. Mobile
 * first: the single-column stack is the base, the two-column layout is the
 * enhancement. Motion is opt-out via prefers-reduced-motion.
 */

.stp-capture,
.stp-capture-launcher,
.stp-cart-edit {
	--stp-accent: #1f5eff;
	--stp-accent-contrast: #ffffff;
	--stp-ink: #1a1a1a;
	--stp-ink-muted: #5b6470;
	--stp-surface: #ffffff;
	--stp-surface-alt: #f5f6f8;
	--stp-border: #d8dce3;
	--stp-border-strong: #9aa3b0;
	--stp-danger: #b3261e;
	--stp-success: #1a7f4b;
	--stp-notice: #7a5200;
	--stp-radius: 6px;
	--stp-radius-sm: 4px;
	--stp-gap: 16px;
	--stp-gap-sm: 8px;
	--stp-shadow: 0 12px 40px rgba( 15, 23, 42, 0.24 );
	--stp-focus: 0 0 0 3px rgba( 31, 94, 255, 0.35 );
	--stp-swatch-size: 34px;
	--stp-zone-outline: rgba( 255, 255, 255, 0.9 );
	/*
	 * Visual placement. The halo is what makes the selection frame and the
	 * handles readable on a white tee AND on a black cap — the item sits on a
	 * photograph whose colours we do not control, so every stage affordance is
	 * drawn twice: accent on top of a light halo.
	 */
	--stp-halo: rgba( 255, 255, 255, 0.92 );
	--stp-handle-hit: 44px;
	--stp-handle-dot: 14px;
}

/* -------------------------------------------------------------------------
 * Launcher (in form.cart)
 * ---------------------------------------------------------------------- */

.stp-capture-launcher {
	margin: 0 0 var( --stp-gap );
}

.stp-capture-launcher__summary {
	margin: var( --stp-gap-sm ) 0 0;
	color: var( --stp-ink-muted );
	font-size: 0.875em;
}

.stp-capture-launcher__summary:empty {
	display: none;
}

/*
 * Post-add confirmation. It replaces a page reload as the customer's only
 * evidence that anything happened, so it does not fade out on a timer and it
 * carries the obvious next step with it.
 */
.stp-capture-launcher__flash {
	margin: var( --stp-gap-sm ) 0 0;
	padding: var( --stp-gap-sm ) 12px;
	color: var( --stp-success );
	background: rgba( 26, 127, 75, 0.08 );
	border: 1px solid rgba( 26, 127, 75, 0.3 );
	border-radius: var( --stp-radius-sm );
	font-size: 0.875em;
}

.stp-capture-launcher__flash[hidden] {
	display: none;
}

.stp-capture-launcher__flash-link {
	color: inherit;
	text-decoration: underline;
}

/* -------------------------------------------------------------------------
 * Cart re-edit link (rendered into the cart's product-name cell)
 * ---------------------------------------------------------------------- */

.stp-cart-edit {
	display: inline-block;
	margin-top: 4px;
	font-size: 0.8125em;
	color: var( --stp-accent );
	text-decoration: underline;
}

/* -------------------------------------------------------------------------
 * Overlay + dialog
 * ---------------------------------------------------------------------- */

body.stp-capture-open {
	overflow: hidden;
}

.stp-capture__overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 0;
	background: rgba( 15, 23, 42, 0.55 );
	overflow-y: auto;
}

.stp-capture__overlay[hidden] {
	display: none;
}

.stp-capture__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 960px;
	max-height: 100%;
	overflow: hidden;
	background: var( --stp-surface );
	border-radius: var( --stp-radius ) var( --stp-radius ) 0 0;
	box-shadow: var( --stp-shadow );
	color: var( --stp-ink );
	font-size: 16px;
	line-height: 1.45;
}

.stp-capture__dialog:focus {
	outline: none;
}

.stp-capture__dialog :focus-visible {
	outline: 2px solid var( --stp-accent );
	outline-offset: 2px;
	box-shadow: var( --stp-focus );
}

/* -------------------------------------------------------------------------
 * Header
 * ---------------------------------------------------------------------- */

.stp-capture__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var( --stp-gap-sm );
	padding: var( --stp-gap );
	border-bottom: 1px solid var( --stp-border );
}

.stp-capture__title {
	margin: 0;
	font-size: 1.125em;
	line-height: 1.2;
}

.stp-capture__close {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	padding: 0;
	font-size: 24px;
	line-height: 1;
	color: var( --stp-ink-muted );
	background: transparent;
	border: 1px solid transparent;
	border-radius: var( --stp-radius-sm );
	cursor: pointer;
}

.stp-capture__close:hover {
	color: var( --stp-ink );
	border-color: var( --stp-border );
}

/* -------------------------------------------------------------------------
 * Error region
 * ---------------------------------------------------------------------- */

.stp-capture__error {
	margin: 0;
	padding: var( --stp-gap-sm ) var( --stp-gap );
	color: var( --stp-danger );
	background: rgba( 179, 38, 30, 0.08 );
	border-bottom: 1px solid rgba( 179, 38, 30, 0.25 );
	font-size: 0.9375em;
}

.stp-capture__error[hidden] {
	display: none;
}

/*
 * The server can refuse an add for more than one reason at a time; they are
 * listed rather than run together into one sentence, because each one is a
 * separate thing the customer has to go and fix.
 */
.stp-capture__error-list {
	margin: 0;
	padding-left: 1.25em;
}

.stp-capture__error-list li + li {
	margin-top: 4px;
}

/* -------------------------------------------------------------------------
 * Notice region (not a failure — currently "you are editing a saved design")
 * ---------------------------------------------------------------------- */

.stp-capture__notice {
	margin: 0;
	padding: var( --stp-gap-sm ) var( --stp-gap );
	color: var( --stp-notice );
	background: rgba( 122, 82, 0, 0.08 );
	border-bottom: 1px solid rgba( 122, 82, 0, 0.25 );
	font-size: 0.9375em;
}

.stp-capture__notice[hidden] {
	display: none;
}

/* -------------------------------------------------------------------------
 * Capture-mode pills (quick / visual placement)
 *
 * Rendered only when the template offers both, so this bar is either two
 * buttons or absent — never one button pretending to be a choice.
 * ---------------------------------------------------------------------- */

.stp-capture__capture-modes {
	display: flex;
	flex-wrap: wrap;
	gap: var( --stp-gap-sm );
	padding: var( --stp-gap ) var( --stp-gap ) 0;
}

.stp-capture__capture-modes[hidden] {
	display: none;
}

/* -------------------------------------------------------------------------
 * Screen-reader-only region (throttled placement announcements)
 * ---------------------------------------------------------------------- */

.stp-capture__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

/* -------------------------------------------------------------------------
 * Body: stage + panel
 * ---------------------------------------------------------------------- */

.stp-capture__body {
	display: flex;
	flex-direction: column;
	gap: var( --stp-gap );
	padding: var( --stp-gap );
	overflow-y: auto;
}

.stp-capture__views {
	display: flex;
	flex-wrap: wrap;
	gap: var( --stp-gap-sm );
	margin-bottom: var( --stp-gap-sm );
}

.stp-capture__views[hidden] {
	display: none;
}

.stp-capture__view {
	padding: 6px 12px;
	font-size: 0.875em;
	color: var( --stp-ink );
	background: var( --stp-surface-alt );
	border: 1px solid var( --stp-border );
	border-radius: 999px;
	cursor: pointer;
}

/*
 * aria-pressed, not aria-selected: the view switcher is a group of toggle
 * buttons, not a tablist — every view paints the same canvas, so there are no
 * tabpanels for tab semantics to point at. Matches the method pills.
 */
.stp-capture__view[aria-pressed="true"] {
	color: var( --stp-accent-contrast );
	background: var( --stp-accent );
	border-color: var( --stp-accent );
}

.stp-capture__canvas {
	position: relative;
	overflow: hidden;
	background: var( --stp-surface-alt );
	border: 1px solid var( --stp-border );
	border-radius: var( --stp-radius-sm );
}

.stp-capture__image {
	display: block;
	width: 100%;
	height: auto;
}

.stp-capture__zones {
	position: absolute;
	inset: 0;
}

/*
 * Zone hotspots are positioned with the percentages stored on the template.
 * There is no correction pass anywhere in this stylesheet or in capture.js —
 * if a zone looks wrong, the stored geometry is wrong (capture-integrity D1).
 */
.stp-capture__zone {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	/*
	 * Visual floor only — the stored percentages are untouched (D1). A 1%-wide
	 * zone on a 320px phone canvas is a 3px tap target; the hotspot is grown to
	 * something a finger can hit while the geometry it represents stays exactly
	 * as configured.
	 */
	min-width: 24px;
	min-height: 24px;
	padding: 0;
	color: var( --stp-ink );
	background: rgba( 255, 255, 255, 0.16 );
	border: 2px dashed var( --stp-zone-outline );
	border-radius: var( --stp-radius-sm );
	cursor: pointer;
}

.stp-capture__zone:hover,
.stp-capture__zone:focus-visible {
	background: rgba( 255, 255, 255, 0.34 );
	border-style: solid;
}

.stp-capture__zone.is-filled {
	border-color: var( --stp-accent );
	border-style: solid;
	background: rgba( 31, 94, 255, 0.14 );
}

.stp-capture__zone-label {
	padding: 2px 6px;
	font-size: 11px;
	line-height: 1.2;
	text-align: center;
	background: rgba( 255, 255, 255, 0.85 );
	border-radius: 3px;
}

.stp-capture__hint {
	display: block;
	margin: var( --stp-gap-sm ) 0 0;
	color: var( --stp-ink-muted );
	font-size: 0.8125em;
}

/* -------------------------------------------------------------------------
 * Visual placement: items on the garment
 *
 * The layer is pointer-transparent and the items in it are not, so a tap on
 * bare garment still reaches the zone hotspot underneath it. Every offset in
 * here is a percentage of the ZONE box (the wrapper), which is the only
 * coordinate frame the stored placement knows about.
 * ---------------------------------------------------------------------- */

/*
 * The canvas clips in quick mode (nothing should ever paint outside the
 * garment) but must not in visual mode: the rotate handle deliberately hangs
 * above the item, and a zone near the top of the garment would otherwise have
 * a handle that is half there and impossible to grab.
 */
.stp-capture.is-visual .stp-capture__canvas {
	overflow: visible;
}

.stp-capture__items {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.stp-capture__zone-items {
	position: absolute;
	/* Handles hang outside the item, and a rotated item outside its own box. */
	overflow: visible;
}

.stp-capture__item {
	position: absolute;
	pointer-events: auto;
	/*
	 * The browser must not claim the gesture: without this a drag down the
	 * garment scrolls the modal instead of moving the decoration.
	 */
	touch-action: none;
	cursor: move;
	/* The stored value is a percentage of the zone; JS writes it. */
	width: 80%;
	transform-origin: 50% 50%;
	-webkit-user-select: none;
	user-select: none;
}

/*
 * Selection frame. Drawn as a ring OUTSIDE the content so it never covers the
 * decoration, dashed accent over a light halo so it reads on a dark garment
 * and on a light one.
 */
.stp-capture__item::before {
	content: "";
	position: absolute;
	inset: -4px;
	border: 1px dashed var( --stp-accent );
	border-radius: 2px;
	box-shadow:
		0 0 0 1px var( --stp-halo ),
		inset 0 0 0 1px var( --stp-halo );
	pointer-events: none;
}

.stp-capture__item:focus {
	outline: none;
}

.stp-capture__item:focus-visible::before,
.stp-capture__item.is-active::before {
	border-style: solid;
	border-width: 2px;
	box-shadow:
		0 0 0 2px var( --stp-halo ),
		inset 0 0 0 2px var( --stp-halo );
}

.stp-capture__item-text {
	display: block;
	width: 100%;
	line-height: 1;
	text-align: center;
}

/*
 * inline-block + nowrap is load-bearing, not cosmetic: capture.js reads this
 * span's offsetWidth at a reference font-size to derive the size that fills
 * the item exactly. Let it wrap and that measurement becomes meaningless.
 */
.stp-capture__item-line {
	display: inline-block;
	line-height: 1;
	white-space: nowrap;
}

.stp-capture__item-art {
	display: block;
	width: 100%;
	height: auto;
	-webkit-user-drag: none;
}

/*
 * Handles: a 44px touch target with a small visible dot, per the mobile-first
 * ship gate. The hit area is the element; the dot is a pseudo-element, so the
 * target does not have to look like a 44px blob on a phone-sized garment.
 */
.stp-capture__handle {
	position: absolute;
	display: block;
	width: var( --stp-handle-hit );
	height: var( --stp-handle-hit );
	pointer-events: auto;
	touch-action: none;
}

.stp-capture__handle::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: var( --stp-handle-dot );
	height: var( --stp-handle-dot );
	margin: calc( var( --stp-handle-dot ) / -2 ) 0 0 calc( var( --stp-handle-dot ) / -2 );
	background: var( --stp-accent );
	border: 2px solid var( --stp-halo );
	border-radius: 50%;
	box-sizing: border-box;
}

.stp-capture__handle--scale {
	right: calc( var( --stp-handle-hit ) / -2 );
	bottom: calc( var( --stp-handle-hit ) / -2 );
	cursor: nwse-resize;
}

/*
 * Above the item, and no further above it than it has to be: the hit area
 * hangs outside the garment image and the modal body is a scroll container,
 * so every extra pixel here is a pixel of handle a top-edge zone can push out
 * of view.
 */
.stp-capture__handle--rotate {
	left: 50%;
	top: calc( ( var( --stp-handle-hit ) + 6px ) * -1 );
	margin-left: calc( var( --stp-handle-hit ) / -2 );
	cursor: grab;
}

/* The tether, so the rotate dot reads as belonging to this item. */
.stp-capture__handle--rotate::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 2px;
	height: calc( ( var( --stp-handle-hit ) / 2 ) + 6px );
	margin-left: -1px;
	background: var( --stp-accent );
	box-shadow: 0 0 0 1px var( --stp-halo );
}

/*
 * With something drawn in the zone, the zone's own name label is in the way of
 * the thing it names. The hotspot keeps its accessible name either way.
 */
.stp-capture.is-visual .stp-capture__zone.is-filled .stp-capture__zone-label {
	display: none;
}

/*
 * Fidelity honesty (SPEC-SCHEMA): the stage is an approximation drawn with the
 * customer's own screen metrics. Permanent while visual mode is on — not a
 * dismissible tooltip.
 */
.stp-capture__disclaimer {
	display: block;
	margin: 4px 0 0;
	color: var( --stp-ink-muted );
	font-size: 0.75em;
}

.stp-capture__disclaimer[hidden] {
	display: none;
}

/* -------------------------------------------------------------------------
 * Panel: methods + editors
 * ---------------------------------------------------------------------- */

.stp-capture__methods {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var( --stp-gap-sm );
	margin-bottom: var( --stp-gap );
}

.stp-capture__methods[hidden] {
	display: none;
}

.stp-capture__pill {
	padding: 6px 12px;
	font-size: 0.875em;
	color: var( --stp-ink );
	background: var( --stp-surface );
	border: 1px solid var( --stp-border-strong );
	border-radius: 999px;
	cursor: pointer;
}

.stp-capture__pill[aria-pressed="true"] {
	color: var( --stp-accent-contrast );
	background: var( --stp-accent );
	border-color: var( --stp-accent );
}

.stp-capture__editor {
	border: 1px solid var( --stp-border );
	border-radius: var( --stp-radius-sm );
	margin-bottom: var( --stp-gap-sm );
	background: var( --stp-surface );
}

.stp-capture__editor.is-filled {
	border-color: var( --stp-accent );
}

.stp-capture__editor-heading {
	margin: 0;
	font-size: 1em;
}

.stp-capture__editor-toggle {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var( --stp-gap-sm );
	width: 100%;
	padding: 12px var( --stp-gap );
	font: inherit;
	text-align: left;
	color: var( --stp-ink );
	background: transparent;
	border: 0;
	cursor: pointer;
}

.stp-capture__editor-name {
	font-weight: 600;
}

.stp-capture__editor-status {
	flex: 1 1 auto;
	overflow: hidden;
	color: var( --stp-ink-muted );
	font-size: 0.8125em;
	text-align: right;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.stp-capture__editor-body {
	padding: 0 var( --stp-gap ) var( --stp-gap );
	border-top: 1px solid var( --stp-border );
}

.stp-capture__editor-body[hidden] {
	display: none;
}

.stp-capture__modes {
	display: flex;
	flex-wrap: wrap;
	gap: var( --stp-gap-sm );
	margin: var( --stp-gap ) 0;
}

.stp-capture__editor-actions {
	margin-top: var( --stp-gap );
}

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

.stp-capture__fields {
	display: flex;
	flex-direction: column;
	gap: var( --stp-gap );
}

.stp-capture__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.stp-capture__label {
	font-size: 0.8125em;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var( --stp-ink-muted );
}

.stp-capture__input,
.stp-capture__select,
.stp-capture__textarea {
	width: 100%;
	padding: 10px 12px;
	font: inherit;
	color: var( --stp-ink );
	background: var( --stp-surface );
	border: 1px solid var( --stp-border-strong );
	border-radius: var( --stp-radius-sm );
}

.stp-capture__textarea {
	resize: vertical;
}

.stp-capture__preview {
	min-height: 64px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
	font-size: 26px;
	line-height: 1.2;
	text-align: center;
	word-break: break-word;
	background: var( --stp-surface-alt );
	border: 1px dashed var( --stp-border );
	border-radius: var( --stp-radius-sm );
}

/*
 * The empty-preview placeholder is TEXT the customer reads ("Your text"), not a
 * border, so it takes the muted-ink token. --stp-border-strong is a line colour;
 * used as type it fell below 4.5:1 on the panel background.
 */
.stp-capture__preview.is-empty {
	color: var( --stp-ink-muted );
}

.stp-capture__link {
	align-self: flex-start;
	padding: 0;
	font: inherit;
	font-size: 0.875em;
	color: var( --stp-accent );
	background: none;
	border: 0;
	text-decoration: underline;
	cursor: pointer;
}

.stp-capture__link[hidden] {
	display: none;
}

/* -------------------------------------------------------------------------
 * Swatches
 * ---------------------------------------------------------------------- */

.stp-capture__swatches {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( var( --stp-swatch-size ), 1fr ) );
	gap: 6px;
}

.stp-capture__swatch {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	min-height: var( --stp-swatch-size );
	padding: 0;
	background-clip: padding-box;
	border: 1px solid rgba( 0, 0, 0, 0.25 );
	border-radius: var( --stp-radius-sm );
	cursor: pointer;
}

.stp-capture__swatch.is-on {
	box-shadow: 0 0 0 2px var( --stp-surface ), 0 0 0 4px var( --stp-accent );
}

/* A tick that reads on both light and dark swatches without relying on colour
 * alone — selection must not be conveyed by hue only. */
.stp-capture__swatch.is-on::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 46%;
	width: 30%;
	height: 55%;
	transform: translate( -50%, -50% ) rotate( 45deg );
	border: solid var( --stp-surface );
	border-width: 0 3px 3px 0;
	filter: drop-shadow( 0 0 1px rgba( 0, 0, 0, 0.8 ) );
}

.stp-capture__chosen {
	margin: 0;
	color: var( --stp-ink-muted );
	font-size: 0.8125em;
}

/* -------------------------------------------------------------------------
 * Upload
 * ---------------------------------------------------------------------- */

.stp-capture__drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var( --stp-gap-sm );
	padding: var( --stp-gap );
	text-align: center;
	background: var( --stp-surface-alt );
	border: 2px dashed var( --stp-border-strong );
	border-radius: var( --stp-radius-sm );
}

.stp-capture__drop.is-over {
	border-color: var( --stp-accent );
	background: rgba( 31, 94, 255, 0.06 );
}

.stp-capture__drop-button {
	padding: 10px 16px;
	font: inherit;
	color: var( --stp-accent-contrast );
	background: var( --stp-accent );
	border: 0;
	border-radius: var( --stp-radius-sm );
	cursor: pointer;
}

.stp-capture__drop-button[disabled] {
	opacity: 0.6;
	cursor: default;
}

.stp-capture__file {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

.stp-capture__progress {
	width: 100%;
	height: 6px;
}

.stp-capture__thumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var( --stp-gap-sm );
}

.stp-capture__thumb:empty {
	display: none;
}

.stp-capture__thumb-image {
	width: 56px;
	height: 56px;
	object-fit: contain;
	background: var( --stp-surface-alt );
	border: 1px solid var( --stp-border );
	border-radius: var( --stp-radius-sm );
}

.stp-capture__chip {
	padding: 4px 10px;
	font-size: 0.8125em;
	word-break: break-all;
	background: var( --stp-surface-alt );
	border: 1px solid var( --stp-border );
	border-radius: 999px;
}

/* -------------------------------------------------------------------------
 * Footer
 * ---------------------------------------------------------------------- */

.stp-capture__footer {
	display: flex;
	flex-direction: column;
	gap: var( --stp-gap );
	padding: var( --stp-gap );
	background: var( --stp-surface-alt );
	border-top: 1px solid var( --stp-border );
}

.stp-capture__checkbox {
	display: flex;
	align-items: flex-start;
	gap: var( --stp-gap-sm );
	font-size: 0.9375em;
	cursor: pointer;
}

.stp-capture__checkbox input {
	margin-top: 3px;
}

.stp-capture__price {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.stp-capture__price[hidden] {
	display: none;
}

.stp-capture__price-value {
	font-size: 1.0625em;
}

/*
 * The setup fee is its own line and never folded into the per-unit figure: it
 * is charged once per job across the whole cart and may be waived.
 */
.stp-capture__price-setup {
	font-size: 0.875em;
}

.stp-capture__price-setup[hidden] {
	display: none;
}

.stp-capture__price-note {
	color: var( --stp-ink-muted );
	font-size: 0.8125em;
}

.stp-capture__submit {
	width: 100%;
	padding: 14px 20px;
	font: inherit;
	font-weight: 600;
	color: var( --stp-accent-contrast );
	background: var( --stp-accent );
	border: 0;
	border-radius: var( --stp-radius-sm );
	cursor: pointer;
}

.stp-capture__submit[disabled] {
	opacity: 0.65;
	cursor: default;
}

/* -------------------------------------------------------------------------
 * Tablet and up
 * ---------------------------------------------------------------------- */

@media ( min-width: 720px ) {

	.stp-capture__overlay {
		align-items: center;
		padding: 24px;
	}

	.stp-capture__dialog {
		max-height: calc( 100vh - 48px );
		border-radius: var( --stp-radius );
	}

	.stp-capture__body {
		flex-direction: row;
		align-items: flex-start;
	}

	.stp-capture__stage {
		flex: 1 1 45%;
		position: sticky;
		top: 0;
		min-width: 0;
	}

	.stp-capture__panel {
		flex: 1 1 55%;
		min-width: 0;
	}

	.stp-capture__footer {
		display: grid;
		grid-template-columns: 2fr 1fr;
		align-items: end;
	}

	.stp-capture__field--note {
		grid-column: 1 / -1;
	}

	.stp-capture__submit {
		width: auto;
		justify-self: end;
	}
}

/* -------------------------------------------------------------------------
 * Motion + contrast preferences
 * ---------------------------------------------------------------------- */

@media ( prefers-reduced-motion: reduce ) {

	.stp-capture *,
	.stp-capture *::before,
	.stp-capture *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}

@media ( forced-colors: active ) {

	.stp-capture__zone,
	.stp-capture__swatch,
	.stp-capture__pill {
		border: 1px solid CanvasText;
	}

	.stp-capture__swatch.is-on {
		outline: 3px solid Highlight;
		outline-offset: 1px;
	}

	/*
	 * Forced colours drop the accent and the halo both, so the stage
	 * affordances are redrawn in system colours: the frame in CanvasText, the
	 * handles filled with Highlight so the two things you can grab are the two
	 * things that stand out.
	 */
	.stp-capture__item::before {
		border-color: CanvasText;
		box-shadow: none;
	}

	.stp-capture__item:focus-visible::before,
	.stp-capture__item.is-active::before {
		border-color: Highlight;
		box-shadow: none;
	}

	.stp-capture__handle::after {
		background: Highlight;
		border-color: CanvasText;
		forced-color-adjust: none;
	}

	.stp-capture__handle--rotate::before {
		background: CanvasText;
		box-shadow: none;
		forced-color-adjust: none;
	}
}
