/* Production entry: shared header/footer and the real order upload form. */
html { background:var(--brand-depth); }
.customer-page { background:var(--brand-night); }
/* Route titles receive focus for announcements and scroll restoration, not as controls. */
.customer-page h1#flow-title[tabindex="-1"]:focus { outline:none; }
.order-entry .order-page { width:100%; max-width:916px; min-height:0; margin:0 auto; padding:48px; display:flex; flex-direction:column; justify-content:center; }
.order-entry .flow-steps,.order-entry #upload-button,.order-entry #thumbnails,.order-entry .file-guide,.order-entry #upload-form > .micro { display:none; }
.order-entry .flow-heading { text-align:center; margin-bottom:36px; }
.order-entry #flow-title { font-size:clamp(36px,3.6vw,50px); line-height:1.08; letter-spacing:-.035em; }
.order-entry #flow-description { margin:18px auto 0; max-width:55ch; font-size:17px; line-height:1.65; }
.order-entry .dropzone { min-height:300px; justify-content:center; padding:32px; }
.order-entry .dropzone > svg { width:36px; height:36px; }
.upload-invitation { font-size:20px; font-weight:650; }
.order-entry .dropzone label { justify-content:center; gap:12px; min-height:54px; padding:14px 24px; border-radius:999px; background:var(--brand-accent); color:var(--brand-night); font-size:15px; line-height:1.4; }
.order-entry .dropzone label svg { width:18px; height:18px; }
.order-entry .dropzone p { font-size:13px; }
.order-entry .file-help { text-align:center; margin:14px 0 0; }
#turnstile-container { display:flex; justify-content:center; width:100%; margin-top:24px; }
#turnstile-container:empty { display:none; }
@media(hover:hover) { .order-entry .dropzone:hover label { background:var(--brand-accent-hover); } }
@media(max-width:760px) {
 .upload-invitation { display:none; }
 .order-entry .order-page { padding:32px 20px; }
 .order-entry #flow-title { font-size:36px; }
 .order-entry #flow-description { font-size:15px; }
 .order-entry .dropzone { min-height:240px; padding:24px; }
}

/* Selected photos: a compact gallery and the next actions in one view. */
.order-collection .order-page { width:100%; max-width:1056px; padding:48px 48px 64px; }
/* Keep natural content height: modest section insets, never a full-screen spacer. Footer is owner-locked. */
.order-collection:not(.choosing-preview) .order-page { min-height:0; display:flex; flex-direction:column; justify-content:center; padding-block:64px; }
.order-collection:not(.choosing-preview) .flow-heading { margin-bottom:40px; }
.order-collection .flow-steps,.order-collection #dropzone,.order-collection .file-guide { display:none; }
.order-collection .flow-heading { text-align:center; margin-bottom:32px; }
.order-collection #flow-title { font-size:40px; }
.order-collection #flow-description { margin:14px auto 0; max-width:60ch; }
.order-collection .gallery-heading { margin:0 0 16px; }
.order-collection #thumbnails { grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:28px; }
.order-collection .thumbnail-image { border:1px solid var(--brand-line-dark); }
.order-collection .thumbnail-image img { object-fit:contain; }
.order-collection .thumbnail p { display:none; }
.add-photo { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; width:100%; height:100%; min-height:120px; aspect-ratio:4/3; border:1px dashed var(--brand-field); border-radius:12px; background:transparent; color:var(--brand-ice); font-weight:650; cursor:pointer; }
.add-photo:hover:not(:disabled) { border-color:var(--brand-accent); color:var(--brand-accent); }
.order-collection #selection-summary { margin:0; padding:24px 0; }
#package-remaining { color:var(--brand-muted-dark); font-size:14px; line-height:1.6; margin-top:6px; }
.collection-buttons { display:flex; gap:16px; flex-wrap:wrap; margin-top:24px; }
.collection-buttons button { flex:1 1 260px; }
.order-collection #turnstile-container { margin:20px 0 0; }
.order-collection #upload-form > .micro { max-width:75ch; margin:20px 0 0; }
@media(max-width:760px) {
 .order-collection .order-page { padding:32px 20px 40px; }
 .order-collection:not(.choosing-preview) .order-page { padding-block:48px; }
 .order-collection:not(.choosing-preview) .flow-heading { margin-bottom:32px; }
 .order-collection #flow-title { font-size:32px; }
 .order-collection #thumbnails { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
 .collection-buttons { flex-direction:column; gap:12px; }
 .collection-buttons button { flex:auto; width:100%; }
 .order-collection #selection-summary { align-items:flex-start; gap:12px; }
 .add-photo { min-height:0; }
}

.order-entry #upload-form > #upload-privacy { display:block; text-align:center; margin:16px auto 0; max-width:70ch; }

.gallery-control { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:9px 16px; border:1px solid var(--brand-line-dark); border-radius:999px; background:transparent; color:var(--brand-ice); font:inherit; font-size:14px; font-weight:650; line-height:1.4; text-decoration:none; cursor:pointer; }
.gallery-control:hover:not(:disabled) { border-color:var(--brand-field); background:var(--brand-depth); }
.gallery-control:focus-visible,.add-photo:focus-visible { outline:2px solid var(--brand-accent); outline-offset:4px; }
.gallery-control svg,.add-photo svg { flex-shrink:0; width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; }
.add-photo svg { width:28px; height:28px; color:var(--brand-accent); }
#toggle-gallery[aria-expanded="true"] svg { transform:rotate(180deg); }
.order-collection #toggle-gallery { display:flex; width:fit-content; margin:-8px auto 24px; }
.order-collection #retry-uploads { display:block; margin:0 auto 20px; }
.preview-selection-hint { margin:0 0 20px; color:var(--brand-ice); font-weight:650; }
/* A photo tile enters once its photo has arrived: no placeholder, no status text. */
@keyframes thumbnail-in { from { opacity:0; transform:translateY(10px) scale(.97); } to { opacity:1; transform:none; } }
.thumbnail-enter { animation:thumbnail-in .5s cubic-bezier(.16,1,.3,1) both; }
@media(prefers-reduced-motion:reduce) { .thumbnail-enter { animation:none; } }
.choosing-preview #thumbnails .thumbnail-image { cursor:pointer; }
.choosing-preview #thumbnails .thumbnail-image:has(button[aria-pressed=true]) { border:2px solid var(--brand-accent); }
#inline-preview-actions .text-button { flex:0 0 auto; padding-inline:20px; }

