/* Shared photo, face confirmation and result interaction layout. */
.photo-chosen{display:flex;gap:14px;align-items:center;margin-bottom:16px}.photo-chosen img{width:72px;height:72px;object-fit:contain;border-radius:9px}.flow-settings{margin:12px 0;padding:10px 12px}.result-stage{position:relative;display:flex;align-items:center;justify-content:center;min-height:240px;background:#f4f6f2;border-radius:12px;touch-action:pan-y pinch-zoom;overflow:hidden}.result-stage>img,.result-stage>canvas{display:block;max-width:100%;max-height:55dvh;width:auto;height:auto;object-fit:contain}.result-stage>img{min-height:240px}#flow-processing{position:absolute;bottom:14px;left:50%;transform:translateX(-50%);background:rgba(32,48,43,.88);color:white;border-radius:20px;padding:8px 16px;white-space:nowrap}body[data-app-flow] #gallery{display:flex;justify-content:center;gap:8px;margin:12px 0}body[data-app-flow] #gallery img{display:none}body[data-app-flow] #gallery button{font-size:14px;padding:8px 16px}.result-navigation{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:12px 0}.result-navigation button{font-size:14px}.result-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap}#flow-position{white-space:nowrap;color:var(--flow-muted,#607469)}#flow-usage{margin:6px 0}.flow-hint{font-size:12px;color:var(--flow-muted,#607469);margin:6px 0}.photo-start{margin-top:16px}body[data-app-flow] #preview{display:block;max-width:100%;max-height:35dvh;margin:14px auto}@media(max-width:460px){.result-stage>img,.result-stage>canvas{max-height:48dvh}.result-navigation button{padding:10px}.result-stage{min-height:200px}.result-stage>img{min-height:200px}}
body[data-app-flow] .swipe-actions{display:flex;gap:10px;margin:10px 0}body[data-app-flow] .swipe-actions button{flex:1;padding:11px 8px;font-size:14px}
body[data-app-flow][data-app-screen=result] main{padding-bottom:calc(110px + env(safe-area-inset-bottom,0px))}
body[data-app-flow][data-app-screen=result] .swipe-actions{position:fixed;left:0;right:0;bottom:0;z-index:10;max-width:var(--flow-max-width,920px);margin:0 auto;padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px));background:rgba(255,255,255,.98);border-top:1px solid #dce4dd;box-shadow:0 -3px 12px rgba(32,48,43,.08)}
html:has(body[data-app-flow][data-app-screen=result]){scroll-padding-bottom:calc(100px + env(safe-area-inset-bottom,0px))}
body[data-app-flow] .swipe-actions button{min-height:52px;flex:1 1 0;min-width:0;white-space:nowrap}
body[data-app-flow] #flow-directions{padding:0;border:0;background:transparent;margin:4px 0 8px}
body[data-app-flow] #flow-directions #gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:8px 0}
body[data-app-flow] #flow-directions #gallery button{min-height:44px;padding:8px;white-space:nowrap}
#photo-browse-only,#result-browse-only,#resume-face-swap{display:block;width:100%;margin:12px 0;min-height:48px}
#photo-expand-trial,#result-expand-trial{width:100%;margin:12px 0;min-height:48px;background:var(--flow-accent,#246c53);color:#fff;border:1px solid var(--flow-accent,#246c53)}
body[data-app-flow] .swipe-actions:has(#result-expand-trial:not([hidden])){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));box-sizing:border-box}
body[data-app-flow] .swipe-actions #result-expand-trial{grid-column:1/-1;width:100%;margin:0;white-space:normal}
body[data-app-flow][data-app-screen=result]:has(#result-expand-trial:not([hidden])) main{padding-bottom:calc(180px + env(safe-area-inset-bottom,0px))}
html:has(body[data-app-flow][data-app-screen=result] #result-expand-trial:not([hidden])){scroll-padding-bottom:calc(180px + env(safe-area-inset-bottom,0px))}
#flow-view-mode{background:transparent;border:0;border-radius:0;padding:0;margin:10px 0;color:var(--flow-muted,#607469);font-size:14px;cursor:default}
.photo-start{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.photo-start:has(#photo-browse-only[hidden]){grid-template-columns:1fr}
.photo-start button{min-width:0;min-height:48px;padding:12px 8px;font-size:14px;white-space:nowrap}
.photo-start #photo-browse-only{width:auto;margin:0}
.photo-start:has(#swap:disabled) #photo-browse-only:enabled{background:var(--flow-accent,#246c53);color:#fff;border:1px solid var(--flow-accent,#246c53);opacity:1}
.result-navigation #flow-position{min-width:0;white-space:normal;text-align:right;font-size:14px}
.flow-finish-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:20px}.flow-finish-actions button{min-height:48px}
body[data-app-flow] .result-stage>img,body[data-app-flow] .result-stage>canvas{transform:translateX(var(--swipe-x,0px)) rotate(var(--swipe-angle,0deg));transition:transform 170ms ease-out;user-select:none;-webkit-user-select:none}
body[data-app-flow] .result-stage.swipe-dragging>img,body[data-app-flow] .result-stage.swipe-dragging>canvas{transition:none}
body[data-app-flow] .swipe-feedback{position:absolute;top:18px;left:50%;transform:translateX(-50%);padding:8px 18px;border:2px solid #65736c;border-radius:9px;background:rgba(255,255,255,.95);color:#45564b;font-size:20px;font-weight:700;pointer-events:none}
body[data-app-flow] .swipe-feedback[data-like=true]{color:var(--flow-accent,#246c53);border-color:var(--flow-accent,#246c53)}
@media(prefers-reduced-motion:reduce){body[data-app-flow] .result-stage>img,body[data-app-flow] .result-stage>canvas{transition:none}}
.face-confirm-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px}
#face-confirm{width:min(94vw,680px);max-height:94dvh;overflow:auto;border:1px solid var(--flow-line,#c5d5ca);border-radius:14px;padding:18px;color:#20302b}
#face-confirm::backdrop{background:rgba(0,0,0,.55)}
#face-confirm canvas{display:block;max-width:100%;max-height:50dvh;width:auto;height:auto;margin:10px auto;background:#f4f6f2}
#face-confirm canvas.face-manual-canvas{touch-action:none;cursor:move}
#face-confirm .face-confirm-actions button,#face-confirm #face-detect-again{min-height:48px}
#face-confirm p{margin:8px 0;font-size:14px}
@media(max-width:460px){#face-confirm{padding:13px}.face-confirm-actions button{flex:1 1 42%;font-size:14px;padding:10px}}
/* Keep repeated action taps from becoming double-tap zoom; allow pinch zoom. */
body[data-app-flow] button,body[data-app-flow] .swipe-actions{touch-action:manipulation}
body[data-app-flow] .result-help{padding:0;border:0;background:transparent;margin:8px 0;font-size:13px}
.result-help summary{font-weight:500;color:#52695d;padding:8px 0}
.result-help .flow-hint{margin:6px 0}
body[data-app-flow] #flow-usage{font-size:13px;font-weight:600;color:#425b4d}
body[data-app-flow] .photo-help{border:0;padding:0;background:transparent;margin:8px 0;font-size:13px}
.photo-help summary{font-weight:500;color:#52695d;padding:8px 0}
#flow-processing{font:inherit;font-size:14px;border:1px solid transparent;margin:0;touch-action:manipulation}
#flow-processing:disabled{opacity:1;cursor:default}
#flow-processing:enabled{min-height:44px;border-color:rgba(255,255,255,.55);cursor:pointer}
#flow-processing:enabled::after{content:' ›';font-size:18px}
#flow-processing:focus-visible{outline:3px solid var(--flow-accent,#246c53);outline-offset:3px}
#quota-help-dialog{width:min(90vw,430px);max-height:80dvh;box-sizing:border-box;overflow:auto;border:1px solid var(--flow-line,#bfd3c6);border-radius:14px;padding:20px;color:#20302b}
#quota-help-dialog::backdrop{background:rgba(20,35,28,.4)}
#quota-help-dialog h2{font-size:18px;line-height:1.5;margin:0 0 12px}
#quota-help-dialog p{font-size:14px;line-height:1.7}
.photo-examples{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:8px 0 16px;max-width:540px}
.photo-example{margin:0;padding:12px;background:#f5f7f5;border-radius:12px;text-align:center}
.photo-example svg{display:block;width:92px;max-width:100%;height:auto;margin:0 auto 8px}
.photo-example figcaption{display:flex;flex-direction:column;gap:4px;font-size:12px;line-height:1.5;color:#52695d}
.photo-example figcaption strong{font-size:14px;color:#263c32}
.photo-example-badge{font-weight:600}
.photo-example[data-photo-example=front]{background:#edf6f0;box-shadow:inset 0 0 0 1px #9bbdaa}
.photo-example[data-photo-example=front] .photo-example-badge{color:var(--flow-accent,#246c53)}
.photo-short-tip{margin:8px 0}
body[data-app-flow] #undo-decision{font-size:12px;min-height:40px;padding:8px;white-space:nowrap}
body[data-app-flow] .result-navigation{flex-wrap:wrap;justify-content:flex-start;gap:7px}
body[data-app-flow] #flow-position{margin-right:auto}
#private-result-browse{display:block;width:100%;margin:12px 0;min-height:48px}

/* Export actions share button affordances across both sites. */
#download.result-download-button{display:inline-flex;align-items:center;justify-content:center;min-height:48px;margin:0;padding:11px 18px;border:1px solid transparent;border-radius:9px;background:var(--accent,var(--flow-accent,#246c53));color:white;font:inherit;text-decoration:none;cursor:pointer;touch-action:manipulation}
#download[data-share-preferred=true]{display:none!important}
#share-image{min-height:48px}
