/* V521 — XAB Community discovery layout inspired by modern 3D model platforms.
   Scoped to the public community only; builder, shop, doctor and admin are untouched. */

body.home-page {
  --community-surface: rgba(15, 23, 42, .88);
  --community-surface-2: rgba(30, 41, 59, .78);
  --community-line: rgba(148, 163, 184, .18);
  --community-muted: #9fb0c6;
  --community-accent: #16a34a;
  --community-accent-2: #22c55e;
}

body.home-page .marketplace-home {
  max-width: 1510px !important;
  width: min(1510px, calc(100vw - 28px)) !important;
  margin-top: 16px !important;
}

body.home-page .community-hub {
  gap: 18px !important;
}

body.home-page .community-hub__hero {
  min-height: 126px;
  padding: 22px 26px !important;
  align-items: center !important;
  border-radius: 18px !important;
  background:
    radial-gradient(circle at 88% 12%, rgba(34, 197, 94, .24), transparent 34%),
    radial-gradient(circle at 58% 90%, rgba(14, 165, 233, .18), transparent 42%),
    linear-gradient(135deg, rgba(15, 23, 42, .97), rgba(22, 35, 55, .92)) !important;
}

body.home-page .community-hub__intro h1 {
  max-width: 880px !important;
  font-size: clamp(30px, 4vw, 48px) !important;
  line-height: 1.04 !important;
}

body.home-page .community-hub__intro p {
  max-width: 820px !important;
  font-size: 15px !important;
}

body.home-page .community-topic-strip {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 1px 5px;
  scrollbar-width: thin;
}

body.home-page .community-topic-strip button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid var(--community-line);
  border-radius: 10px;
  background: var(--community-surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

body.home-page .community-topic-strip button:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 197, 94, .45);
}

body.home-page .community-topic-strip button.is-active {
  border-color: #22c55e;
  background: #16a34a;
  color: #fff;
}

body.home-page .community-discovery {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, .95fr);
  gap: 16px;
  min-height: 330px;
}

body.home-page .community-spotlight {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid var(--community-line);
  border-radius: 18px;
  background: #0b1120;
  box-shadow: 0 18px 40px rgba(2, 6, 23, .24);
}

body.home-page .community-spotlight__media,
body.home-page .community-spotlight__media img,
body.home-page .community-spotlight__media .community-card__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 330px;
}

body.home-page .community-spotlight__media img {
  object-fit: cover;
  transition: transform .45s ease;
}

body.home-page .community-spotlight:hover .community-spotlight__media img {
  transform: scale(1.025);
}

body.home-page .community-spotlight__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(2, 6, 23, .9) 0%, rgba(2, 6, 23, .58) 46%, rgba(2, 6, 23, .08) 100%);
}

body.home-page .community-spotlight__content {
  position: absolute;
  z-index: 2;
  left: 26px;
  bottom: 24px;
  display: grid;
  gap: 10px;
  width: min(540px, calc(100% - 52px));
  color: #fff;
}

body.home-page .community-spotlight__content > span {
  width: max-content;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, .9);
  font-size: 12px;
  font-weight: 900;
}

body.home-page .community-spotlight__content h2 {
  margin: 0;
  font-size: clamp(25px, 3vw, 42px);
  line-height: 1.03;
}

body.home-page .community-spotlight__content p {
  margin: 0;
  max-width: 500px;
  color: rgba(255, 255, 255, .8);
  line-height: 1.45;
}

body.home-page .community-spotlight__content > div {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

body.home-page .community-spotlight__placeholder {
  display: grid;
  place-items: center;
  min-height: 330px;
  padding: 24px;
  color: var(--community-muted);
  text-align: center;
}

body.home-page .community-discovery__side {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(34, 197, 94, .22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 90% 0%, rgba(34, 197, 94, .2), transparent 40%),
    var(--community-surface);
}

body.home-page .community-discovery__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

body.home-page .community-discovery__head b {
  font-size: 22px;
}

body.home-page .community-discovery__head span {
  color: var(--community-muted);
  font-size: 12px;
}

body.home-page .community-discovery__tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

body.home-page .community-discovery__tiles a,
body.home-page .community-discovery__tiles button {
  position: relative;
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 112px;
  padding: 15px 54px 15px 15px;
  overflow: hidden;
  border: 1px solid var(--community-line);
  border-radius: 13px;
  background: rgba(15, 23, 42, .75);
  color: var(--text);
  text-decoration: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

body.home-page .community-discovery__tiles a:hover,
body.home-page .community-discovery__tiles button:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, .48);
  background: rgba(30, 41, 59, .92);
}

body.home-page .community-discovery__tiles b {
  font-size: 16px;
}

body.home-page .community-discovery__tiles span {
  color: var(--community-muted);
  font-size: 12px;
  line-height: 1.35;
}

body.home-page .community-discovery__tiles i {
  position: absolute;
  right: 13px;
  top: 13px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #22c55e, #0ea5e9);
  color: #fff;
  font-style: normal;
  font-weight: 950;
}

body.home-page .community-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 4px;
}

body.home-page .community-section-heading span {
  color: #22c55e;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

body.home-page .community-section-heading h2 {
  margin: 3px 0 0;
  font-size: clamp(24px, 3vw, 34px);
}

body.home-page .community-section-heading p {
  margin: 0;
  color: var(--community-muted);
  text-align: right;
}

body.home-page .community-controls {
  grid-template-columns: minmax(300px, 1fr) minmax(170px, 220px) minmax(170px, 220px) !important;
  padding: 10px;
  border: 1px solid var(--community-line);
  border-radius: 15px;
  background: var(--community-surface);
}

body.home-page .community-search {
  min-height: 42px !important;
  border-radius: 10px !important;
}

body.home-page .community-feed-head {
  margin-top: -4px;
}

body.home-page .community-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 16px !important;
}

body.home-page .community-card {
  position: relative;
  border-radius: 14px !important;
  background: var(--community-surface) !important;
  box-shadow: none !important;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

body.home-page .community-card:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 197, 94, .4) !important;
  box-shadow: 0 15px 34px rgba(2, 6, 23, .22) !important;
}

body.home-page .community-card__media {
  aspect-ratio: 1 / 1 !important;
  border-radius: 0 !important;
}

body.home-page .community-card__media img {
  transition: transform .28s ease;
}

body.home-page .community-card:hover .community-card__media img {
  transform: scale(1.035);
}

