.mobile-save-label,.mobile-photo-manager{display:none}
/* Explicit foreground/background pairs prevent inherited white hover text. */
.rounded-select-popup .rounded-option{color:var(--popup-fg);background:transparent}
.rounded-select-popup .rounded-option:hover,.rounded-select-popup .rounded-option:focus-visible,.rounded-select-popup .rounded-option:active{color:var(--popup-fg)!important;background:var(--popup-hover)!important}
.rounded-select-popup .rounded-option.is-selected{color:var(--popup-fg)!important;background:var(--popup-selected)!important}
[data-theme=dark] .rounded-select-popup .rounded-option:hover,[data-theme=dark] .rounded-select-popup .rounded-option:focus-visible,[data-theme=dark] .rounded-select-popup .rounded-option:active{color:var(--text)!important;background:var(--selected)!important}
@media(max-width:1100px){
 #product-dialog #save-product{display:flex!important;align-items:center!important;justify-content:center!important;font-size:15px!important;line-height:1!important;text-indent:0!important;padding:0!important}
 #product-dialog #save-product:after{content:none!important;display:none!important}
 #product-dialog #save-product .desktop-save-label{display:none}
 #product-dialog #save-product .mobile-save-label{display:inline;line-height:1;transform:none;margin:0;padding:0;color:inherit}
 #product-dialog .image-manager-heading{display:none}
 #product-dialog .mobile-image-carousel{display:none!important}
 #product-dialog .mobile-photo-manager{display:block;min-width:0;max-width:100%}
 .gallery-stage{position:relative;border-radius:16px;overflow:hidden;background:var(--input)}
 .gallery-track{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:none;-webkit-overflow-scrolling:touch;max-width:100%}
 .gallery-track::-webkit-scrollbar{display:none}
 .gallery-page{position:relative;flex:0 0 100%;width:100%;min-width:0;border:0;border-radius:0;background:transparent;padding:0;scroll-snap-align:start;scroll-snap-stop:always;cursor:zoom-in}
 #product-dialog .gallery-page img{display:block;width:100%;height:clamp(240px,68vw,370px)!important;object-fit:contain;border-radius:0;background:var(--input)}
 .gallery-counter{position:absolute;right:10px;bottom:10px;border-radius:10px;padding:5px 9px;background:#0008;color:#fff;font-size:12px;pointer-events:none}
 .gallery-main-badge,.gallery-unpublished{position:absolute;left:10px;top:10px;background:var(--accent);color:white;padding:5px 9px;border-radius:10px;font-size:12px}
 .gallery-unpublished{top:auto;bottom:10px;background:var(--danger);color:var(--page)}
 .gallery-thumbnails{display:flex;gap:7px;overflow-x:auto;scrollbar-width:none;padding:12px 0;overscroll-behavior-x:contain}
 .gallery-thumb{padding:2px;flex:0 0 50px;width:50px;height:55px;min-height:44px;border:2px solid transparent;border-radius:10px;background:var(--input);overflow:hidden}
 .gallery-thumb.active{border-color:var(--accent)}
 .gallery-thumb img{display:block;width:100%;height:100%;object-fit:cover;border-radius:6px}
 .gallery-current-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:2px}
 .gallery-current-actions button,.gallery-sort-button{background:var(--input);color:var(--text);border:1px solid var(--line);padding:8px 12px;min-height:44px;border-radius:12px;font-size:12px}
 .mobile-danger,.gallery-current-actions .mobile-danger{color:var(--danger)!important;border-color:var(--danger)!important;background:transparent!important}
 .gallery-status{width:100%;font-size:12px;color:var(--muted);margin:3px 0;line-height:1.5}
 .gallery-sort-button{width:100%;margin-top:10px}
 #product-dialog #image-preview>.image-upload-actions{justify-content:flex-start;margin-top:10px;gap:8px}
 #product-dialog .image-upload-actions button{min-height:44px!important;flex:1;padding:10px 12px!important;font-size:12px!important}
 #product-dialog #image-undo{flex:0 1 auto}
 .mobile-native-sheet,.mobile-select-sheet{position:fixed!important;inset:auto 0 0!important;top:auto!important;bottom:0!important;margin:0 auto!important;width:min(100%,700px)!important;max-width:100vw!important;max-height:85dvh!important;border:1px solid var(--line)!important;border-radius:24px 24px 0 0!important;background:var(--panel)!important;color:var(--text)!important;padding:10px 18px calc(22px + env(safe-area-inset-bottom))!important;box-sizing:border-box;overflow:auto;overscroll-behavior:contain}
 .mobile-native-sheet::backdrop,.mobile-select-sheet::backdrop{background:#0007;backdrop-filter:blur(6px)}
 .sheet-grabber{width:100%;height:28px;position:relative;touch-action:none;cursor:grab}
 .sheet-grabber:before{content:'';display:block;position:absolute;left:calc(50% - 19px);top:6px;width:38px;height:5px;border-radius:4px;background:var(--muted);opacity:.6}
 .sheet-title,.select-sheet-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
 .sheet-title h2,.select-sheet-header strong{font-size:18px;margin:0}
 .sheet-title button,.select-sheet-header button{border:0;background:transparent;color:var(--text);min-width:44px;min-height:44px;font-size:14px}
 .sheet-title button{color:var(--accent)}
 .sheet-note{color:var(--muted);font-size:13px;line-height:1.6;margin:8px 0 18px}
 .mobile-select-sheet .rounded-search{min-height:48px;font-size:16px;background:var(--input);color:var(--text);border-color:var(--line);position:static}
 .mobile-select-sheet .category-option-list{display:block}
 .mobile-select-sheet .rounded-option{display:block;width:100%;min-height:50px;padding:13px 14px;border-bottom:1px solid var(--line);font-size:15px;border-radius:10px}
 .mobile-select-sheet .rounded-option.is-selected:after{content:'✓';float:right;color:var(--accent);font-weight:700}
 .mobile-select-sheet .category-group-tabs{flex-wrap:nowrap;overflow:auto;scrollbar-width:none}
 .mobile-select-sheet .category-group-tab{flex:none;min-height:44px;white-space:nowrap}
 .sheet-stacked-actions{display:grid;gap:10px;margin-top:18px}
 .sheet-stacked-actions button{width:100%;min-height:50px;border-radius:14px;font-size:15px}
 #mobile-exit-sheet h2{text-align:center;font-size:21px;margin:10px 0}
 #mobile-exit-sheet .sheet-note{text-align:center}
 #mobile-exit-status{font-size:13px;color:var(--danger)}
 .gallery-sort-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;max-height:46dvh;overflow:auto;padding:5px}
 .sort-thumb{position:relative;border:2px solid transparent;border-radius:12px;padding:0;overflow:hidden;min-width:0;aspect-ratio:1;background:var(--input);touch-action:none}
 .sort-thumb.selected{border-color:var(--accent)}
 .sort-thumb img{width:100%;height:100%;object-fit:contain;pointer-events:none}
 .sort-thumb span{position:absolute;left:4px;top:4px;border-radius:6px;background:#0009;color:#fff;padding:4px 6px;font-size:11px;pointer-events:none}
 .sort-thumb:first-child span{background:var(--accent)}
 .sort-lifted{transform:scale(.95);opacity:.7}
 .gallery-sort-tools{display:flex;gap:10px;margin:14px 0}
 .gallery-sort-tools button,#gallery-sort-cancel{min-height:46px;flex:1;background:var(--input);color:var(--text);border:1px solid var(--line);border-radius:12px}
 #gallery-sort-cancel{width:100%}
 #gallery-sort-status{color:var(--danger);font-size:12px}
 #mobile-image-viewer{position:fixed!important;inset:0!important;width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;padding:12px 14px calc(14px + env(safe-area-inset-bottom))!important;margin:0!important;border:0!important;border-radius:0!important;background:var(--page)!important;color:var(--text);display:none;flex-direction:column;overflow:hidden}
 #mobile-image-viewer[open]{display:flex}
 .gallery-viewer-header{display:grid;grid-template-columns:44px 1fr 44px;align-items:center;min-height:50px;margin-bottom:12px}
 .gallery-viewer-header button{width:44px;height:44px;border:1px solid var(--line);border-radius:50%;background:var(--panel);color:var(--text);font-size:25px;display:flex;align-items:center;justify-content:center;padding:0}
 .gallery-viewer-header .gallery-counter{position:static;justify-self:center;background:transparent;color:var(--text);font-size:15px}
 #mobile-image-viewer>.gallery-track{flex:1;min-height:0}
 #mobile-image-viewer .gallery-page img{width:100%;height:100%;object-fit:contain;max-height:100%}
 #mobile-image-viewer .gallery-main-badge{display:none}
 #mobile-image-viewer .gallery-current-actions button{flex:1;min-height:46px;font-size:14px}
 .gallery-hint{margin:10px 0 0;text-align:center;color:var(--muted);font-size:12px}
 .right-column .selection{padding:12px 16px calc(108px + env(safe-area-inset-bottom))}
 .right-column .selection-title{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:10px;margin-bottom:18px;padding:10px 12px}
 .right-column .selection-title h2{font-size:23px;letter-spacing:-.5px}
 .selection-intro{display:none!important}
 .selected-products{width:100%;max-width:100%;overflow-x:hidden!important;max-height:37dvh}
 .selected-row{display:grid!important;grid-template-columns:58px minmax(0,1fr) 44px!important;gap:10px;align-items:center;min-width:0;width:100%;box-sizing:border-box}
 .selected-row>div{min-width:0}.selected-row strong{white-space:normal;overflow-wrap:anywhere}.selected-row img{width:58px;height:66px;object-fit:contain}
 .selected-row button.remove{width:44px!important;min-width:44px;justify-self:end;position:static!important;margin:0!important}
 .selection .export-area{display:flex!important;flex-direction:column;gap:14px;margin-top:18px!important}
 .selection .store-target{order:0!important;margin:0}.selection .mobile-extra-tools{order:1!important;margin:0}.selection .mobile-extra-tools button{text-align:left;min-height:56px}
 .selection #export{order:2!important}.selection #export-status{order:3!important;padding:0 4px;margin:0;font-size:13px}
 .mobile-extra-tools #mobile-batch-facts{display:none!important}
}

@media(max-width:1100px){.right-column .selection-title{grid-template-columns:84px minmax(0,1fr) 38px}.right-column .selection-title h2{grid-column:2;grid-row:1;justify-self:center;font-size:20px;white-space:nowrap}.right-column .selection-title .pill{grid-column:3;grid-row:1}.right-column #mobile-close-selection{grid-column:1;grid-row:1;justify-self:start;font-size:13px;padding:0}.gallery-current-actions button:disabled{opacity:.5}}

@media(max-width:1100px){.mobile-photo-manager .gallery-current-actions [data-gallery-copy],.mobile-photo-manager .gallery-current-actions [data-gallery-remove]{display:none}.mobile-photo-manager .gallery-current-actions:empty{display:none}#product-dialog .image-upload-actions #gallery-sort{flex:0 1 auto;width:auto;margin:0;padding:8px 12px!important}.mobile-photo-manager .gallery-current-actions{margin:0}}

/* Selection generation belongs to the shop card, not the viewport dock. */
@media(max-width:1100px){
 .selection .export-area{flex:0 0 auto!important}
 .selection .store-target #export{position:static!important;inset:auto!important;transform:none!important;width:100%!important;margin:16px 0 0!important;box-shadow:none!important;min-height:52px}
}

/* Mobile store selection shares the centered form dialog treatment. */
@media(max-width:1100px){
 dialog.mobile-store-dialog{inset:0!important;margin:auto!important;top:0!important;bottom:0!important;width:calc(100% - 32px)!important;max-width:700px!important;height:fit-content!important;max-height:calc(100dvh - 48px)!important;border-radius:24px!important;padding:24px 20px!important}
 .mobile-store-dialog>.sheet-grabber{display:none}
 .mobile-store-dialog .select-sheet-header{margin-bottom:20px}
 .mobile-store-dialog .select-sheet-header strong{font-size:20px}
 #batch-close,.mobile-store-dialog .store-dialog-close,.selected-row button.remove{position:relative!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 44px!important;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;max-width:44px!important;max-height:44px!important;box-sizing:border-box!important;border-radius:50%!important;padding:0!important;font-size:0!important;line-height:1!important;text-indent:0!important;border:1px solid var(--line)!important;background:var(--input)!important;color:var(--text)!important}
 #batch-close::before,#batch-close::after,.mobile-store-dialog .store-dialog-close::before,.mobile-store-dialog .store-dialog-close::after,.selected-row button.remove::before,.selected-row button.remove::after{content:''!important;display:block!important;position:absolute!important;left:50%!important;top:50%!important;width:18px!important;height:2px!important;border-radius:1px;background:currentColor!important;transform:translate(-50%,-50%) rotate(45deg)!important;margin:0!important}
 #batch-close::after,.mobile-store-dialog .store-dialog-close::after,.selected-row button.remove::after{transform:translate(-50%,-50%) rotate(-45deg)!important}
 .selection-title #selected-count{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;padding:0!important;border-radius:50%!important;box-sizing:border-box;line-height:1!important;flex:none}
}

button.ui-close-icon{position:relative;display:inline-flex;align-items:center;justify-content:center;padding:0!important;font-size:0!important;line-height:1!important;text-indent:0!important}
button.ui-close-icon::before,button.ui-close-icon::after{content:''!important;position:absolute;display:block;left:50%;top:50%;width:18px;height:2px;border-radius:1px;background:currentColor;transform:translate(-50%,-50%) rotate(45deg);pointer-events:none}
button.ui-close-icon::after{transform:translate(-50%,-50%) rotate(-45deg)}
#batch-dialog .batch-heading.listing-heading{background:transparent!important;box-shadow:none!important;backdrop-filter:none!important}
@media(max-width:1100px){
 #mobile-exit-sheet{inset:0!important;top:0!important;bottom:0!important;margin:auto!important;height:fit-content!important;width:calc(100% - 40px)!important;max-width:380px!important;max-height:calc(100dvh - 48px)!important;border-radius:24px!important;padding:46px 20px 22px!important}
 #mobile-exit-sheet #mobile-exit-continue{position:absolute!important;right:12px;top:10px;width:44px;height:44px;min-width:44px;min-height:44px;border-radius:50%;border:1px solid var(--line);background:var(--input);color:var(--text)}
 #mobile-exit-sheet .sheet-stacked-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
 #mobile-exit-sheet .sheet-stacked-actions button{min-width:0;min-height:48px;padding:10px 6px;font-size:14px}
 #mobile-exit-discard{grid-column:1;grid-row:1}#mobile-exit-save{grid-column:2;grid-row:1}
}
