.ae-searchOverlay-bar.has-ae-photo {
	grid-template-columns: auto minmax(0, 1fr);
	grid-auto-flow: column;
	grid-auto-columns: auto;
}

.ae-photo-svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ae-photo-camera {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--ae-color-text, #111);
	cursor: pointer;
	transition: opacity 140ms ease;
}

.ae-photo-camera:hover {
	opacity: 0.6;
}

/* The file input is the camera's whole tap area, so iOS anchors its photo menu under the camera. */
.ae-photo-camera {
	position: relative;
}

.ae-photo-cameraInput {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.ae-photo-camera:focus-within {
	outline: 2px solid #111;
	outline-offset: 2px;
}

.ae-photo-chip {
	position: relative;
	display: inline-block;
	width: 34px;
	height: 34px;
}

.ae-photo-thumb {
	display: block;
	width: 34px;
	height: 34px;
	border-radius: 4px;
	background: #f4f2ee;
	object-fit: cover;
}

.ae-photo-remove {
	position: absolute;
	top: -7px;
	right: -7px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	padding: 0;
	border: 0;
	border-radius: 9px;
	background: #111;
	color: #fff;
	cursor: pointer;
}

.ae-photo-remove .ae-photo-svg {
	width: 10px;
	height: 10px;
	stroke-width: 2.2;
}

.ae-searchOverlay-icon.is-photo-hidden,
.ae-photo-file {
	display: none;
}

/* The app's search bar on photo results (SearchScreen): the photo chip, then the refine phrases; it replaces the
   small thumb beside the title. */
.ae-photo-pageBar {
	display: flex;
	align-items: center;
	gap: 12px;
	box-sizing: border-box;
	width: 100%;
	max-width: 560px;
	height: 56px;
	margin: 16px auto 0;
	padding: 0 18px 0 14px;
	border: 1px solid rgba(17, 17, 17, 0.18);
	border-radius: 28px;
	background: #fff;
}

.ae-photo-pageField {
	flex: 1;
	min-width: 0;
	height: 100%;
	padding: 0;
	border: 0;
	background: none;
	color: #5c5c57;
	font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	text-align: left;
	cursor: text;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

html.ae-photo-pageBar-on .ae-shopPageHead-thumb {
	display: none;
}

/* The bar's 56 px and 16 px margin, held from the first paint until the footer script mounts it. */
html.ae-photo-held:not(.ae-photo-pageBar-on) body.ae-photo-results .ae-shopPageHead::after {
	content: "";
	display: block;
	height: 72px;
}

.ae-photo-pageWords {
	color: #111;
}

/* The app's 14 pt hit slop around the small x (the search bar's and the page bar's), and 44px taps for the crop's
   Cancel and the camera, with the same look. */
.ae-photo-remove::after {
	content: "";
	position: absolute;
	inset: -13px -8px -13px -13px;
}

/* In the search bar the field starts 9px right of the x: its slop stops short of it. */
.ae-photo-pageBar .ae-photo-remove::after {
	inset: -13px;
}

.ae-photo-cropCancel {
	position: relative;
}

.ae-photo-cropCancel::after {
	content: "";
	position: absolute;
	inset: -13px -8px;
}

/* The camera's own box is the 44px tap (padding, cancelled by margin so nothing moves), and it clips the file
   input: WebKit let the bare input's tap area spill past the close button. */
.ae-photo-camera {
	box-sizing: content-box;
	margin: -6px;
	padding: 6px;
	overflow: hidden;
}

html.ae-photo-open,
html.ae-photo-open body {
	overflow: hidden;
}

.ae-photo-layer {
	position: fixed;
	inset: 0;
	z-index: 100000;
	font-family: var(--ae-font-ui, "Inter", "Helvetica Neue", Arial, sans-serif);
	color: #111;
}

.ae-photo-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 17, 17, 0.38);
}

.ae-photo-sheet {
	position: absolute;
	top: 50%;
	left: 50%;
	width: min(400px, calc(100vw - 32px));
	padding: 28px 28px 12px;
	background: #fff;
	box-shadow: 0 18px 48px rgba(17, 17, 17, 0.18);
	transform: translate(-50%, -50%);
}

.ae-photo-handle {
	display: none;
}

.ae-photo-eyebrow {
	margin: 0 0 8px;
	color: #6b6b6b;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
}

.ae-photo-option {
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	min-height: 56px;
	padding: 0;
	border: 0;
	border-bottom: 1px solid rgba(17, 17, 17, 0.12);
	background: transparent;
	color: #111;
	font: inherit;
	font-size: 16px;
	text-align: left;
	cursor: pointer;
}