body.home-page .community-card__media-stats {
  position: absolute;
  right: 9px;
  bottom: 9px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(2, 6, 23, .7);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

body.home-page .community-card__body {
  gap: 9px !important;
  padding: 11px !important;
}

body.home-page .community-card__heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

body.home-page .community-card__title {
  display: -webkit-box;
  min-height: 40px;
  color: var(--text);
  text-decoration: none;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.home-page .community-card__heading .community-like-btn {
  min-width: 32px;
  min-height: 32px;
  padding: 0 8px;
}

body.home-page .community-card__author span:last-child {
  display: grid;
  min-width: 0;
}

body.home-page .community-card__author b,
body.home-page .community-card__author em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.home-page .community-card__author em {
  color: var(--community-muted);
  font-size: 10px;
  font-style: normal;
}

body.home-page .community-card__tags {
  flex-wrap: nowrap !important;
  overflow: hidden;
}

body.home-page .community-card__tags span {
  flex: 0 1 auto;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

body.home-page .community-card__footer {
  display: grid;
  gap: 9px;
  margin-top: auto;
}

body.home-page .community-card__stats {
  min-height: 18px;
}

body.home-page .community-card__actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

body.home-page .community-card__actions .btn {
  min-width: 0;
  padding-inline: 8px;
  white-space: nowrap;
}

body.home-page .community-builder-cta {
  border-color: #16a34a !important;
  background: #16a34a !important;
  color: #fff !important;
}

/* Model card / detail view */
body.home-page .community-world-dialog {
  width: min(1320px, calc(100vw - 28px)) !important;
  max-height: calc(100dvh - 22px) !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 18px !important;
}

body.home-page .community-world-dialog > .modal__header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--community-line);
  background: var(--community-surface);
}

body.home-page .community-world-dialog .community-model-detail {
  max-height: calc(100dvh - 96px);
  padding: 18px;
  overflow-y: auto;
  background: rgba(2, 6, 23, .96);
}

body.home-page .community-world-detail {
  display: grid;
  gap: 18px;
}

body.home-page .community-world-detail__top {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, .65fr);
  gap: 18px;
  align-items: start;
}

body.home-page .community-world-detail__gallery .community-model-detail__visual {
  aspect-ratio: 16 / 10 !important;
  border-radius: 14px !important;
}

body.home-page .community-world-detail__panel {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--community-line);
  border-radius: 14px;
  background: var(--community-surface);
}

body.home-page .community-world-detail__category {
  width: max-content;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(34, 197, 94, .14);
  color: #86efac;
  font-size: 12px;
  font-weight: 900;
}

body.home-page .community-world-detail__builder {
  min-height: 46px;
  font-size: 15px;
}

body.home-page .community-world-detail__builder-note {
  margin: -5px 0 0;
  color: var(--community-muted);
  font-size: 11px;
  line-height: 1.45;
}

body.home-page .community-world-detail__panel .community-license {
  display: grid;
  gap: 3px;
}

body.home-page .community-world-detail__panel .community-license span {
  font-size: 12px;
  font-weight: 650;
}

body.home-page .community-world-detail__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

body.home-page .community-world-detail__main {
  display: grid;
  gap: 14px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

body.home-page .community-world-detail__section,
body.home-page .community-world-related {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--community-line);
  border-radius: 14px;
  background: var(--community-surface);
}

body.home-page .community-world-detail__section > h3,
body.home-page .community-world-related h3 {
  margin: 0;
  font-size: 19px;
}

body.home-page .community-world-related {
  position: sticky;
  top: 0;
}

body.home-page .community-world-related__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

body.home-page .community-world-related__head span {
  color: var(--community-muted);
  font-size: 11px;
}

body.home-page .community-world-related__list {
  display: grid;
  gap: 12px;
}

body.home-page .community-world-related .community-card--compact {
  grid-template-columns: 96px minmax(0, 1fr);
  grid-template-rows: none;
}

body.home-page .community-world-related .community-card--compact .community-card__media {
  aspect-ratio: 1 / 1 !important;
}

body.home-page .community-world-related .community-card--compact .community-card__body {
  padding: 8px !important;
}

body.home-page .community-world-related .community-card--compact .community-card__author,
body.home-page .community-world-related .community-card--compact .community-card__tags,
body.home-page .community-world-related .community-card--compact .community-card__stats,
body.home-page .community-world-related .community-card--compact .community-card__actions,
body.home-page .community-world-related .community-card--compact .community-like-btn,
body.home-page .community-world-related .community-card--compact .community-card__media-stats {
  display: none !important;
}

/* Light theme: closer to the reference, while preserving XAB branding. */
body[data-theme="light"].home-page,
html[data-theme="light"] body.home-page {
  --community-surface: #fff;
  --community-surface-2: #f3f5f7;
  --community-line: #e2e6ea;
  --community-muted: #748091;
  background: #f5f6f7 !important;
}

