/* responsive-parity-fixes-r1 item 6: /gallery on phones (<=520 px). Compact 2-column view is the default; html.gxm-large (toggle, remembered per device) restores the existing large cards.
   Filters (media chips, sort, collections, search) sit behind a Filters button and open as a bottom sheet (the same #galleryControls element, no DOM moved). Tablet/desktop untouched. */
.gxm-bar,.gxm-more,.gxm-done,.gxm-back,.gxm-actions{display:none}
@media (max-width:520px){
html .gx-controls{top:54px}
#galleryControls:not(.gxm-open)>:not(.gallery-view-tabs):not(.gxm-bar){display:none!important}
.gxm-bar{display:flex;align-items:center;gap:8px;flex:1 1 100%;margin-top:8px}
#galleryControls.gxm-open .gxm-bar{display:none}
.gxm-filters,.gxm-view button,.gxm-done,.gxm-act{box-sizing:border-box;min-height:44px;border-radius:999px;border:1px solid rgba(255,255,255,.24);background:#16161f;color:#fff;font:600 14px/1 Inter,system-ui,sans-serif;cursor:pointer;padding:0 16px}
.gxm-filters{flex:1 1 auto;display:inline-flex;align-items:center;justify-content:center;gap:8px}
.gxm-count{min-width:20px;height:20px;border-radius:10px;background:#c6ff3d;color:#0a0a0f;font-size:12px;display:inline-flex;align-items:center;justify-content:center;padding:0 5px}
.gxm-count[hidden]{display:none}
.gxm-view{display:inline-flex;gap:4px}
.gxm-view button{min-width:44px;padding:0 12px}
.gxm-view button[aria-pressed="true"]{background:#c6ff3d;border-color:#c6ff3d;color:#0a0a0f}
.gxm-filters:focus-visible,.gxm-view button:focus-visible,.gxm-done:focus-visible,.gxm-act:focus-visible,.gxm-more:focus-visible{outline:3px solid #fff;outline-offset:2px}
#galleryControls.gxm-open{position:fixed!important;left:0;right:0;bottom:0;top:auto!important;margin:0!important;z-index:9100;max-height:80svh;overflow:auto;box-sizing:border-box;background:#13131c;border-radius:18px 18px 0 0;border-top:1px solid rgba(255,255,255,.14);padding:16px 16px calc(16px + env(safe-area-inset-bottom,0px))!important;display:flex;flex-wrap:wrap;gap:10px;box-shadow:0 -20px 60px rgba(0,0,0,.6)}
#galleryControls.gxm-open .gxm-done{order:99;display:inline-flex;align-items:center;justify-content:center;flex:1 1 100%;background:#c6ff3d;border-color:#c6ff3d;color:#0a0a0f}
.gxm-back{position:fixed;inset:0;z-index:9099;background:rgba(4,4,8,.7)}
.gxm-back.is-on{display:block}
/* compact cards */
html:not(.gxm-large) .gallery-main-landmark .gallery-grid{columns:2;column-gap:6px}
html:not(.gxm-large) .gallery-main-landmark .image-card{margin-bottom:6px;border-radius:12px}
html:not(.gxm-large) .gallery-main-landmark .card-overlay{opacity:1;padding:30px 44px 8px 8px;gap:2px}
html:not(.gxm-large) .gallery-main-landmark .card-overlay :is(.card-category,.card-prompt,.card-use-prompt,.card-meta-row,.card-ts,.card-username,.card-username-follow,.card-partof,.card-model){display:none}
html:not(.gxm-large) .gallery-main-landmark .card-title{font-size:13px;line-height:1.25;-webkit-line-clamp:2}
html:not(.gxm-large) .image-card :is(.card-fav,.card-save,.card-share){display:none}
html:not(.gxm-large) .image-card .gxm-more{display:inline-flex;position:absolute;right:2px;bottom:2px;z-index:6;width:44px;height:44px;align-items:center;justify-content:center;border:0;background:transparent;color:#fff;font:700 22px/1 Inter,system-ui,sans-serif;cursor:pointer;padding:0}
.gxm-back.is-on~.gxm-actions,.gxm-actions.is-on{display:flex}
.gxm-actions{position:fixed;left:0;right:0;bottom:0;z-index:9101;flex-direction:column;gap:8px;box-sizing:border-box;padding:16px 16px calc(16px + env(safe-area-inset-bottom,0px));background:#13131c;border-radius:18px 18px 0 0;border-top:1px solid rgba(255,255,255,.14);box-shadow:0 -20px 60px rgba(0,0,0,.6);max-height:80svh;overflow:auto}
.gxm-actions h2{margin:0 0 4px;font:700 16px/1.3 Inter,system-ui,sans-serif;color:#fff}
.gxm-act{width:100%;text-align:left;border-radius:12px;min-height:48px}
}
/* touch targets: the card Follow pill was 26 px tall (large cards / tablets); 40 px on touch devices. */
@media (hover:none),(pointer:coarse){.card-username-follow .es-follow{min-height:40px;min-width:48px}}
