.gallery-toolbar,.gallery-dialog-head,.gallery-actions,.gallery-path{display:flex;align-items:center;gap:8px}
.gallery-toolbar,.gallery-dialog-head{justify-content:space-between;flex-wrap:wrap;margin-bottom:12px}
.gallery-path{flex-wrap:wrap;min-width:0;font-size:.9rem;overflow-wrap:anywhere}
.gallery-path strong{font-size:1rem}
.gallery-link{border:0;background:none;color:var(--muted);padding:6px 1px;font-size:inherit;cursor:pointer}
.gallery-link:hover{text-decoration:underline}
.gallery-status{padding:8px 0;color:var(--muted);font-size:.86rem}
.gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,142px),1fr));gap:9px}
.gallery-tile{min-width:0;display:grid;align-content:start;gap:7px;padding:8px;border:1px solid var(--line);border-radius:9px;background:var(--card);color:var(--text,var(--ink));text-align:start;cursor:pointer}
.gallery-tile:hover{border-color:var(--accent)}
.gallery-title{min-width:0;overflow-wrap:anywhere;font-size:.85rem;font-weight:650;padding:0 3px 2px}
.gallery-photo img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:5px;background:var(--bg,var(--canvas))}
.gallery-folder{align-content:center;min-height:74px}
.gallery-folder-icon{position:relative;width:24px;height:17px;margin:6px 3px 0;border:1px solid var(--accent);border-radius:4px;background:var(--soft,var(--accent-soft))}
.gallery-folder-icon::before{position:absolute;content:'';width:9px;height:4px;top:-5px;left:-1px;border:1px solid var(--accent);border-bottom:0;border-radius:3px 3px 0 0;background:inherit}
.gallery-dialog-head h2{font-size:1.05rem;overflow-wrap:anywhere}
.gallery-dialog .gallery-full{display:block;width:100%;max-height:65vh;object-fit:contain;margin:8px 0}
.gallery-full:not([src]){display:none}

.gallery-upload-preview{display:grid;gap:6px;margin-bottom:10px}
.gallery-upload-preview img{width:100%;max-height:180px;object-fit:contain}
.gallery-upload-preview button{justify-self:start}