body[data-theme="light"].home-page .community-hub__hero,
html[data-theme="light"] body.home-page .community-hub__hero {
  border-color: #dfe8e3 !important;
  background:
    radial-gradient(circle at 86% 15%, rgba(134, 239, 172, .42), transparent 34%),
    linear-gradient(135deg, #fff, #eefbf2) !important;
  color: #111827;
}

body[data-theme="light"].home-page .community-hub__intro p,
html[data-theme="light"] body.home-page .community-hub__intro p {
  color: #64748b;
}

body[data-theme="light"].home-page .community-controls,
body[data-theme="light"].home-page .community-discovery__side,
body[data-theme="light"].home-page .community-discovery__tiles a,
body[data-theme="light"].home-page .community-discovery__tiles button,
body[data-theme="light"].home-page .community-card,
html[data-theme="light"] body.home-page .community-controls,
html[data-theme="light"] body.home-page .community-discovery__side,
html[data-theme="light"] body.home-page .community-discovery__tiles a,
html[data-theme="light"] body.home-page .community-discovery__tiles button,
html[data-theme="light"] body.home-page .community-card {
  background: #fff !important;
  color: #18212f !important;
}

body[data-theme="light"].home-page .community-discovery__tiles a,
body[data-theme="light"].home-page .community-discovery__tiles button,
html[data-theme="light"] body.home-page .community-discovery__tiles a,
html[data-theme="light"] body.home-page .community-discovery__tiles button {
  background: #f8faf9 !important;
}

body[data-theme="light"].home-page .community-card__title,
body[data-theme="light"].home-page .community-card__author,
html[data-theme="light"] body.home-page .community-card__title,
html[data-theme="light"] body.home-page .community-card__author {
  color: #111827 !important;
}

body[data-theme="light"].home-page .community-world-dialog .community-model-detail,
html[data-theme="light"] body.home-page .community-world-dialog .community-model-detail {
  background: #f5f6f7;
}

body[data-theme="light"].home-page .community-world-dialog > .modal__header,
body[data-theme="light"].home-page .community-world-detail__panel,
body[data-theme="light"].home-page .community-world-detail__section,
body[data-theme="light"].home-page .community-world-related,
html[data-theme="light"] body.home-page .community-world-dialog > .modal__header,
html[data-theme="light"] body.home-page .community-world-detail__panel,
html[data-theme="light"] body.home-page .community-world-detail__section,
html[data-theme="light"] body.home-page .community-world-related {
  background: #fff;
  color: #18212f;
}

body[data-theme="light"].home-page .community-model-detail__main p,
html[data-theme="light"] body.home-page .community-model-detail__main p {
  color: #334155 !important;
}

@media (max-width: 1280px) {
  body.home-page .community-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1040px) {
  body.home-page .community-discovery {
    grid-template-columns: 1fr;
  }

  body.home-page .community-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.home-page .community-world-detail__top,
  body.home-page .community-world-detail__body {
    grid-template-columns: 1fr;
  }

  body.home-page .community-world-related {
    position: static;
  }

  body.home-page .community-world-related__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body.home-page .marketplace-home {
    width: min(100%, calc(100vw - 16px)) !important;
    margin-top: 10px !important;
  }

  body.home-page .community-hub__hero {
    grid-template-columns: 1fr !important;
    padding: 17px !important;
  }

  body.home-page .community-hub__actions {
    justify-content: flex-start !important;
  }

  body.home-page .community-discovery,
  body.home-page .community-spotlight,
  body.home-page .community-spotlight__media,
  body.home-page .community-spotlight__media img,
  body.home-page .community-spotlight__media .community-card__placeholder {
    min-height: 280px;
  }

  body.home-page .community-spotlight__content {
    left: 17px;
    bottom: 17px;
    width: calc(100% - 34px);
  }

  body.home-page .community-spotlight__content p {
    display: none;
  }

  body.home-page .community-discovery__tiles {
    grid-template-columns: 1fr 1fr;
  }

  body.home-page .community-discovery__tiles a,
  body.home-page .community-discovery__tiles button {
    min-height: 96px;
  }

  body.home-page .community-section-heading {
    display: grid;
  }

  body.home-page .community-section-heading p {
    text-align: left;
  }

  body.home-page .community-controls {
    grid-template-columns: 1fr !important;
  }

  body.home-page .community-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  body.home-page .community-card__actions {
    grid-template-columns: 1fr !important;
  }

  body.home-page .community-card__actions .btn--ghost {
    display: none;
  }

  body.home-page .community-world-dialog {
    width: calc(100vw - 8px) !important;
    max-height: calc(100dvh - 8px) !important;
    border-radius: 12px !important;
  }

  body.home-page .community-world-dialog .community-model-detail {
    max-height: calc(100dvh - 78px);
    padding: 10px;
  }

  body.home-page .community-world-related__list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  body.home-page .community-grid {
    grid-template-columns: 1fr !important;
  }

  body.home-page .community-card__media {
    aspect-ratio: 4 / 3 !important;
  }

  body.home-page .community-discovery__tiles {
    grid-template-columns: 1fr;
  }
}


/* V522 — full-width community and a single invisible scrollbar. */
body.home-page .marketplace-home {
  width: calc(100vw - 16px) !important;
  max-width: none !important;
  margin: 10px 8px 64px !important;
}

body.home-page .community-hub {
  width: 100%;
  max-width: none;
}

body.home-page .community-hub__hero {
  display: none !important;
}

body.home-page .community-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
}

/* The page keeps scrolling, but browser scrollbars do not occupy or flash in the UI. */
html:has(body.home-page),
body.home-page,
body.home-page .community-topic-strip,
body.home-page .community-world-dialog .community-model-detail {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
html:has(body.home-page)::-webkit-scrollbar,
body.home-page::-webkit-scrollbar,
body.home-page .community-topic-strip::-webkit-scrollbar,
body.home-page .community-world-dialog .community-model-detail::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

/* Lock both document scroll containers while the model card is open: no double scrolling. */
html.is-modal-open,
html.is-modal-open body.home-page,
html:has(body.home-page.is-modal-open),
html:has(body.home-page.is-modal-open) body.home-page {
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.home-page .community-world-dialog {
  width: calc(100vw - 16px) !important;
  max-width: none !important;
  height: calc(100dvh - 16px) !important;
  max-height: calc(100dvh - 16px) !important;
  margin: 0 !important;
}

body.home-page .community-world-dialog .community-model-detail {
  height: calc(100dvh - 78px) !important;
  max-height: calc(100dvh - 78px) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

@media (max-width: 760px) {
  body.home-page .marketplace-home {
    width: calc(100vw - 8px) !important;
    margin: 6px 4px 48px !important;
  }
  body.home-page .community-world-dialog {
    width: calc(100vw - 4px) !important;
    height: calc(100dvh - 4px) !important;
    max-height: calc(100dvh - 4px) !important;
  }
}

/* V523 — balanced community width, compact model image, exact-source builder fix. */
body.home-page .marketplace-home {
  width: min(1640px, calc(100vw - 32px)) !important;
  max-width: 1640px !important;
  margin: 14px auto 64px !important;
}

body.home-page .community-grid {
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)) !important;
  gap: 15px !important;
}

body.home-page .community-world-dialog {
  width: min(1240px, calc(100vw - 32px)) !important;
  max-width: 1240px !important;
  height: auto !important;
  max-height: calc(100dvh - 32px) !important;
  margin: auto !important;
}

body.home-page .community-world-dialog .community-model-detail {
  height: auto !important;
  max-height: calc(100dvh - 104px) !important;
  padding: 16px !important;
}

body.home-page .community-world-detail__top {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr) !important;
  gap: 16px !important;
}

body.home-page .community-world-detail__gallery {
  min-width: 0;
  max-width: 100%;
}

body.home-page .community-world-detail__gallery .community-model-detail__visual {
  width: 100%;
  height: clamp(280px, 42dvh, 430px) !important;
  max-height: 430px !important;
  aspect-ratio: auto !important;
  display: grid;
  place-items: center;
}

