:root {
  --bg: #e7ebef;
  --panel: #fdfefe;
  --panel-alt: #f1f5fa;
  --border: #cfd9e6;
  --text: #233142;
  --muted: #6a7a8f;
  --brand: #4a76a8;
  --brand-dark: #365f8d;
  --brand-soft: #e8f0fb;
  --accent: #2f9b8f;
  --warning: #fff3cd;
  --success: #4b9c72;
  --danger: #c95d4c;
  --shadow: 0 12px 28px rgba(47, 74, 108, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f4f6f8 0%, var(--bg) 100%);
  color: var(--text);
  font-family: 'Onest', sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  gap: 10px;
  padding: 12px 24px 10px;
  background: rgba(233, 239, 247, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(207, 217, 230, 0.9);
  box-shadow: 0 12px 28px rgba(47, 74, 108, 0.08);
}

.topbar__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.topbar__brand {
  display: inline-flex;
  grid-column: 2;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.mobile-menu-btn,
.mobile-account-btn,
.mobile-close-btn,
.shop-search-toggle {
  display: grid;
  height: 42px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  cursor: pointer;
}

.mobile-menu-btn,
.mobile-account-btn {
  min-width: 104px;
  grid-auto-flow: column;
  gap: 8px;
  padding: 0 12px;
  font-weight: 800;
}

.mobile-menu-btn {
  display: none;
  justify-self: start;
}

.mobile-account-btn {
  justify-self: end;
}

.shop-search-toggle {
  width: 42px;
}

.mobile-close-btn {
  display: none;
  width: 42px;
}

.mobile-menu-btn:hover,
.mobile-account-btn:hover,
.mobile-close-btn:hover,
.shop-search-toggle:hover,
.shop-search-toggle.is-active {
  background: var(--brand-soft);
}

.topbar__logo {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
  color: #fff;
  font-size: 20px;
  box-shadow: var(--shadow);
}

.topbar__logo--image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.topbar__title {
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.topbar__subtitle {
  color: var(--muted);
  font-size: 13px;
}

.topbar__site-nav {
  display: grid;
  grid-template-columns: 42px auto 42px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.topbar__nav-slot {
  display: grid;
  width: 42px;
  place-items: center;
}

.topbar__nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.topbar__nav-links a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.topbar__nav-links a:hover,
.topbar__nav-links a[aria-current='page'] {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.topbar__search-panel {
  display: none;
  width: min(720px, 100%);
  margin: 0 auto;
}

body.shop-search-open .topbar__search-panel {
  display: block;
}

.topbar__search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.topbar__search input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
}

.topbar__actions {
  position: absolute;
  top: calc(100% + 8px);
  right: max(24px, calc((100vw - 1120px) / 2));
  display: none;
  max-width: min(420px, calc(100vw - 32px));
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

body.mobile-account-open .topbar__actions {
  display: flex;
}

@media (min-width: 1121px) {
  .topbar__actions {
    width: 360px;
    max-width: 360px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px;
  }

  .topbar__actions .inline-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
  }

  .topbar__actions .inline-form input,
  .topbar__actions .inline-form select,
  .topbar__actions .inline-form button,
  .topbar__actions > button {
    width: 100%;
    min-width: 0;
  }

  .topbar__actions .user-chip {
    width: 100%;
  }

  .topbar__actions .notification-btn {
    justify-content: center;
  }
}

.page {
  display: grid;
  grid-template-columns: 240px minmax(0, 800px) 300px;
  gap: 20px;
  justify-content: center;
  max-width: none;
  margin: 0 auto;
  padding: 24px;
}

.sidebar,
.content {
  min-width: 0;
}

.sidebar--left {
  position: sticky;
  top: 138px;
  align-self: start;
}

.mobile-nav-backdrop {
  display: none;
}

body.mobile-nav-open {
  overflow: hidden;
}

body.mobile-account-open .mobile-account-btn {
  background: var(--brand-soft);
}

.panel {
  background: rgba(253, 254, 254, 0.95);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}

.panel--accent {
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel__header h2 {
  margin: 0;
  font-size: 18px;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 13px;
  padding: 12px;
  margin-bottom: 15px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(74, 118, 168, 0.98), rgba(47, 155, 143, 0.95));
  color: #fff;
  box-shadow: 0 18px 42px rgba(40, 72, 112, 0.18);
}

.hero-card {
  display: flex;
  flex-direction: column; /* Меняем ось на вертикальную */
  align-items: center; /* Выравнивание по центру (опционально) */
  text-align: center; /* Чтобы текст тоже был по центру */
  gap: 15px; /* Отступ между текстом и статистикой */
}

.hero-card p,
.hero-card__eyebrow {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

.hero-card__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 6px;
  margin-bottom: 5px;
}

.hero-card__stats {
	
   order: 1; /* Статистика уйдет вверх */
   margin-bottom: 20px; /* Отступ снизу, чтобы не прилипала к тексту */
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  min-width: 280px;
}

.stat-card {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  padding: 5px;
}

.stat-card strong {
  display: block;
  font-size: 15px;
  margin-bottom: 1px;
}

.main-view.is-hidden {
  display: none;
}

.is-hidden {
  display: none !important;
}

.feed-list,
.stack-list,
.nav-list {
  display: grid;
  gap: 12px;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.nav-btn,
.primary-btn,
.ghost-btn,
.danger-btn,
.chip-btn {
  border: 0;
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.nav-btn.is-active,
.nav-btn:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.primary-btn,
.ghost-btn,
.danger-btn,
.chip-btn {
  padding: 11px 16px;
  border-radius: 8px;
  font-weight: 600;
}

.primary-btn {
  background: var(--brand);
  color: #fff;
}

.primary-btn:hover {
  background: var(--brand-dark);
}

.primary-btn:disabled,
.ghost-btn:disabled,
.danger-btn:disabled,
.chip-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary-btn--block {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  text-decoration: none;
}

.ghost-btn {
  background: var(--panel-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.ghost-btn:hover {
  background: #e6edf7;
}

.danger-btn {
  background: #fbe9e7;
  color: var(--danger);
}

.danger-btn:hover {
  background: #f8ddd8;
}

.chip-btn {
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 9px 13px;
}

.chip-btn.is-active {
  background: #e8f5f3;
  color: var(--accent);
}

.chip-btn[data-like-profile].is-active,
.chip-btn[data-like-news].is-active {
  background: var(--brand-soft);
  color: #d92d52;
  box-shadow: none;
}

.chip-btn:hover {
  background: #d8e7f7;
}

.card-mini,
.post-card,
.profile-card,
.message-card,
.admin-user-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.card-mini {
  padding: 14px;
}

.card-mini h3,
.profile-card h3,
.post-card h3 {
  margin: 0 0 6px;
}

.meta,
.muted,
.empty-state {
  color: var(--muted);
}

.empty-state {
  padding: 10px 0;
}

.card-mini__actions,
.post-actions,
.inline-actions,
.profile-actions,
.moderation-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.admin-panel {
  display: grid;
  gap: 12px;
}

.admin-sections {
  display: grid;
  gap: 10px;
}

.admin-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.admin-section__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 0;
  background: #f7f9fc;
  color: var(--brand-dark);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.admin-section__toggle:hover,
.admin-section.is-open .admin-section__toggle {
  background: var(--brand-soft);
}

.admin-section__count {
  min-width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
}

.admin-section__body {
  max-height: min(74vh, 760px);
  overflow: auto;
  padding: 14px;
  border-top: 1px solid var(--border);
}

.admin-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.78fr);
  gap: 14px;
  align-items: start;
}

.admin-control-column {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.admin-control-column h3 {
  margin: 0;
  font-size: 16px;
  color: var(--brand-dark);
}

.admin-note {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #f3d0c8;
  border-radius: 8px;
  background: #fff6f4;
  color: #8b2e22;
}

.profile-browse-cta {
  display: flex;
  justify-content: center;
  margin: 18px 0 22px;
}

.profile-browse-cta__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  background: #4a76a8;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(74, 118, 168, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.profile-browse-cta__button:hover {
  background: #365f8d;
  box-shadow: 0 14px 30px rgba(54, 95, 141, 0.25);
  transform: translateY(-1px);
}

.partner-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid #2c9d63;
  border-radius: 8px;
  background: #e8f7ee;
  color: #16613c;
  font-weight: 900;
  text-align: center;
}

.partner-inline-link {
  color: #2469a6;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.partner-link-line {
  margin: 0;
  line-height: 1.55;
}

.post-card,
.profile-card--feed {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.post-card {
  position: relative;
}

.profile-card--feed {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,250,254,0.98));
}

.profile-feed-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-feed-actions > button {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.profile-feed-actions__follow {
  grid-column: 1 / -1;
  min-height: 44px;
}

.profile-feed-actions--owner {
  grid-template-columns: 1fr;
}

.post-card__head,
.profile-head,
.thread-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.post-card__head > div,
.profile-head > div,
.thread-item > div {
  min-width: 0;
}

.post-card__head h3 {
  overflow-wrap: anywhere;
}

.content-card__head {
  align-items: center;
}

.content-card__identity {
  flex: 1;
  min-width: 0;
}

.content-overflow {
  position: relative;
  align-self: flex-start;
  flex: 0 0 auto;
  margin-left: auto;
}

.content-overflow.is-open {
  z-index: 30;
}

.content-overflow__toggle {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.content-overflow__toggle:hover,
.content-overflow.is-open .content-overflow__toggle {
  border-color: var(--border);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.content-overflow__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: max-content;
  min-width: 174px;
  display: grid;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(35, 49, 66, 0.18);
}

.content-overflow__menu[hidden] {
  display: none;
}

.content-overflow__menu button {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--brand-dark);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.content-overflow__menu button:hover {
  background: var(--brand-soft);
}

.content-overflow__menu .content-overflow__danger {
  color: var(--danger);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: linear-gradient(135deg, #dce8f6, #c7dbf1);
  color: var(--brand-dark);
  flex-shrink: 0;
  overflow: hidden;
}

.avatar--image {
  padding: 0;
  cursor: zoom-in;
  background: #e6edf5;
}

.avatar--image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.avatar-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbff;
}

.avatar-preview-btn {
  width: 72px;
  height: 72px;
}

.avatar--link,
.profile-link,
.comment-avatar {
  color: inherit;
  text-decoration: none;
}

.profile-link:hover,
.comment-avatar:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.post-card__image,
.profile-gallery img,
.preview-photo,
.catalog-photo {
  width: 100%;
  display: block;
  object-fit: cover;
  border-radius: 8px;
}

img[loading="lazy"] {
  content-visibility: auto;
}

.post-card__image {
  max-height: 520px;
  margin-top: 14px;
  border: 1px solid var(--border);
}

.post-card__description {
  position: relative;
  color: var(--text);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.post-card__description p {
  margin: 0;
  white-space: pre-line;
}

.post-card__description.is-collapsed p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.post-card__description.is-collapsed::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 34px;
  left: 0;
  height: 38px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 85%);
}

.post-card__description.is-expanded p {
  display: block;
}

.post-card__description.is-expanded::after {
  display: none;
}

.post-card__more {
  position: relative;
  z-index: 1;
  width: fit-content;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  font-weight: 800;
  cursor: pointer;
}

.post-card__more:hover {
  text-decoration: underline;
}

.post-card .profile-badges,
.post-card .post-actions {
  margin-top: 0;
}

.portfolio-post {
  gap: 12px;
}

.portfolio-post__body {
  display: grid;
  gap: 10px;
}

.profile-card__body {
  display: grid;
  gap: 10px;
}

.profile-card__description {
  margin: 0;
  line-height: 1.55;
  white-space: pre-line;
}

.portfolio-post__author {
  align-items: center;
}

.portfolio-post__author .avatar {
  width: 42px;
  height: 42px;
}

.portfolio-price-line {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid #d3e1f2;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.portfolio-price-line span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.portfolio-price-line strong {
  font-size: 16px;
}

.portfolio-tags {
  margin: 0;
}

.portfolio-action-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fbff;
}

.portfolio-action-row--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portfolio-action-btn,
.portfolio-action-stat {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--brand-dark);
  font-weight: 800;
}

.portfolio-action-btn {
  cursor: pointer;
}

.portfolio-action-btn:hover {
  background: var(--brand-soft);
}

.portfolio-action-btn.is-active {
  color: var(--accent);
  background: #e8f5f3;
}

.portfolio-action-share__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-action-btn[data-like-photo].is-active {
  color: #d92d52;
  background: transparent;
}

.portfolio-action-row > :last-child {
  border-right: 0;
}

.direct-post-toolbar {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.direct-post-toolbar .ghost-btn {
  width: fit-content;
  text-decoration: none;
}

body.post-share-open {
  overflow: hidden;
}

.post-share-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(22, 35, 50, 0.5);
}

.post-share-sheet {
  width: min(440px, 100%);
  max-height: min(680px, calc(100vh - 40px));
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(22, 35, 50, 0.24);
}

.post-share-sheet__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 14px;
  align-items: start;
}

.post-share-sheet__head h2 {
  margin: 0 0 6px;
  font-size: 21px;
}

.post-share-sheet__head p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.post-share-sheet__close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.post-share-sheet__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.post-share-option {
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--brand-dark);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.post-share-option:hover {
  background: var(--brand-soft);
}

.post-share-option i {
  width: 28px;
  font-size: 23px;
  text-align: center;
}

.post-share-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-share-option--telegram i {
  color: #229ed9;
}

.post-share-option--vk i {
  color: #0077ff;
}

.post-share-sheet__link {
  margin-top: 12px;
  padding: 11px 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f4f7fa;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-share-sheet__status {
  min-height: 20px;
  margin-top: 8px;
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 700;
}

.post-comments {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.profile-comments-section {
  margin: 16px 0 20px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbff;
}

.profile-comments-section .panel__header {
  margin-bottom: 8px;
}

.post-comments--profile {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.comment-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f7;
}

.comment-item:last-child {
  border-bottom: 0;
}

.comment-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.comment-item__body {
  min-width: 0;
  flex: 1;
}

.content-safety-actions,
.comment-item__actions,
.message-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.content-safety-actions {
  padding: 0 16px 12px;
}

.comment-item__actions {
  align-self: flex-start;
  flex: 0 0 auto;
}

.message-card__actions {
  margin-top: 8px;
}

.message-card__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.message-card__head > strong {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.content-safety-actions .icon-btn,
.comment-action-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.content-safety-actions .icon-btn:hover,
.comment-action-btn:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.content-safety-actions .icon-btn--danger,
.comment-action-btn--danger {
  color: var(--danger);
}

.admin-report-card,
.admin-comment-card {
  overflow-wrap: anywhere;
}

.comment-form,
.chat-form,
.composer-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 14px;
  min-width: 0;
}

.comment-form textarea,
.chat-form textarea,
.composer-form textarea,
.form-grid textarea,
.form-grid input {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  outline: none;
}

.comment-form textarea:focus,
.chat-form textarea:focus,
.composer-form textarea:focus,
.form-grid textarea:focus,
.form-grid input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(74, 118, 168, 0.14);
}

.composer__hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.publication-policy-notice {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
  padding: 14px;
  border: 1px solid #e5c46a;
  border-radius: 8px;
  background: #fff9e8;
  color: #5f4712;
}

.publication-policy-notice__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #f7e7ae;
  color: #8a6413;
  font-size: 18px;
}

.publication-policy-notice__body {
  min-width: 0;
}

.publication-policy-notice__body strong,
.publication-policy-notice__body p {
  margin: 0;
}

.publication-policy-notice__body p {
  margin-top: 2px;
  line-height: 1.45;
}

.publication-policy-notice__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  text-decoration: none;
}

.publication-policy-notice__link:hover {
  text-decoration: none;
}

.composer-field {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.composer-field input {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  outline: none;
}

.composer-field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(74, 118, 168, 0.14);
}

.composer-link-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 10px;
  min-width: 0;
}

