/* Shared attribution keeps catalog entries readable even without a public profile. */
.gallery-info footer .tile-byline {display:flex; align-items:center; gap:6px; min-width:0}
.tile-avatar {display:grid; place-items:center; flex:none; width:22px; height:22px; border-radius:50%; background:var(--raised); color:var(--strong); font-size:10px; font-weight:650}
.tile-byline time, .mobile-head-actions, .mobile-dock, .mobile-sort-links, .mobile-filter-field, .mobile-type-reset {display:none}

@media (max-width:760px) {
  :root {--rail-width:0px; --gutter:16px; --dock-space:calc(80px + env(safe-area-inset-bottom))}
  html {scroll-padding-bottom:var(--dock-space)}
  body {padding-inline-start:0; padding-bottom:var(--dock-space)}
  .app-rail, .mast-search {display:none}
  .mast-inner {padding:4px max(var(--gutter), env(safe-area-inset-right)) 4px max(var(--gutter), env(safe-area-inset-left)); min-height:52px}
  .mast-path {gap:8px; font-size:12px}
  .mast-name {gap:6px; font-size:18px; white-space:nowrap}
  .mast-name img {width:30px; height:25px}
  .mobile-head-actions {display:flex; align-items:center; flex:none}
  .mobile-head-actions > * {display:grid; place-items:center; min-width:44px; height:44px; color:var(--muted)}
  .mobile-head-actions .rail-avatar {width:30px; height:30px}
  .mobile-head-actions .ico {width:19px; height:19px}
  .mobile-dock {
    position:fixed; z-index:9; bottom:max(8px,env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%);
    width:min(calc(100% - 24px),420px); display:flex; gap:8px; align-items:stretch; pointer-events:none
  }
  .dock-links,.mobile-dock .dock-create {pointer-events:auto; border:1px solid var(--line); background:var(--surface); box-shadow:0 2px 8px #0002}
  .dock-links {display:grid; grid-template-columns:repeat(4,1fr); flex:1; padding:3px; border-radius:19px}
  .dock-links > *, .dock-create {display:grid; place-items:center; min-height:44px; padding:0; border-radius:15px; color:var(--muted)}
  .dock-links [aria-current],.dock-links [aria-expanded=true] {background:var(--selected); color:var(--strong)}
  .mobile-dock .dock-create {width:52px; border-radius:17px; background:var(--accent); color:var(--accent-text)}
  .mobile-dock .ico {width:21px; height:21px}
  body:has(.site-main input:focus, .site-main textarea:focus) .mobile-dock {visibility:hidden}
  .dock-links > :active, .mobile-head-actions > :active {background:var(--raised)}
  .drawer {inset:auto 0 0; width:min(100%,480px); margin:0 auto; max-height:min(82dvh,640px); border-radius:16px 16px 0 0; padding-bottom:max(16px,env(safe-area-inset-bottom)); overscroll-behavior:contain}
  .drawer .drawer-head {position:sticky; top:-18px; z-index:1; background:var(--surface); padding-block:6px}
  .drawer nav a,.drawer nav form button,.drawer-head button,.create-flyout nav a {min-height:44px}
  .search-dialog input,.gallery-filters input,.gallery-filters select {font-size:16px}

  /* The feed opens on products. Ranking is one tap, less frequent controls live in filters. */
  .site-main:has(> #catalog.gallery) {padding-top:0}
  #catalog.gallery > .gallery-head {position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); padding:0}
  #catalog.gallery > .gallery-head .primary, #catalog.gallery > .browse-types,
  .gallery-toolbar .gallery-search, .gallery-toolbar .sort-form {display:none}
  .gallery-toolbar {display:flex; flex-direction:row; align-items:center; gap:4px; margin:0; border-bottom:1px solid var(--hair)}
  .mobile-sort-links {display:flex; align-items:stretch; flex:1; min-width:0; overflow-x:auto; scrollbar-width:none; gap:clamp(10px,3vw,22px)}
  .mobile-sort-links a {position:relative; display:inline-flex; align-items:center; flex:none; min-height:48px; font-size:13px; font-weight:550; color:var(--muted); white-space:nowrap}
  .mobile-sort-links a[aria-current] {color:var(--strong); font-weight:700}
  .mobile-sort-links a[aria-current]::after {content:""; position:absolute; bottom:0; left:0; right:0; height:3px; background:currentColor; border-radius:3px}
  .gallery-toolbar #filters {border:0; background:transparent; width:44px; min-height:44px; padding:0}
  .gallery-toolbar #filters .ico {width:20px; height:20px}
  .gallery-toolbar #filters span {display:none}
  .gallery-toolbar #filters[aria-expanded=true] {background:var(--raised)}
  .gallery-filters {margin:8px 0; gap:10px; background:var(--surface)}
  .gallery-filters .mobile-filter-field {display:block}
  .gallery-filters .mobile-filter-field:first-of-type {flex-basis:100%}
  .gallery-filters select,.gallery-filters input,.gallery-filters button {min-height:44px}
  .gallery-count {margin:0; min-height:48px; gap:6px}
  .gallery-count strong {color:var(--muted); font-size:12px}
  .gallery-count .desktop-type {display:none}
  .gallery-count .mobile-type-reset {display:inline-flex}
  .view-switch {gap:0; padding:0; background:transparent}
  .view-switch button {min-height:44px; width:44px}
  .view-switch [aria-pressed=true] {color:var(--strong); background:transparent}
  .view-switch [aria-pressed=false] {color:var(--faint)}
  .view-switch [aria-pressed=true] .ico {background:var(--selected); box-sizing:content-box; padding:5px; border-radius:5px}

  .cover-grid:not([data-view=list]) {grid-template-columns:minmax(0,1fr); gap:10px}
  .cover-grid:not([data-view=list]) .gallery-item {
    display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:0 6px;
    grid-template-areas:"owner price" "title title" "summary summary" "meta meta" "cover cover" "tools license";
    padding:16px 14px 4px; background:var(--surface); border:1px solid var(--hair); border-radius:12px
  }
  #catalog.gallery > .cover-grid:not([data-view=list]) {margin-inline:-8px}
  .cover-grid:not([data-view=list]) .gallery-info,
  .cover-grid:not([data-view=list]) .gallery-name,
  .cover-grid:not([data-view=list]) .gallery-info footer {display:contents}
  .cover-grid:not([data-view=list]) .tile-byline {
    grid-area:owner; display:grid; grid-template-columns:32px minmax(0,1fr); gap:0 8px; align-items:center
  }
  .cover-grid:not([data-view=list]) .tile-avatar {grid-row:span 2; width:32px; height:32px; font-size:13px; background:var(--selected)}
  .cover-grid:not([data-view=list]) .creator-link {line-height:1.3; font-size:13px; justify-self:start}
  .cover-grid:not([data-view=list]) .tile-byline time {display:block; font-size:11px; color:var(--muted); line-height:1.5}
  .cover-grid:not([data-view=list]) .gallery-price {grid-area:price; align-self:center; max-width:36vw; overflow-wrap:anywhere; font-weight:600; color:var(--muted)}
  .cover-grid:not([data-view=list]) .gallery-name h2 {grid-area:title; margin-top:12px; font-size:22px; line-height:1.2; letter-spacing:-.035em}
  .cover-grid:not([data-view=list]) .gallery-info > p {grid-area:summary; margin:5px 0 6px; font-size:14px; line-height:1.5; -webkit-line-clamp:3}
  .cover-grid:not([data-view=list]) .card-context {grid-area:meta; margin:0 0 12px; gap:7px; font-size:12px}
  .cover-grid:not([data-view=list]) .gallery-cover {grid-area:cover; width:100%}
  .cover-grid:not([data-view=list]) .card-tools {grid-area:tools; align-self:center; display:flex; padding-top:2px; gap:3px}
  .gallery-item .card-tools .action {min-height:44px; min-width:44px; justify-content:center; font-size:12px}
  .gallery-item .card-tools .action .ico {width:17px; height:17px}
  .cover-grid:not([data-view=list]) .license-line {grid-area:license; justify-self:end; align-self:center; margin:0; padding-left:4px; max-width:clamp(100px,37vw,200px); font-size:11px}
  .cover-grid[data-view=list] .gallery-item {grid-template-columns:minmax(68px,24%) minmax(0,1fr); gap:12px}
  .cover-grid[data-view=list] .gallery-info footer {flex-wrap:wrap}
  .cover-grid[data-view=list] .card-tools {flex-wrap:wrap}
}
@media (max-width:360px) {
  .mobile-sort-links {gap:10px}
  .mobile-sort-links a {font-size:12px}
  .cover-grid:not([data-view=list]) .gallery-item {padding-inline:12px}
}
