/* Client gallery */
main { max-width: 960px; margin: 0 auto; padding: 0 12px 24px; }
.hint-note {
  max-width: 560px; margin: 0 auto 12px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  color: var(--fg); font-size: 14px; text-align: center;
}

/* Category tiles */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.tile {
  display: block; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: inherit; text-decoration: none;
}
.tile:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.tile-img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: #1a1a1a; }
.tile-body { display: grid; gap: 2px; padding: 10px 12px 12px; }
.tile-name { font-family: var(--heading); font-size: 17px; overflow-wrap: anywhere; }
.tile-count { color: var(--muted); font-size: 13px; font-weight: 700; }

/* Photo grid */
.g-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.g-title-row { display: grid; flex: 1; min-width: 140px; }
.g-title { font-size: 22px; overflow-wrap: anywhere; }
.g-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 700px) { .g-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; } }
.g-cell {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden;
  border: 0; border-radius: 6px; background: #1a1a1a; cursor: pointer;
  -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
}
.g-cell img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-touch-callout: none; }
.g-cell.is-picked img { opacity: .55; }
.g-tick {
  position: absolute; top: 6px; right: 6px; display: grid; place-items: center;
  width: 26px; height: 26px; border: 2px solid #fff; border-radius: 50%;
  background: rgba(0, 0, 0, .45); color: #000; font-size: 15px; font-weight: 900;
}
.g-cell.is-picked .g-tick { background: var(--fg); border-color: var(--fg); }
.g-sentinel { height: 1px; }
.select-bar {
  position: sticky; bottom: 0; z-index: 5; margin: 12px -12px 0;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line);
}
.foot { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

/* Full-screen viewer */
.viewer {
  position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto 1fr auto;
  background: #000; outline: none;
}
.v-top, .v-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.v-top { padding-top: calc(10px + env(safe-area-inset-top)); }
.v-bottom { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.v-count { color: var(--muted); font-size: 14px; font-weight: 700; }
.v-code { font-family: var(--heading); font-size: 18px; letter-spacing: .03em; }
.v-actions { display: flex; gap: 8px; }
.v-actions .btn { min-width: 92px; }
.v-track {
  display: flex; overflow-x: auto; overflow-y: hidden; min-height: 0;
  scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain;
}
.v-track::-webkit-scrollbar { display: none; }
.v-slide { flex: 0 0 100%; display: grid; place-items: center; min-width: 0; scroll-snap-align: start; }
.v-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.v-gone { color: var(--muted); }
.g-more { margin-top: 12px; }
.pop-note {
  position: fixed; left: 12px; right: 12px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 70;
  display: flex; align-items: flex-start; gap: 10px; max-width: 520px; margin: 0 auto; padding: 12px 12px 12px 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 8px 28px rgba(0, 0, 0, .6);
}
.pop-note-body { flex: 1; display: grid; gap: 6px; font-size: 14px; }
.pop-note-body p { margin: 0; }