.partner-admin-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.partner-admin-form input[type="text"] {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.partner-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.feed-composer-card {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbff;
}

.feed-composer-trigger {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 14px;
}

.feed-composer-trigger > .primary-btn,
.profile-add-post-row > .primary-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.feed-composer-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.feed-composer-card__head h3 {
  margin: 0 0 4px;
}

.feed-composer-card__head p {
  margin: 0;
}

.composer-inline-fields {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.composer-inline-fields input {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  outline: none;
}

.composer-inline-fields input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(74, 118, 168, 0.14);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.form-grid__full {
  grid-column: 1 / -1;
}

.form-actions,
.avatar-submit-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.photo-preview-grid,
.profile-gallery:not(.profile-gallery--carousel) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.preview-photo {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
}

.photo-preview-item {
  position: relative;
  min-width: 0;
}

.photo-preview-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: rgba(35, 49, 66, 0.72);
  color: #fff;
  cursor: pointer;
}

.photo-preview-remove:hover {
  background: var(--danger);
}

.profile-card {
  padding: 18px;
}

.profile-card--feed .profile-head {
  align-items: center;
}

.profile-card__summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 18px;
  margin-top: 14px;
}

.profile-price-box {
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(180deg, #f3f8fd 0%, #e8f1fb 100%);
  border: 1px solid #d3e1f2;
}

.profile-price-box strong {
  display: block;
  font-size: 28px;
  color: var(--brand-dark);
}

.profile-gallery {
  margin-top: 16px;
}

.profile-gallery:not(.profile-gallery--carousel) img {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  background: #e6edf5;
}

.profile-photo-btn {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: zoom-in;
  display: block;
  min-width: 0;
}

.profile-photo-btn:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

.profile-gallery:not(.profile-gallery--carousel) .profile-photo-btn img {
  height: 100%;
}

.profile-card__cover {
  margin-top: 14px;
}

.profile-gallery--carousel {
  display: block;
  border: 1px solid var(--border);
}

.profile-gallery--carousel .portfolio-photo-stage {
  border-radius: 8px 8px 0 0;
}

.profile-gallery--carousel .profile-photo {
  aspect-ratio: var(--portfolio-photo-ratio, 4 / 3);
  max-height: 560px;
  background: #edf3f8;
}

.profile-gallery--carousel .portfolio-thumbs {
  padding: 8px;
}

.profile-gallery--carousel .portfolio-thumb {
  width: 62px;
  height: 62px;
}

.profile-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.profile-owner-toolbar,
.profile-add-post-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.profile-owner-toolbar {
  justify-content: flex-end;
}

.profile-inline-composer,
.post-edit-manager {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbff;
}

.post-edit-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.post-edit-card + .post-edit-card {
  margin-top: 12px;
}

.post-edit-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.post-edit-card__head h3 {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 600;
}

.badge--success {
  background: #e3f4ea;
  color: var(--success);
}

.badge--danger {
  background: #faece9;
  color: var(--danger);
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.chat-panel {
  overflow: hidden;
}

.chat-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 64px;
  margin-bottom: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.chat-header-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-header-identity h2 {
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header-avatar,
.chat-avatar {
  flex: 0 0 auto;
}

.chat-avatar {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, #dce8f6, #c7dbf1);
  color: var(--brand-dark);
  font-weight: 700;
}

.chat-avatar.avatar--image {
  cursor: default;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.chat-header-avatar .chat-avatar {
  width: 44px;
  height: 44px;
}

.mobile-chat-back {
  display: none;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  cursor: pointer;
}

.mobile-chat-back:hover {
  background: var(--brand-soft);
}

.chat-panel--conversation {
  display: none;
}

#messagesView.chat-open .chat-panel--threads {
  display: none;
}

#messagesView.chat-open .chat-panel--conversation {
  display: block;
}

#messagesView.chat-open .mobile-chat-back {
  display: grid;
  place-items: center;
}

.chat-messages {
  min-height: 360px;
  max-height: 620px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  background:
    radial-gradient(circle at 16px 16px, rgba(74, 118, 168, 0.055) 1.5px, transparent 1.5px) 0 0 / 32px 32px,
    #eef4f8;
}

.message-card {
  width: fit-content;
  max-width: min(76%, 620px);
  justify-self: start;
  padding: 9px 12px 7px;
  border: 0;
  border-radius: 6px 16px 16px 16px;
  overflow: visible;
  background: #fff;
  box-shadow: 0 1px 2px rgba(25, 52, 79, 0.12);
  overflow-wrap: anywhere;
}

.message-card--mine {
  justify-self: end;
  border-radius: 16px 6px 16px 16px;
  background: #d9f1ff;
}

.message-card--admin {
  background: var(--warning);
  border-color: #f0d98c;
}

.message-card__author {
  margin-bottom: 3px;
  color: #8a6300;
  font-size: 12px;
  font-weight: 800;
}

.message-card__text {
  line-height: 1.42;
  white-space: pre-wrap;
}

.message-card__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  margin-top: 3px;
}