body.home-page .community-world-detail__gallery .community-model-detail__visual img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
}

body.home-page .community-model-gallery__thumbs {
  grid-template-columns: repeat(auto-fill, minmax(76px, 92px)) !important;
  justify-content: start;
}

body.home-page .community-model-gallery__thumb {
  width: 100%;
  max-width: 92px;
}

@media (max-width: 1280px) {
  body.home-page .marketplace-home {
    width: min(1180px, calc(100vw - 28px)) !important;
  }
  body.home-page .community-world-dialog {
    width: min(1120px, calc(100vw - 24px)) !important;
  }
}

@media (max-width: 1040px) {
  body.home-page .community-world-detail__top {
    grid-template-columns: 1fr !important;
  }
  body.home-page .community-world-detail__gallery .community-model-detail__visual {
    height: clamp(260px, 45dvh, 400px) !important;
  }
}

@media (max-width: 760px) {
  body.home-page .marketplace-home {
    width: calc(100vw - 16px) !important;
    margin: 8px auto 48px !important;
  }
  body.home-page .community-world-dialog {
    width: calc(100vw - 10px) !important;
    max-width: none !important;
    max-height: calc(100dvh - 10px) !important;
  }
  body.home-page .community-world-dialog .community-model-detail {
    max-height: calc(100dvh - 82px) !important;
    padding: 10px !important;
  }
  body.home-page .community-world-detail__gallery .community-model-detail__visual {
    height: clamp(220px, 40dvh, 330px) !important;
    max-height: 330px !important;
  }
}

/* V524 — professional category sidebar, full image fit and separate favorites star. */
body.home-page .community-hub {
  display: grid !important;
  grid-template-columns: 224px minmax(0, 1fr) !important;
  column-gap: 22px !important;
  row-gap: 18px !important;
  align-items: start;
}

body.home-page .community-hub > :not(.community-topic-strip) {
  grid-column: 2;
  min-width: 0;
}

body.home-page .community-topic-strip {
  grid-column: 1;
  grid-row: 1 / span 20;
  position: sticky;
  top: 92px;
  display: grid !important;
  align-content: start;
  gap: 5px !important;
  max-height: calc(100dvh - 112px);
  padding: 14px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  border: 1px solid var(--community-line);
  border-radius: 16px;
  background: var(--community-surface);
  box-shadow: 0 12px 30px rgba(2, 6, 23, .12);
}

body.home-page .community-topic-strip::before {
  content: var(--abgul-label-05f6c615a3, "Категории");
  display: block;
  padding: 2px 8px 9px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .01em;
}

body.home-page .community-topic-strip button {
  display: grid !important;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 7px 10px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: var(--text) !important;
  text-align: left;
  box-shadow: none !important;
  transform: none !important;
}

body.home-page .community-topic-strip button > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(148, 163, 184, .12);
  color: var(--community-muted);
  font-size: 13px;
  font-weight: 900;
}

body.home-page .community-topic-strip button > b {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: normal;
}

body.home-page .community-topic-strip button:hover {
  background: rgba(34, 197, 94, .09) !important;
}

body.home-page .community-topic-strip button.is-active {
  background: rgba(34, 197, 94, .16) !important;
  color: #22c55e !important;
}

body.home-page .community-topic-strip button.is-active > span {
  background: #16a34a;
  color: #fff;
}

body.home-page .community-topic-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

body.home-page #community-category-select {
  display: none !important;
}

body.home-page .community-controls {
  grid-template-columns: minmax(280px, 1fr) minmax(180px, 230px) !important;
}

/* Show uploaded photographs completely instead of cropping their edges. */
body.home-page .community-card__media,
body.home-page .community-spotlight__media,
body.home-page .community-model-detail__visual {
  background:
    linear-gradient(45deg, rgba(148, 163, 184, .045) 25%, transparent 25%, transparent 75%, rgba(148, 163, 184, .045) 75%),
    linear-gradient(45deg, rgba(148, 163, 184, .045) 25%, transparent 25%, transparent 75%, rgba(148, 163, 184, .045) 75%),
    rgba(15, 23, 42, .45) !important;
  background-position: 0 0, 10px 10px !important;
  background-size: 20px 20px !important;
}

body.home-page .community-card__media img,
body.home-page .community-spotlight__media img,
body.home-page .community-model-detail__visual img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  padding: 8px;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
}

body.home-page .community-card:hover .community-card__media img,
body.home-page .community-spotlight:hover .community-spotlight__media img {
  transform: none !important;
}

body.home-page .community-world-detail__gallery {
  position: relative;
}

body.home-page .community-favorite-btn {
  position: absolute;
  z-index: 8;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 12px;
  background: rgba(2, 6, 23, .68);
  color: #fff;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(2, 6, 23, .2);
  transition: transform .16s ease, color .16s ease, background .16s ease;
}

body.home-page .community-favorite-btn:hover {
  transform: translateY(-1px) scale(1.03);
  background: rgba(15, 23, 42, .9);
}

body.home-page .community-favorite-btn.is-active {
  border-color: rgba(250, 204, 21, .82);
  background: rgba(120, 83, 10, .88);
  color: #fde047;
}

body.home-page .community-favorite-btn--detail {
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  font-size: 24px;
}

body.home-page .community-world-related .community-card--compact .community-favorite-btn {
  display: none !important;
}

body[data-theme="light"].home-page .community-card__media,
body[data-theme="light"].home-page .community-spotlight__media,
body[data-theme="light"].home-page .community-model-detail__visual,
html[data-theme="light"] body.home-page .community-card__media,
html[data-theme="light"] body.home-page .community-spotlight__media,
html[data-theme="light"] body.home-page .community-model-detail__visual {
  background-color: #eef1f4 !important;
}