.ae-photo-option .ae-photo-svg {
	width: 18px;
	height: 18px;
}

.ae-photo-cancel {
	display: block;
	width: 100%;
	min-height: 56px;
	border: 0;
	background: transparent;
	color: #6b6b6b;
	font: inherit;
	font-size: 15px;
	cursor: pointer;
}

.ae-photo-option:hover,
.ae-photo-cancel:hover {
	opacity: 0.6;
}

.ae-photo-crop {
	display: flex;
	flex-direction: column;
	background: #fff;
}

.ae-photo-cropHead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px;
}

.ae-photo-cropCancel {
	width: 72px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #111;
	font: inherit;
	font-size: 15px;
	text-align: left;
	cursor: pointer;
}

.ae-photo-cropSpacer {
	width: 72px;
}

.ae-photo-cropTitle {
	margin: 0;
	font-family: var(--ae-font-editorial, "Cormorant Garamond", Didot, "Bodoni 72", Georgia, serif);
	font-size: 26px;
	font-weight: 400;
	letter-spacing: -0.01em;
}

.ae-photo-hint {
	margin: 0 0 16px;
	padding: 0 32px;
	color: #6b6b6b;
	font-size: 13px;
	text-align: center;
}

.ae-photo-stage {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	min-height: 0;
	margin: 0 24px;
}

.ae-photo-frame {
	position: relative;
	touch-action: none;
	user-select: none;
}

.ae-photo-image {
	display: block;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.ae-photo-shade {
	position: absolute;
	background: rgba(17, 17, 17, 0.45);
	pointer-events: none;
}

.ae-photo-box {
	position: absolute;
	cursor: move;
}

.ae-photo-corner {
	position: absolute;
	width: 18px;
	height: 18px;
	border: 0 solid #fff;
	filter: drop-shadow(0 0 1.5px rgba(17, 17, 17, 0.45));
}

.ae-photo-corner.is-tl { top: 0; left: 0; border-width: 3px 0 0 3px; }
.ae-photo-corner.is-tr { top: 0; right: 0; border-width: 3px 3px 0 0; }
.ae-photo-corner.is-bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; }
.ae-photo-corner.is-br { right: 14px; bottom: 14px; border-width: 0 3px 3px 0; }

.ae-photo-handleBR {
	position: absolute;
	right: -14px;
	bottom: -14px;
	width: 38px;
	height: 38px;
	cursor: nwse-resize;
}

.ae-photo-message {
	min-height: 20px;
	margin: 12px 24px 0;
	color: #111;
	font-size: 14px;
	text-align: center;
}

.ae-photo-use {
	align-self: center;
	width: min(420px, calc(100% - 48px));
	margin: 16px 24px 28px;
	padding: 16px 0;
	border: 0;
	background: #111;
	color: #fff;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	cursor: pointer;
}

.ae-photo-use:hover {
	opacity: 0.85;
}

.ae-photo-use[disabled] {
	opacity: 0.55;
	cursor: default;
}

@media (max-width: 767px) {
	.ae-photo-sheet {
		top: auto;
		bottom: 0;
		left: 0;
		width: 100%;
		padding: 8px 24px calc(8px + env(safe-area-inset-bottom));
		box-shadow: none;
		transform: none;
	}

	.ae-photo-handle {
		display: block;
		width: 38px;
		height: 4px;
		margin: 0 auto 16px;
		border-radius: 3px;
		background: rgba(17, 17, 17, 0.2);
	}

	.ae-photo-cropTitle {
		font-size: 22px;
	}

	.ae-photo-use {
		width: calc(100% - 48px);
		margin-bottom: calc(24px + env(safe-area-inset-bottom));
	}

	.ae-photo-camera {
		width: 32px;
		height: 32px;
	}
}

.ae-turnstile {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}

.ae-turnstile.is-interactive {
	bottom: calc(24px + env(safe-area-inset-bottom));
	left: 50%;
	/* Centred at its own width: left:50% alone squeezed the check into the right half of a phone. */
	transform: translateX(-50%);
	max-width: calc(100vw - 24px);
	box-sizing: border-box;
	z-index: 100001;
	width: max-content;
	height: auto;
	padding: 12px;
	background: #fff;
	box-shadow: 0 12px 32px rgba(17, 17, 17, 0.18);
	opacity: 1;
	pointer-events: auto;
	transform: translateX(-50%);
}

.ae-photo-box:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
	box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.6);
}

/* The app's AI Search loader (SmartSearchLoader): editorial line, italic words, a drawing hairline. */
.ae-ai-loader {
	margin: 12px 0 0;
}