.message-card__footer .content-overflow {
  align-self: center;
  margin-left: 0;
}

.message-card__footer .content-overflow__toggle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.message-card__time {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-align: right;
}

.chat-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 0;
  padding: 14px 18px 4px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.chat-form textarea {
  min-height: 46px;
  max-height: 140px;
  resize: vertical;
  border-radius: 18px;
}

.chat-form .primary-btn {
  min-height: 46px;
  border-radius: 16px;
}

.thread-item {
  width: 100%;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  border-radius: 0;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.thread-item:hover,
.thread-item.is-active {
  background: var(--brand-soft);
}

.thread-item__content {
  flex: 1;
  min-width: 0;
}

.thread-item__head,
.thread-item__bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.thread-item__head > strong,
.thread-item__preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-item__head > strong,
.thread-item__preview {
  flex: 1;
}

.thread-item__time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.thread-item__preview {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.thread-item .thread-badge {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.sticky-ad {
  position: sticky;
  top: 88px;
}

.ad-card {
  padding: 16px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fbff 0%, #e7f0fb 100%);
}

.ad-card--yandex {
  padding: 10px;
  min-height: 640px;
  display: grid;
  align-content: start;
}

#yandex_rtb_R-A-17231672-1 {
  width: 100%;
  min-height: 600px;
}

.feed-ad-card {
  display: none;
}

.ad-card--feed {
  min-height: 260px;
  max-height: 360px;
  overflow: hidden;
  display: grid;
  align-content: start;
  border: 1px solid var(--border);
}

.feed-ad-slot {
  width: 100%;
  min-height: 220px;
  max-height: 310px;
  overflow: hidden;
}

.ad-card__badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(35, 49, 66, 0.94);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 0.2s ease;
  z-index: 30;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

body.lightbox-open {
  overflow: hidden;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  place-items: center;
  justify-items: center;
  padding: 28px;
  background: rgba(20, 28, 38, 0.86);
}

.photo-lightbox.is-open {
  display: grid;
}

.photo-lightbox img {
  display: block;
  max-width: min(1120px, calc(100vw - 56px));
  max-height: calc(100vh - 56px);
  max-height: calc(100dvh - 56px);
  object-fit: contain;
  border-radius: 8px;
  background: #111923;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
  cursor: zoom-out;
}

.photo-lightbox__close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

.photo-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.photo-lightbox__nav {
  position: fixed;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 72px;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

.photo-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.24);
}

.photo-lightbox__nav:disabled {
  display: none;
}

.photo-lightbox__nav--prev {
  left: 18px;
}

.photo-lightbox__nav--next {
  right: 18px;
}

.photo-lightbox__counter {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 2;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(20, 28, 38, 0.72);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.settings-panel {
  display: grid;
  gap: 12px;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--brand-dark);
}

.settings-field {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.settings-field select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.status-banner {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff6d8;
}

.status-banner--danger {
  border-color: #f0b9b9;
  background: #fff0f0;
  color: #9b1c1c;
  font-weight: 800;
}

#profileDetailCard {
  scroll-margin-top: 100px;
}

.auth-box {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
}

.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-form__legal {
  width: 100%;
  margin: 0;
  text-align: left;
}

.inline-form__legal span,
.inline-form__legal a {
  min-width: 0;
  overflow-wrap: anywhere;
}

.inline-form > input,
.inline-form > select {
  min-width: 160px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.notification-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.notification-btn span,
.thread-badge {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.panel__header--compact {
  margin-top: 18px;
}

.search-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.news-photo-grid {
  display: grid;
  gap: 10px;
}

.news-photo-grid .post-card__image {
  margin-top: 0;
}

.portfolio-gallery {
  --portfolio-photo-ratio: 4 / 3;
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #eef3f8;
}

.portfolio-photo-stage {
  position: relative;
  min-width: 0;
  background: #e8edf3;
}

.portfolio-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(35, 49, 66, 0.72);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  height: 58px;
  transform: translateY(-50%);
  border: 0;
  background: rgba(255, 255, 255, 0.82);
  color: var(--brand-dark);
  cursor: pointer;
}

.gallery-arrow--prev {
  left: 10px;
  border-radius: 8px;
}

.gallery-arrow--next {
  right: 10px;
  border-radius: 8px;
}

.gallery-arrow:hover {
  background: var(--brand-soft);
}

.portfolio-slide {
  display: none;
  padding: 0;
}

.portfolio-slide.is-active {
  display: block;
}

.portfolio-photo-btn {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  display: block;
}

.portfolio-photo-btn:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 8px;
}

.portfolio-photo {
  width: 100%;
  aspect-ratio: var(--portfolio-photo-ratio, 4 / 3);
  max-height: 680px;
  object-fit: cover;
  display: block;
  border-radius: 0;
  background: #e8edf3;
}

.portfolio-thumbs {
  display: flex;
  gap: 8px;
  padding: 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid rgba(207, 217, 230, 0.9);
  background: #f8fbff;
  scrollbar-width: thin;
  cursor: grab;
}

.portfolio-thumbs.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.portfolio-thumb {
  flex: 0 0 auto;
  width: 66px;
  height: 58px;
  padding: 2px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #fff;
  opacity: 0.62;
  cursor: pointer;
}

.portfolio-thumb:hover,
.portfolio-thumb.is-active {
  opacity: 1;
  border-color: var(--brand);
}

.portfolio-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 4px;
}