@media (max-width: 980px) {
  body.home-page .community-hub {
    grid-template-columns: 1fr !important;
  }

  body.home-page .community-hub > :not(.community-topic-strip),
  body.home-page .community-topic-strip {
    grid-column: 1;
  }

  body.home-page .community-topic-strip {
    grid-row: auto;
    position: static;
    display: flex !important;
    max-height: none;
    padding: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  body.home-page .community-topic-strip::before {
    display: none;
  }

  body.home-page .community-topic-strip button {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    grid-template-columns: 22px auto;
  }
}

@media (max-width: 760px) {
  body.home-page .community-controls {
    grid-template-columns: 1fr !important;
  }

  body.home-page .community-favorite-btn {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    font-size: 20px;
  }
}


/* V525 — discovery only in “Для вас”; sticky search and filters below the main topbar. */
body.home-page .community-controls {
  position: sticky !important;
  top: 92px !important;
  z-index: 45 !important;
  margin: 0 !important;
  background: rgba(15, 23, 42, .94) !important;
  box-shadow: 0 14px 34px rgba(2, 6, 23, .22) !important;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

body[data-theme="light"].home-page .community-controls,
html[data-theme="light"] body.home-page .community-controls {
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .10) !important;
}

@media (max-width: 1180px) {
  body.home-page .community-controls {
    top: 76px !important;
  }
}

@media (max-width: 760px) {
  body.home-page .community-controls {
    top: 68px !important;
    padding: 8px !important;
    border-radius: 13px !important;
  }
}


/* V526 — fixed discovery banner carousel with dedicated user-uploaded banners. */
body.home-page .community-spotlight {
  height: 330px !important;
  min-height: 330px !important;
}

body.home-page .community-banner-carousel,
body.home-page .community-banner-slide,
body.home-page .community-spotlight__placeholder--banner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

body.home-page .community-banner-carousel {
  overflow: hidden;
  border-radius: inherit;
  background: #0b1120;
}

body.home-page .community-banner-slide {
  z-index: 1;
  display: block;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .45s ease, visibility .45s ease;
}

body.home-page .community-banner-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.home-page .community-banner-slide > img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  padding: 0 !important;
  object-fit: cover !important;
  object-position: center !important;
  transform: none !important;
}

body.home-page .community-banner-slide__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, .88), rgba(2, 6, 23, .48) 50%, rgba(2, 6, 23, .08));
  pointer-events: none;
}

body.home-page .community-banner-slide__copy {
  position: absolute;
  z-index: 2;
  left: 26px;
  bottom: 25px;
  display: grid;
  gap: 7px;
  width: min(610px, calc(100% - 100px));
}

body.home-page .community-banner-slide__copy em {
  width: max-content;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(22, 163, 74, .92);
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

body.home-page .community-banner-slide__copy b {
  overflow: hidden;
  color: #fff;
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.06;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.home-page .community-banner-slide__copy small {
  color: rgba(255,255,255,.84);
  font-size: 12px;
  font-weight: 750;
}

body.home-page .community-banner-arrow {
  position: absolute;
  z-index: 5;
  top: 50%;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0 0 3px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 50%;
  background: rgba(2, 6, 23, .58);
  color: #fff;
  font: inherit;
  font-size: 33px;
  line-height: 1;
  cursor: pointer;
  opacity: .9;
  transform: translateY(-50%);
  backdrop-filter: blur(10px);
  transition: background .16s ease, opacity .16s ease;
}

body.home-page .community-banner-arrow:hover { background: rgba(2, 6, 23, .9); opacity: 1; }
body.home-page .community-banner-arrow--prev { left: 13px; }
body.home-page .community-banner-arrow--next { right: 13px; }

body.home-page .community-banner-dots {
  position: absolute;
  z-index: 6;
  right: 18px;
  bottom: 17px;
  display: flex;
  gap: 7px;
}

body.home-page .community-banner-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.52);
  cursor: pointer;
  transition: width .2s ease, background .2s ease;
}

body.home-page .community-banner-dots button.is-active {
  width: 25px;
  background: #22c55e;
}

body.home-page .community-spotlight__placeholder--banner {
  display: block;
  min-height: 0 !important;
  padding: 0 !important;
}

body.home-page .community-spotlight__placeholder--banner img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 !important;
  object-fit: cover !important;
  object-position: center !important;
}

body.home-page .community-spotlight__placeholder-copy {
  position: absolute;
  z-index: 2;
  left: clamp(18px, 4vw, 38px);
  bottom: clamp(20px, 5vw, 42px);
  display: grid;
  gap: 8px;
  width: min(620px, calc(100% - 36px));
  color: #fff;
  text-align: left;
}

body.home-page .community-spotlight__placeholder-copy span {
  width: max-content;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(22, 163, 74, .92);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

body.home-page .community-spotlight__placeholder-copy strong {
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.04;
}

body.home-page .community-spotlight__placeholder-copy small {
  max-width: 520px;
  color: rgba(255, 255, 255, .8);
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 760px) {
  body.home-page .community-spotlight__placeholder-copy {
    bottom: 20px;
    gap: 7px;
    width: calc(100% - 36px);
  }

  body.home-page .community-spotlight__placeholder-copy strong {
    font-size: 28px;
  }

  body.home-page .community-spotlight__placeholder-copy small {
    font-size: 12px;
  }
}

.community-upload-drop--banner .community-upload-drop__title em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 650;
}

.community-file-picker--banner {
  min-height: 94px;
}

.community-banner-preview {
  overflow: hidden;
  width: 100%;
  aspect-ratio: 8 / 3;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #0b1120;
}

.community-banner-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 760px) {
  body.home-page .community-spotlight { height: 280px !important; min-height: 280px !important; }
  body.home-page .community-banner-slide__copy { left: 18px; bottom: 20px; width: calc(100% - 76px); }
  body.home-page .community-banner-slide__copy b { font-size: clamp(22px, 7vw, 30px); }
  body.home-page .community-banner-slide__copy small { display: none; }
  body.home-page .community-banner-arrow { width: 36px; height: 36px; font-size: 28px; }
  body.home-page .community-banner-arrow--prev { left: 8px; }
  body.home-page .community-banner-arrow--next { right: 8px; }
  body.home-page .community-banner-dots { right: 12px; bottom: 12px; }
}


/* V527 — slightly wider community, restored “My publications”, cleaner constructor CTA. */
body.home-page .marketplace-home {
  width: min(1760px, calc(100vw - 28px)) !important;
  max-width: 1760px !important;
}

body.home-page .community-feed-head__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

body.home-page .community-card__actions {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: center;
  justify-items: stretch;
}

body.home-page .community-builder-cta {
  grid-column: 1 / -1;
  justify-self: center;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: min(100%, 220px);
  min-height: 38px;
  padding: 8px 16px !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  text-align: center;
  text-transform: none !important;
}

body.home-page .community-card--compact .community-builder-cta {
  width: min(100%, 190px);
}

