/* Shared selection surface. Product placement belongs to image_studio.css. */
#imageStudio .bx-body { flex:1; min-height:0; display:flex; --tint:rgba(255,59,107,.45); }
#imageStudio .bx-stage { position:relative; flex:1; min-width:0; overflow:hidden; background:#fff; touch-action:pinch-zoom; outline:none; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; }
#imageStudio[data-input=keyboard] .bx-stage:focus-visible { box-shadow:inset 0 0 0 2px #333; }
#imageStudio .bx-view { position:absolute; left:0; top:0; transform-origin:0 0; will-change:transform; }
#imageStudio .bx-view img, #imageStudio .bx-view canvas { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
#imageStudio .bx-view img { border-radius:2px; }
#imageStudio .bx-stage.is-hand { cursor:grab; }
#imageStudio .bx-stage.is-panning { cursor:grabbing; }
#imageStudio .bx-stage.has-cursor { cursor:none; }
#imageStudio .bx-cursor, #imageStudio .bx-ring { position:absolute; left:0; top:0; border-radius:50%; pointer-events:none; transform:translate(-50%,-50%); box-shadow:0 0 0 1.5px #fff, 0 0 0 2.5px rgba(0,0,0,.45), inset 0 0 0 1px rgba(0,0,0,.25); }
#imageStudio .bx-cursor { display:none; }
#imageStudio .bx-stage.has-cursor .bx-cursor, #imageStudio .bx-stage.kb-cursor .bx-cursor { display:block; }
#imageStudio .bx-cursor.is-sub { box-shadow:none; border:1.5px dashed #fff; outline:1px solid rgba(0,0,0,.35); }
#imageStudio .bx-cursor.is-sub::after { content:''; position:absolute; left:50%; top:50%; width:8px; height:1.5px; background:#fff; transform:translate(-50%,-50%); box-shadow:0 0 0 .5px rgba(0,0,0,.4); }
#imageStudio .bx-ring { left:50%; top:50%; opacity:0; background:var(--tint); }
#imageStudio .bx-mask.is-working { animation:bxpulse 1.1s ease-in-out infinite; }
@keyframes bxpulse { 50% { opacity:.35; } }
#imageStudio .bx-hint, #imageStudio .bx-pill { position:absolute; left:50%; top:14px; transform:translateX(-50%); padding:5px 10px; border-radius:5px; background:rgba(0,0,0,.7); color:#fff; font-size:13px; line-height:18px; white-space:nowrap; pointer-events:none; }
#imageStudio .bx-stack { position:absolute; right:10px; bottom:10px; display:flex; flex-direction:column; gap:8px; z-index:2; }
#imageStudio .bx-stack .studio-action { position:relative; width:36px; height:36px; }
#imageStudio .bx-stack .studio-action::after { content:''; position:absolute; inset:-4px; }
#imageStudio .bx-stack .studio-action svg { width:18px; height:18px; }
#imageStudio .bx-stack .studio-action:hover svg, #imageStudio .bx-stack .studio-action[aria-pressed=true] svg { opacity:1; }
#imageStudio .bx-stack .studio-action[aria-pressed=true] { background:rgba(0,0,0,.88); box-shadow:inset 0 0 0 1.5px #fff; }
#imageStudio .bx-stack .studio-action:disabled { opacity:.35; }
#imageStudio .bx-stack .bx-gap { height:4px; }
#imageStudio .bx-composer .studio-composer-row { min-height:32px; }
#imageStudio .bx-tools { gap:4px; min-width:0; }
#imageStudio .bx-tools .studio-icon { position:relative; width:32px; height:32px; color:#6f6b72; }
#imageStudio .bx-tools .studio-icon svg { width:18px; height:18px; }
#imageStudio .bx-tools .studio-icon::after, #imageStudio .bx-seg button::after { content:''; position:absolute; inset:-6px 0; }
#imageStudio .bx-seg button { width:32px; height:32px; border-radius:8px; }
#imageStudio .bx-seg::before { border-radius:8px; }
#imageStudio .bx-seg button::before { border-radius:6px; }
#imageStudio .bx-seg svg { width:18px; height:18px; }
#imageStudio .bx-seg { flex:none; margin-right:0; }
#imageStudio .bx-seg button[aria-pressed=true] { color:#38363b; }
#imageStudio .bx-tools .studio-icon:disabled:hover { background:none; }
#imageStudio .bx-dot { display:block; border-radius:50%; background:#5e5a61; }
#imageStudio .bx-sizebtn[aria-expanded=true] { background:var(--menu-hover); }
#imageStudio .bx-composer .studio-send:disabled { opacity:.35; }
#imageStudio .bx-pop { position:fixed; z-index:20; padding:8px; background:#fff; border:1px solid #e7e5e8; border-radius:11px; box-shadow:0 8px 28px rgba(0,0,0,.12); }
#imageStudio .bx-sizepop { display:flex; align-items:center; gap:14px; width:252px; padding:8px 12px 8px 16px; }
#imageStudio .bx-foot { flex:none; display:grid; place-items:center; width:64px; height:64px; }
#imageStudio .bx-foot span { display:block; border-radius:50%; background:var(--tint); box-shadow:0 0 0 1.5px #fff, 0 0 0 2.5px rgba(0,0,0,.35); max-width:60px; max-height:60px; }
#imageStudio .bx-range { appearance:none; -webkit-appearance:none; flex:1; min-width:0; height:44px; background:none; margin:0; cursor:pointer; }
#imageStudio .bx-range::-webkit-slider-runnable-track { height:4px; border-radius:2px; background:linear-gradient(90deg,#5e5a61 var(--v,36%),#e5e3e7 var(--v,36%)); }
#imageStudio .bx-range::-moz-range-track { height:4px; border-radius:2px; background:#e5e3e7; }
#imageStudio .bx-range::-moz-range-progress { height:4px; border-radius:2px; background:#5e5a61; }
#imageStudio .bx-range::-webkit-slider-thumb { -webkit-appearance:none; width:22px; height:22px; margin-top:-9px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.3), 0 0 0 1px rgba(0,0,0,.06); }
#imageStudio .bx-range::-moz-range-thumb { width:22px; height:22px; border:0; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.3); }
#imageStudio[data-input=keyboard] .bx-range:focus-visible { outline:2px solid #333; outline-offset:2px; }
@media (max-width:760px) {
  #imageStudio .bx-tools { gap:0; }
  #imageStudio .bx-seg { margin-right:2px; }
  #imageStudio .bx-stack { right:8px; bottom:72px; }
  #imageStudio .bx-hint, #imageStudio .bx-pill { top:10px; font-size:14px; }
  #imageStudio .bx-sizepop.is-sheet { left:0!important; right:0!important; bottom:0!important; top:auto!important; width:100%!important; border-radius:17px 17px 0 0; border:0; padding:14px 22px max(22px,env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion:reduce) { #imageStudio .bx-mask.is-working { animation:none; } }

/* Short landscape/keyboard viewports retain reachable 44px controls. */
#imageStudio .bx-stage.is-short .bx-stack { display:grid; grid-template-columns:36px 36px; bottom:8px; max-height:calc(100% - 16px); overflow-y:auto; overscroll-behavior:contain; padding:4px; margin:-4px; }
#imageStudio .bx-stage.is-short .bx-gap { display:none; }


/* Preserve the bottom control order; give history its own space on phones. */
#imageStudio .bx-tools .studio-setting[data-menu=quality] { margin:0 4px; }
#imageStudio .bx-history { display:flex; flex:none; gap:4px; margin-left:6px; }
#imageStudio .bx-history .studio-icon { position:relative; width:32px; height:32px; color:#65616a; }
#imageStudio .bx-history .studio-icon::after { content:''; position:absolute; inset:-6px 0; }
#imageStudio .bx-history svg { width:18px; height:18px; }
#imageStudio .bx-history .studio-icon:disabled { opacity:.35; }
#imageStudio .bx-history .studio-icon:disabled:hover { background:none; }
@media (max-width:600px) {
  #imageStudio .bx-history { position:absolute; left:11px; bottom:calc(100% + 6px); margin:0; padding:2px; border:1px solid #e7e4e9; border-radius:9px; background:#f7f6f8; }
}
