.studio-frame-presets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0 20px}
.studio-frame-presets button{position:relative;min-width:0;padding:5px;border:2px solid #eedff1;border-radius:12px;background:white;color:var(--text)}
.studio-frame-presets canvas{width:100%;height:auto;border-radius:7px;touch-action:auto}
.studio-frame-presets span{display:block;padding:8px 2px 5px;font-size:12px;font-weight:700}
.studio-frame-presets button:hover{border-color:var(--purple-soft);background:#fff7fd}
.studio-frame-presets button[aria-pressed=true]{border-color:var(--pink);background:var(--pink-light)}
.studio-frame-presets button[aria-pressed=true]::after{content:'✓';position:absolute;top:8px;right:8px;background:var(--pink);color:white;border-radius:50%;width:20px;height:20px;font-size:13px}

.photo-bling-presets,.photo-color-presets{display:flex;flex-wrap:wrap;gap:7px;margin:12px 0}.photo-color-presets button{display:flex;align-items:center;gap:7px;font-size:12px;padding:8px 10px;border-radius:999px;min-height:40px}.photo-color-presets i{display:block;width:20px;height:20px;border-radius:50%;flex-shrink:0;box-shadow:inset 0 0 0 1px #0002}.photo-color-presets button[aria-pressed="true"],.photo-bling-presets button[aria-pressed="true"]{background:var(--pink-light);border:2px solid var(--pink)}.photo-bling-presets button{font-size:12px;min-height:44px}#photoGifSettings{border-top:1px solid #eedbeb;margin-top:18px;padding-top:12px}#photoGifStatus{font-size:12px}button:hover{transform:none}
.photo-tool-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0}.photo-tool-list button{min-width:0;min-height:48px;font-size:12px;text-align:left}.photo-tool-dialog{width:min(900px,calc(100vw - 24px));height:min(850px,90dvh);padding:0;border:1px solid #ead4ed;border-radius:20px;background:#fff8fd;color:var(--text)}.photo-tool-dialog[open]{display:flex;flex-direction:column}.photo-tool-dialog::backdrop{background:#30123e80}.photo-tool-dialog-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid #ead4ed}.photo-tool-dialog iframe{width:100%;flex:1;border:0;min-height:0}.photo-tool-dialog>p{margin:0;padding:0 16px;font-size:13px}.photo-live-controls{display:flex;align-items:center;gap:10px;margin-bottom:8px;flex-shrink:0}.photo-live-controls button{font-size:11px;padding:7px 10px;min-height:36px}.photo-live-controls span{font-size:11px;color:#795c80}@media(max-width:780px){.photo-tool-dialog{width:100vw;height:100dvh;max-width:100vw;max-height:100dvh;border-radius:0;margin:0}.photo-live-controls span{font-size:10px}.photo-tool-list{grid-template-columns:repeat(2,minmax(0,1fr))}}

.photo-sparkle-colors .photo-color-presets button,.photo-compact-colors .photo-color-presets button{width:44px;height:44px;padding:8px;justify-content:center}.photo-sparkle-colors .photo-color-presets i,.photo-compact-colors .photo-color-presets i{width:26px;height:26px}

.photo-sparkle-presets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.photo-sparkle-presets button{position:relative;min-width:0;padding:5px;border-radius:12px;border:2px solid #eedff1;background:white}.photo-sparkle-presets canvas{display:block;width:100%;height:auto;border-radius:7px}.photo-sparkle-presets span{display:block;font-size:11px;font-weight:700;padding:7px 1px 3px;line-height:1.3}.photo-sparkle-presets button[aria-pressed="true"]::after{content:'✓';position:absolute;top:7px;right:7px;background:var(--pink);color:white;width:18px;height:18px;border-radius:50%}

.photo-frame-color-section{padding:16px 0;border-top:1px solid #eedbeb}.photo-frame-color-section h3{margin:0 0 6px;font-size:16px;color:var(--purple)}.photo-frame-color-section .hint{margin:0 0 12px}.photo-frame-color-section .photo-color-presets{margin:12px 0}

.photo-color-presets button.photo-custom-color-button{width:44px;min-width:44px;gap:0;padding:8px;justify-content:center}.photo-color-presets .photo-custom-color-button i{display:flex;align-items:center;justify-content:center;font-style:normal;font-size:21px}.photo-custom-color-button span{font-size:11px;font-weight:700}

#photoGlowLayers,#photoGlowAutoControls{border-top:1px solid #eedbeb;padding:16px 0;margin-top:12px}#photoGlowLayers h3{color:var(--purple);margin:0 0 8px}.photo-glow-layer-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:10px 0;border-bottom:1px solid #eedbeb}.photo-glow-layer-row span{width:100%;font-weight:700}.photo-glow-layer-row button{font-size:12px;min-height:36px}#photoGlowLayerAdd{margin-top:12px}#photoGlowAuto[aria-pressed=true]{background:var(--purple);color:white}#photoGlowAutoSettings{padding-top:10px}

#photoGlowWizard{border:1px solid #eedbeb;border-radius:14px;background:#fff8fd;padding:14px;margin-bottom:18px}#photoGlowWizard section+section{border-top:1px solid #eedbeb;margin-top:14px;padding-top:14px}#photoGlowWizard h3{font-size:16px}#photoGlowWizard .photo-color-presets button{width:44px;height:44px;padding:8px;justify-content:center}#photoGlowWizard .photo-color-presets i{width:26px;height:26px}.photo-glow-region-actions{display:flex;flex-wrap:wrap;gap:8px}.photo-glow-region-actions button{font-size:12px}.photo-glow-region-actions button[aria-pressed=true]{background:var(--purple);color:white}#photoGlowLayers>h3:first-of-type,#photoGlowLayers>p:first-of-type{display:none}

.photo-glow-selection-switch{display:inline-flex;border:1px solid #e4c5ed;border-radius:999px;padding:3px;background:white;gap:3px}.photo-glow-selection-switch button{border:0;border-radius:999px;min-height:40px;padding:8px 16px}.photo-glow-selection-switch button[aria-pressed=true]{background:var(--purple);color:white}

#photoGlowRegionHint{height:6em;line-height:1.5;overflow:auto;margin:8px 0 12px}.photo-glow-selection-switch{display:inline-flex;align-items:center;border:0;border-radius:0;padding:0;background:transparent;gap:10px}.photo-glow-selection-switch .photo-glow-switch-label{background:transparent!important;border:0;border-radius:0;padding:0;min-height:44px;color:var(--text)!important;font-weight:400}.photo-glow-selection-switch .photo-glow-switch-label[aria-pressed=true]{color:var(--purple)!important;font-weight:700}#photoGlowModeSwitch{width:48px;min-width:48px;height:28px;min-height:28px;border:0;border-radius:999px;background:var(--purple);padding:4px;display:flex;align-items:center}#photoGlowModeSwitch span{display:block;width:20px;height:20px;border-radius:50%;background:white}#photoGlowModeSwitch[aria-checked=true]{justify-content:flex-end}#photoGlowModeSwitch[aria-checked=false]{justify-content:flex-start}

.photo-glow-three-way{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;padding:3px;gap:3px;border:1px solid #e4c5ed;border-radius:12px;background:white}.photo-glow-three-way button{min-width:0;min-height:44px;border:0;border-radius:9px;padding:8px 6px;background:transparent;color:var(--text);font-size:12px}.photo-glow-three-way button[aria-pressed=true]{background:var(--purple);color:white}

#photoGlowLayerAdd{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;min-height:48px;padding:10px}#photoGlowLayerAdd svg{display:block;overflow:visible}

.paint-actions .photo-paint-icon{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;min-height:44px;padding:10px}.photo-paint-icon svg{display:block}

#photoGlowDistribution{padding:12px 0}#photoGlowDistribution>span{display:block;margin-bottom:8px}#photoGlowDistribution [role=group]{display:flex;flex-wrap:wrap;gap:6px}#photoGlowDistribution button{min-height:36px;padding:6px 10px;font-size:12px;background:transparent;border:1px solid #e8d6ec;border-radius:8px}#photoGlowDistribution button[aria-pressed=true]{background:var(--pink-light);color:var(--purple);border-color:var(--pink)}#photoGlowSelectionControls{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:10px 0}#photoGlowSelectionControls button{font-size:12px;min-height:36px}

.photo-glow-motif-buttons{display:flex;gap:8px;margin:8px 0}.photo-glow-motif-buttons button{display:flex;align-items:center;justify-content:center;width:48px;height:48px;min-height:48px;padding:10px;border-radius:10px}.photo-glow-motif-buttons button[aria-pressed=true]{border-color:var(--pink);background:var(--pink-light);color:var(--purple)}

/* Crop preview fits its panel without a scrollbar changing the available width. */
main[data-step="0"] .preview{overflow:hidden;min-width:0;align-self:stretch}
main[data-step="0"] .preview .stage{flex:1 1 0;min-height:0;min-width:0}
main[data-step="0"] .preview #status{flex:0 0 auto}

#photoBffControls{border-top:1px solid #eedbeb;padding-top:16px;margin-top:20px}#photoBffControls h3{color:var(--purple)}#photoBffOptions button{margin:6px 6px 0 0;font-size:12px}
#photoStylePicker{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:12px 0 20px}#photoStylePicker button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:12px 5px;min-height:88px;border:2px solid #eedff1;border-radius:12px;background:white;font-size:12px}#photoStylePicker button span{line-height:1.3}#photoStylePicker button[aria-pressed=true]{border-color:var(--pink);background:var(--pink-light);color:var(--purple)}

/* Leave room for slider thumbs and shadows inside the scrolling controls. */
#controls .step-body{padding-left:10px;padding-right:18px;scrollbar-gutter:stable}
#controls .step-body input[type=range]{display:block;width:calc(100% - 12px);margin-left:6px;margin-right:6px;margin-top:12px;margin-bottom:18px}
@media(max-width:780px){#controls .step-body{padding-left:8px;padding-right:14px}}

.preview #photoBffControls{flex:0 0 auto;margin-top:12px;padding-top:12px}.preview #photoBffControls h3{margin:0 0 6px;font-size:16px}.preview #photoBffControls .hint{margin:6px 0}.preview #photoBffControls label{margin:8px 0 6px;font-size:12px}

#photoStylePicker{gap:5px;margin:8px 0 14px}#photoStylePicker button{min-height:58px;padding:5px 3px;gap:4px;border-radius:8px;font-size:11px}#photoStylePicker button svg{width:24px;height:24px}.photo-glow-motif-buttons{gap:5px;margin:6px 0}.photo-glow-motif-buttons button{width:36px;height:36px;min-height:36px;padding:6px;border-radius:8px}.photo-glow-motif-buttons button svg{width:20px;height:20px}

/* Keep the landscape photo and its settings together at the top of the preview. */
@media(min-width:781px){main .preview .stage{flex:0 1 auto;aspect-ratio:420/203;width:100%;min-height:50px;align-items:start}main .preview #view{align-self:start}main[data-step="0"] .preview .stage{flex:0 1 auto;min-height:0}main .preview #status{flex:0 0 auto}}

#view.bff-movable{cursor:grab;touch-action:none}#view.bff-dragging{cursor:grabbing}

#glowPresets{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:8px 0 14px}#glowPresets button{padding:3px;border-radius:8px}#glowPresets button canvas{height:40px;aspect-ratio:auto;object-fit:cover;border-radius:5px}#glowPresets button span{font-size:10px;padding:5px 1px 3px}#glowPresets button[aria-pressed="true"]::after{top:5px;right:5px;width:15px;height:15px;font-size:10px}

.photo-extra-settings{flex:0 0 auto;margin-top:12px;padding-top:12px;border-top:1px solid #eedbeb}.photo-extra-settings h3{margin:0 0 6px;font-size:16px;color:var(--purple)}.photo-extra-settings .hint{margin:6px 0}.photo-extra-settings label{font-size:12px;margin:8px 0 6px}.photo-extra-settings button{font-size:12px;min-height:36px}.photo-extra-settings input[type=text]{width:100%;padding:8px;border:1px solid #dec4e7;border-radius:8px;background:#fff8fd;color:var(--text);font:inherit}

.photo-end-watermark{margin:14px 0;line-height:1.4}.photo-end-watermark .hint{display:block;margin:5px 0 0 22px}

#photoGifSettings .photo-end-watermark{font-size:12px;font-weight:400;color:#735879;line-height:1.6;margin:8px 0 0}
/* Responsive start illustration: HTML text stays sharp at every screen size. */
.preview .stage{position:relative}.photo-start-empty #view{visibility:hidden}.photo-start-preview{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:20px;text-align:center;background:radial-gradient(circle at 15% 25%,#ffe3f5,transparent 55%),linear-gradient(135deg,#fff5fc,#eee3fb);color:var(--purple-dark)}.photo-start-preview[hidden]{display:none}.photo-start-preview svg{width:clamp(38px,6vw,64px);height:clamp(38px,6vw,64px);fill:none;stroke:var(--pink);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}.photo-start-preview h2{font-size:clamp(20px,2.6vw,34px);line-height:1.15;margin:0}.photo-start-preview p{font-size:clamp(13px,1.3vw,17px);line-height:1.4;color:#735879;margin:0}.photo-start-preview>span{font-size:12px;color:#8e709a}@media(max-width:480px){.photo-start-preview{gap:7px;padding:14px}.photo-start-preview>span{display:none}}
/* Mobile editing uses document flow instead of squeezing two panels into one viewport. */
@media(max-width:780px){
 main{height:auto;min-height:0;grid-template-rows:auto auto auto;padding:8px;gap:10px}
 main .preview,main[data-step="0"] .preview{height:auto;min-height:0;overflow:visible;padding:10px;align-self:start}
 main .preview .stage,main[data-step="0"] .preview .stage{flex:none;width:100%;aspect-ratio:420/203;min-height:0;display:block}
 main .preview #view{width:100%!important;height:auto!important;max-height:none;display:block}
 main .preview>*{flex-shrink:0}
 #controls{height:auto;min-height:0;padding:12px}.step-body,#controls .step-body{overflow:visible;flex:none;max-height:none;padding:0 4px 12px}
 .photo-live-controls{flex-wrap:wrap;gap:6px;margin-bottom:8px}.photo-live-controls span{width:100%;line-height:1.4;font-size:11px}
 .paint-toolbar{margin-top:8px;padding-top:8px;display:flex;flex-direction:column;gap:6px}
 #paintTitle{display:block;font-size:13px;line-height:1.4;margin:0}
 .paint-toolbar p,.paint-toolbar label{line-height:1.4;margin:0}
 #photoGlowAutoControls{border:0;margin:0;padding:0}#photoGlowAutoSettings{display:grid;grid-template-columns:88px minmax(0,1fr);align-items:center;gap:6px 10px;padding:0}
 #photoGlowAutoSettings>.hint{display:none}#photoGlowAutoSettings>label[for=photoGlowTolerance]{font-size:12px;display:flex;justify-content:space-between;gap:8px}
 #photoGlowTolerance{width:100%;margin:8px 0}#photoGlowAutoSettings>label:last-child{grid-column:1/-1;font-size:11px}
 #photoGlowSelectionControls{padding:0;gap:8px;font-size:11px}.paint-actions{margin:0;gap:5px}.paint-actions .photo-paint-icon{width:36px;height:36px;min-height:36px;padding:6px}
 #photoGlowDistribution{padding:0}#photoGlowDistribution>span{margin-bottom:4px}
 #photoGlowRegionHint{height:auto;min-height:0;overflow:visible;font-size:12px;line-height:1.5;margin:6px 0 10px}
 #status{font-size:11px;line-height:1.4;margin:6px 0}
}
#photoWorkspaceOpen{font-size:11px;min-height:36px;padding:7px 10px}.photo-workspace-dialog{width:100vw;height:100dvh;max-width:100vw;max-height:100dvh;margin:0;padding:12px;border:0;background:#fff8fd;color:var(--text)}.photo-workspace-dialog[open]{display:flex;flex-direction:column;gap:8px}.photo-workspace-dialog::backdrop{background:#32113e99}.photo-workspace-bar{display:flex;align-items:center;justify-content:space-between;gap:8px}.photo-workspace-bar strong{font-size:14px}.photo-workspace-bar button{min-height:40px;font-size:12px}.photo-workspace-dialog .stage{position:relative;flex:1;min-height:0;display:grid;place-items:center;background:#f5eaf7;border-radius:12px}.photo-workspace-dialog #view{object-fit:contain;max-width:100%;max-height:100%;touch-action:none}.photo-workspace-dialog .paint-toolbar{flex:none;min-height:0;margin:0;padding-top:6px}.photo-workspace-dialog #paintTitle,.photo-workspace-dialog #status{display:none}.photo-workspace-dialog #photoGlowAutoControls{margin:0;padding:0;border:0}.photo-workspace-dialog #photoGlowAutoSettings{padding:0}.photo-workspace-dialog #photoGlowAutoSettings>.hint{display:none}