@media (max-width: 760px) {
  body.home-page .marketplace-home {
    width: calc(100vw - 16px) !important;
  }

  body.home-page .community-feed-head {
    align-items: flex-start;
  }

  body.home-page .community-feed-head__actions {
    width: 100%;
    justify-content: stretch;
  }

  body.home-page .community-feed-head__actions .btn {
    flex: 1 1 140px;
  }
}


/* V528 — wider community canvas; publication control lives in the main topbar. */
body.home-page .marketplace-home {
  width: min(1880px, calc(100vw - 20px)) !important;
  max-width: 1880px !important;
}

@media (max-width: 760px) {
  body.home-page .marketplace-home {
    width: calc(100vw - 16px) !important;
  }
}

body.home-page .topbar-my-publications-btn {
  color: #a7f3d0;
}

body.home-page .topbar-my-publications-btn .topbar-icon-btn__glyph--publications {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  font-size: 0;
  line-height: 0;
}

body.home-page .topbar-my-publications-btn .topbar-icon-btn__glyph--publications svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* V529 — wider canvas, persistent publication assets and full edit workflow. */
body.home-page .marketplace-home {
  width: min(2160px, calc(100vw - 12px)) !important;
  max-width: 2160px !important;
}

body.home-page .community-card__media,
body.home-page .community-model-detail__visual,
body.home-page .community-model-gallery__thumb {
  display: grid !important;
  place-items: center !important;
  overflow: hidden;
}

body.home-page .community-card__media > img,
body.home-page .community-model-detail__visual > img,
body.home-page .community-model-gallery__thumb > img,
body.home-page .community-world-detail__gallery .community-model-detail__visual > img {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  flex: 0 1 auto;
}

.community-dialog--upload {
  width: min(1180px, calc(100vw - 28px)) !important;
  max-width: 1180px !important;
  max-height: calc(100dvh - 24px) !important;
}

.community-dialog--upload .community-upload-form {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.community-dialog--upload .community-upload-form::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.community-asset-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.community-asset-list.hidden {
  display: none;
}

.community-asset-row {
  display: grid;
  grid-template-columns: 22px 38px minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 8px 9px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 11px;
  background: rgba(15, 23, 42, .48);
  transition: border-color .16s ease, background .16s ease, opacity .16s ease;
}

.community-asset-row.is-primary {
  border-color: rgba(34, 197, 94, .48);
  background: rgba(22, 163, 74, .09);
}

.community-asset-row.is-dragging,
.community-cover-editor__thumb.is-dragging {
  opacity: .45;
}

.community-asset-drag,
.community-cover-editor__drag {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.community-asset-file-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(34, 197, 94, .24), rgba(14, 165, 233, .2));
  color: #d1fae5;
  font-size: 11px;
  font-weight: 900;
}

.community-asset-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.community-asset-copy b {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-asset-copy em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.community-asset-primary {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, .16);
  color: #86efac;
  font-size: 10px;
  font-weight: 850;
}

.community-asset-remove {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(248, 113, 113, .34);
  border-radius: 9px;
  background: rgba(127, 29, 29, .18);
  color: #fca5a5;
  font-family: inherit;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.community-asset-remove:hover {
  border-color: rgba(248, 113, 113, .7);
  background: rgba(220, 38, 38, .28);
  transform: scale(1.04);
}

body.shop-page .community-cover-editor__thumb,
body.home-page .community-cover-editor__thumb {
  position: relative;
  flex-basis: 96px;
  width: 96px;
  overflow: visible;
  cursor: grab;
}

body.shop-page .community-cover-editor__thumb img,
body.home-page .community-cover-editor__thumb img {
  overflow: hidden;
  border-radius: 7px;
}

.community-cover-editor__drag {
  position: absolute !important;
  left: 4px !important;
  top: 4px !important;
  right: auto !important;
  bottom: auto !important;
  padding: 3px 5px !important;
  border-radius: 6px !important;
  background: rgba(2, 6, 23, .78) !important;
  color: #fff !important;
  font-size: 12px !important;
}

.community-cover-editor__main-badge {
  position: absolute !important;
  right: 4px !important;
  bottom: 4px !important;
}

.community-cover-editor__remove {
  position: absolute;
  z-index: 3;
  top: -9px;
  right: -9px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  font-size: 18px;
}

.community-banner-preview {
  position: relative;
}

.community-banner-remove {
  position: absolute;
  z-index: 4;
  top: 10px;
  right: 10px;
  border-radius: 50%;
  background: rgba(127, 29, 29, .82);
  backdrop-filter: blur(8px);
}

body[data-theme="light"] .community-asset-row,
html[data-theme="light"] body .community-asset-row {
  background: rgba(248, 250, 252, .94);
  border-color: rgba(100, 116, 139, .24);
}

body[data-theme="light"] .community-asset-row.is-primary,
html[data-theme="light"] body .community-asset-row.is-primary {
  background: rgba(220, 252, 231, .78);
  border-color: rgba(22, 163, 74, .38);
}

body[data-theme="light"] .community-asset-primary,
html[data-theme="light"] body .community-asset-primary {
  color: #166534;
}

@media (max-width: 760px) {
  body.home-page .marketplace-home {
    width: calc(100vw - 10px) !important;
  }

  .community-dialog--upload {
    width: calc(100vw - 10px) !important;
    max-width: none !important;
    max-height: calc(100dvh - 10px) !important;
  }

  .community-asset-row {
    grid-template-columns: 18px 34px minmax(0, 1fr) 32px;
  }

  .community-asset-primary {
    display: none;
  }
}

/* V530 — polished image editor, automatic image guidance and fullscreen gallery. */
.community-photo-guidance {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 9px;
  padding: 10px 12px;
  border: 1px solid rgba(56, 189, 248, .25);
  border-radius: 11px;
  background: rgba(14, 165, 233, .09);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.community-photo-guidance b {
  color: var(--text);
  font-weight: 800;
}

.community-photo-guidance__icon {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(56, 189, 248, .18);
  color: #7dd3fc;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.community-photo-guidance--banner {
  border-color: rgba(167, 139, 250, .26);
  background: rgba(124, 58, 237, .09);
}

.community-photo-guidance--banner .community-photo-guidance__icon {
  background: rgba(167, 139, 250, .18);
  color: #c4b5fd;
}

body.shop-page .community-cover-editor,
body.home-page .community-cover-editor {
  grid-template-columns: minmax(250px, 340px) minmax(0, 1fr) !important;
  gap: 16px 18px !important;
  padding: 15px !important;
  border-radius: 14px !important;
}

body.shop-page .community-cover-editor__frame,
body.home-page .community-cover-editor__frame {
  position: relative;
  width: 100%;
  min-height: 210px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 12px;
  background: #0b1220;
  cursor: zoom-in;
  appearance: none;
}

body.shop-page .community-cover-editor__frame:hover,
body.home-page .community-cover-editor__frame:hover {
  border-color: rgba(52, 211, 153, .56);
  box-shadow: 0 12px 30px rgba(2, 6, 23, .22);
}

.community-cover-editor__zoom,
.community-model-detail__zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(2, 6, 23, .72);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

body.shop-page .community-cover-editor__thumbs,
body.home-page .community-cover-editor__thumbs {
  gap: 12px !important;
  padding: 8px 4px 10px 2px !important;
}

body.shop-page .community-cover-editor__thumb,
body.home-page .community-cover-editor__thumb {
  flex: 0 0 132px !important;
  flex-basis: 132px !important;
  width: 132px !important;
  min-width: 132px !important;
  border-radius: 11px !important;
  box-shadow: 0 8px 20px rgba(2, 6, 23, .16);
}

body.shop-page .community-cover-editor__thumb img,
body.home-page .community-cover-editor__thumb img {
  border-radius: 10px !important;
}

.community-asset-remove {
  width: 34px !important;
  height: 34px !important;
  border: 1px solid rgba(248, 113, 113, .42) !important;
  border-radius: 50% !important;
  background: rgba(127, 29, 29, .76) !important;
  color: #fee2e2 !important;
  box-shadow: 0 8px 18px rgba(69, 10, 10, .28), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(10px);
}

.community-asset-remove svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.community-asset-remove:hover {
  border-color: rgba(254, 202, 202, .78) !important;
  background: rgba(220, 38, 38, .92) !important;
  transform: translateY(-1px) scale(1.06) !important;
  box-shadow: 0 10px 24px rgba(127, 29, 29, .38);
}

.community-asset-remove:focus-visible {
  outline: 3px solid rgba(248, 113, 113, .28);
  outline-offset: 2px;
}

.community-cover-editor__remove {
  top: -10px !important;
  right: -10px !important;
  width: 36px !important;
  height: 36px !important;
}

.community-banner-remove {
  top: 12px !important;
  right: 12px !important;
  width: 38px !important;
  height: 38px !important;
}

.community-model-detail__visual-button {
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  background: #0b1220;
  cursor: zoom-in;
  appearance: none;
}

.community-model-detail__visual-button:focus-visible {
  outline: 3px solid rgba(52, 211, 153, .42);
  outline-offset: 2px;
}

.community-lightbox {
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
}

.community-lightbox.hidden {
  display: none !important;
}

.community-lightbox__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, .94);
  cursor: zoom-out;
}

