/* Scoped to the reusable editor: Seller Admin's colours, modal shape and controls. */
.photo-editor,.photo-editor-discard{box-sizing:border-box;border:0;color:var(--ink,#10251d);background:#fff;font:inherit;border-radius:18px;box-shadow:0 24px 90px #10251d38;padding:0}
.photo-editor{width:min(1080px,calc(100vw - 40px));max-width:none;max-height:calc(100dvh - 40px);overflow:hidden;flex-direction:column}
.photo-editor[open]{display:flex}.photo-editor::backdrop,.photo-editor-discard::backdrop{background:rgba(16,37,29,.58)}
.photo-editor *,.photo-editor-discard *{box-sizing:border-box}.photo-editor button,.photo-editor-discard button{font:inherit;cursor:pointer;min-height:44px;border:1px solid var(--line,#dce5de);border-radius:9px;background:#fff;color:var(--leaf-dark,#0d3b28);padding:10px 15px;font-size:.88rem;font-weight:650;display:inline-flex;align-items:center;justify-content:center;gap:8px;line-height:1.2}
.photo-editor button:hover:not(:disabled),.photo-editor-discard button:hover{background:#f0f5ef;border-color:#a4bba3}.photo-editor button:disabled{opacity:.4;cursor:default}.photo-editor :focus-visible,.photo-editor-discard :focus-visible{outline:3px solid var(--leaf-dark,#0d3b28);outline-offset:3px}
.photo-editor-header{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:22px 26px;border-bottom:1px solid var(--line,#dce5de);flex:none}.photo-editor-heading{display:flex;align-items:center;gap:13px;min-width:0}.photo-editor-mark{width:42px;height:42px;border-radius:12px;background:#eaf0e3;color:#315b3b;display:grid;place-items:center;flex:none}.photo-editor h2{font-weight:750;font-family:inherit;font-size:1.25rem;line-height:1.25;margin:0 0 5px}.photo-editor-header p{font-size:.83rem;color:var(--muted,#64736c);margin:0;line-height:1.45}.photo-editor .photo-editor-icon{padding:9px;width:44px;min-width:44px;min-height:44px;border-color:transparent;background:transparent;border-radius:8px}.photo-editor-body{display:grid;grid-template-columns:minmax(0,1fr) 272px;gap:30px;padding:20px 28px 24px;overflow-y:auto;overscroll-behavior:contain;min-height:0}.photo-editor-preview{min-width:0}.photo-editor-preview-bar{height:42px;display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;font-size:.8rem;color:#5c6b60}.photo-editor-ratio{font-size:.7rem;font-weight:700;padding:4px 7px;background:#edf2e9;border-radius:5px;margin-left:6px;color:#315b3b}.photo-editor-history{display:flex;gap:3px}.photo-editor-workspace{position:relative;padding:36px 32px;background:#f2f5ef;border:1px solid #e3e9df;border-radius:12px;isolation:isolate}.photo-editor-surface{position:relative;aspect-ratio:1;width:100%;background-color:white;background-image:linear-gradient(45deg,#f0f2ed 25%,transparent 25%),linear-gradient(-45deg,#f0f2ed 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#f0f2ed 75%),linear-gradient(-45deg,transparent 75%,#f0f2ed 75%);background-size:20px 20px;background-position:0 0,0 10px,10px -10px,-10px 0;box-shadow:0 2px 12px #2536210b;touch-action:none}.photo-editor-stage{position:absolute;inset:-28px;touch-action:none}.photo-editor-stage .konvajs-content{touch-action:none}.photo-editor-loading,.photo-editor-error{position:absolute;inset:20px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:14px;color:#53664f;background:#f2f5ef;z-index:2;font-size:.9rem;line-height:1.55}.photo-editor-loading::before{content:"";width:27px;height:27px;border:3px solid #d8e4d4;border-top-color:#315b3b;border-radius:50%;animation:photo-editor-spin 1s linear infinite}.photo-editor [hidden]{display:none!important}.photo-editor-error strong{color:#273f2a;font-size:1.05rem}.photo-editor-error p{margin:0;max-width:330px}.photo-editor-hint{font-size:.76rem;text-align:center;line-height:1.5;color:#65755f;margin:14px 0 0}.photo-editor-controls{padding:27px 0 0;min-width:0}.photo-editor-eyebrow{font-size:.62rem;letter-spacing:.12em;font-weight:750;color:#6e8162}.photo-editor h3{font-family:inherit;font-size:1.22rem;line-height:1.25;letter-spacing:-.02em;margin:9px 0}.photo-editor-controls-heading>p{font-size:.82rem;color:var(--muted,#64736c);margin:0;line-height:1.5}.photo-editor-quick{display:grid;grid-template-columns:1.1fr 1fr;gap:8px;margin:24px 0 26px}.photo-editor-quick button{padding:10px 7px;font-size:.79rem}.photo-editor-quick button:first-child{background:#edf3e9;border-color:#d4e0cd}.photo-editor-range{display:block;margin:0 0 23px}.photo-editor-range>span{display:flex;justify-content:space-between;align-items:center;font-size:.86rem;font-weight:600;margin-bottom:10px}.photo-editor-range output{font-variant-numeric:tabular-nums;color:#67745f;font-size:.78rem;font-weight:500;background:#f4f6f0;padding:4px 8px;border-radius:5px;min-width:48px;text-align:center}.photo-editor-range input{display:block;width:100%;height:44px;margin:0;accent-color:#315b3b;cursor:pointer;background:transparent}.photo-editor-turns{display:grid;grid-template-columns:1fr 1fr;gap:8px}.photo-editor-turns button{padding:10px 7px;font-size:.81rem}.photo-editor-move{margin:22px 0 0;padding:0;border:0}.photo-editor-move legend{font-size:.8rem;font-weight:600;margin-bottom:10px}.photo-editor-move>div{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}.photo-editor-move button{font-size:1.15rem;line-height:1;min-height:44px;padding:8px}.photo-editor-original-note{border-top:1px solid var(--line,#dce5de);display:flex;gap:9px;padding-top:21px;margin-top:25px;color:#617157}.photo-editor-original-note>span{color:#547644;background:#edf3e7;border-radius:50%;width:20px;height:20px;display:grid;place-items:center;font-size:.7rem;flex:none;margin-top:1px}.photo-editor-original-note p{font-size:.75rem;line-height:1.6;margin:0}.photo-editor-note{background:#f7f3e7;border:1px solid #eee2c5;padding:10px;border-radius:8px;font-size:.77rem;line-height:1.5;color:#6c5b32;margin:18px 0 0}.photo-editor-footer{border-top:1px solid var(--line,#dce5de);padding:16px 26px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;background:#fff}.photo-editor-footer>div{display:flex;align-items:center;gap:14px}.photo-editor .photo-editor-text{border-color:transparent;padding-left:0;padding-right:0;min-width:44px}.photo-editor-local{font-size:.72rem;color:#66745f}.photo-editor .photo-editor-primary,.photo-editor-discard .photo-editor-primary{background:#315b3b;border-color:#315b3b;color:#fff;min-width:94px}.photo-editor .photo-editor-primary:hover:not(:disabled),.photo-editor-discard .photo-editor-primary:hover{background:#244a2e;border-color:#244a2e}.photo-editor .photo-editor-footer-actions{gap:9px}.photo-editor-sr{position:absolute!important;width:1px;height:1px;padding:0!important;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0;margin:-1px!important}
.photo-editor-discard{width:min(430px,calc(100vw - 32px));padding:26px}.photo-editor-discard h2{font-family:inherit;font-size:1.2rem;margin:0 0 12px}.photo-editor-discard p{font-size:.9rem;color:#657068;line-height:1.6;margin:0 0 23px}.photo-editor-discard>div{display:flex;justify-content:flex-end;gap:10px}
@keyframes photo-editor-spin{to{transform:rotate(360deg)}}
@media(min-width:900px){.photo-editor-body{grid-template-columns:minmax(0,1fr) 272px}.photo-editor-preview{max-width:650px}}
@media(max-width:850px){.photo-editor{width:min(680px,calc(100vw - 32px))}.photo-editor-body{grid-template-columns:minmax(0,1fr);gap:24px;padding:16px 24px 24px}.photo-editor-preview{width:min(100%,520px);margin:auto}.photo-editor-controls{padding:0;display:grid;grid-template-columns:1fr 1fr;gap:20px}.photo-editor-controls-heading{grid-column:1/-1}.photo-editor-controls-heading>p{display:none}.photo-editor-controls-heading h3{margin-bottom:0}.photo-editor-quick{margin:0;grid-column:1/-1}.photo-editor-range{margin:0}.photo-editor-turns{align-items:start}.photo-editor-move{margin:0}.photo-editor-original-note{grid-column:1/-1;margin:0;padding-top:15px}.photo-editor-note{grid-column:1/-1;margin:0}}
@media(max-width:500px){.photo-editor{width:100%;max-height:100dvh;height:100dvh;border-radius:0;margin:0}.photo-editor-header{padding:16px;align-items:flex-start}.photo-editor-mark{display:none}.photo-editor-header p{font-size:.76rem;max-width:255px}.photo-editor-header h2{font-size:1.15rem}.photo-editor-body{padding:10px 16px 22px;gap:24px}.photo-editor-preview-bar{margin-bottom:6px}.photo-editor-workspace{padding:34px 28px;border-radius:10px}.photo-editor-hint{font-size:.68rem;margin-top:12px}.photo-editor-controls{gap:18px 14px}.photo-editor-controls-heading h3{font-size:1.1rem}.photo-editor-eyebrow{display:none}.photo-editor-controls-heading h3{margin:0}.photo-editor-footer{padding:12px 16px;align-items:center}.photo-editor-local{display:none}.photo-editor-footer>div{gap:6px}.photo-editor-footer button{padding:10px 13px}.photo-editor-original-note{display:none}.photo-editor-discard{padding:22px}.photo-editor-discard>div{display:grid;grid-template-columns:1fr 1fr}.photo-editor-discard button{padding:11px 7px}}
@media(prefers-reduced-motion:reduce){.photo-editor-loading::before{animation:none}}
@media(min-width:851px){.photo-editor-preview{width:min(100%,max(300px,calc(100dvh - 350px)));margin-inline:auto}}
/* Task 3: background and shadow controls, deliberately isolated from Seller Admin. */
.photo-editor-backgrounds,.photo-editor-shadows{margin:20px 0 0;min-width:0}.photo-editor-backgrounds h4,.photo-editor-shadows h4,.photo-editor-framing-title{font-family:inherit;font-size:.88rem;line-height:1.4;margin:0 0 12px}.photo-editor-backgrounds h5{font-family:inherit;font-size:.74rem;margin:18px 0 9px;color:#596a50;font-weight:650}.photo-editor-swatches,.photo-editor-presets,.photo-editor-my-backgrounds{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.photo-editor .photo-editor-swatch,.photo-editor .photo-editor-preset{position:relative;min-width:0;padding:5px;display:flex;flex-direction:column;gap:6px;font-size:.66rem;font-weight:550;border-radius:8px;line-height:1.25;text-align:center;justify-content:flex-start;overflow:hidden}.photo-editor-colour-chip,.photo-editor-preset-image{height:32px;display:block;width:100%;border:1px solid #e0e6dc;border-radius:4px}.photo-editor-preset-image{height:46px;overflow:hidden;display:grid;place-items:center;background:#f0f3ed;color:#687761;font-size:.62rem}.photo-editor-preset-image img{width:100%;height:100%;object-fit:cover;display:block}.photo-editor-checker{background-color:white;background-image:linear-gradient(45deg,#e4e9e0 25%,transparent 25%),linear-gradient(-45deg,#e4e9e0 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e4e9e0 75%),linear-gradient(-45deg,transparent 75%,#e4e9e0 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0}.photo-editor button[aria-pressed=true]{border-color:#315b3b;box-shadow:0 0 0 1px #315b3b;background:#f0f5ec}.photo-editor-swatch[aria-pressed=true]::after,.photo-editor-preset[aria-pressed=true]::after{content:'✓';position:absolute;right:7px;top:7px;display:grid;place-items:center;background:#315b3b;color:white;border-radius:50%;width:15px;height:15px;font-size:10px}.photo-editor-custom{display:flex;align-items:center;justify-content:space-between;font-size:.78rem;gap:12px;margin-top:14px;min-height:44px}.photo-editor-custom>span{display:flex;align-items:center;gap:7px}.photo-editor-custom input{width:44px;height:36px;padding:3px;border:1px solid #cdd9c7;border-radius:6px;background:white;cursor:pointer}.photo-editor-custom output{font-size:.65rem;font-variant-numeric:tabular-nums;color:#647359}.photo-editor-empty-presets,.photo-editor-opaque-note,.photo-editor-shadows>p{font-size:.72rem;line-height:1.55;color:#65745c;margin:0}.photo-editor-empty-presets{padding:11px 12px;background:#f4f6ef;border:1px dashed #d8e0d1;border-radius:7px}.photo-editor-opaque-note{background:#f7f3e7;border-radius:7px;padding:10px;margin-top:12px}.photo-editor-background-status p{font-size:.74rem;line-height:1.5;color:#7e4c39;margin:9px 0 0}.photo-editor-background-status p:empty{display:none}.photo-editor-background-status button{font-size:.73rem;min-height:36px;margin-top:6px;padding:8px}.photo-editor-shadows>div{display:grid;grid-template-columns:1fr 1fr;gap:8px}.photo-editor-shadows>div>button{font-size:.79rem}.photo-editor-shadows>p{margin:9px 0 0}.photo-editor-framing-title{border-top:1px solid var(--line,#dce5de);padding-top:20px;margin:24px 0 -6px}.photo-editor-backgrounds h4,.photo-editor-shadows h4,.photo-editor-framing-title{font-weight:700}.photo-editor-original-note{margin-top:20px}
@media(min-width:851px){.photo-editor-body{height:calc(100dvh - 220px);grid-template-rows:minmax(0,1fr);overflow:hidden}.photo-editor-preview{width:min(100%,max(300px,calc(100dvh - 370px)))}.photo-editor-controls{height:100%;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px 10px 20px 0;scrollbar-gutter:stable}}
@media(max-width:850px){.photo-editor-backgrounds,.photo-editor-shadows,.photo-editor-framing-title{grid-column:1/-1;margin:0}.photo-editor-shadows{padding-bottom:18px;border-bottom:1px solid var(--line,#dce5de)}.photo-editor-framing-title{padding:0;border:0}.photo-editor-custom{justify-content:flex-start}.photo-editor-backgrounds h5{margin-top:15px}.photo-editor-swatches{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(max-width:500px){.photo-editor-swatches{grid-template-columns:repeat(3,minmax(0,1fr))}.photo-editor-custom input{height:44px}.photo-editor-controls-heading h3{font-size:1.1rem}}
/* Explicit save feedback remains outside the scrolling adjustments. */
.photo-editor-save-message{flex:none;padding:10px 26px;background:#f7f3e7;border-top:1px solid #e8ddc3;font-size:.82rem;line-height:1.5;color:#654f28;max-height:26dvh;overflow:auto}.photo-editor-save-message p{margin:0}.photo-editor-save-message button{margin-top:8px}.admin-photo-save-note{font-size:.8rem;color:var(--muted,#64736c);line-height:1.5;margin:12px 0}
@media(max-width:500px){.photo-editor-save-message{padding:10px 16px;font-size:.76rem}}
/* Keep larger preset libraries compact; thumbnails load when they approach view. */
.photo-editor-presets,.photo-editor-my-backgrounds{max-height:320px;overflow-y:auto;overscroll-behavior:contain;align-content:start;padding:2px;scrollbar-gutter:stable}.photo-editor-preset-image{flex:none}

/* Shop library uses the same thumbnail choices as the preset library. */
.photo-editor-my-backgrounds{margin-top:12px;max-height:280px;overflow:auto;padding:2px}.photo-editor-library-tile{min-width:0;display:flex;flex-direction:column;gap:3px}.photo-editor-library-tile>.photo-editor-preset{width:100%;flex:1}.photo-editor .photo-editor-background-delete{font-size:.68rem;min-height:36px;padding:5px}[data-library-message]{font-size:.72rem;line-height:1.5;color:#65745c;margin:8px 0}.photo-editor [data-action=upload-background]{width:100%;font-size:.78rem;min-height:44px}[data-library-message]:empty{display:none}.photo-editor-library-tile .photo-editor-preset>span:last-child{overflow-wrap:anywhere}

.photo-editor-library-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:18px 0 9px}.photo-editor-backgrounds .photo-editor-library-heading h5{margin:0}.photo-editor-upload-info{position:relative;flex:none}.photo-editor-upload-info summary{display:grid;place-items:center;list-style:none;width:28px;height:28px;border:1px solid #cdd9c7;border-radius:50%;font-size:.78rem;font-weight:650;color:#596a50;cursor:pointer}.photo-editor-upload-info summary::-webkit-details-marker{display:none}.photo-editor-upload-info summary:hover{background:#f0f5ef}.photo-editor-upload-info p{position:absolute;z-index:3;right:0;top:calc(100% + 6px);width:min(260px,calc(100vw - 64px));margin:0;padding:10px 12px;border:1px solid #dce5de;border-radius:8px;background:#fff;box-shadow:0 4px 16px #10251d18;font-size:.72rem;line-height:1.6;color:#65745c}

/* Shadow presets share the existing alpha-shadow rendering and gesture history. */
.photo-editor-shadow-adjustments{margin-top:12px;border:1px solid #dce5de;border-radius:8px;padding:0 10px 10px}.photo-editor-shadow-adjustments summary{cursor:pointer;font-size:.78rem;font-weight:600;color:#596a50;min-height:44px;align-content:center}.photo-editor-shadow-adjustments:not([open]){padding-bottom:0}.photo-editor-shadow-adjustments .photo-editor-range{margin:8px 0 0}.photo-editor-shadow-adjustments .photo-editor-range>span{font-size:.76rem;margin-bottom:0}.photo-editor-shadow-adjustments .photo-editor-range output{font-size:.7rem}.photo-editor .photo-editor-shadow-adjustments button{width:100%;margin-top:8px;font-size:.74rem}.photo-editor-shadow-adjustments input{min-width:0}

.photo-editor-shop-style{margin-top:20px;border-bottom:1px solid var(--line,#dce5de);padding-bottom:18px;min-width:0}.photo-editor-shop-style h4{font-family:inherit;font-size:.88rem;font-weight:700;line-height:1.4;margin:0 0 4px}.photo-editor-shop-style p{font-size:.74rem;line-height:1.55;margin:8px 0;overflow-wrap:anywhere;color:#65745c}.photo-editor-style-actions{display:flex;flex-direction:column;gap:8px;margin-top:10px}.photo-editor .photo-editor-style-actions button,.photo-editor [data-action=reload-shop-style]{font-size:.76rem;width:100%}.photo-editor-style-preference{margin-top:14px}.photo-editor-style-preference label{display:flex;align-items:flex-start;gap:8px;font-size:.76rem;line-height:1.5;cursor:pointer}.photo-editor-style-preference input{margin:3px 0 0;accent-color:#315b3b;flex:none}.photo-editor-shop-style .photo-editor-style-subtitle{margin:0 0 10px}.photo-editor-shop-style .photo-editor-style-help{font-size:.69rem}.photo-editor-shop-style [data-shop-style-message]:empty{display:none}@media(max-width:850px){.photo-editor-shop-style{grid-column:1/-1;margin:0}.photo-editor-style-actions{flex-direction:row}.photo-editor-style-actions button{flex:1;min-width:0}}

/* An existing modal already dims the page when the photo editor is stacked. */
.photo-editor.photo-editor-stacked::backdrop{background:transparent}
/* Keep the product form mounted and its backdrop active, without exposed edges. */
html:has(.photo-editor.photo-editor-stacked[open]) #productEditorDialog[open]{visibility:hidden}
html:has(.photo-editor.photo-editor-stacked[open]) #productEditorDialog[open]::backdrop{visibility:visible}

/* Shared compact style workspace: the single editor and Bulk Edit use the same controls. */
:is(#bulkPhotoPanel,.photo-style-panel) .photo-style-tabs{display:flex;position:sticky;top:0;z-index:2;gap:6px;padding:8px;background:#f5f7f3;border-bottom:1px solid #dce5de}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-style-tabs button{flex:1;min-height:40px;border-color:transparent;background:transparent;font-size:.82rem;font-weight:650}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-style-tabs [aria-selected=true]{background:#fff;color:#164b38;box-shadow:0 1px 4px #10251d18;border-color:#cfdccb}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-style-body{padding:14px;min-width:0}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-style-body>section{padding:0;margin:0;border:0}
:is(#bulkPhotoPanel,.photo-style-panel) button{border:1px solid #cdd8cd;background:#fff;color:#234b36;border-radius:8px;min-height:40px;padding:8px;cursor:pointer;font:inherit;font-size:.78rem}
:is(#bulkPhotoPanel,.photo-style-panel) button[aria-pressed=true]{border-color:#315b3b;background:#eef4e8;box-shadow:inset 0 0 0 1px #315b3b}
:is(#bulkPhotoPanel,.photo-style-panel) button:focus-visible,:is(#bulkPhotoPanel,.photo-style-panel) [role=tabpanel]:focus-visible{outline:2px solid #315b3b;outline-offset:2px}
:is(#bulkPhotoPanel,.photo-style-panel) button:disabled{cursor:default;opacity:.5}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-style-colours{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin:-3px -3px 8px}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-swatches{display:flex;flex-wrap:wrap;gap:0}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-swatch{position:relative;display:grid;place-items:center;width:44px;height:44px;padding:5px;border:1px solid transparent;border-radius:50%;background:transparent;box-sizing:border-box;overflow:visible}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-swatch>span:last-child,:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-custom output{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-colour-chip{width:30px;height:30px;border-radius:50%;box-sizing:border-box}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-swatch[aria-pressed=true]::after{right:0;top:0}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-custom{position:relative;display:block;width:44px;height:44px;min-height:44px;margin:0;font-size:0;cursor:pointer}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-custom.is-selected{border-radius:50%;box-shadow:inset 0 0 0 2px #315b3b}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-custom>span{display:block}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-custom::after{content:'+';position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;font-size:1.3rem;color:#234b36;text-shadow:0 0 3px #fff}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-custom input{display:block;box-sizing:border-box;width:38px;height:38px;margin:3px;padding:4px;border:1px solid #bccab8;border-radius:50%;background:#fff;cursor:pointer}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-custom input::-webkit-color-swatch-wrapper{padding:0}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-custom input::-webkit-color-swatch{border:0;border-radius:50%}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-custom input::-moz-color-swatch{border:0;border-radius:50%}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-backgrounds h5{margin:12px 0 9px;font-size:.8rem}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-presets,:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-my-backgrounds{grid-template-columns:repeat(3,minmax(0,1fr));max-height:none;overflow:visible;gap:8px;scrollbar-gutter:auto}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-preset{position:relative;display:flex;flex-direction:column;gap:5px;overflow:hidden;justify-content:flex-start;text-align:center;padding:4px;min-width:0;font-size:.66rem}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-preset-image{height:72px}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-preset>span:last-child{overflow-wrap:anywhere;line-height:1.35}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-library-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:18px 0 9px;flex-wrap:wrap}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-library-heading h5{margin:0}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-upload-info[open]{flex-basis:100%;display:flex;flex-wrap:wrap;justify-content:flex-end}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-upload-info p{position:static;flex-basis:100%;width:auto;margin-top:6px;box-sizing:border-box}
:is(#bulkPhotoPanel,.photo-style-panel) [data-action=upload-background]{width:100%;min-height:44px;font-size:.78rem}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-background-delete{min-height:40px;font-size:.68rem;padding:5px}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-shadows>div{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-shadows>div button{min-height:44px}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-shadow-adjustments{margin-top:14px}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-range{margin:10px 0}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-range>span{display:flex;justify-content:space-between}
:is(#bulkPhotoPanel,.photo-style-panel) .photo-editor-range input{width:100%;min-height:40px;accent-color:#315b3b}
:is(#bulkPhotoPanel,.photo-style-panel) [data-action=reset-shadow]{width:100%;margin-top:10px}

/* Interactive editor frame: geometry tools stay beside the canvas, styling scrolls separately. */
.photo-editor{width:min(1160px,calc(100vw - 48px));height:min(860px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);margin:auto}
.photo-editor-header{padding:20px 24px}
.photo-editor-header h2{margin:0;font-size:1.35rem}
.photo-editor .photo-editor-icon[data-action=cancel]{border-radius:50%;background:#edf3e7}
.photo-editor-body{flex:1;height:auto;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(340px,1fr);grid-template-rows:minmax(0,1fr);gap:24px;padding:16px 24px 20px;overflow:hidden;min-height:0}
.photo-editor-preview{width:100%;max-width:608px;margin:0;align-self:start;min-height:0}
.photo-editor-preview-bar{position:relative;height:44px;gap:6px;justify-content:flex-start;margin:0 0 8px;z-index:4}
.photo-editor-quick{display:flex;gap:6px;margin:0}
.photo-editor-quick button,.photo-editor-framing>summary{min-height:40px;font-size:.75rem;padding:8px 10px;white-space:nowrap}
.photo-editor-history{margin-left:auto;flex:none}
.photo-editor .photo-editor-history button{width:36px;min-width:36px;padding:8px}
.photo-editor-framing{margin:0;min-width:0}
.photo-editor-framing>summary{cursor:pointer;list-style:none;border:1px solid #dce5de;border-radius:8px;color:#234b36;font-weight:650;align-content:center}
.photo-editor-framing>summary::-webkit-details-marker{display:none}
.photo-editor-framing>summary::after{content:'⌄';margin-left:6px}
.photo-editor-framing[open]>summary{background:#eef4e8;border-color:#315b3b}
.photo-editor-framing-options{position:absolute;top:calc(100% + 8px);right:0;z-index:5;background:#fff;border:1px solid #dce5de;border-radius:12px;box-shadow:0 8px 24px #10251d26;padding:16px;width:min(330px,100%);max-height:min(430px,calc(100dvh - 220px));overflow-y:auto;overscroll-behavior:contain}
.photo-editor-framing-options .photo-editor-range{margin:0 0 12px}
.photo-editor-framing-options .photo-editor-move{margin:14px 0 0}
.photo-editor-workspace{padding:28px;width:min(100%,606px,calc(100dvh - 310px));margin:auto;border:0;background:transparent;border-radius:12px}
.photo-editor-surface{border-radius:8px;box-shadow:0 0 0 1px #dce5de}
.photo-editor-hint{margin:4px 0 0;font-size:.73rem}
.photo-editor-controls{display:flex;flex-direction:column;gap:12px;min-height:0;height:100%;padding:0;overflow:hidden;scrollbar-gutter:auto}
.photo-editor-controls>.photo-style-panel{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;border:1px solid #dce5de;border-radius:12px;isolation:isolate}
.photo-editor-shop-style{flex:none;max-height:45%;overflow-y:auto;scrollbar-gutter:stable;margin:0;padding:12px 14px;border:1px solid #dce5de;border-radius:12px;background:#f8faf6}
.photo-editor-shop-overview{display:flex;gap:10px;align-items:center;justify-content:space-between}
.photo-editor-shop-overview>div{min-width:0}
.photo-editor-shop-style h4{font-size:.85rem;margin:0}
.photo-editor-shop-style p{font-size:.73rem;margin:4px 0 0;line-height:1.45}
.photo-editor .photo-editor-shop-overview button{flex:none;font-size:.73rem;padding:9px;min-height:40px}
.photo-editor-shop-manage{margin-top:8px}
.photo-editor-shop-manage>summary{font-size:.74rem;cursor:pointer;min-height:32px;align-content:center;color:#234b36}
.photo-editor-style-actions{margin-top:6px}
.photo-editor-style-preference{margin-top:10px}
.photo-editor-style-preference input{width:18px;height:18px}
.photo-editor-style-preference label{font-size:.73rem}
.photo-editor-controls>.photo-editor-note{flex:none;margin:0;max-height:20%;overflow:auto}
.photo-editor-footer{background:#f7f9f6;padding:16px 24px}
.photo-editor .photo-editor-primary{background:#103e2c;border-color:#103e2c;min-width:150px}
.photo-editor-local{display:none}
@media(max-width:1000px) and (min-width:851px){
 .photo-editor-body{gap:14px;padding-inline:16px;grid-template-columns:minmax(0,1.15fr) minmax(320px,1fr)}
 .photo-editor-preview-bar{flex-wrap:wrap;height:auto;min-height:44px}
 .photo-editor-quick button,.photo-editor-framing>summary{padding-inline:7px;font-size:.7rem}
}
@media(max-width:850px){
 .photo-editor{width:min(720px,calc(100vw - 24px));height:calc(100dvh - 24px);max-height:calc(100dvh - 24px)}
 .photo-editor-body{display:flex;flex-direction:column;gap:12px;padding:8px 16px 14px;overflow:hidden;scrollbar-gutter:auto}
 .photo-editor-preview{flex:none;max-width:none;width:100%;margin:0;position:relative;z-index:3;background:#fff}
 .photo-editor-preview-bar{max-width:520px;margin:0 auto 4px}
 .photo-editor-workspace{width:min(100%,390px,calc(42dvh + 20px));padding:28px}
 .photo-editor-controls{height:auto;overflow:hidden;flex:1;min-height:0;gap:10px}
 .photo-editor-controls>.photo-style-panel{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable}
 .photo-editor-shop-style{max-height:44%;overflow-y:auto;scrollbar-gutter:stable}
 .photo-editor .photo-style-tabs{top:0}
 .photo-editor-hint{font-size:.68rem}
}
@media(max-width:500px){
 .photo-editor{width:100%;height:100dvh;max-height:100dvh;border-radius:0;margin:0}
 .photo-editor-header{padding:12px 16px}
 .photo-editor-body{padding:6px 10px 12px;gap:8px}
 .photo-editor-preview-bar{gap:4px}
 .photo-editor-quick{gap:4px}
 .photo-editor-quick button,.photo-editor-framing>summary{font-size:.68rem;padding:8px 6px}
 .photo-editor .photo-editor-history button{width:32px;min-width:32px;padding:6px}
 .photo-editor-workspace{width:min(100%,350px,calc(37dvh + 20px))}
 .photo-editor-footer{padding:12px 16px}
 .photo-editor .photo-editor-primary{min-width:110px}
 .photo-editor-shop-overview{gap:6px}
 .photo-editor-shop-style{padding:10px}
 .photo-editor .photo-editor-shop-overview button{font-size:.68rem}
}

/* Preserve Bulk Edit's existing compact controls on short touch viewports. */
@media(max-width:899px) and (max-height:700px){
 #bulkPhotoPanel .photo-style-tabs{padding:6px}
 #bulkPhotoPanel .photo-style-tabs button{min-height:36px}
 #bulkPhotoPanel .photo-style-body{padding:10px}
}
