@media(min-width:851px){main{max-width:1640px}.workspace{grid-template-columns:325px 190px minmax(0,1fr);gap:22px}.photo-library{position:sticky;top:16px;max-height:calc(100dvh - 32px);overflow-y:auto;scrollbar-color:#f62acb #252a30;scrollbar-width:thin}}
.photo-library{box-sizing:border-box;min-width:0;padding:16px 12px;background:#2e353d;border:1px solid #a86de7;border-radius:18px;box-shadow:0 0 16px #ab53ef22;color:#f5f2f8;align-self:start}.photo-library h2{font-size:20px;margin:0 0 10px}.photo-library p{font-size:12px;line-height:1.5;margin:8px 0 12px}.photo-library-actions{display:grid;gap:8px}.photo-library-actions button{width:100%;font-size:12px;padding:10px 5px;border:1px solid #be7cff;border-radius:10px;background:#46315c;color:white}.photo-library-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.photo-library-item{position:relative;min-width:0}.photo-library-item>button[data-photo]{padding:0;display:block;width:100%;aspect-ratio:1;border:2px solid transparent;border-radius:9px;background:#1c2027;overflow:hidden;cursor:grab}.photo-library-item img{width:100%;height:100%;object-fit:cover;display:block}.photo-library-item>button.is-selected{border-color:#f62acb;box-shadow:0 0 9px #f62acb}.photo-library-remove{position:absolute;right:3px;top:3px;width:22px;height:22px;padding:0!important;border:0;border-radius:50%;background:#17151edb;color:white;font-size:18px}.photo-library small{display:block;font-size:10px;line-height:1.5;color:#c4bdce;margin-top:14px}.photo-library-clear{font-size:11px;margin-top:12px;padding:7px}.photo-library-empty{padding:20px 8px;text-align:center;border:1px dashed #9982ab;border-radius:10px}.photo-library.is-dragging{outline:3px solid #f62acb}.photo-library [hidden]{display:none!important}
@media(min-width:851px) and (max-width:1100px){.workspace{grid-template-columns:285px 150px minmax(0,1fr);gap:14px}.photo-library{padding:12px 8px}}
@media(max-width:850px){.photo-library{order:0;width:100%;max-height:380px;overflow-y:auto}.photo-library-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.photo-library-actions{grid-template-columns:1fr 1fr}.photo-library p{margin:5px 0 9px}.photo-library small{margin-top:8px}}

.photo-library-used{position:absolute;left:4px;bottom:4px;min-width:23px;height:23px;display:grid;place-items:center;padding:0 5px;box-sizing:border-box;border-radius:7px;background:#c6ff33;color:#202323;font-size:13px;font-weight:800;box-shadow:0 1px 5px #0008;pointer-events:none}.library-drop-preview{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;object-fit:cover!important;opacity:.85;z-index:20;pointer-events:none!important;border-radius:inherit}.slot-upload{font-size:clamp(7px,1vw,12px)}

/* Selection belongs to text editors, never to photo placement gestures. */
.photo-library-item,.photo-library-item *,.stage,.stage *{-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.stage input,.stage textarea,.stage [contenteditable="true"]{-webkit-user-select:text;user-select:text}.photo-library-item>button[data-photo]{touch-action:none}.photo-library-item img{pointer-events:none}.photo-library-drag-ghost{position:fixed!important;width:100px!important;height:100px!important;object-fit:contain;background:#252a30;border:2px solid #c77dff;border-radius:9px;box-shadow:0 6px 20px #0008;pointer-events:none!important;z-index:2147483647;contain:strict;padding:3px;box-sizing:border-box}.album-photo-dragging,.album-photo-dragging *{-webkit-user-select:none!important;user-select:none!important;cursor:grabbing!important}.album-photo-dragging .library-drop-preview{outline:2px solid #c77dff}