.portfolio-comments-panel {
  position: absolute;
  right: 14px;
  bottom: 62px;
  z-index: 8;
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(420px, calc(100% - 28px));
  height: 420px;
  max-height: calc(100% - 28px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 48px rgba(35, 49, 66, 0.24);
}

.portfolio-comments-panel.is-open {
  display: grid;
}

.portfolio-comments-panel__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.portfolio-comments-panel__head .ghost-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.portfolio-comments-section {
  display: none;
  min-height: 0;
  padding: 12px;
}

.portfolio-comments-section.is-active {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
}

.portfolio-comments-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.post-author-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.photo-preview-grid {
  align-items: start;
}

@media (max-width: 1440px) {
  .page {
    grid-template-columns: minmax(210px, 240px) minmax(0, 800px);
  }

  .sidebar--right {
    display: none;
  }

  .feed-ad-card {
    display: block;
  }
}

@media (max-width: 1120px) {
  .topbar {
    padding: 10px 18px;
  }

  .mobile-menu-btn {
    display: grid;
  }

  .page {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .content {
    width: min(800px, 100%);
    justify-self: center;
  }

  .mobile-close-btn {
    display: grid;
  }

  .sidebar--left {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: min(82vw, 320px);
    max-width: 320px;
    padding: 14px;
    overflow-y: auto;
    background: var(--bg);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: 18px 0 42px rgba(35, 49, 66, 0.18);
  }

  body.mobile-nav-open .sidebar--left {
    transform: translateX(0);
  }

  .sidebar--left .panel {
    min-height: calc(100vh - 28px);
    margin-bottom: 0;
  }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    pointer-events: none;
    opacity: 0;
    background: rgba(25, 35, 48, 0.36);
    transition: opacity 180ms ease;
  }

  body.mobile-nav-open .mobile-nav-backdrop {
    pointer-events: auto;
    opacity: 1;
  }

  .nav-btn {
    min-height: 48px;
  }

  .topbar__actions .inline-form {
    width: 100%;
  }

  .hero-card,
  .chat-layout,
  .form-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .profile-card__summary {
    grid-template-columns: 1fr;
  }

  .profile-owner-toolbar {
    justify-content: flex-start;
  }

}

/* Immersive post and profile media */
.post-card.portfolio-post,
.profile-card,
.news-post-card {
  gap: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.post-card.portfolio-post > .content-card__head,
.profile-card > .content-card__head,
.news-post-card > .post-card__head {
  padding: 20px 20px 16px;
}

.portfolio-post > .partner-badge,
.profile-card > .partner-badge {
  margin: 0 20px 16px;
  border: 0;
}

.portfolio-gallery,
.profile-gallery--carousel {
  --media-frame-ratio: 4 / 3;
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.portfolio-photo-stage {
  isolation: isolate;
  overflow: hidden;
  background: transparent;
}

.portfolio-photo-stage::before,
.portfolio-photo-stage::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  z-index: 1;
  height: clamp(18px, 6vw, 44px);
  pointer-events: none;
  display: none;
}

.portfolio-photo-stage::before {
  top: 0;
  background: linear-gradient(180deg, rgba(10, 16, 24, 0.18), transparent);
}

.portfolio-photo-stage::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(10, 16, 24, 0.18), transparent);
}