/* Keep the first row steady while additional rows unfold. */
.order-collection #thumbnails.gallery-moving { overflow:clip; align-content:start; }
#toggle-gallery svg { transition:transform 300ms cubic-bezier(.16,1,.3,1); }
@media(prefers-reduced-motion:reduce) { #toggle-gallery svg { transition:none; } }

/* An existing order must resolve before any upload screen is displayed. */
#order-restore-status,#retry-order-restore { display:none; }
.order-restoring #order-app { display:none; }
.order-restoring #order-restore-status { display:block; position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.order-restore-error #order-app > :not(#app-error):not(#test-notice):not(#retry-order-restore) { display:none!important; }
.order-restore-error #retry-order-restore { display:inline-flex; margin-bottom:20px; }

#order-app { view-transition-name:order-flow; }
::view-transition-old(root),::view-transition-new(root) { animation:none; }
::view-transition-old(order-flow) { animation:order-flow-out 120ms ease-out both; }
::view-transition-new(order-flow) { animation:order-flow-in 240ms cubic-bezier(.16,1,.3,1) both; }
@keyframes order-flow-out { to { opacity:0; } }
@keyframes order-flow-in { from { opacity:0; } to { opacity:1; } }
#back-confirmation { width:min(520px,calc(100% - 40px)); margin:auto; padding:28px; border:1px solid var(--brand-line-dark); border-radius:16px; background:var(--brand-night); color:var(--brand-ice); }
#back-confirmation::backdrop { background:rgb(0 0 0 / .65); }
#back-confirmation h2 { font-size:24px; line-height:1.25; margin:0 0 12px; }
#back-confirmation p { color:var(--brand-muted-dark); margin:0; line-height:1.6; }
.back-confirmation-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:12px; margin-top:24px; }
@media(max-width:600px) { .back-confirmation-actions { flex-direction:column; } .back-confirmation-actions button { width:100%; } }
@media(prefers-reduced-motion:reduce) { ::view-transition-old(order-flow),::view-transition-new(order-flow) { animation:none; } }

#back-confirmation button { display:inline-flex; align-items:center; justify-content:center; min-height:52px; padding:14px 20px; border-radius:999px; font:inherit; font-size:14px; font-weight:650; cursor:pointer; }
#back-confirmation .secondary { border:1px solid var(--brand-field); background:transparent; color:var(--brand-ice); }
#back-confirmation .primary { border:1px solid transparent; background:var(--brand-accent); color:var(--brand-night); }
#back-confirmation button:focus-visible { outline:2px solid var(--brand-accent); outline-offset:4px; }
#back-confirmation .primary:hover { background:var(--brand-accent-hover); }
#back-confirmation .secondary:hover { border-color:var(--brand-ice); }

#back-confirmation button:disabled { opacity:.65; cursor:wait; }