.community-lightbox__surface {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(1600px, calc(100vw - 32px));
  height: min(960px, calc(100dvh - 32px));
  min-width: 0;
  min-height: 0;
}

.community-lightbox__stage {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
}

.community-lightbox__stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}

.community-lightbox__close,
.community-lightbox__arrow {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(15, 23, 42, .76);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: background .16s ease, transform .16s ease, border-color .16s ease;
}

.community-lightbox__close:hover,
.community-lightbox__arrow:hover {
  border-color: rgba(255, 255, 255, .34);
  background: rgba(30, 41, 59, .94);
  transform: scale(1.05);
}

.community-lightbox__close {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 19px;
}

.community-lightbox__arrow {
  align-self: center;
  width: 46px;
  height: 64px;
  border-radius: 14px;
  font-family: Arial, sans-serif;
  font-size: 40px;
  font-weight: 300;
  line-height: 1;
}

.community-lightbox__arrow--prev {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.community-lightbox__arrow--next {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.community-lightbox__footer {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  justify-items: center;
  gap: 9px;
  min-height: 48px;
  padding-top: 12px;
  color: rgba(255, 255, 255, .84);
  font-size: 12px;
  font-weight: 750;
}

.community-lightbox__dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  max-width: min(600px, 80vw);
}

.community-lightbox__dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .34);
  cursor: pointer;
  transition: width .16s ease, background .16s ease;
}

.community-lightbox__dots button.is-active {
  width: 24px;
  border-radius: 999px;
  background: #34d399;
}

html.community-lightbox-open,
html.community-lightbox-open body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

body[data-theme="light"] .community-photo-guidance,
html[data-theme="light"] body .community-photo-guidance {
  background: #effaff;
  border-color: #bae6fd;
  color: #475569;
}

body[data-theme="light"] .community-photo-guidance--banner,
html[data-theme="light"] body .community-photo-guidance--banner {
  background: #f5f3ff;
  border-color: #ddd6fe;
}

@media (max-width: 760px) {
  body.shop-page .community-cover-editor,
  body.home-page .community-cover-editor {
    grid-template-columns: 1fr !important;
  }

  body.shop-page .community-cover-editor__frame,
  body.home-page .community-cover-editor__frame {
    width: min(100%, 420px) !important;
    min-height: 190px;
    margin-inline: auto;
  }

  body.shop-page .community-cover-editor__thumb,
  body.home-page .community-cover-editor__thumb {
    flex-basis: 112px !important;
    width: 112px !important;
    min-width: 112px !important;
  }

  .community-lightbox {
    padding: 6px;
  }

  .community-lightbox__surface {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    width: calc(100vw - 12px);
    height: calc(100dvh - 12px);
  }

  .community-lightbox__stage {
    border-radius: 8px;
  }

  .community-lightbox__arrow {
    width: 38px;
    height: 54px;
    border-radius: 11px;
    font-size: 34px;
  }

  .community-lightbox__close {
    top: 6px;
    right: 6px;
    width: 40px;
    height: 40px;
  }
}


/* V531 — adaptive desktop community width for laptops and wide monitors. */
body.home-page .marketplace-home {
  box-sizing: border-box !important;
  width: min(2100px, calc(100% - clamp(32px, 5vw, 96px))) !important;
  max-width: 2100px !important;
  margin: 14px auto 64px !important;
  overflow: visible;
}

body.home-page .community-hub,
body.home-page .community-hub > *,
body.home-page .community-discovery,
body.home-page .community-discovery > *,
body.home-page .community-controls,
body.home-page .community-grid {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

body.home-page .community-hub {
  grid-template-columns: clamp(196px, 14vw, 224px) minmax(0, 1fr) !important;
  column-gap: clamp(16px, 1.5vw, 24px) !important;
}

body.home-page .community-discovery {
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, .8fr) !important;
}

