#background-media .background-viewport { position:absolute; overflow:hidden; pointer-events:none; }
.background-viewport > :is(img,video) { position:absolute; display:block; max-width:none; max-height:none; }
#bg-crop-dialog { box-sizing:border-box; width:min(96vw,540px); max-height:90dvh; padding:20px; border:1px solid #5c5044; border-radius:12px; color:#f3ede4; background:#222325; overflow:auto; }
#bg-crop-dialog::backdrop { background:rgb(10 11 12 / .78); }
#bg-crop-dialog h2 { font-size:21px; margin:0 0 6px; }
#bg-crop-dialog p { margin:0 0 12px; font-size:14px; color:#d4cbbf; }
#bg-crop-space { display:grid; place-items:center; background:#141516; height:clamp(145px,35dvh,300px); border-radius:6px; overflow:hidden; }
#bg-crop-photo { position:relative; overflow:hidden; touch-action:none; user-select:none; }
#bg-crop-thumb { width:100%; height:100%; display:block; }
#bg-crop-frame { position:absolute; border:2px solid #ffda98; box-shadow:0 0 0 120vmax rgb(0 0 0 / .56); cursor:move; box-sizing:border-box; }
#bg-crop-frame i { position:absolute; width:40px; height:40px; max-width:50%; max-height:50%; display:flex; }
#bg-crop-frame i::before { content:""; display:block; margin:1px; background:#fff5e5; border:1px solid #513b22; box-sizing:border-box; width:12px; height:12px; border-radius:2px; }
#bg-crop-frame [data-edge^=n] { top:0; align-items:flex-start; }
#bg-crop-frame [data-edge^=s] { bottom:0; align-items:flex-end; }
#bg-crop-frame [data-edge$=w] { left:0; justify-content:flex-start; }
#bg-crop-frame [data-edge$=e] { right:0; justify-content:flex-end; }
#bg-crop-frame :is([data-edge=nw],[data-edge=se]) { cursor:nwse-resize; }
#bg-crop-frame :is([data-edge=ne],[data-edge=sw]) { cursor:nesw-resize; }
.bg-crop-presets,.bg-crop-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
#bg-crop-dialog button { min-height:44px; padding:6px 14px; border:1px solid #60584f; border-radius:6px; background:#29292b; color:inherit; cursor:pointer; }
#bg-crop-dialog summary { min-height:44px; display:list-item; padding:10px 0; font-size:14px; cursor:pointer; }
.bg-crop-edges { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 14px; }
.bg-crop-edges label { font-size:13px; }
.bg-crop-edges output { float:right; color:#eac791; }
.bg-crop-edges input { display:block; width:100%; min-height:40px; accent-color:#eac791; margin:0; }
.bg-crop-actions { justify-content:flex-end; }
#bg-crop-apply { background:#e9c899!important; color:#231b14!important; font-weight:650; }
