.profile-category-shelf {
  min-width: 0;
  padding: 14px 25px 22px;
  border-top: 1px solid var(--profile-border, var(--background4));
}
.profile-category-shelf-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.profile-category-shelf-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 19px;
}
.profile-category-shelf-heading small {
  display: block;
  margin-top: 3px;
  color: var(--text3);
}
.profile-shelf-controls,
.listing-similar-controls {
  display: flex;
  gap: 7px;
}
.profile-shelf-controls button,
.listing-similar-controls button {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid var(--background4);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition:
    opacity 0.2s,
    background 0.2s;
}
.profile-shelf-controls button:hover,
.listing-similar-controls button:hover {
  background: var(--background3);
}
.profile-shelf-controls button:disabled,
.listing-similar-controls button:disabled {
  opacity: 0.35;
  cursor: default;
}
.profile-shelf-viewport {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.profile-shelf-viewport::-webkit-scrollbar {
  display: none;
}
.profile-shared-listing-grid.listings-container {
  --listing-card-width: min(320px, calc(100vw - 64px));
  display: flex !important;
  align-items: stretch;
  gap: 18px;
  width: max-content;
  max-width: none;
  min-width: 100%;
  padding: 0 !important;
  margin: 0 !important;
  grid-template-columns: none !important;
}

.profile-modal-listing-grid.listings-container {
  --listing-card-width: min(360px, calc(100vw - 56px));
  display: grid;
  grid-template-columns: repeat(auto-fit, var(--listing-card-width));
  gap: 18px;
  padding: 0 !important;
  margin: 0 !important;
}
.profile-modal-categories {
  display: grid;
  gap: 24px;
}
.profile-modal-category[hidden] {
  display: none !important;
}
.profile-modal-category > h3 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 18px;
}

.profile-content-grid,
.profile-main-column,
.profile-listings-panel,
.profile-category-shelf,
.organization-profile-shell {
  min-width: 0;
}
.profile-shelf-viewport,
.organization-listings-viewport {
  max-width: 100%;
  box-sizing: border-box;
  padding: 6px 0 10px;
  scrollbar-width: none;
}
.profile-shelf-viewport::-webkit-scrollbar,
.organization-listings-viewport::-webkit-scrollbar,
.profile-modal-listing-grid::-webkit-scrollbar {
  display: none;
}
.profile-shared-listing-grid > .profile-more-listings-card {
  flex: 0 0 var(--listing-card-width);
  width: var(--listing-card-width);
  min-width: var(--listing-card-width);
  height: calc(var(--listing-card-width) * 0.583333 + 294px);
  box-sizing: border-box;
  scroll-snap-align: start;
}
.profile-modal-listing-grid.listings-container {
  justify-content: start !important;
  overflow-x: auto;
  scrollbar-width: none;
}
.organization-listings-viewport {
  padding: 6px 0 10px;
}
body .profile-shared-listing-grid .shared-listing-card.car-banner:hover,
body .profile-modal-listing-grid .shared-listing-card.car-banner:hover {
  background: var(--card-hover, var(--card));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
  transform: none;
}
body.profile-page .profile-panel {
  background: var(--background2);
}
body.profile-page .profile-panel .shared-listing-card.car-banner {
  background: var(--card);
}
body.profile-page .profile-more-listings-card:hover {
  transform: none;
}
@media (max-width: 640px) {
  .profile-category-shelf {
    padding-inline: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .profile-shelf-viewport {
    scroll-behavior: auto;
  }
}

@property --shelf-fade-end {
  syntax: '<length>';
  inherits: false;
  initial-value: 0px;
}
:is(.profile-shelf-viewport, .listing-similar-viewport) {
  --shelf-fade-end: 0px;
  transition: --shelf-fade-end 160ms ease;
  -webkit-mask-image: linear-gradient(
    to right,
    #000,
    #000 calc(100% - var(--shelf-fade-end)),
    transparent
  );
  mask-image: linear-gradient(to right, #000, #000 calc(100% - var(--shelf-fade-end)), transparent);
}
:is(.profile-shelf-viewport, .listing-similar-viewport).can-scroll-end {
  --shelf-fade-end: 8px;
}

@media (prefers-reduced-motion: reduce) {
  :is(.profile-shelf-viewport, .listing-similar-viewport) {
    transition: none;
  }
}

/* Scale the complete market card, including its image, type and controls. */
body.profile-page
  :is(
    .listings-container.profile-shared-listing-grid,
    .listings-container.profile-modal-listing-grid
  ) {
  --listing-card-width: 360px;
  --profile-card-scale: 0.85;
  gap: 16px !important;
}
body.profile-page
  :is(
    .listings-container.profile-shared-listing-grid,
    .listings-container.profile-modal-listing-grid
  )
  :is(.shared-listing-card.car-banner, .profile-more-listings-card) {
  zoom: var(--profile-card-scale);
  height: 544px !important;
  min-height: 544px !important;
  max-height: 544px !important;
}
body.profile-page .profile-listings-modal .listings-container.profile-modal-listing-grid {
  grid-template-columns: repeat(
    var(--profile-modal-columns, 3),
    calc(360px * var(--profile-card-scale))
  ) !important;
  justify-content: start !important;
  width: max-content;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}
body.profile-page .profile-listings-modal > section {
  box-sizing: border-box;
  width: var(--profile-modal-width, min(996px, 100%));
  max-width: 100%;
  scrollbar-width: none;
}
body.profile-page .profile-listings-modal > section::-webkit-scrollbar {
  display: none;
}
@media (max-width: 520px) {
  body.profile-page
    :is(
      .listings-container.profile-shared-listing-grid,
      .listings-container.profile-modal-listing-grid
    ) {
    --profile-card-scale: 0.78;
  }
}
@media (max-width: 360px) {
  body.profile-page
    :is(
      .listings-container.profile-shared-listing-grid,
      .listings-container.profile-modal-listing-grid
    ) {
    --profile-card-scale: 0.68;
  }
}
