/* The familiar night street frames the people; controls use quiet solid surfaces.
   Loaded last. Profile purchase frames and their visibility lifecycle stay intact. */
#view-gallery {
  --gallery-surface: #130f1b;
  --gallery-field: #100b17;
  --gallery-border: #513746;
  --gallery-ink: #f4eff6;
  --gallery-muted: #c5b7c6;
  position: relative;
  isolation: isolate;
  max-width: 1320px;
  min-width: 0;
  color: var(--gallery-ink);
}
#view-gallery::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, #0b07118c, #0b0711c7 48%, #0b0711de);
}
#view-gallery > .topbar {
  width: auto;
  margin: 0 28px;
  padding: 20px 0 7px;
  gap: 16px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#view-gallery .brand {
  color: var(--gallery-ink);
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: .015em;
  text-shadow: none;
}
#view-gallery #catalogIntro { margin: 4px 0 0; color: var(--gallery-muted); font-size: 12px; }
#view-gallery > .halloween-route-tools { width: auto; margin: 0 28px 4px; min-height: 24px; }
#view-gallery .brand-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  margin: 0 28px 12px;
  padding: 0;
  gap: 22px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 4px;
  scrollbar-width: none;
}
#view-gallery .brand-nav::-webkit-scrollbar { display: none; }
#view-gallery .brand-nav .bn-link {
  flex: 0 0 auto;
  justify-content: flex-start;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 2px;
  color: var(--gallery-muted);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0;
  white-space: nowrap;
}
#view-gallery .brand-nav .bn-link:hover { color: var(--gallery-ink); border-bottom-color: #e1b77f; }
#view-gallery .brand-nav .bn-link:focus-visible { outline-offset: -2px; border-radius: 5px; }
#view-gallery .nav-balance { margin-left: auto; }
#view-gallery .gal-filters { margin: 0 28px 8px; gap: 8px; }
#view-gallery .gal-selects { gap: 8px; }
#view-gallery .gal-filters :is(.flt-sel, .chip, .flt-age) {
  min-height: 44px;
  min-width: 0;
  border: 1px solid var(--gallery-border);
  border-radius: 9px;
  background-color: var(--gallery-field);
  color: var(--gallery-ink);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0;
}
#view-gallery .gal-filters .flt-sel { padding: 10px 32px 10px 12px; }
#view-gallery .gal-filters .chip { padding: 10px 13px; }
#view-gallery .gal-filters .flt-age { padding: 0 10px; gap: 6px; color: var(--gallery-muted); }
#view-gallery .gal-filters .flt-age input { min-height: 42px; background: var(--gallery-field); font-size: 16px; }
#view-gallery .gal-filters .chip:is(.active, [aria-pressed='true']) {
  background: #351320;
  border-color: #a44865;
  color: #ffe0e6;
}
#view-gallery .gal-filters .flt-more { color: var(--gallery-muted); }
#view-gallery .gal-filters .flt-more.has-selection { color: #ffe0e6; border-color: #a44865; }
#view-gallery :is(button, a, input, select):focus-visible { outline: 2px solid #ffb36b; outline-offset: 3px; }
#view-gallery :is(input, textarea) { caret-color: #ffb36b; }
#view-gallery ::selection { background: #7e2944; color: #fff2f1; }

#view-gallery #rails {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 28px 6px;
}
#view-gallery #rails > .catalog-group { min-width: 0; margin-top: 12px; }
#view-gallery #rails > #giftFeedSlot:not(.gift-feed-loading) { display: none; }
#view-gallery #rails > .gift-feed { min-width: 0; margin-top: 4px; animation: none; transform: none; }
#view-gallery #rails .gift-feed-placeholder { flex: 0 0 168px; min-height: 48px; border: 1px solid var(--gallery-border); border-radius: 10px; background: #1b121f; }
#view-gallery #rails .catalog-group > .rail { margin-top: 20px; }
#view-gallery #rails .catalog-group > .rail:first-child { margin-top: 0; }
#view-gallery #rails .rail > .rail-head { min-height: 36px; margin: 0 0 5px; padding: 0; }
#view-gallery #rails .rail > .rail-head::after { background: #51374680; }
#view-gallery #rails .rail .rail-title {
  color: var(--gallery-ink);
  font-size: 24px !important;
  line-height: 1.25;
  letter-spacing: 0;
}
#view-gallery #rails .catalog-group .rail-active h3.rail-title { font-family: var(--font-b); font-size: 14px !important; }
#view-gallery #rails .rail > .rail-track { gap: 12px; padding: 6px 6px 6px; margin: 0 -6px; }
#view-gallery #rails .catalog-group > .rail > .rail-track > .card {
  flex: 0 0 auto;
  width: 140px;
  min-width: 0;
  border: 1px solid var(--gallery-border);
  border-radius: 12px;
  background: var(--gallery-surface);
  box-shadow: none;
  animation: none;
  transition: border-color .18s ease;
}
/* A purchased frame is an independent child layer. Keep its material and motion. */
#view-gallery #rails .card[data-profile-hue] { border-color: hsl(var(--profile-hue) 45% 60% / .55); }
#view-gallery #rails .card:hover { transform: none; box-shadow: none; border-color: #a87887; }
#view-gallery #rails .card .c-photo { flex: none; width: 100%; aspect-ratio: 3 / 4; }
#view-gallery #rails .card .c-photo :is(.cov, .cov-empty) {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  transform: none;
  transition: none;
}
#view-gallery #rails .rail .c-card-details { padding: 8px; background: var(--gallery-surface); }
#view-gallery #rails .rail .c-name { margin: 0; color: var(--gallery-ink); font-size: 14px; line-height: 1.4; }
#view-gallery #rails .rail .c-name .c-nm { min-width: 0; overflow-wrap: anywhere; }
#view-gallery #rails .rail .c-city { color: var(--gallery-muted); font-size: 12px; line-height: 1.4; }
#view-gallery #rails .rail .c-meta { margin-top: 4px; }
#view-gallery #rails .rail .c-recent-activity { margin-top: 6px; color: var(--gallery-muted); font-size: 11px; }
#view-gallery #rails .rail .c-card-decoration { padding: 0 8px 8px; background: var(--gallery-surface); }
#view-gallery #rails .rail .c-fav {
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0 8px;
  background: #100b17eb;
  box-shadow: none;
  transform: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#view-gallery #rails .gift-feed > .rail-head { min-height: 26px; margin-bottom: 3px; }