.portfolio-photo-btn {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--media-frame-ratio, 4 / 3);
  overflow: hidden;
  background: transparent;
}

.portfolio-slide[data-photo-shape='landscape'] .portfolio-photo-btn {
  aspect-ratio: var(--media-frame-ratio, 4 / 3);
}

.portfolio-slide[data-photo-shape='portrait'] .portfolio-photo-btn {
  height: auto;
  aspect-ratio: var(--media-frame-ratio, 4 / 3);
}

.portfolio-slide[data-photo-shape='square'] .portfolio-photo-btn {
  aspect-ratio: var(--media-frame-ratio, 4 / 3);
}

.news-photo-grid {
  --media-frame-ratio: 4 / 3;
  gap: 0;
}

.news-photo-grid .profile-photo-btn {
  position: relative;
  width: 100%;
  aspect-ratio: var(--media-frame-ratio, 4 / 3);
  overflow: hidden;
  border-radius: 0;
  background: transparent;
}

.news-photo-grid .profile-photo-btn[data-photo-shape='landscape'] {
  aspect-ratio: var(--media-frame-ratio, 4 / 3);
}

.news-photo-grid .profile-photo-btn[data-photo-shape='portrait'] {
  height: auto;
  aspect-ratio: var(--media-frame-ratio, 4 / 3);
}

.news-photo-grid .profile-photo-btn[data-photo-shape='square'] {
  aspect-ratio: var(--media-frame-ratio, 4 / 3);
}

.news-photo-grid .profile-photo-btn::before,
.news-photo-grid .profile-photo-btn::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  z-index: 1;
  height: clamp(18px, 6vw, 44px);
  pointer-events: none;
  display: none;
}

.news-photo-grid .profile-photo-btn::before {
  top: 0;
  background: linear-gradient(180deg, rgba(10, 16, 24, 0.18), transparent);
}

.news-photo-grid .profile-photo-btn::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(10, 16, 24, 0.18), transparent);
}

.portfolio-photo,
.profile-gallery--carousel .profile-photo,
.news-photo-grid .post-card__image {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: 50% 50%;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.news-photo-grid .post-card__image {
  margin: 0;
}

.news-post-card > .post-card__description {
  padding: 0 20px 16px;
}

.news-post-card > .post-actions {
  margin: 0;
  padding: 16px 20px 0;
}

.news-post-card > .content-overflow {
  margin: 0 20px;
}

.news-post-card > .post-comments {
  margin: 16px 20px 20px;
  border-top: 0;
}

.portfolio-counter,
.gallery-arrow {
  z-index: 3;
}

.portfolio-thumbs {
  border-top: 0;
  background: transparent;
}

.portfolio-post__body,
.profile-card__body {
  padding: 18px 20px 12px;
}

.portfolio-price-line,
.portfolio-action-row {
  border: 0;
}

.portfolio-action-row {
  gap: 4px;
  margin: 0 20px 16px;
  padding: 4px;
  border-radius: 12px;
}

.portfolio-action-btn,
.portfolio-action-stat {
  border-right: 0;
  border-radius: 8px;
}

.post-card.portfolio-post > .post-author-actions,
.profile-card > .profile-actions,
.profile-card > .profile-feed-actions,
.post-card.portfolio-post > .content-safety-actions,
.profile-card > .content-safety-actions {
  margin: 0;
  padding: 0 20px 20px;
  border-top: 0;
}

.post-card.portfolio-post .ghost-btn,
.profile-card .ghost-btn {
  border: 0;
}

#postsView > .panel,
#profilesView > .panel,
#newsView > .panel,
#subscriptionsView > .panel,
#searchView > .panel {
  border: 0;
  background: transparent;
  box-shadow: none;
}

#postsFeed,
#profilesFeed,
#newsFeed,
#subscriptionsFeed,
#searchResults,
#profileDetailCard .feed-list,
#myProfileCard .feed-list {
  gap: 24px;
}

