.gallery-head {
  padding: 0.85rem 0 var(--space-2);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent);
}

.gallery-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.gallery-head .gallery-tools {
  margin-top: 0;
}

.model-ui .gallery-tools input,
.model-ui .gallery-tools select {
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #09090b;
}

.model-ui .gallery-tools input::placeholder {
  color: rgba(9, 9, 11, 0.52);
}

.category-carousel {
  display: flex;
  align-items: flex-start;
  gap: 0.78rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.12rem 0 0.5rem;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.category-carousel::-webkit-scrollbar {
  display: none;
}

.gallery-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  padding-bottom: var(--space-5);
}

.gallery-list .model-post-card {
  max-width: none;
  margin: 0 auto;
  width: 100%;
}

.gallery-list .model-post-card {
  gap: 0.55rem;
  padding: 0.55rem;
  border-radius: 22px;
}

.gallery-drawing-card {
  position: relative;
}

.gallery-card-meta {
  position: absolute;
  top: 0.62rem;
  right: 0.62rem;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.gallery-list .model-action-pill {
  padding: 0.35rem 0.5rem;
  font-size: 0.66rem;
  white-space: nowrap;
}

.home-feed-page .gallery-list .model-post-user {
  gap: 0.5rem;
}

.home-feed-page .gallery-list .model-post-user img {
  width: 34px;
  height: 34px;
  border-width: 2px;
}

.home-feed-page .gallery-list .model-post-user strong,
.home-feed-page .gallery-list .model-post-user small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-feed-page .gallery-list .model-post-user strong {
  font-size: 0.82rem;
}

.home-feed-page .gallery-list .model-post-user small {
  font-size: 0.68rem;
}

.gallery-list .views-pill {
  gap: 0.28rem;
  padding-inline: 0.46rem;
}

.gallery-list .views-pill svg {
  width: 0.82rem;
  height: 0.82rem;
}

.gallery-list .model-post-art {
  min-height: 0;
  aspect-ratio: 1;
  border-radius: 18px;
  background: #fff;
}

.gallery-list .model-post-art::before {
  display: none;
}

.gallery-list .model-post-art svg {
  width: 96%;
  height: 96%;
  max-height: none;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.gallery-list .model-post-card h3 {
  font-size: clamp(0.78rem, 3.1vw, 1rem);
  line-height: 1.05;
}

.gallery-list .model-post-card p,
.gallery-list .model-post-tags,
.gallery-list .model-post-actions {
  display: none;
}

.gallery-category-chip {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0.32rem;
  flex: 0 0 52px;
  width: 52px;
  min-height: 62px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--model-text);
  text-align: center;
  scroll-snap-align: start;
}

.gallery-category-chip .category-outline {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  background: transparent;
  opacity: 0.94;
}

.gallery-category-chip .category-outline svg {
  width: 20px;
  height: 20px;
}

.gallery-category-chip strong {
  color: currentColor;
  font-size: 0.74rem;
  line-height: 1;
}

.gallery-category-chip.active .category-outline {
  background: transparent;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 18%, transparent);
}

@media (max-width: 680px) {
  .home-feed-page .gallery-list {
    grid-template-columns: 1fr;
    max-width: 430px;
    margin-inline: auto;
  }

  .home-feed-page .gallery-list .model-post-art {
    aspect-ratio: 1 / 0.9;
  }

  .category-carousel {
    gap: 0.58rem;
    padding-left: 0;
  }

  .gallery-category-chip {
    flex-basis: 50px;
    width: 50px;
    min-height: 60px;
  }

  .gallery-category-chip .category-outline {
    width: 38px;
    height: 38px;
  }
}

@media (min-width: 700px) {
  .gallery-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.95rem;
  }
}

@media (min-width: 1100px) {
  .gallery-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.badge {
  width: max-content;
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  color: #17213a;
  background: var(--color-mint);
  font-size: 0.78rem;
  font-weight: 900;
}

@media (max-width: 680px) {
  .gallery-tools {
    grid-template-columns: 1fr;
  }
}
