.bg-edit [hidden]{display:none!important}
.bg-edit .bg-stage{display:grid;place-items:center;background:repeating-conic-gradient(#eee 0 25%,white 0 50%) 0 0/18px 18px;border-radius:12px;overflow:hidden;margin:.6rem 0}
.bg-edit .bg-stage canvas{display:block;max-width:100%;max-height:44vh;width:auto;height:auto;touch-action:none;cursor:crosshair}
.bg-edit .bg-row{display:flex;gap:.65rem;align-items:end;flex-wrap:wrap;margin:.65rem 0}
.bg-edit .bg-row label{flex:1;min-width:8rem}
.bg-edit input[type=color]{width:4rem;height:2.7rem;padding:.15rem}

.bg-edit .bg-upload{position:relative;display:grid;justify-items:center;gap:.25rem;padding:1.1rem;border:2px dashed #b1a5cd;border-radius:14px;cursor:pointer}
.bg-upload input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.bg-upload:focus-within{outline:2px solid currentColor}
.bg-edit .bg-tabs{display:flex;gap:.25rem;justify-content:center}
.bg-tabs button[aria-pressed=true]{background:#48236a;color:white;border-radius:1rem}
.bg-edit [data-download]{margin-top:.8rem}
.bg-edit .bg-stage{display:block;overflow:auto;max-height:44vh;container-type:inline-size;overscroll-behavior:contain}
.bg-edit .bg-scroll{width:max-content;min-width:100%;display:flex;justify-content:center}
.bg-edit .bg-frame{position:relative;width:calc(min(100cqw,var(--fit-height,44vh),var(--native,100cqw)) * var(--zoom,1));flex:none}
.bg-edit .bg-frame canvas{width:100%;height:auto;max-width:none;max-height:none}
.bg-frame [data-ghost]{position:absolute;inset:0;opacity:.22;pointer-events:none}
.bg-frame [data-ring]{position:absolute;transform:translate(-50%,-50%);box-sizing:border-box;border:1px solid white;box-shadow:0 0 0 1px #222;border-radius:50%;pointer-events:none}
.bg-edit .bg-brushes{justify-content:flex-start;flex-wrap:wrap}