#back-confirmation .removal-spinner { display:none; }
#back-confirmation.is-removing { width:72px; height:72px; padding:16px; border:0; background:transparent; overflow:hidden; outline:none; }
#back-confirmation.is-removing > :not(.removal-spinner) { display:none; }
#back-confirmation.is-removing .removal-spinner { display:block; width:40px; height:40px; border:3px solid rgb(255 255 255 / .2); border-top-color:var(--brand-accent); border-radius:50%; animation:removal-spin .8s linear infinite; outline:none; }
#back-confirmation::backdrop { transition:opacity 180ms ease-out; }
#back-confirmation.is-leaving::backdrop { opacity:0; }
@keyframes removal-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { #back-confirmation.is-removing .removal-spinner { animation:none; } #back-confirmation::backdrop { transition:none; } }

/* Preview choice is a focused selection task, separate from group management. */
.choosing-preview .order-page { min-height:0; display:flex; flex-direction:column; justify-content:center; padding-block:64px; }
.choosing-preview #inline-preview-actions { width:100%; max-width:420px; margin:24px auto 0; }
.choosing-preview #inline-preview-actions button { flex:1 1 auto; width:100%; }
.choosing-preview #thumbnails:not(:has(.thumbnail:nth-child(3))) { max-width:640px; margin-inline:auto; grid-template-columns:repeat(2,minmax(0,1fr)); }
.choosing-preview #thumbnails .thumbnail-image { border-width:2px; }
.choosing-preview #thumbnails .thumbnail p { display:block; margin:8px 0 0; font-size:13px; line-height:1.5; }
.choosing-preview .thumbnail:has(button[aria-pressed=true]) p { color:var(--brand-accent); font-weight:700; }
.choosing-preview .thumbnail:has(button[aria-pressed=true]) p::after { content:' · Selezionata'; }
.choosing-preview .thumbnail-image:has(button[aria-pressed=true])::after { content:none; }
.customer-page.choosing-preview .order-app .thumbnail-image button { border:0; border-radius:inherit; cursor:pointer; }
.preview-choice-mark { position:absolute; top:10px; right:10px; width:26px; height:26px; padding:4px; border:1.5px solid var(--brand-ice); border-radius:50%; background:var(--brand-night); color:var(--brand-night); fill:none; stroke:currentColor; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }
.preview-choice-mark path { visibility:hidden; }
[aria-pressed=true] .preview-choice-mark { border-color:var(--brand-accent); background:var(--brand-accent); }
[aria-pressed=true] .preview-choice-mark path { visibility:visible; }
.choosing-preview .thumbnail-image:has(button:focus-visible) { border-color:var(--brand-accent); }
.choosing-preview .thumbnail-image:has(button:focus-visible) { outline:2px solid var(--brand-accent); outline-offset:3px; }
@media(hover:hover) and (pointer:fine) { .choosing-preview .thumbnail-image:has(button:hover):not(:has(button[aria-pressed=true])) { border-color:var(--brand-field); } }
@media(max-width:760px) { .choosing-preview .order-page { padding-block:48px; } .choosing-preview #inline-preview-actions { flex-direction:row; flex-wrap:wrap; } .choosing-preview #inline-preview-actions button { max-width:100%; } }

.preview-page .order-page { width:100%; max-width:1056px; padding:48px 48px 64px; }
.preview-page .flow-steps { display:none; }
.preview-page .flow-heading { text-align:center; margin-bottom:32px; }
.preview-page #flow-title { font-size:40px; }
.preview-page #flow-description { max-width:64ch; margin:14px auto 0; }
#preview-stage { max-width:720px; margin:0 auto; text-align:center; }
:is(.preview-page,.delivery-attention) .preview-failure { max-width:620px; margin:0 auto; padding:28px 32px; border:1px solid var(--brand-line-dark); border-radius:12px; background:var(--brand-surface); }
:is(.preview-page,.delivery-attention) .preview-failure-message { margin:0; color:var(--brand-muted-dark); font-size:16px; line-height:1.65; }
:is(.preview-page,.delivery-attention) .preview-contact-form { display:grid; gap:10px; max-width:420px; margin:24px auto 0; text-align:left; }
:is(.preview-page,.delivery-attention) .preview-contact-form label { color:var(--brand-ice); font-size:13px; font-weight:700; }
:is(.preview-page,.delivery-attention) .preview-contact-form input { width:100%; min-height:46px; padding:11px 12px; border:1px solid var(--brand-field); border-radius:8px; background:#fff; color:var(--brand-night); font:inherit; }
:is(.preview-page,.delivery-attention) .preview-contact-form input:focus-visible { outline:2px solid var(--brand-accent); outline-offset:2px; }
:is(.preview-page,.delivery-attention) .preview-contact-form button { min-height:46px; margin-top:6px; }
:is(.preview-page,.delivery-attention) .preview-contact-status { min-height:1.5em; margin:0; color:var(--brand-muted-dark); font-size:13px; line-height:1.5; }
:is(.preview-page,.delivery-attention) .preview-contact-status:empty { min-height:0; }
:is(.preview-page,.delivery-attention) .preview-contact-form .sr-only { position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
:is(.preview-page,.delivery-attention) .preview-failure-message:focus { outline:none; }
:is(.preview-page,.delivery-attention) .preview-failure-whatsapp { display:inline-flex; align-items:center; justify-content:center; gap:10px; margin-top:24px; }
:is(.preview-page,.delivery-attention) .preview-failure-whatsapp svg { width:22px; height:22px; flex:none; fill:currentColor; stroke:none; }
:is(.preview-page,.delivery-attention) .preview-failure-whatsapp .preview-failure-arrow { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
@media(max-width:760px) { :is(.preview-page,.delivery-attention) .preview-failure { padding:24px; } :is(.preview-page,.delivery-attention) .preview-failure-whatsapp { width:100%; padding-inline:16px; } }
.preview-wait-photo { position:relative; aspect-ratio:4/3; overflow:hidden; border-radius:12px; background:var(--brand-surface); }
.preview-wait-photo img { width:100%; height:100%; object-fit:contain; }
.preview-wait-overlay { position:absolute; inset:0; display:grid; place-items:center; background:rgb(0 0 0 / .45); }
.preview-page .comparison-view { aspect-ratio:4/3; border-radius:12px; margin-bottom:20px; }
.preview-page .comparison-view img { width:100%; height:100%; object-fit:contain; }
.preview-actions { display:flex; flex-direction:column; align-items:center; gap:12px; margin-top:24px; }
.preview-page #buy-after-preview { width:100%; max-width:420px; margin:0; }
/* Return remains in the shared header; avoid repeating it ahead of the primary action. */
.preview-page #edit-preview { display:none; }
.preview-page .comparison-switch { justify-content:center; margin-bottom:0; }
.preview-page .comparison-switch button { min-height:44px; min-width:96px; padding:8px 20px; font-size:14px; line-height:22px; }
@media(max-width:760px) { .preview-page .order-page { padding:32px 20px 40px; } .preview-page #flow-title { font-size:32px; } }

.payment-page .order-page { width:100%; max-width:1056px; padding:48px 48px 64px; }
.payment-page .flow-steps, .payment-page #back-payment { display:none; }
.payment-page .flow-heading { text-align:center; margin-bottom:32px; }
.payment-page #flow-title { font-size:40px; }
.payment-page #flow-description { margin:16px auto 0; }
#payment-stage { max-width:640px; margin:0 auto; }
.payment-page .payment-summary { margin-top:0; }
.payment-methods { margin:28px 0; }
.payment-methods h2 { font-size:16px; margin:0 0 14px; }
#payment-loading { color:var(--brand-muted-dark); font-size:14px; padding:24px 0; }
.payment-page #checkout-button { margin-top:12px; }
@media(max-width:760px){.payment-page .order-page{padding:32px 20px 40px;}.payment-page #flow-title{font-size:32px;}}

/* Stripe owns the complete payment form; the site keeps its shared shell. */
#payment-stage { max-width:100%; }
#embedded-checkout { min-height:320px; }
#legacy-payment-form[hidden] { display:none; }
.payment-page .order-page { max-width:1120px; }

/* Checkout: total stays visible; photo review is optional on every viewport. */
.checkout-layout { display:grid; grid-template-columns:minmax(0,288px) minmax(0,1fr); gap:56px; align-items:start; }
.checkout-photo-summary { min-width:0; padding:4px 0 0; }
#checkout-photo-title { margin:0 0 20px; font-size:23px; line-height:1.35; letter-spacing:-.025em; }
.checkout-total { margin:0 0 12px; }
.checkout-total-label { display:block; margin:0 0 4px; color:var(--brand-muted-dark); font-size:14px; line-height:1.5; }
#checkout-photo-price { margin:0; font-size:40px; line-height:1.1; font-weight:700; letter-spacing:-.025em; color:var(--brand-ice); font-variant-numeric:tabular-nums; }
.checkout-once { margin:0; font-size:14px; line-height:1.6; color:var(--brand-muted-dark); }
.checkout-photo-review { margin-top:24px; padding-top:4px; border-top:1px solid var(--brand-line-dark); }
.checkout-photo-review summary { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:44px; padding:0; color:var(--brand-ice); font-size:14px; font-weight:700; cursor:pointer; list-style:none; }
.checkout-photo-review summary::-webkit-details-marker { display:none; }
.checkout-photo-review summary svg { width:18px; height:18px; color:inherit; fill:none; stroke:currentColor; stroke-width:1.8; }
.checkout-photo-review[open] summary svg { transform:rotate(180deg); }
.checkout-photo-review summary:focus-visible { outline:2px solid var(--brand-accent); outline-offset:4px; border-radius:4px; }
.checkout-output-note { margin:12px 0 0; font-size:13px; line-height:1.6; color:var(--brand-muted-dark); }
#checkout-photo-stack { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; width:100%; max-width:360px; margin:12px 0 0; }
#checkout-photo-stack[data-count="1"] { grid-template-columns:1fr; max-width:112px; }
#checkout-photo-stack[data-count="2"] { grid-template-columns:repeat(2,minmax(0,1fr)); max-width:232px; }
.checkout-photo { position:relative; min-width:0; aspect-ratio:4/3; }
.checkout-photo img { display:block; width:100%; height:100%; object-fit:contain; border:1px solid var(--brand-line-dark); border-radius:8px; background:var(--brand-depth); }
.checkout-photo-more { position:absolute; bottom:6px; right:6px; padding:4px 8px; border-radius:999px; background:var(--brand-night); color:var(--brand-ice); font-size:12px; line-height:1.4; white-space:nowrap; }
.checkout-form-panel { min-width:0; padding:28px; border-radius:12px; background:var(--brand-white,#fff); color:var(--brand-night); }
.checkout-panel-heading { display:flex; align-items:center; gap:10px; margin-bottom:24px; }
.checkout-lock { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.7; }
#checkout-panel-title { margin:0; font-size:19px; line-height:1.3; letter-spacing:-.025em; color:var(--brand-night); }
.checkout-provider { margin-left:auto; color:var(--brand-muted-light); font-size:13px; font-weight:600; }
#checkout-retry-help { margin:0 0 20px; color:var(--brand-muted-light); font-size:14px; line-height:1.6; }
.checkout-form-panel #retry-payment.secondary { width:100%; background:var(--brand-night); color:var(--brand-ice); border-color:var(--brand-night); }
.checkout-form-panel #retry-payment.secondary:hover:not(:disabled) { background:var(--brand-surface); }
.checkout-form-panel[data-payment-state="error"] .checkout-panel-heading { margin-bottom:12px; }
.checkout-form-panel[data-payment-state="error"] .checkout-lock { display:none; }
.checkout-form-panel[data-payment-state="error"] .checkout-terms { display:none; }
.checkout-terms { margin:12px 0 0; color:var(--brand-muted-light); font-size:12px; line-height:1.6; text-align:center; }
.checkout-terms a { color:inherit; text-decoration:underline; text-underline-offset:3px; }
@media(max-width:900px) { .checkout-layout { grid-template-columns:minmax(0,1fr) minmax(0,1.5fr); gap:32px; } }
@media(max-width:760px) {
 .checkout-layout { display:block; }
 .payment-page #flow-title { font-size:30px; line-height:1.15; }
 .payment-page #flow-description { margin-top:12px; font-size:15px; }
 .checkout-photo-summary { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px 16px; padding:0 0 20px; }
 #checkout-photo-title { max-width:13ch; margin:0; font-size:18px; line-height:1.4; }
 .checkout-total { grid-column:2; grid-row:1; margin:0; text-align:right; }
 #checkout-photo-price { font-size:30px; white-space:nowrap; }
 .checkout-total-label { font-size:13px; }
 .checkout-once { grid-column:1/-1; font-size:13px; }
 .checkout-photo-review { grid-column:1/-1; margin-top:4px; }
 #checkout-photo-stack { max-width:288px; }
 #checkout-photo-stack[data-count="2"] { max-width:184px; }
 #checkout-photo-stack[data-count="1"] { max-width:88px; }
 .checkout-form-panel { padding:24px 16px 20px; }
 .checkout-panel-heading { gap:8px; margin-bottom:20px; }
 #checkout-panel-title { font-size:17px; }
 .checkout-provider { font-size:12px; }
}

/* Payment confirmation and delivery share the same compact customer layout. */
.delivery-page .order-page { width:100%; max-width:1056px; min-height:0; margin:0 auto; padding:48px 48px 64px; }
.delivery-page .flow-steps { display:none; }
.delivery-page .flow-heading { text-align:center; margin-bottom:36px; }
.delivery-page #flow-title { font-size:40px; }
.delivery-page #flow-description { max-width:60ch; margin:14px auto 0; }
.delivery-symbol { display:flex; justify-content:center; align-items:center; height:52px; margin-bottom:24px; color:var(--brand-accent); }
.delivery-symbol svg { width:48px; height:48px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.delivery-symbol.delivery-symbol-error { color:#ffb4a8; }
.delivery-spinner { width:36px; height:36px; border:2px solid var(--brand-line-dark); border-top-color:var(--brand-accent); border-radius:50%; animation:delivery-spin .9s linear infinite; }
@keyframes delivery-spin { to { transform:rotate(360deg); } }
.delivery-page #order-progress { max-width:520px; margin:0 auto; text-align:center; }
.delivery-page #processing-count { margin:0 0 14px; font-size:15px; font-weight:600; }
.delivery-page #processing-meter { display:block; width:100%; height:6px; margin:0; border:0; border-radius:999px; overflow:hidden; background:var(--brand-line-dark); accent-color:var(--brand-accent); }
.delivery-page #processing-meter::-webkit-progress-bar { background:var(--brand-line-dark); border-radius:999px; }
.delivery-page #processing-meter::-webkit-progress-value { background:var(--brand-accent); border-radius:999px; transition:width 240ms ease-out; }
.delivery-page #processing-meter::-moz-progress-bar { background:var(--brand-accent); }
.delivery-page #delivery-help { margin:24px auto 0; max-width:52ch; font-size:14px; line-height:1.65; color:var(--brand-muted-dark); }
.delivery-verifying #processing-meter { display:none; }
.delivery-page #downloads { text-align:center; }
.delivery-page .download-main { max-width:400px; margin:0 auto 32px; }
.delivery-page #download-alternatives { text-align:left; }
.delivery-page #start-new-order { display:flex; width:max-content; max-width:100%; align-items:center; gap:10px; margin:44px auto 0; text-decoration:none; }
.delivery-page #start-new-order svg { width:18px; height:18px; stroke-width:1.7; }
@media(hover:hover) { .delivery-page #start-new-order:hover { background:var(--brand-surface); } }
@media(max-width:760px) { .delivery-page .order-page { padding:32px 20px 40px; } .delivery-page #flow-title { font-size:32px; } .delivery-page .flow-heading { margin-bottom:28px; } }
@media(prefers-reduced-motion:reduce) { .delivery-spinner { animation:none; } .delivery-page #processing-meter::-webkit-progress-value { transition:none; } }

/* Confirmed group: show actual completed photos, rather than payment success. */
.processing-page .processing-meta { display:flex; align-items:baseline; justify-content:space-between; gap:16px; margin-bottom:14px; }
.processing-page #processing-count { margin:0; text-align:left; font-variant-numeric:tabular-nums; }
.processing-page #processing-percentage { color:var(--brand-ice); font-size:15px; font-weight:650; font-variant-numeric:tabular-nums; }
.processing-page #processing-meter { height:8px; }
.processing-page #delivery-help { max-width:48ch; }

.result-gallery .photo-download { position:absolute; right:5px; top:5px; display:flex; align-items:center; justify-content:center; width:34px; height:34px; border:1px solid var(--brand-accent); border-radius:50%; background:var(--brand-accent); color:#000; text-decoration:none; transition:background 160ms ease-out,color 160ms ease-out; }
.result-gallery .photo-download svg { width:18px; height:18px; stroke-width:1.7; }
@media(hover:hover) { .result-gallery .photo-download:hover { background:var(--brand-accent-hover,var(--brand-accent)); color:#000; } }
@media(prefers-reduced-motion:reduce) { .result-gallery .photo-download { transition:none; } }

.delivery-page #downloads #expiry-message { margin:12px 0 0; color:var(--brand-muted-dark); font-size:12px; line-height:1.6; }
.delivery-page .result-gallery { grid-template-columns:repeat(4,minmax(0,1fr)); }
@media(max-width:999px) { .delivery-page .result-gallery { grid-template-columns:repeat(2,minmax(0,1fr)); } }

.result-gallery .photo-download::after { content:""; position:absolute; inset:-5px; border-radius:50%; }

/* Native Photos delivery is enabled only by the iOS capability path. */
#downloads[data-photo-save="ios"] .download-main { display:flex; flex-direction:column; align-items:stretch; }
#downloads[data-photo-save="ios"] #download-photos { order:0; }
#downloads[data-photo-save="ios"] #download-progress { order:1; height:6px; margin:16px 0 0; }
#downloads[data-photo-save="ios"] #delivery-status { order:2; margin:12px 0 0; color:var(--brand-muted-dark); font-size:14px; line-height:1.6; }
#downloads[data-photo-save="ios"] #download-help { order:3; margin:12px 0 0; }
#downloads[data-photo-save="ios"] .result-gallery { margin-bottom:0; }
.delivery-page #downloads[data-photo-save="ios"] #expiry-message { margin:16px 0 0; }
#downloads[data-photo-save="ios"] button.photo-download { padding:0; cursor:pointer; }
#downloads[data-photo-save="ios"] .photo-download.is-ready { background:var(--brand-accent); color:#000; border-color:var(--brand-accent); }
#downloads[data-photo-save="ios"] .ios-photo-hint { left:8px; right:8px; bottom:8px; padding:6px 8px; border-radius:8px; background:var(--brand-night); color:var(--brand-ice); font-size:12px; line-height:1.4; text-align:center; }

/* Android uses its own native menu; per-photo icons keep direct JPG downloads. */
#downloads[data-photo-save="android"] .download-main { display:flex; flex-direction:column; align-items:stretch; }
#downloads[data-photo-save="android"] #download-photos { order:0; }
#downloads[data-photo-save="android"] #download-progress { order:1; height:6px; margin:16px 0 0; }
#downloads[data-photo-save="android"] #delivery-status { order:2; margin:12px 0 0; color:var(--brand-muted-dark); font-size:14px; line-height:1.6; }
#downloads[data-photo-save="android"] #download-help { order:3; margin:12px 0 0; }
#downloads[data-photo-save="android"] .result-gallery { margin-bottom:0; }
.delivery-page #downloads[data-photo-save="android"] #expiry-message { margin:16px 0 0; }

/* Completed delivery: keep the entire photo visible within its aspect-ratio tile. */
.ready-page #delivery-summary { margin:0 0 16px; color:var(--brand-ice); font-size:16px; font-weight:650; text-align:left; }
.ready-page .result-gallery { grid-template-columns:repeat(auto-fit,minmax(min(210px,100%),1fr)); margin-top:0; }
.ready-page .result-gallery img { position:absolute; inset:0; min-width:0; min-height:0; width:100%; height:100%; object-fit:contain; }
.ready-page #downloads #expiry-message { margin:16px 0 0; }
@media(min-width:761px) {
 .ready-page .result-gallery .photo-download { width:44px; height:44px; }
 .ready-page .result-gallery .photo-download svg { width:20px; height:20px; }
}
.ready-page .result-gallery:not(:has(li:nth-child(3))) { max-width:640px; margin-inline:auto; }
.ready-page .result-gallery:not(:has(li:nth-child(2))) { max-width:400px; grid-template-columns:minmax(0,1fr); }
@media(max-width:760px) {
 .ready-page .result-gallery { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .ready-page .result-gallery .photo-download { width:30px; height:30px; }
 .ready-page .result-gallery .photo-download::after { inset:-5px -5px -11px -11px; }
}

.preview-progress { position:relative; width:64px; height:64px; border-radius:50%; background:var(--brand-night); }
.preview-progress svg { width:100%; height:100%; fill:none; stroke-width:3; }
.preview-progress-value { position:absolute; inset:0; display:grid; place-items:center; color:var(--brand-ice); font-size:13px; font-weight:700; line-height:1; font-variant-numeric:tabular-nums; }
.preview-progress-track { stroke:rgb(255 255 255 / .28); }
.preview-progress-fill { stroke:var(--brand-accent); stroke-linecap:round; stroke-dasharray:100; stroke-dashoffset:100; transform:rotate(-90deg); transform-origin:center; transition:stroke-dashoffset 160ms linear; }
@media(prefers-reduced-motion:reduce) { .preview-progress-fill { transition:none; } }

/* Stable, static payment placeholders; the real Stripe form fades in on ready. */
.checkout-form-stage{display:grid;min-width:0}
.checkout-form-stage>#payment-loading,.checkout-form-stage>#embedded-checkout{grid-area:1/1;min-width:0}
#payment-loading{padding:0;margin:0;pointer-events:none}
#payment-loading[hidden]{display:none}
#payment-loading>.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
#embedded-checkout{opacity:0;pointer-events:none;transition:opacity 120ms ease-out}
.checkout-form-panel[data-payment-state="ready"] #embedded-checkout{opacity:1;pointer-events:auto}
.checkout-form-panel:not([data-payment-state="ready"]) .checkout-terms{visibility:hidden}
.checkout-form-panel[data-payment-state="error"] .checkout-form-stage{display:none}
.checkout-skeleton{padding-bottom:4px}
.skeleton-wallets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.skeleton-wallets span,.skeleton-input,.skeleton-split span,.skeleton-pay{background:#edf0f3;border-radius:6px}
.skeleton-wallets span{height:44px}
.skeleton-divider{height:1px;background:#e3e7ec;margin:28px 0}
.skeleton-label{display:block;width:72px;height:12px;border-radius:3px;background:#e5eaf0;margin-bottom:12px}
.skeleton-input{height:46px}.skeleton-method-label{width:144px;margin-top:32px}
.skeleton-methods{border:1px solid #e3e7ec;border-radius:6px;overflow:hidden}
.skeleton-card{padding:20px 16px}.skeleton-card>.skeleton-label{width:60px;margin-bottom:22px}
.skeleton-split{display:grid;grid-template-columns:1fr 1fr;gap:1px;margin-top:1px}.skeleton-split span{height:44px}
.skeleton-method{height:52px;border-top:1px solid #e3e7ec}
.skeleton-total{display:flex;justify-content:space-between;margin:32px 0 18px}.skeleton-total span{height:12px;width:86px;background:#e5eaf0;border-radius:3px}.skeleton-total span+span{width:46px}
.skeleton-pay{height:44px;background:#e2e7ed}
@media(prefers-reduced-motion:reduce){#embedded-checkout{transition:none}}

/* Site-owned checkout status; the Stripe form remains unchanged. */
.checkout-loading-message { margin:0 0 20px; color:var(--brand-muted-light); font-size:14px; line-height:1.6; }

/* Work preview: choose one paid photo group, then use the genuine Stripe form. */
.group-checkout .checkout-photo-summary { display:block; padding:0; }
.group-checkout #checkout-photo-title,.group-checkout .checkout-total,.group-checkout .checkout-once,.group-checkout .checkout-photo-review { display:none; }
#checkout-package-options { min-width:0; padding:0; margin:0; border:0; }
#checkout-package-options legend { padding:0; margin:0 0 20px; color:var(--brand-ice); font-family:var(--display); font-size:23px; font-weight:700; line-height:1.35; letter-spacing:-.025em; }
.checkout-package-grid { display:grid; gap:12px; }
.checkout-package { display:grid; grid-template-columns:20px minmax(0,1fr) auto; align-items:center; gap:12px; min-height:76px; padding:18px 16px; border:1px solid var(--brand-line-dark); border-radius:12px; cursor:pointer; color:var(--brand-ice); background:var(--brand-surface); }
.checkout-package:has(input:checked) { border-color:var(--brand-accent); background:var(--brand-depth); }
#order-app .checkout-package input[type=radio] { background:revert; color:revert; border:revert; border-radius:revert; box-sizing:border-box; width:18px; height:18px; min-width:18px; min-height:18px; padding:0; margin:0; accent-color:var(--brand-accent); cursor:inherit; }
.checkout-package:has(input:focus-visible) { outline:2px solid var(--brand-accent); outline-offset:4px; }
.checkout-package-label { font-size:14px; font-weight:600; line-height:1.5; }
.checkout-package-price { font-size:25px; font-weight:700; line-height:1.2; font-variant-numeric:tabular-nums; white-space:nowrap; }
.checkout-package:has(input:disabled) { opacity:.6; cursor:default; }
#checkout-package-capacity { margin:16px 0 0; color:var(--brand-accent); font-size:13px; line-height:1.6; }
@media(hover:hover) { .checkout-package:hover:has(input:not(:disabled)) { border-color:var(--brand-accent); } }
@media(max-width:760px) {
 .group-checkout .checkout-photo-summary { padding-bottom:28px; }
 #checkout-package-options legend { margin-bottom:16px; font-size:18px; }
 .checkout-package-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
 .checkout-package { grid-template-columns:18px minmax(0,1fr); gap:10px 8px; padding:16px 12px; }
 .checkout-package-price { grid-column:2; font-size:26px; }
 .checkout-package-label { font-size:13px; }
}

/* Composed Stripe Elements: retain the white Stripe panel and its visual rhythm. */
.stripe-elements-form { margin:0; padding:0; font:400 16px/1.5 Inter,sans-serif; color:#0b1625; }
.stripe-elements-form [hidden] { display:none; }
.stripe-elements-divider { display:flex; align-items:center; gap:12px; margin:24px 0; color:#4a5a6e; font-size:12px; }
.stripe-elements-divider::before,.stripe-elements-divider::after { content:''; flex:1; height:1px; background:#e3e7ec; }
.stripe-elements-form h3 { margin:0 0 12px; color:#0b1625; font:400 14px/1.5 Inter,sans-serif; letter-spacing:0; }
.stripe-elements-contact { margin-bottom:28px; }
.stripe-elements-payment { min-width:0; }
.stripe-elements-total { display:flex; align-items:baseline; justify-content:space-between; gap:16px; margin:32px 0 16px; font-size:14px; font-variant-numeric:tabular-nums; }
#order-app .stripe-elements-submit { display:block; width:100%; min-height:44px; margin:0; padding:10px 16px; border:1px solid var(--brand-surface); border-radius:6px; background:var(--brand-surface); color:#fff; font:700 16px/1.5 Inter,sans-serif; cursor:pointer; }
#order-app .stripe-elements-submit:hover:not(:disabled) { background:var(--brand-surface-raised); border-color:var(--brand-surface-raised); }
#order-app .stripe-elements-submit:disabled { background:#565656; border-color:#565656; color:#fff; opacity:1; cursor:wait; }
#order-app .stripe-elements-submit:focus-visible { outline:2px solid #34465b; outline-offset:3px; }
.stripe-elements-error { margin:0 0 16px; color:#a32828; font-size:14px; line-height:1.5; }

/* The payment task needs no repeated title or provider label above the wallets. */
.group-checkout .checkout-form-panel:not([data-payment-state="error"]) .checkout-panel-heading { display:none; }
.group-checkout .checkout-provider { display:none; }
/* Let Stripe choose its native compact logo treatment; never mask iframe text. */
.stripe-elements-express [data-stripe-express] { width:100%; max-width:450px; margin-inline:auto; }
.stripe-elements-express[data-wallet-count="2"] [data-stripe-express] { max-width:308px; }
.stripe-elements-express[data-wallet-count="1"] [data-stripe-express] { max-width:150px; }
/* Owner-approved desktop width: use the full payment column, as before. */
@media(min-width:761px) {
 .group-checkout .stripe-elements-express [data-stripe-express] { max-width:none; }
}

/* Paid group: review the purchased collection before explicitly starting work. */
.paid-group-page .order-page { width:100%; max-width:1056px; padding-inline:48px; }
.paid-group-page .flow-steps { display:none; }
.paid-group-page .flow-heading { text-align:center; }
.paid-group-page #flow-title { font-size:40px; line-height:1.15; letter-spacing:-.025em; }
.paid-group-page #flow-description { max-width:60ch; margin:14px auto 0; }
#paid-photos-stage { width:100%; }
.paid-group-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0 0 16px; }
.paid-group-count { margin:0; color:var(--brand-ice); font-size:18px; font-weight:700; line-height:1.5; font-variant-numeric:tabular-nums; }
.paid-group-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin:0; padding:0; list-style:none; }
.paid-group-grid[hidden],.paid-group-empty[hidden] { display:none; }
.paid-group-photo .thumbnail-image { border:1px solid var(--brand-line-dark); }
.paid-group-photo img { display:block; object-fit:contain; color:var(--brand-muted-dark); font-size:13px; }
.paid-group-photo .remove-photo:focus-visible,.paid-group-confirm:focus-visible { outline:2px solid var(--brand-accent); outline-offset:4px; }
.paid-group-empty { padding:36px 20px; margin:0; border:1px dashed var(--brand-field); border-radius:12px; text-align:center; color:var(--brand-muted-dark); }
.paid-group-status { margin:16px 0 0; color:var(--brand-muted-dark); font-size:14px; line-height:1.6; text-align:center; }
.paid-group-status:empty { display:none; }
.paid-group-actions { margin:28px auto 0; max-width:440px; text-align:center; }
#order-app .paid-group-confirm { width:100%; margin:0; }
.paid-group-actions p { margin:12px 0 0; color:var(--brand-muted-dark); font-size:13px; line-height:1.6; }
.paid-group-toggle { display:flex; width:fit-content; margin:20px auto 0; }
.paid-group-toggle[hidden] { display:none; }
.paid-group-toggle svg { transition:transform 300ms cubic-bezier(.16,1,.3,1); }
.paid-group-toggle[aria-expanded="true"] svg { transform:rotate(180deg); }
@media(prefers-reduced-motion:reduce) { .paid-group-toggle svg { transition:none; } }
@media(max-width:760px) {
 .paid-group-page .order-page { padding-inline:20px; }
 .paid-group-page #flow-title { font-size:32px; }
 .paid-group-page #flow-description { font-size:15px; }
 .paid-group-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
 .paid-group-count { font-size:16px; }
 .paid-group-toolbar { gap:12px; }
}

.paid-group-terms a { color:inherit; text-decoration:underline; text-underline-offset:3px; }
.paid-group-terms a:focus-visible { outline:2px solid var(--brand-accent); outline-offset:3px; }

/* Preview offer: content only; shared page chrome is protected. */
.preview-offer { width:100%; max-width:720px; margin:0 auto 28px; padding:20px 16px; border:1px solid var(--brand-accent); border-radius:12px; background:var(--brand-depth); text-align:center; }
.preview-offer[hidden] { display:none; }
.preview-page .preview-upload-note { max-width:560px; margin:14px auto 0; color:var(--brand-muted-dark); font-size:14px; line-height:1.5; text-align:center; }
.preview-offer strong { display:block; color:var(--brand-accent); font-family:var(--display); font-size:20px; line-height:1.35; letter-spacing:-.02em; }
.preview-offer:has(.offer-title-discount) strong { white-space:nowrap; }
.preview-offer .offer-title-discount { font-size:26px; font-weight:800; white-space:nowrap; }
.preview-offer p { max-width:58ch; margin:8px auto 0; font-size:14px; line-height:1.6; color:var(--brand-muted-dark); }
.has-purchase-offer { display:inline-flex; align-items:center; justify-content:center; gap:16px; min-height:68px; padding:14px 20px; font-size:16px; line-height:1.4; }
.purchase-button-copy { display:flex; flex-direction:column; align-items:center; gap:3px; }
.purchase-button-copy small { font-size:12px; font-weight:500; line-height:1.5; }
.purchase-button-arrow { display:flex; flex:none; }
.purchase-button-arrow svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.preview-page #preview-offer { margin:24px auto 0; }
.preview-page #preview-offer:not([hidden]) + .preview-actions { margin-top:16px; }
.preview-offer.offer-expired { border-color:var(--brand-line-dark); background:transparent; }
.preview-offer.offer-expired strong { color:var(--brand-ice); }
.checkout-package-price { display:flex; flex-direction:column; align-items:flex-end; gap:2px; }
.checkout-package-price del { color:var(--brand-muted-dark); font-size:14px; font-weight:400; line-height:1.4; }
.checkout-package-price del[hidden] { display:none; }
@media(max-width:760px) { .preview-offer { margin-bottom:24px; } .has-purchase-offer { padding:14px 16px; font-size:15px; } }
@media(max-width:359px) { .preview-offer strong { font-size:18px; } .preview-offer .offer-title-discount { font-size:24px; } .has-purchase-offer { font-size:14px; } }

/* Preview offer badge and expiry. */
.preview-offer .preview-offer-expiry { margin-top:10px; font-size:12px; line-height:1.5; color:var(--brand-muted-dark); }
.checkout-offer-validity { text-align:center; margin:14px 0 0; color:var(--brand-muted-dark); font-size:12px; line-height:1.6; }
.checkout-offer-validity[hidden],[data-package-discount][hidden] { display:none; }
.package-original-line { display:flex; align-items:center; gap:8px; }
.package-offer-badge { display:inline-flex; padding:2px 7px; border-radius:6px; background:var(--brand-accent); color:#0b1625; font-size:12px; font-weight:700; line-height:1.4; }

.delivery-attention .preview-failure { text-align:center; }
.delivery-attention #downloads { margin-top:32px; }

/* Upload feedback stays inside the existing collection, never header/footer. */
.order-collection #upload-meter{accent-color:var(--brand-accent);}
.paid-group-upload{margin-top:24px;color:var(--brand-muted-dark);font-size:14px;line-height:1.6;}
.paid-group-upload[hidden],.paid-group-retry[hidden]{display:none;}
.paid-group-retry{display:flex;width:fit-content;margin:20px auto 0;}

/* Local feedback and offer alignment; no shared chrome geometry changes. */

#photo-save-toast{position:fixed;z-index:30;left:50%;bottom:max(24px,env(safe-area-inset-bottom));transform:translateX(-50%);width:max-content;max-width:calc(100% - 48px);padding:12px 18px;border:1px solid var(--brand-line-dark);border-radius:12px;background:var(--brand-depth);color:var(--brand-ice);box-shadow:0 8px 24px #0004;font:600 14px/1.5 var(--body);text-align:center;pointer-events:none;}
#photo-save-toast[hidden]{display:none;}
/* A single official Express Checkout Element needs room for all three wallets. */
@media(min-width:1200px) {
 .payment-page.group-checkout .order-page { max-width:1240px; }
}