.ae-ai-loaderText {
	min-height: 56px;
	margin: 0 0 8px;
	color: #111;
	font-family: var(--ae-font-editorial, "Cormorant Garamond", Didot, "Bodoni 72", Georgia, serif);
	font-size: 22px;
	/* The app's SmartSearchLoader: Cormorant Garamond Light, 22/28. */
	font-weight: 300;
	line-height: 28px;
	transition: opacity 200ms ease;
}

.ae-ai-loaderText em {
	font-style: italic;
}

.ae-ai-loaderText.is-later {
	color: #5c5c57;
}

.ae-ai-loaderText.is-fading {
	opacity: 0;
}

.ae-ai-loaderTrack {
	display: block;
	height: 1px;
	overflow: hidden;
}

.ae-ai-loaderTrack span {
	display: block;
	height: 1px;
	background: #8a6f4e;
	animation: ae-ai-hairline 3.1s ease-in-out infinite;
}

@keyframes ae-ai-hairline {
	0% { transform: translateX(-100%); opacity: 1; }
	84% { transform: translateX(0); opacity: 1; }
	100% { transform: translateX(0); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.ae-ai-loaderTrack span {
		animation: none;
	}
}

.ae-photo-loaderSlot {
	align-self: center;
	width: min(420px, calc(100% - 48px));
	/* The loader's own height (12 + 56 + 8 + 1), held from the start: the stage is measured once to size the photo,
	   so a loader that appeared later would push the frame out over it on a short window. */
	min-height: 77px;
	margin: 0 24px;
}

/* The crop screen is centred (title, hint, photo, button): its loader line is too, and its hairline grows from the
   centre across the button's column. */
.ae-photo-loaderSlot .ae-ai-loaderText {
	text-align: center;
}

.ae-photo-loaderSlot .ae-ai-loaderTrack span {
	animation-name: ae-ai-hairline-centre;
}

@keyframes ae-ai-hairline-centre {
	0% { transform: scaleX(0); opacity: 1; }
	84% { transform: scaleX(1); opacity: 1; }
	100% { transform: scaleX(1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.ae-photo-loaderSlot .ae-ai-loaderTrack span {
		animation: none;
	}
}

/* The smallest phones: "Frame the piece" stays on one line between Cancel and its balancing spacer. */
@media (max-width: 360px) {
	.ae-photo-cropHead {
		padding: 18px 16px;
	}

	.ae-photo-cropCancel,
	.ae-photo-cropSpacer {
		width: 56px;
	}
}

/* The app's example phrases are long for a phone bar that also holds the camera: cut cleanly. */
@media (max-width: 480px) {
	.ae-searchOverlay-bar.has-ae-photo input[type="search"] {
		text-overflow: ellipsis;
	}
}

/* The floating feedback button would sit over the sheet's own buttons on a phone. */
html.ae-photo-open .ae-feedback {
	display: none;
}

/* The photo lines fade out between phrases (web-ai-photo.js fadeTyping). */
.ae-searchOverlay-bar input::placeholder,
.ae-photo-pageHint {
	transition: opacity 0.2s ease;
}
/* As specific as the theme's own placeholder rule (style.css loads later), so the fade wins. */
.ae-searchOverlay-bar input[type="search"].ae-ph-fading::placeholder,
.ae-photo-pageHint.is-fading {
	opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
	.ae-searchOverlay-bar input::placeholder,
	.ae-photo-pageHint {
		transition: none;
	}
}

.ae-turnstile-caption {
	margin: 0 0 10px;
	font: 13px/1.4 "Helvetica Neue", Arial, sans-serif;
	color: #111;
	text-align: center;
}

/* A photo held: the search panel offers only the photo's own lines (web-ai-photo.js), never the site's designers or
   suggestions, whose links would drop the photo or start a paid photo + words search under a misleading label. */
html.ae-photo-held .ae-searchOverlay-body > :not(.ae-photo-refine) {
	display: none !important;
}

.ae-photo-refineKicker {
	margin: 0 0 6px;
	font: 11px/1.2 "Helvetica Neue", Arial, sans-serif;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: #777;
}

.ae-photo-refineLine {
	display: block;
	width: 100%;
	min-height: 44px;
	padding: 12px 0;
	border: 0;
	border-bottom: 1px solid #eee;
	background: none;
	font: 16px/1.3 "Helvetica Neue", Arial, sans-serif;
	color: #111;
	text-align: left;
	cursor: pointer;
}

.ae-photo-refineHint {
	margin: 0;
	padding: 12px 0;
	font: italic 18px/1.4 "Cormorant Garamond", Georgia, serif;
	color: #555;
}