@media (max-width: 640px) {
  .portfolio-gallery {
    width: 100vw;
    max-width: 100vw;
    margin-right: calc(50% - 50vw);
    margin-left: calc(50% - 50vw);
  }

  .news-photo-grid {
    width: 100vw;
    max-width: 100vw;
    margin-right: calc(50% - 50vw);
    margin-left: calc(50% - 50vw);
  }

  .portfolio-thumbs {
    display: none;
  }

  .post-card.portfolio-post > .content-card__head,
  .profile-card > .content-card__head,
  .news-post-card > .post-card__head {
    padding: 18px 14px 14px;
  }

  .portfolio-post > .partner-badge,
  .profile-card > .partner-badge {
    margin-right: 14px;
    margin-left: 14px;
  }

  .portfolio-post__body,
  .profile-card__body {
    padding: 16px 14px 10px;
  }

  .news-post-card > .post-card__description {
    padding: 0 14px 14px;
  }

  .news-post-card > .post-actions {
    padding: 14px 14px 0;
  }

  .news-post-card > .content-overflow {
    margin-right: 14px;
    margin-left: 14px;
  }

  .news-post-card > .post-comments {
    margin: 14px 14px 18px;
  }

  .portfolio-action-row {
    margin-right: 14px;
    margin-bottom: 14px;
    margin-left: 14px;
  }

  .post-card.portfolio-post > .post-author-actions,
  .profile-card > .profile-actions,
  .profile-card > .profile-feed-actions,
  .post-card.portfolio-post > .content-safety-actions,
  .profile-card > .content-safety-actions {
    padding-right: 14px;
    padding-bottom: 18px;
    padding-left: 14px;
  }
}

