[data-upload-reorder="true"], [data-upload-reorder="true"] button:has(img) { cursor: grab; }
[data-upload-reorder="true"] img { -webkit-user-drag: none; user-select: none; }
html.image-order-dragging, html.image-order-dragging * { cursor: grabbing !important; user-select: none !important; }
.image-order-placeholder { outline: 2px dashed #1685ff !important; outline-offset: -2px; background: #1685ff16 !important; border-radius: 12px; }
.image-order-placeholder > * { opacity: 0 !important; }
.image-order-group { scroll-snap-type: none !important; scroll-behavior: auto !important; overflow-anchor: none; }
.image-order-cross-target { outline: 2px solid #1685ff; outline-offset: 2px; box-shadow: 0 0 0 5px #1685ff18; }
.image-order-ghost { position: fixed; z-index: 2147483000; pointer-events: none; opacity: .88; padding: 6px; box-sizing: border-box; border: 2px solid #1685ff; border-radius: 14px; background: #23374be8; box-shadow: 0 14px 38px #00172d55,0 0 0 4px #1685ff20; transform: scale(1.035); overflow: hidden; }
.image-order-ghost img { width: 100%; height: 100%; display: block; object-fit: contain; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { .image-order-ghost { transform: none; } }

.universal-selection-bar:not([hidden]) { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin:0 0 14px; padding:8px 12px; border:1px solid #1685ff55; border-radius:12px; background:#1685ff12; color:var(--text-primary, #559fff); font-size:12px; }
.universal-thumbnail.image-order-selected { outline:2px solid #1685ff; outline-offset:2px; border-radius:12px; box-shadow:0 0 0 5px #1685ff1c; }
.universal-thumbnail .image-order-selection-mark { display:none; }
.universal-thumbnail.image-order-selected .image-order-selection-mark { display:grid; place-items:center; position:absolute; top:73px; right:5px; width:21px; height:21px; border-radius:50%; border:2px solid #fff; background:#1685ff; color:#fff; font-style:normal; font-size:12px; box-shadow:0 1px 5px #00172d44; pointer-events:none; }
.image-order-ghost-count { position:absolute; right:7px; bottom:7px; padding:4px 8px; border:1px solid #ffffff88; border-radius:8px; background:#1685ff; color:#fff; font-size:12px; font-weight:600; box-shadow:0 2px 6px #00172d44; }
.image-upload-container {min-height:64px;}
.image-upload-selectable {position:relative;}
.image-upload-selected {outline:2px solid #1685ff!important;outline-offset:2px;border-radius:10px;box-shadow:0 0 0 5px #1685ff20;}
.image-upload-selected:not(img)::after {content:'✓';position:absolute;right:6px;bottom:6px;width:20px;height:20px;display:grid;place-items:center;background:#1685ff;border:2px solid white;border-radius:50%;color:white;font:12px sans-serif;pointer-events:none;z-index:6;}
.image-upload-selection-bar:not([hidden]) {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;grid-column:1/-1;padding:9px 12px;margin:10px 0 14px;border:1px solid #1685ff55;border-radius:12px;background:#1685ff10;color:#1685ff;font-size:12px;}
.image-upload-selection-bar>div {display:flex;gap:12px;align-items:center;}
.image-upload-selection-bar button {border:0;background:transparent;padding:5px;color:inherit;font:inherit;cursor:pointer;}
.image-upload-selection-bar [data-image-selection=delete] {border:1px solid currentColor;border-radius:8px;color:#dd665e;padding:5px 10px;}
.image-upload-selection-bar button:disabled {opacity:.4;cursor:not-allowed;}
.image-upload-selection-bar button:focus-visible {outline:2px solid #1685ff;outline-offset:2px;}
.image-order-cross-denied {outline:2px dashed #e75e56;outline-offset:2px;}
.motion-image-library {display:flex;flex-wrap:wrap;gap:10px;margin:12px 0;}
.motion-image-source {width:96px;padding:0;border:1px solid #1685ff40;border-radius:10px;}
.motion-image-source img {width:96px;height:88px;object-fit:contain;}
.motion-image-source small {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