body.home-page .community-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 245px), 1fr)) !important;
  gap: clamp(12px, 1vw, 16px) !important;
}

body.home-page .community-card,
body.home-page .community-card__body,
body.home-page .community-card__media {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1439px) {
  body.home-page .marketplace-home {
    width: calc(100% - 48px) !important;
  }

  body.home-page .community-hub {
    grid-template-columns: 204px minmax(0, 1fr) !important;
    column-gap: 18px !important;
  }

  body.home-page .community-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr)) !important;
  }
}

@media (max-width: 1180px) {
  body.home-page .marketplace-home {
    width: calc(100% - 36px) !important;
  }

  body.home-page .community-hub {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.home-page .community-hub > :not(.community-topic-strip),
  body.home-page .community-topic-strip {
    grid-column: 1 !important;
  }

  body.home-page .community-topic-strip {
    grid-row: auto !important;
    position: static !important;
    display: flex !important;
    max-height: none !important;
    padding: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  body.home-page .community-topic-strip::before {
    display: none !important;
  }

  body.home-page .community-topic-strip button {
    flex: 0 0 auto;
    width: auto !important;
    min-width: max-content;
    grid-template-columns: 22px auto !important;
  }

  body.home-page .community-discovery {
    grid-template-columns: minmax(0, 1.35fr) minmax(290px, .75fr) !important;
  }
}

@media (max-width: 980px) {
  body.home-page .marketplace-home {
    width: calc(100% - 28px) !important;
  }

  body.home-page .community-discovery {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.home-page .community-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)) !important;
  }
}

@media (max-width: 760px) {
  body.home-page .marketplace-home {
    width: calc(100% - 16px) !important;
    margin: 8px auto 48px !important;
  }

  body.home-page .community-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
}

@media (max-width: 460px) {
  body.home-page .community-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* V532 — clean owner actions inside profile model cards. */
body.home-page #community-profile-modal .community-profile-models {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 248px), 1fr)) !important;
  gap: 14px !important;
  align-items: start;
}

body.home-page #community-profile-modal .community-card--compact .community-card__actions {
  display: grid !important;
  grid-template-columns: minmax(112px, 1.35fr) minmax(76px, .85fr) !important;
  gap: 8px !important;
  width: 100%;
  align-items: stretch;
}

body.home-page #community-profile-modal .community-card--compact .community-card__actions .btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 36px;
  padding: 8px 10px !important;
  border-radius: 9px !important;
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
  letter-spacing: 0 !important;
  text-align: center;
  text-transform: none !important;
  white-space: nowrap;
  overflow: visible;
}

body.home-page #community-profile-modal .community-card--compact .community-builder-cta {
  grid-column: 1 / -1 !important;
  max-width: none !important;
}

body.home-page #community-profile-modal .community-card--compact .community-edit-btn {
  color: #d7f2ff !important;
  background: rgba(14, 116, 144, .22) !important;
  border-color: rgba(56, 189, 248, .42) !important;
}

body.home-page #community-profile-modal .community-card--compact .community-edit-btn:hover {
  background: rgba(14, 116, 144, .36) !important;
  border-color: rgba(125, 211, 252, .72) !important;
}

body.home-page #community-profile-modal .community-card--compact .community-delete-btn {
  background: rgba(220, 38, 38, .88) !important;
  border-color: rgba(248, 113, 113, .72) !important;
  color: #fff !important;
}

@media (max-width: 640px) {
  body.home-page #community-profile-modal .community-card--compact .community-card__actions {
    grid-template-columns: 1fr !important;
  }

  body.home-page #community-profile-modal .community-card--compact .community-builder-cta {
    grid-column: auto !important;
  }
}

/* V534 — safe floating community search without changing the page grid or ancestor overflow. */
body.home-page .community-controls-shell {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

body.home-page .community-controls-shell .community-controls {
  position: relative !important;
  top: auto !important;
  left: auto;
  right: auto;
  width: 100%;
  max-width: 100%;
  margin: 0 !important;
}

body.home-page .community-controls-shell .community-controls.community-controls--floating {
  position: fixed !important;
  right: auto !important;
  z-index: 9990 !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  background: rgba(15, 23, 42, .97) !important;
  box-shadow: 0 14px 34px rgba(2, 6, 23, .26) !important;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

body[data-theme="light"].home-page .community-controls-shell .community-controls.community-controls--floating,
html[data-theme="light"] body.home-page .community-controls-shell .community-controls.community-controls--floating {
  background: rgba(255, 255, 255, .97) !important;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .12) !important;
}

@media (max-width: 760px) {
  body.home-page .community-controls-shell .community-controls.community-controls--floating {
    border-radius: 13px !important;
  }
}
/* V585: touch cards keep their position while the user swipes photos. */
@media (max-width: 760px) {
  body.home-page .community-card:hover {
    transform: none !important;
  }

  body.home-page .community-card:hover .community-card__media img {
    transform: none !important;
  }
}

/* The unenhanced strip remains natively scrollable without JavaScript. */
@media (max-width: 1180px) {
  body.home-page .community-hub, body.home-page .marketplace-home { min-width: 0 !important; }
  body.home-page #community-topic-strip {
    display: flex !important; flex-wrap: nowrap !important; min-width: 0 !important;
    width: 100% !important; max-width: 100% !important; box-sizing: border-box;
    overflow-x: auto !important; overflow-y: hidden !important;
    touch-action: pan-x pan-y pinch-zoom !important; -webkit-overflow-scrolling: touch;
    scroll-behavior: auto !important;
    overscroll-behavior-x: contain; scrollbar-width: thin; cursor: grab;
  }
  body.home-page #community-topic-strip button { flex: 0 0 auto; min-height: 44px; user-select: none; }
  body.home-page #community-topic-strip * { touch-action: pan-x pan-y pinch-zoom !important; }
  body.home-page #community-topic-strip.is-dragging, body.home-page #community-topic-strip.is-dragging button { cursor: grabbing; }
  /* V690: the controller owns horizontal swipes; vertical panning stays native. */
  body.home-page #community-topic-strip.has-swipe-scroll,
  body.home-page #community-topic-strip.has-swipe-scroll * {
    touch-action: pan-y pinch-zoom !important;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
}
