.gallery-editor { min-width:0; grid-column:1/-1; border:1px solid #ffffff24; padding:16px; border-radius:16px; }
.gallery-editor [hidden] { display:none !important; }
.gallery-editor-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:16px; }
.gallery-editor-image { display:flex; flex-wrap:wrap; align-items:center; gap:8px; min-width:0; padding:12px; background:#ffffff08; border-radius:12px; }
.gallery-editor-image img { width:100%; height:140px; object-fit:contain; }
.gallery-editor-image input { width:100%; min-width:0; }
.gallery-modal { padding:0; border:0; border-radius:18px; background:#141829; color:#fff; max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); overflow:auto; }
.gallery-modal::backdrop { background:#080b16df; }
.gallery-modal-shell { display:flex; flex-direction:column; align-items:center; gap:12px; padding:16px; min-width:0; }
.gallery-modal-close { align-self:flex-end; }
.gallery-modal button { font:inherit; color:inherit; background:#ffffff18; border:1px solid #ffffff50; padding:8px 12px; border-radius:8px; cursor:pointer; }
.gallery-modal button:focus-visible { outline:3px solid #ff647e; outline-offset:2px; }
.gallery-modal button:disabled { opacity:.4; cursor:default; }
.gallery-modal-stage { display:grid; place-items:center; max-width:100%; }
.gallery-modal-stage[data-orientation="image"] { width:min(860px,calc(100vw - 60px)); }
.gallery-modal-stage img { display:block; width:100%; height:auto; max-height:65dvh; object-fit:contain; }
.gallery-modal-stage[data-orientation="landscape"] { width:min(900px,calc(100vw - 60px),calc((100dvh - 190px)*16/9)); aspect-ratio:16/9; }
.gallery-modal-stage[data-orientation="portrait"] { width:min(380px,calc(100vw - 60px),calc((100dvh - 190px)*9/16)); aspect-ratio:9/16; }
.gallery-modal-stage iframe { display:block; width:100%; height:100%; border:0; }
.gallery-modal-caption { max-width:min(780px,calc(100vw - 60px)); margin:0; overflow-wrap:anywhere; text-align:center; }
.gallery-modal-nav { display:flex; justify-content:center; align-items:center; gap:12px; flex-wrap:wrap; }
.gallery-modal [hidden] { display:none !important; }