#view-gallery #rails .gift-feed .rail-title { color: var(--gallery-muted); font: 500 14px/1.4 var(--font-b); font-size: 14px !important; }
#view-gallery #rails .gift-feed .gf-item { min-height: 48px; padding: 6px 10px; border-radius: 10px; background: #1b121f; box-shadow: none; animation: none; }
#view-gallery #rails .gift-feed .gf-item:hover { transform: none; }

#view-gallery > :is(#eveningPlans, #profileMatches, #catalogForumPlaces) { min-width: 0; margin-inline: 28px; }
#view-gallery > #profileMatches { margin-top: 24px; margin-bottom: 20px; }
#view-gallery .profile-matches { margin: 0; }
#view-gallery .profile-matches-heading { margin: 0 0 10px; font-size: 25px; line-height: 1.2; }
#view-gallery .profile-matches-list { gap: 20px; padding: 0 0 4px; }
#view-gallery .profile-match-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 4px;
  flex: 0 0 310px;
  padding: 8px 0;
}
#view-gallery .profile-match-portraits { grid-column: 1; grid-row: 1 / 3; grid-template-columns: 52px 24px 52px; }
#view-gallery .profile-match-profile { gap: 5px; }
#view-gallery .profile-match-photo { aspect-ratio: 3 / 4; border-radius: 7px; }
#view-gallery .profile-match-name { font-size: 12px; line-height: 1.4; color: var(--gallery-ink); }
#view-gallery .profile-match-heart { width: 28px; height: 28px; margin-top: -20px; background: var(--gallery-surface); font-size: 19px; }
#view-gallery .profile-match-note { grid-column: 2; grid-row: 1; margin: 0; text-align: left; color: var(--gallery-muted); font-size: 11px; line-height: 1.45; }
#view-gallery .profile-match-chat {
  grid-column: 2;
  grid-row: 2;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #a44865;
  border-radius: 8px;
  background: #351320;
  color: #fff2f1;
}
#view-gallery .profile-match-chat:hover { background: #4a1a2b; }
#view-gallery .profile-match-card:not(:has(.profile-match-chat)) { grid-template-columns: 128px; flex-basis: 144px; }
/* showView currently toggles only on-login. The active view provides the scope. */
body.halloween-season:has(#view-gallery.active) #scene .halloween-corner { display: none; }

@media (max-width: 760px) {
  #view-gallery > .topbar { margin-inline: 16px; padding: 12px 0 5px; gap: 8px; }
  #view-gallery .brand { font-size: 30px; }
  #view-gallery #catalogIntro { margin-top: 3px; font-size: 11px; }
  #view-gallery > .halloween-route-tools { margin-inline: 16px; margin-bottom: 2px; }
  #view-gallery .brand-nav { margin: 0 16px 8px; gap: 18px; }
  #view-gallery .brand-nav .bn-link { min-height: 44px; font-size: 12px; white-space: nowrap; }
  #view-gallery .gal-filters { margin: 0 16px 6px; gap: 6px; }
  #view-gallery .gal-filters .gal-selects { gap: 6px; }
  #view-gallery .gal-filters .flt-more { display: flex; }
  #view-gallery .gal-extra.is-open { gap: 6px; }
  #view-gallery .gal-extra .flt-age { flex: 1; min-width: 0; }
  #view-gallery .gal-extra #fltActive { flex: none; }
  #view-gallery #rails { padding: 0 16px 6px; }
  #view-gallery #rails > .catalog-group { margin-top: 8px; }
  #view-gallery #rails .rail .rail-title { font-size: 23px !important; }
  #view-gallery #rails .rail.gift-feed .rail-title { font-size: 14px !important; }
  #view-gallery > :is(#eveningPlans, #profileMatches, #catalogForumPlaces) { margin-inline: 16px; }
  #view-gallery > #profileMatches { margin-top: 20px; }
  #view-gallery .profile-matches-heading { font-size: 23px; }
  #view-gallery .profile-matches-list { gap: 16px; }
}
@media (max-width: 640px) {
  #view-gallery #rails .catalog-group > .rail > .rail-track > .card { width: 108px; }
}