@media (max-width: 640px) {
  .publication-policy-notice {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .publication-policy-notice__icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .publication-policy-notice__link {
    width: 100%;
    padding-right: 10px;
    padding-left: 10px;
    font-size: 14px;
    white-space: normal;
  }

  .admin-control-grid {
    grid-template-columns: 1fr;
  }

  .admin-section__body {
    max-height: 72vh;
    padding: 12px;
  }

  .page {
    padding: 12px;
  }

  .topbar {
    padding: 10px 12px;
  }

  .topbar__site-nav {
    position: relative;
    display: block;
    min-height: 36px;
  }

  .topbar__nav-links {
    flex-wrap: nowrap;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .topbar__nav-slot {
    position: absolute;
    top: 1px;
    left: -4px;
    z-index: 1;
    width: 34px;
  }

  .topbar__nav-slot[aria-hidden='true'] {
    display: none;
  }

  .shop-search-toggle {
    width: 34px;
    height: 34px;
  }

  .topbar__nav-links::-webkit-scrollbar {
    display: none;
  }

  .topbar__nav-links a {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 9px;
    font-size: 13px;
  }

  .topbar__brand {
    min-width: 0;
    justify-content: center;
  }

  .mobile-account-btn {
    min-width: 42px;
    padding: 0 10px;
  }

  .topbar__logo {
    width: 40px;
    height: 40px;
  }

  .mobile-menu-btn {
    min-width: 42px;
    padding: 0 10px;
	margin-right: auto; /* Прижимает к левому краю */
    justify-self: start;
  }

  .mobile-menu-btn span,
  .mobile-account-btn span {
    display: none;
  }

  .topbar__actions {
    right: 12px;
    width: calc(100vw - 24px);
    max-width: none;
  }

  .topbar__actions .user-chip {
    width: 100%;
  }

  .topbar__actions > button,
  .topbar__actions .inline-form,
  .topbar__actions .inline-form input,
  .topbar__actions .inline-form button {
    width: 100%;
  }

  .topbar__actions .inline-form {
    display: grid;
    gap: 8px;
  }

  .topbar__subtitle {
    display: none;
  }

  .hero-card {
	display: flex;
  flex-direction: column; /* Меняем ось на вертикальную */
  align-items: center; /* Выравнивание по центру (опционально) */
  text-align: center; /* Чтобы текст тоже был по центру */
  gap: 15px; /* Отступ между текстом и статистикой */  
    padding: 10px;
	
  }

  .hero-card h1 {
    font-size: 20px;
  }

  .hero-card__stats {
	    order: 2; /* Статистика уйдет вверх */
    min-width: 0;
    grid-template-columns: repeat(4, minmax(0, 1.2fr));
	font-size: 14px; /* Было 24px */
  }

  .panel,
  .post-card,
  .profile-card--feed {
    padding: 14px;
    gap: 10px;
  }

  .topbar__search {
    height: 42px;
  }

  .load-more-wrap .primary-btn {
    width: 100%;
    justify-content: center;
  }

  .post-card__head,
  .profile-head {
    gap: 10px;
  }

  .post-card__description {
    font-size: 15px;
    line-height: 1.5;
  }

  .post-card__description.is-collapsed p {
    -webkit-line-clamp: 3;
  }

  .post-card__description.is-collapsed::after {
    bottom: 32px;
  }

  .ad-card--feed {
    min-height: 320px;
    max-height: 600px;
    padding: px;
  }

  .feed-ad-slot {
    min-height: 370px;
    max-height: 600px;
  }

  .avatar {
    width: 42px;
    height: 42px;
  }

  .portfolio-post {
    gap: 10px;
  }

  .portfolio-gallery {
    --portfolio-photo-ratio: 4 / 5;
  }

  .profile-feed-actions > button {
    padding-right: 10px;
    padding-left: 10px;
    font-size: 14px;
    white-space: nowrap;
  }

  .portfolio-action-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .portfolio-action-row--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portfolio-action-btn,
  .portfolio-action-stat {
    min-height: 44px;
    padding: 0 8px;
  }

  .portfolio-action-share__label {
    display: none;
  }

  .post-share-overlay {
    place-items: end center;
    padding: 0;
  }

  .post-share-sheet {
    width: 100%;
    max-height: min(720px, calc(100vh - 16px));
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
  }

  .post-share-sheet__actions {
    gap: 8px;
  }

  .post-share-option {
    min-height: 56px;
    padding: 9px 11px;
  }

  .portfolio-price-line {
    width: 100%;
    justify-content: space-between;
  }

  .gallery-arrow,
  .photo-lightbox__nav {
    display: none;
  }

  .gallery-arrow {
    width: 38px;
    height: 50px;
  }

  .gallery-arrow--prev {
    left: 6px;
  }

  .gallery-arrow--next {
    right: 6px;
  }

  .portfolio-counter {
    right: 8px;
    bottom: 8px;
  }

  .portfolio-slide {
    padding: 0;
  }

  .portfolio-photo {
    max-height: 82vh;
  }

  .profile-gallery--carousel .profile-photo {
    max-height: 82vh;
  }

  .portfolio-thumbs {
    padding: 8px;
  }

  .portfolio-thumb {
    width: 58px;
    height: 52px;
  }

  .portfolio-comments-panel {
    position: fixed;
    inset: auto 10px 10px;
    z-index: 70;
    width: auto;
    height: min(70vh, 540px);
    max-height: calc(100vh - 88px);
    max-height: calc(100dvh - 88px);
    border-radius: 12px;
    box-shadow: 0 18px 56px rgba(35, 49, 66, 0.32);
  }

  .portfolio-comments-panel__head,
  .portfolio-comments-section {
    padding: 10px;
  }

  .portfolio-comments-panel__head {
    min-height: 54px;
  }

  body.comments-panel-open {
    overflow: hidden;
  }

  .photo-lightbox {
    padding: 12px;
  }

  .photo-lightbox img {
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }

  .photo-lightbox__close {
    top: 12px;
    right: 12px;
  }

  .photo-lightbox__nav {
    width: 42px;
    height: 56px;
  }

  .photo-lightbox__nav--prev {
    left: 8px;
  }

  .photo-lightbox__nav--next {
    right: 8px;
  }

  .photo-lightbox__counter {
    bottom: 12px;
  }

  .settings-row {
    grid-template-columns: 1fr;
  }

  .settings-field {
    min-width: 0;
  }

  .profile-badges {
    grid-template-columns: 1fr;
  }

  .profile-owner-toolbar,
  .profile-add-post-row,
  .feed-composer-card__head,
  .post-edit-card__head,
  .composer-inline-fields,
  .composer-link-fields,
  .avatar-submit-actions,
  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .profile-owner-toolbar > *,
  .profile-add-post-row > *,
  .feed-composer-card__head > *,
  .post-edit-card__head > button,
  .avatar-submit-actions > *,
  .form-actions > * {
    width: 100%;
  }

  .profile-inline-composer,
  .post-edit-manager {
    padding: 12px;
  }

  .chat-messages {
    min-height: 280px;
    max-height: 56vh;
  }

  .chat-layout {
    gap: 12px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }
}

/* Keep the immersive card rules after the legacy phone overrides. */
@media (max-width: 640px) {
  .post-card.portfolio-post,
  .profile-card,
  .profile-card--feed,
  .news-post-card {
    gap: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .portfolio-gallery {
    --media-frame-ratio: 1 / 1;
    width: 100vw;
    max-width: 100vw;
    margin-right: calc(50% - 50vw);
    margin-left: calc(50% - 50vw);
  }

  .news-photo-grid {
    --media-frame-ratio: 1 / 1;
    width: 100vw;
    max-width: 100vw;
    margin-right: calc(50% - 50vw);
    margin-left: calc(50% - 50vw);
  }

  .portfolio-photo,
  .profile-gallery--carousel .profile-photo,
  .news-photo-grid .post-card__image {
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
    object-fit: contain;
    object-position: 50% 50%;
    border: 0;
    border-radius: 0;
  }

  .post-card.portfolio-post > .content-card__head,
  .profile-card > .content-card__head,
  .news-post-card > .post-card__head {
    width: 100vw;
    max-width: 100vw;
    margin-right: calc(50% - 50vw);
    margin-left: calc(50% - 50vw);
    padding: 16px 18px 14px;
  }

  .portfolio-thumbs {
    position: absolute;
    bottom: 14px;
    left: 50%;
    z-index: 4;
    display: flex;
    width: auto;
    max-width: calc(100% - 112px);
    justify-content: center;
    gap: 7px;
    padding: 8px;
    overflow-x: auto;
    transform: translateX(-50%);
    border: 0;
    background: transparent;
    scrollbar-width: none;
  }

  .portfolio-thumbs::-webkit-scrollbar {
    display: none;
  }

  .portfolio-gallery .portfolio-thumb {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: 0 1px 5px rgba(10, 16, 24, 0.34);
    opacity: 1;
  }

  .portfolio-gallery .portfolio-thumb:hover,
  .portfolio-gallery .portfolio-thumb.is-active {
    background: #fff;
    transform: scale(1.35);
  }

  .portfolio-gallery .portfolio-thumb img {
    display: none;
  }
}

/* Unified social feed: clean white cards inspired by familiar social layouts. */
:root {
  --social-surface: #ffffff;
  --social-page: #eef1f5;
  --social-soft: #f5f7fa;
  --social-line: #e4e8ee;
  --social-shadow: 0 6px 18px rgba(35, 49, 66, 0.06);
  --social-radius: 18px;
}

body {
  background: linear-gradient(180deg, #f7f8fa 0%, var(--social-page) 100%);
}

#postsFeed,
#profilesFeed,
#newsFeed,
#subscriptionsFeed,
#searchResults,
#profileDetailCard .feed-list,
#myProfileCard .feed-list {
  width: min(100%, 720px);
  margin-inline: auto;
  gap: 16px;
}

.post-card.portfolio-post,
.profile-card,
.profile-card--feed,
.news-post-card {
  position: relative;
  display: grid;
  gap: 0;
  padding: 0;
  border: 1px solid var(--social-line);
  border-radius: var(--social-radius);
  background: var(--social-surface);
  box-shadow: var(--social-shadow);
}

.post-card.portfolio-post > .content-card__head,
.profile-card > .content-card__head,
.news-post-card > .post-card__head {
  min-height: 76px;
  gap: 12px;
  margin: 0;
  padding: 15px 18px;
  background: var(--social-surface);
}

.content-card__head .avatar,
.news-post-card > .post-card__head .avatar {
  width: 44px;
  height: 44px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #dbe1e8;
}

.content-card__head h3,
.news-post-card > .post-card__head h3 {
  margin: 0;
  color: #1f2d3d;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.content-card__identity .muted,
.news-post-card > .post-card__head .muted {
  margin-top: 2px;
  color: #65758a;
  font-size: 13px;
  line-height: 1.3;
}

.content-card__identity .meta,
.news-post-card > .post-card__head .meta {
  margin-top: 3px;
  color: #8b98a8;
  font-size: 12px;
  line-height: 1.25;
}

.content-overflow__toggle {
  border: 0;
  border-radius: 50%;
  color: #6d7b8d;
}

.content-overflow__toggle:hover,
.content-overflow.is-open .content-overflow__toggle {
  border-color: transparent;
  background: var(--social-soft);
}

.portfolio-gallery,
.profile-gallery--carousel,
.portfolio-photo-stage,
.portfolio-photo-btn,
.news-photo-grid,
.news-photo-grid .profile-photo-btn,
.portfolio-photo,
.profile-gallery--carousel .profile-photo,
.news-photo-grid .post-card__image {
  background-color: var(--social-surface);
}

.portfolio-gallery,
.profile-gallery--carousel,
.news-photo-grid {
  border-top: 1px solid #edf0f4;
  border-bottom: 1px solid #edf0f4;
}

.portfolio-photo,
.profile-gallery--carousel .profile-photo,
.news-photo-grid .post-card__image {
  object-fit: contain;
  object-position: 50% 50%;
}

.portfolio-post__body,
.profile-card__body {
  gap: 9px;
  padding: 15px 18px 12px;
  background: var(--social-surface);
}

.post-card__description,
.profile-card__description {
  color: #263547;
  font-size: 15px;
  line-height: 1.55;
}

.portfolio-tags {
  color: #4a76a8;
  font-size: 14px;
  line-height: 1.5;
}

.portfolio-price-line {
  width: fit-content;
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: #edf4fc;
  color: #315f91;
}

.portfolio-price-line span {
  color: #6f8298;
}

.portfolio-price-line strong {
  font-size: 15px;
}

.portfolio-action-row {
  gap: 4px;
  margin: 0;
  padding: 5px 10px;
  border: 0;
  border-top: 1px solid #edf0f4;
  border-radius: 0;
  background: var(--social-surface);
}

.portfolio-action-btn,
.portfolio-action-stat {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  color: #52647a;
  font-weight: 750;
}

.portfolio-action-btn:hover {
  background: var(--social-soft);
  color: #315f91;
}

.portfolio-action-btn.is-active,
.portfolio-action-btn[data-like-photo].is-active,
.portfolio-action-btn[data-like-profile].is-active {
  background: #fff0f3;
  color: #d92d52;
}

.post-card.portfolio-post > .post-author-actions,
.profile-card > .profile-actions,
.profile-card > .profile-feed-actions,
.post-card.portfolio-post > .content-safety-actions,
.profile-card > .content-safety-actions {
  margin: 0;
  padding: 0 14px 14px;
  border: 0;
  background: var(--social-surface);
}

.profile-feed-actions {
  grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-feed-actions__follow {
  grid-column: auto;
}

.profile-feed-actions > button,
.post-author-actions > button,
.profile-card > .profile-actions > button {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
}

.profile-feed-actions .primary-btn {
  box-shadow: none;
}

.profile-feed-actions .ghost-btn,
.profile-feed-actions .chip-btn,
.post-author-actions .ghost-btn,
.profile-card > .profile-actions .ghost-btn {
  background: var(--social-soft);
  color: #315f91;
}

.profile-feed-actions .ghost-btn:hover,
.profile-feed-actions .chip-btn:hover,
.post-author-actions .ghost-btn:hover,
.profile-card > .profile-actions .ghost-btn:hover {
  background: #e8eef6;
}

.portfolio-gallery > .portfolio-thumbs {
  position: absolute;
  bottom: 14px;
  left: 50%;
  z-index: 4;
  display: flex;
  width: auto;
  max-width: calc(100% - 112px);
  justify-content: center;
  gap: 7px;
  padding: 8px;
  overflow-x: auto;
  transform: translateX(-50%);
  border: 0;
  background: transparent;
  scrollbar-width: none;
}

.portfolio-gallery > .portfolio-thumbs::-webkit-scrollbar {
  display: none;
}

.portfolio-gallery .portfolio-thumb {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 1px 5px rgba(10, 16, 24, 0.38);
  opacity: 1;
}

.portfolio-gallery .portfolio-thumb:hover,
.portfolio-gallery .portfolio-thumb.is-active {
  border-color: transparent;
  background: #fff;
  transform: scale(1.35);
}

.portfolio-gallery .portfolio-thumb img {
  display: none;
}

.portfolio-counter {
  right: 12px;
  bottom: 12px;
  background: rgba(31, 45, 61, 0.78);
  box-shadow: 0 4px 14px rgba(31, 45, 61, 0.18);
}

.profile-comments-panel__body {
  min-height: 0;
}

.news-post-card > .post-card__head {
  order: 1;
}

.news-post-card > .news-photo-grid {
  order: 2;
}

.news-post-card > .post-card__description {
  order: 3;
  padding: 15px 18px 12px;
  background: var(--social-surface);
}

.news-post-card > .post-actions {
  order: 4;
  gap: 8px;
  margin: 0;
  padding: 10px 14px 14px;
  border-top: 1px solid #edf0f4;
  background: var(--social-surface);
}

.news-post-card > .post-actions > * {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--social-soft);
}

.news-post-card > .content-overflow {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 4;
  order: 5;
  margin: 0;
}

.news-post-card > .post-comments {
  order: 6;
  margin: 0 18px 18px;
  padding-top: 14px;
  border-top: 1px solid #edf0f4;
}

@media (max-width: 640px) {
  .page {
    padding: 0 0 16px;
  }

  .content {
    width: 100%;
    max-width: 100%;
  }

  #postsView > .panel,
  #profilesView > .panel,
  #newsView > .panel:not(.composer),
  #subscriptionsView > .panel,
  #searchView > .panel {
    margin: 0;
    padding: 0;
    border-radius: 0;
  }

  #postsView > .panel > .panel__header,
  #profilesView > .panel > .panel__header,
  #newsView > .panel:not(.composer) > .panel__header,
  #subscriptionsView > .panel > .panel__header,
  #searchView > .panel > .panel__header {
    min-height: 56px;
    margin: 0;
    padding: 14px 16px;
    border-bottom: 1px solid var(--social-line);
    background: var(--social-surface);
  }

  #feedPortfolioComposer,
  #newsComposerCard {
    margin: 10px 0;
  }

  #postsFeed,
  #profilesFeed,
  #newsFeed,
  #subscriptionsFeed,
  #searchResults,
  #profileDetailCard .feed-list,
  #myProfileCard .feed-list {
    width: 100%;
    gap: 10px;
  }

  .post-card.portfolio-post,
  .profile-card,
  .profile-card--feed,
  .news-post-card {
    width: 100%;
    max-width: none;
    margin: 0;
    overflow: visible;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: var(--social-surface);
    box-shadow: none;
  }

  .post-card.portfolio-post > .content-card__head,
  .profile-card > .content-card__head,
  .news-post-card > .post-card__head {
    width: auto;
    max-width: none;
    min-height: 72px;
    margin: 0;
    padding: 14px 16px 12px;
  }

  .content-card__head .avatar,
  .news-post-card > .post-card__head .avatar {
    width: 42px;
    height: 42px;
  }

  .portfolio-gallery,
  .profile-gallery--carousel,
  .news-photo-grid {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: var(--social-surface);
  }

  .portfolio-post__body,
  .profile-card__body {
    padding: 14px 16px 10px;
  }

  .portfolio-action-row {
    margin: 0;
    padding: 5px 8px;
  }

  .post-card.portfolio-post > .post-author-actions,
  .profile-card > .profile-actions,
  .profile-card > .profile-feed-actions,
  .post-card.portfolio-post > .content-safety-actions,
  .profile-card > .content-safety-actions {
    padding: 0 12px 12px;
  }

  .profile-feed-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-feed-actions > button {
    padding-right: 8px;
    padding-left: 8px;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
  }

  .profile-feed-actions--owner {
    grid-template-columns: 1fr;
  }

  .news-post-card > .post-card__description {
    padding: 14px 16px 10px;
  }

  .news-post-card > .post-actions {
    padding: 9px 12px 12px;
  }

  .news-post-card > .content-overflow {
    top: 18px;
    right: 12px;
  }

  .news-post-card > .post-comments {
    margin: 0 16px 16px;
  }
}
