/* Страница публичного профиля пользователя (/user_profile) */

.user-public-profile.modern-profile.profile-shell {
  background: var(--rd-page-bg, #e6e2da) !important;
  color: var(--rd-text, #141210) !important;
}

.user-public-profile {
  --upp-avatar-size: clamp(96px, 22vw, 120px);
  --upp-hero-inset: clamp(20px, 5vw, 32px);
  --upp-hero-gap: 14px;
  --upp-hero-actions-offset: 10px;
}

.user-public-profile .upp-wrap {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 0 clamp(14px, 4vw, 22px) calc(24px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.user-public-profile .upp-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 16px;
  margin: 0 0 4px;
  background: var(--rd-page-bg, #e6e2da);
  border-bottom: 1px solid color-mix(in srgb, var(--rd-border, #c9c2b6) 55%, transparent);
}

@supports (backdrop-filter: blur(8px)) {
  .user-public-profile .upp-topbar {
    background: color-mix(in srgb, var(--rd-page-bg, #e6e2da) 82%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: color-mix(in srgb, var(--rd-border, #c9c2b6) 40%, transparent);
  }
}

.user-public-profile .upp-icon {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--rd-border, #c9c2b6) !important;
  background: var(--rd-card, #faf8f4) !important;
  color: var(--rd-text, #141210) !important;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.user-public-profile .upp-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-public-profile .upp-icon:active {
  transform: scale(0.96);
}

.user-public-profile .upp-topbar-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: clamp(16px, 4.2vw, 18px);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--rd-text, #141210);
}

.user-public-profile .upp-accent-line {
  display: none;
}

.user-public-profile .upp-banner {
  width: 100%;
  border: 1px solid var(--rd-border, #c9c2b6);
  background: linear-gradient(135deg, var(--rd-pill, #ebe6dd), var(--rd-pill-soft, #e0d9ce));
  background-size: cover;
  background-position: center;
  margin-bottom: 0;
}

.user-public-profile .upp-banner.has-image {
  background-color: var(--rd-pill-soft, #e0d9ce);
}

.user-public-profile .upp-hero {
  position: relative;
  margin-bottom: 0;
}

.user-public-profile .upp-topbar-actions {
  position: relative;
}

.user-public-profile .upp-dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  padding: 6px;
  border-radius: 14px;
  background: var(--rd-card, #fff);
  color: var(--rd-text, #0f1115);
  border: 1px solid var(--rd-border, #dfe3eb);
  box-shadow: var(--rd-elev-pop, 0 14px 40px rgba(0, 0, 0, 0.2));
  z-index: 80;
}

.user-public-profile .upp-dropdown-panel.hidden {
  display: none !important;
}

.user-public-profile .upp-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  color: inherit;
}

.user-public-profile .upp-dropdown-item:hover,
.user-public-profile .upp-dropdown-item:focus-visible {
  background: var(--rd-nav-active, rgba(0, 0, 0, 0.06));
  outline: none;
}

.user-public-profile .upp-dropdown-item--warn {
  color: #b45309;
}

body[data-theme="dark"] .user-public-profile .upp-dropdown-item--warn,
body[data-theme="midnight"] .user-public-profile .upp-dropdown-item--warn,
body[data-theme="graphite"] .user-public-profile .upp-dropdown-item--warn {
  color: #fbbf24;
}

.user-public-profile .upp-hero-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: calc(-0.52 * var(--upp-avatar-size));
  position: relative;
  z-index: 3;
  padding: 0 clamp(16px, 4vw, 24px) 0 var(--upp-hero-inset);
}

.user-public-profile .upp-avatar-overlap {
  display: flex;
  justify-content: flex-start;
  flex-shrink: 0;
  margin-top: 0;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.user-public-profile .upp-avatar-overlap .upp-avatar-wrap {
  pointer-events: auto;
}

.user-public-profile .upp-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
  flex: 0 0 auto;
  align-self: flex-end;
  margin-left: auto;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

/* Группа / канал: аватар слева, кнопки справа — в нижней зоне, не на баннере */
.user-public-profile .upp-hero-footer:has(.upp-hero-actions--conv) {
  display: grid;
  grid-template-columns: var(--upp-avatar-size) minmax(0, 1fr);
  grid-template-rows: calc(0.5 * var(--upp-avatar-size)) auto;
  align-items: start;
  column-gap: 12px;
  row-gap: 0;
  margin-top: calc(-0.5 * var(--upp-avatar-size));
  padding: 0 clamp(16px, 4vw, 24px) 8px var(--upp-hero-inset);
}

.user-public-profile .upp-hero-footer:has(.upp-hero-actions--conv) .upp-avatar-overlap {
  grid-column: 1;
  grid-row: 1 / -1;
  margin-top: 0;
  z-index: 3;
  align-self: start;
}

.user-public-profile .upp-hero-actions--conv {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  max-width: none;
  margin: var(--upp-hero-actions-offset) 0 0;
  align-self: start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

/* Публичный профиль пользователя: аватар слева, кнопки справа (нижняя зона) */
.user-public-profile .upp-hero-footer--user {
  display: grid !important;
  grid-template-columns: var(--upp-avatar-size) minmax(0, 1fr);
  grid-template-rows: calc(0.5 * var(--upp-avatar-size)) auto;
  column-gap: 10px;
  row-gap: 0;
  align-items: start;
  justify-content: stretch;
  flex-wrap: unset;
  margin-top: calc(-0.5 * var(--upp-avatar-size));
  padding: 0 clamp(16px, 4vw, 24px) 8px var(--upp-hero-inset);
}

.user-public-profile .upp-hero-footer--user .upp-avatar-overlap {
  grid-column: 1;
  grid-row: 1 / -1;
  margin-top: 0;
  z-index: 3;
  align-self: start;
}

.user-public-profile .upp-hero-footer--user .upp-hero-actions--user {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  max-width: none;
  margin: var(--upp-hero-actions-offset) 0 0;
  align-self: start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 1;
}

.user-public-profile .upp-hero-footer--user .upp-hero-actions--user .upp-hero-btn {
  flex: 1 1 calc(33.333% - 8px);
  min-width: 0;
  max-width: 100%;
  justify-content: center;
}

@media (min-width: 769px) {
  .user-public-profile .upp-hero-footer--user {
    column-gap: 16px;
  }

  .user-public-profile .upp-hero-footer--user .upp-hero-actions--user .upp-hero-btn {
    flex: 0 1 auto;
    min-width: 0;
  }
}

.user-public-profile .upp-hero-btn__text {
  display: inline;
}

.user-public-profile .upp-hero-btn.hidden,
.user-public-profile .upp-hero-actions .hidden {
  display: none !important;
}

.user-public-profile .upp-hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--rd-border, #c9c2b6) !important;
  background: var(--rd-card, #faf8f4) !important;
  color: var(--rd-text, #141210) !important;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, filter 0.15s ease, transform 0.12s ease;
}

.user-public-profile .upp-hero-btn:active {
  transform: scale(0.98);
}

.user-public-profile .upp-hero-btn--primary {
  background: var(--rd-card, #faf8f4) !important;
  color: var(--rd-text, #141210) !important;
}

.user-public-profile .upp-hero-btn--accent {
  background: var(--rd-accent, #2d6cdf) !important;
  color: #fff !important;
  border-color: transparent !important;
}

.user-public-profile .upp-hero-btn--accent .upp-hero-btn__ic {
  color: #fff;
}

.user-public-profile .upp-hero-btn--muted {
  background: color-mix(in srgb, var(--rd-pill, #ebe6dd) 88%, var(--rd-card, #faf8f4)) !important;
  color: var(--rd-text, #141210) !important;
}

.user-public-profile .upp-hero-btn__ic {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-public-profile .upp-hero-btn__ic svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-public-profile .upp-hero-btn__ic img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.user-public-profile .upp-hero-btn--primary .upp-hero-btn__ic img,
.user-public-profile .upp-hero-btn--muted .upp-hero-btn__ic img {
  filter: none;
}

.user-public-profile .upp-profile-body {
  padding: 6px clamp(16px, 4vw, 24px) 0 var(--upp-hero-inset);
  text-align: left;
}

.user-public-profile .upp-profile-body .upp-identity {
  margin: 0;
  padding: 0;
  max-width: 100%;
}

.user-public-profile .upp-profile-body .upp-profile-meta {
  margin-top: 10px;
}

.user-public-profile .upp-identity {
  display: block;
  padding: 0;
  text-align: left;
}

.user-public-profile .upp-identity-head {
  width: 100%;
  max-width: 100%;
}

.user-public-profile .upp-avatar-wrap {
  flex-shrink: 0;
  position: relative;
}

.user-public-profile .upp-online-dot {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #22c55e;
  border: 3px solid var(--rd-page-bg, #e6e2da);
  box-sizing: border-box;
  z-index: 6;
  pointer-events: none;
}

.user-public-profile .upp-online-dot.hidden {
  display: none !important;
}

.user-public-profile .upp-avatar-ring {
  padding: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.user-public-profile .upp-avatar.profile-avatar-big,
.user-public-profile .upp-avatar.tg-avatar {
  width: var(--upp-avatar-size);
  height: var(--upp-avatar-size);
  margin: 0;
  border-radius: 50% !important;
  border: 4px solid var(--rd-page-bg, #e6e2da) !important;
  /* не использовать shorthand background: — он сбрасывает background-size и ломает cover для фото */
  background-color: var(--rd-pill-soft, #e0d9ce);
  font-size: clamp(32px, 8vw, 44px);
  font-weight: 800;
  box-shadow: none;
}

.user-public-profile .upp-avatar.profile-avatar-img {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.user-public-profile .upp-avatar.profile-avatar-fallback {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.user-public-profile .upp-copy {
  min-width: 0;
  flex: 1;
  width: 100%;
}

.user-public-profile .upp-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px 8px;
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--rd-text, #141210);
}

.user-public-profile .upp-name-row .verified-check-slot {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.user-public-profile .upp-name-row .verified-check.verified-check-verify {
  width: var(--badge-md-verify);
  height: var(--badge-md-verify);
  font-size: 0;
  color: transparent;
  background: center / contain no-repeat url("/static/img/VerifyIcon.svg");
}

.user-public-profile .upp-name-row .verified-check.verified-check-premium,
.user-public-profile .upp-name-row .verified-check.verified-check-hi-plus {
  width: var(--badge-md-plus);
  height: var(--badge-md-plus);
  font-size: 0;
  color: transparent;
  background: center / contain no-repeat url("/static/img/Hi! Plus icon.svg");
}

.user-public-profile .upp-name-row .verified-check.verified-check-team {
  width: var(--badge-md-team);
  height: var(--badge-md-team);
  font-size: 0;
  color: transparent;
  background: center / contain no-repeat url("/static/img/Hi! Team Verify.svg");
}

.user-public-profile .upp-name-row .verified-check.verified-check-tester {
  width: var(--badge-md-tester);
  height: var(--badge-md-tester);
  font-size: 0;
  color: transparent;
  background: center / contain no-repeat url("/static/img/Tester Icon.svg");
}

.user-public-profile .upp-name-row .verified-check.verified-check-scam {
  width: var(--badge-md-scam-w);
  height: var(--badge-md-scam-h);
  font-size: 0;
  color: transparent;
  background: center / contain no-repeat url("/static/img/SCAM-BADGE.svg");
}

.user-public-profile .upp-name-row .verified-check.verified-check-fake {
  width: var(--badge-md-fake-w);
  height: var(--badge-md-fake-h);
  font-size: 0;
  color: transparent;
  background: center / contain no-repeat url("/static/img/FAKE-BADGE.svg");
}

.user-public-profile .upp-name-row #profileTitle,
.user-public-profile .upp-name-row #meViewProfileTitle {
  display: inline;
}

.user-public-profile .upp-handle {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--rd-muted, #5e594f);
  letter-spacing: 0.01em;
}

.user-public-profile .upp-bio-inline {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--rd-text, #141210);
  word-break: break-word;
  white-space: pre-wrap;
}

.user-public-profile .upp-identity-head .upp-secondary-line,
.user-public-profile .upp-profile-body .upp-secondary-line {
  margin: 6px 0 0;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  text-align: left;
  font-size: 14px;
  line-height: 1.4;
}

.user-public-profile .upp-profile-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--rd-muted, #5e594f);
}

.user-public-profile .upp-profile-meta svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.75;
}

.user-public-profile .upp-details-card {
  margin-top: 18px;
  padding: 18px 18px 16px;
  border-radius: 24px;
  border: 1px solid var(--rd-border, #c9c2b6);
  background: var(--rd-card, #faf8f4);
  color: var(--rd-text, #141210);
  text-align: left;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--rd-text, #141210) 5%, transparent);
}

.user-public-profile .upp-detail-block + .upp-detail-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid color-mix(in srgb, var(--rd-border, #c9c2b6) 65%, transparent);
}

.user-public-profile .upp-detail-label {
  display: block;
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rd-muted, #5e594f);
}

.user-public-profile .upp-detail-primary {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--rd-accent, #a63b00);
  word-break: break-word;
}

.user-public-profile .upp-details-card .upp-secondary-line {
  margin: 3px 0 0;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  text-align: left;
  font-size: 15px;
  line-height: 1.35;
  color: var(--rd-text, #141210);
}

.user-public-profile .upp-detail-bio {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--rd-text, #141210);
  word-break: break-word;
  white-space: pre-wrap;
}

.user-public-profile .upp-secondary-line {
  margin: 6px 0 0;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--rd-text, #141210);
  text-align: left;
}

.user-public-profile .upp-sec-also-prefix {
  color: var(--rd-muted, #5c574e);
}

.user-public-profile .upp-sec-sep {
  color: var(--rd-muted, #5c574e);
}

.user-public-profile .upp-sec-handle {
  display: inline;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  min-height: 0 !important;
  font: inherit;
  font-weight: 600;
  color: #2563eb !important;
  cursor: pointer;
  text-decoration: none;
}

.user-public-profile .upp-sec-handle:hover {
  text-decoration: underline;
  color: #1d4ed8 !important;
}

body[data-theme="dark"].user-public-profile .upp-sec-handle,
body[data-theme="midnight"].user-public-profile .upp-sec-handle,
body[data-theme="graphite"].user-public-profile .upp-sec-handle {
  color: #93c5fd !important;
}

body[data-theme="dark"].user-public-profile .upp-sec-handle:hover,
body[data-theme="midnight"].user-public-profile .upp-sec-handle:hover,
body[data-theme="graphite"].user-public-profile .upp-sec-handle:hover {
  color: #bfdbfe !important;
}

.user-public-profile .upp-bio {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--rd-text, #141210);
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
  word-break: break-word;
}

@media (min-width: 720px) {
  .user-public-profile .upp-bio {
    margin-left: 0;
    margin-right: 0;
  }
}

.user-public-profile .upp-chips {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

@media (min-width: 720px) {
  .user-public-profile .upp-chips {
    justify-content: flex-start;
  }
}

.user-public-profile .upp-chip {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--rd-border, #c9c2b6);
  background: var(--rd-pill, #ebe6dd);
  color: var(--rd-muted, #5e594f);
}

.user-public-profile .upp-chip--soft {
  background: var(--rd-card-2, #f3f0ea);
}

.user-public-profile .mobile-bottom-nav {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  border-radius: 999px !important;
  padding: 5px !important;
  gap: 0 !important;
  overflow: hidden !important;
  background: color-mix(in srgb, var(--rd-card, #faf8f4) 72%, transparent) !important;
  backdrop-filter: blur(20px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(140%) !important;
  box-shadow: var(--rd-tabbar-shadow, 0 10px 30px rgba(0, 0, 0, 0.34), var(--rd-btn-bevel)) !important;
}

.user-public-profile .mobile-bottom-nav button:not(.active) {
  border-radius: 999px !important;
  background: transparent !important;
  box-shadow: none !important;
}

.user-public-profile .mobile-bottom-nav button.active {
  background: color-mix(in srgb, var(--rd-nav-active, #ebe4d9) 90%, transparent) !important;
  color: var(--rd-accent, #e0702c) !important;
  box-shadow:
    var(--rd-btn-bevel, inset 0 1px 0 rgba(255, 255, 255, 0.14)),
    inset 0 0 0 1px color-mix(in srgb, var(--rd-border, #c9c2b6) 32%, transparent) !important;
  font-weight: 800 !important;
}

.user-public-profile nav.mobile-bottom-nav .mobile-bottom-nav__glide {
  box-shadow: var(--rd-btn-bevel, inset 0 1px 0 rgba(255, 255, 255, 0.14)) !important;
}

.user-public-profile nav.mobile-bottom-nav:has(.mobile-bottom-nav__glide) > button.active {
  box-shadow: none !important;
}

.user-public-profile .upp-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

@media (min-width: 720px) {
  .user-public-profile .upp-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Старый блок действий под именем — скрыт, если кнопки перенесены в hero-footer */
.user-public-profile .upp-hero-footer + .upp-profile-body ~ .upp-actions,
.user-public-profile .upp-hero-footer ~ .upp-actions:not(.upp-actions--legacy) {
  display: none;
}

.user-public-profile .upp-identity + .upp-actions.upp-actions--legacy {
  margin-top: 18px;
  margin-bottom: 0;
  position: relative;
  z-index: 4;
}

.user-public-profile .upp-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 76px;
  padding: 10px 8px;
  border-radius: 16px;
  border: 1px solid var(--rd-border, #c9c2b6) !important;
  background: var(--rd-card, #faf8f4) !important;
  color: var(--rd-text, #141210) !important;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.user-public-profile .upp-action:active {
  transform: scale(0.98);
}

.user-public-profile .upp-action__ic {
  width: 28px;
  height: 28px;
  opacity: 0.92;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-public-profile .upp-action__ic svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-public-profile .upp-action__ic img {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1) !important;
}

.user-public-profile .upp-icon img {
  width: 26px;
  height: 26px;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1) !important;
}

.user-public-profile .upp-action--accent {
  border-color: color-mix(in srgb, var(--rd-accent, #e0702c) 45%, var(--rd-border, #c9c2b6));
  background: color-mix(in srgb, var(--rd-accent, #e0702c) 14%, var(--rd-card, #faf8f4)) !important;
  color: var(--rd-text, #141210);
}

.user-public-profile .upp-action--accent .upp-action__ic {
  color: var(--rd-accent, #e0702c);
}

.user-public-profile .upp-gifts {
  margin-top: 28px;
  padding: 20px 18px 18px;
  border-radius: 28px;
  border: 1px solid var(--rd-border, #c9c2b6);
  background: var(--rd-card, #faf8f4);
}

.user-public-profile .upp-gifts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.user-public-profile .upp-gifts-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rd-muted, #5e594f);
}

.user-public-profile .upp-gifts-count {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--rd-pill, #ebe6dd);
  border: 1px solid var(--rd-border, #c9c2b6);
  color: var(--rd-accent, #a63b00);
}

.user-public-profile .profile-error,
.user-public-profile .upp-error {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--rd-accent-2, #c55d24) 35%, var(--rd-border, #c9c2b6));
  background: color-mix(in srgb, var(--rd-accent, #e0702c) 10%, var(--rd-card, #faf8f4));
  color: var(--rd-text, #141210);
}

/* Редактирование профиля: те же компоненты, что и просмотр (upp-banner, кольцо аватара, карточки) */
.user-public-profile .upp-banner-edit-wrap {
  position: relative;
  width: 100%;
}

.user-public-profile .upp-edit-bio-preview {
  margin-top: 10px;
  margin-bottom: 0;
  text-align: left;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.user-public-profile .upp-details-card--edit {
  margin-top: 18px;
}

.user-public-profile .upp-details-card--edit .upp-gifts-head {
  margin-bottom: 8px;
}

.user-public-profile .upp-details-card--edit .prm-fields {
  gap: 14px;
}

.user-public-profile .upp-details-card--edit .prm-field > span {
  color: var(--rd-muted, #5e594f);
  font-size: clamp(13px, 2.4vw, 14px);
  font-weight: 600;
}

.user-public-profile .upp-details-card--edit .prm-field input,
.user-public-profile .upp-details-card--edit .prm-field textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 16px;
  border: 1px solid var(--rd-border, #c9c2b6);
  background: var(--rd-pill-soft, #e0d9ce);
  color: var(--rd-text, #141210);
  padding: 11px 14px;
  font-size: 16px;
}

.user-public-profile .upp-details-card--edit .prm-field textarea {
  min-height: 96px;
  resize: vertical;
}

.user-public-profile .upp-details-card--edit .prm-field input:focus,
.user-public-profile .upp-details-card--edit .prm-field textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--rd-accent, #e0702c) 45%, transparent);
  outline-offset: 1px;
}

.user-public-profile .upp-edit-save {
  margin-top: 16px;
}

.user-public-profile .upp-edit-save .prm-primary {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
}

/* Телефон: отступ под таббар */
@media (max-width: 900px) and (hover: none), (max-width: 900px) and (pointer: coarse) {
  .user-public-profile .upp-wrap {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
}

/* Телефон и узкий экран: кнопки под аватаром */
@media (max-width: 768px) {
  .user-public-profile {
    --upp-avatar-size: clamp(72px, 20vw, 96px);
  }

  .user-public-profile .upp-hero-actions:not(.upp-hero-actions--me) .upp-hero-btn {
    min-height: 36px;
    min-width: 0;
    padding: 7px 12px;
    gap: 6px;
    font-size: 13px;
    flex-shrink: 0;
  }

  .user-public-profile .upp-hero-actions:not(.upp-hero-actions--me) .upp-hero-btn__ic {
    width: 17px;
    height: 17px;
  }

  .user-public-profile .upp-hero-actions:not(.upp-hero-actions--me) .upp-hero-btn__ic img {
    width: 17px;
    height: 17px;
  }

  .user-public-profile .upp-profile-body {
    padding-top: 4px;
  }

  .user-public-profile .upp-profile-body .upp-name-row {
    font-size: clamp(20px, 5vw, 26px);
  }

  .user-public-profile .upp-profile-body .upp-handle {
    font-size: 14px;
  }

  .user-public-profile .upp-hero-actions--me .upp-hero-btn {
    padding: 7px 12px;
    font-size: 13px;
  }

  .user-public-profile .upp-hero-footer:has(.upp-hero-actions--conv) {
    column-gap: 10px;
    padding-bottom: 4px;
  }

  .user-public-profile .upp-hero-actions--conv .upp-hero-btn {
    padding: 7px 12px;
    font-size: 13px;
  }

  .user-public-profile .upp-hero-footer--user .upp-hero-actions--user .upp-hero-btn {
    padding: 7px 8px;
  }
}

@media (max-width: 520px) {
  .user-public-profile .upp-hero-actions:not(.upp-hero-actions--me) .upp-hero-btn {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 12px;
    gap: 5px;
  }
}

body[data-theme="dark"].user-public-profile .upp-hero-btn,
body[data-theme="midnight"].user-public-profile .upp-hero-btn,
body[data-theme="graphite"].user-public-profile .upp-hero-btn {
  background: var(--rd-card, #1a1714) !important;
  border-color: var(--rd-border, #3d3832) !important;
  color: var(--rd-text, #f5f2ed) !important;
}

body[data-theme="dark"].user-public-profile .upp-hero-btn--muted,
body[data-theme="midnight"].user-public-profile .upp-hero-btn--muted,
body[data-theme="graphite"].user-public-profile .upp-hero-btn--muted {
  background: color-mix(in srgb, var(--rd-pill, #252220) 90%, var(--rd-card, #1a1714)) !important;
}

body[data-theme="dark"].user-public-profile .upp-hero-btn--primary,
body[data-theme="midnight"].user-public-profile .upp-hero-btn--primary,
body[data-theme="graphite"].user-public-profile .upp-hero-btn--primary {
  background: var(--rd-card, #faf8f4) !important;
  color: #141210 !important;
  border-color: transparent !important;
}

body[data-theme="dark"].user-public-profile .upp-hero-btn--accent,
body[data-theme="midnight"].user-public-profile .upp-hero-btn--accent,
body[data-theme="graphite"].user-public-profile .upp-hero-btn--accent {
  background: var(--rd-accent, #2d6cdf) !important;
  color: #fff !important;
  border-color: transparent !important;
}

body[data-theme="dark"].user-public-profile .upp-hero-btn__ic img,
body[data-theme="midnight"].user-public-profile .upp-hero-btn__ic img,
body[data-theme="graphite"].user-public-profile .upp-hero-btn__ic img {
  filter: brightness(0) invert(1);
}

body[data-theme="dark"].user-public-profile .upp-hero-btn--accent .upp-hero-btn__ic img,
body[data-theme="midnight"].user-public-profile .upp-hero-btn--accent .upp-hero-btn__ic img,
body[data-theme="graphite"].user-public-profile .upp-hero-btn--accent .upp-hero-btn__ic img {
  filter: brightness(0) invert(1);
}

body[data-theme="dark"].user-public-profile .upp-topbar,
body[data-theme="midnight"].user-public-profile .upp-topbar,
body[data-theme="graphite"].user-public-profile .upp-topbar {
  background: var(--rd-page-bg, #0f0d0b);
  border-bottom-color: var(--rd-border, #3d3832);
}

@supports (backdrop-filter: blur(8px)) {
  body[data-theme="dark"].user-public-profile .upp-topbar,
  body[data-theme="midnight"].user-public-profile .upp-topbar,
  body[data-theme="graphite"].user-public-profile .upp-topbar {
    background: color-mix(in srgb, var(--rd-page-bg, #0f0d0b) 85%, transparent);
  }
}

body[data-theme="dark"].user-public-profile .upp-icon,
body[data-theme="midnight"].user-public-profile .upp-icon,
body[data-theme="graphite"].user-public-profile .upp-icon {
  background: var(--rd-card, #1a1714) !important;
  border-color: var(--rd-border, #3d3832) !important;
}

body[data-theme="dark"].user-public-profile .upp-action__ic img,
body[data-theme="midnight"].user-public-profile .upp-action__ic img,
body[data-theme="graphite"].user-public-profile .upp-action__ic img,
body[data-theme="dark"].user-public-profile .upp-icon img,
body[data-theme="midnight"].user-public-profile .upp-icon img,
body[data-theme="graphite"].user-public-profile .upp-icon img {
  filter: brightness(0) invert(1);
}

body[data-theme="dark"].user-public-profile .upp-action,
body[data-theme="midnight"].user-public-profile .upp-action,
body[data-theme="graphite"].user-public-profile .upp-action {
  background: var(--rd-card, #1a1714) !important;
  border-color: var(--rd-border, #3d3832) !important;
}

body[data-theme="dark"].user-public-profile .upp-action--accent,
body[data-theme="midnight"].user-public-profile .upp-action--accent,
body[data-theme="graphite"].user-public-profile .upp-action--accent {
  background: color-mix(in srgb, var(--rd-accent, #e0702c) 18%, var(--rd-card, #1a1714));
  border-color: color-mix(in srgb, var(--rd-accent, #e0702c) 40%, var(--rd-border, #3d3832));
}

body[data-theme="dark"].user-public-profile .upp-gifts,
body[data-theme="midnight"].user-public-profile .upp-gifts,
body[data-theme="graphite"].user-public-profile .upp-gifts {
  background: var(--rd-card, #1a1714);
  border-color: var(--rd-border, #3d3832);
}

body[data-theme="dark"].user-public-profile .upp-details-card,
body[data-theme="midnight"].user-public-profile .upp-details-card,
body[data-theme="graphite"].user-public-profile .upp-details-card {
  background: var(--rd-card, #1a1714);
  border-color: var(--rd-border, #3d3832);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"].user-public-profile .mobile-bottom-nav,
body[data-theme="midnight"].user-public-profile .mobile-bottom-nav,
body[data-theme="graphite"].user-public-profile .mobile-bottom-nav {
  background: color-mix(in srgb, var(--rd-card, #1a1714) 68%, transparent) !important;
}

body[data-theme="dark"].user-public-profile .upp-gifts-count,
body[data-theme="midnight"].user-public-profile .upp-gifts-count,
body[data-theme="graphite"].user-public-profile .upp-gifts-count {
  background: var(--rd-pill, #252220);
  border-color: var(--rd-border, #3d3832);
}

body[data-theme="dark"].user-public-profile .upp-avatar-ring,
body[data-theme="midnight"].user-public-profile .upp-avatar-ring,
body[data-theme="graphite"].user-public-profile .upp-avatar-ring {
  box-shadow: none;
}

body[data-theme="dark"].user-public-profile .upp-online-dot,
body[data-theme="midnight"].user-public-profile .upp-online-dot,
body[data-theme="graphite"].user-public-profile .upp-online-dot {
  border-color: var(--rd-page-bg, #0c1018);
}

.profile-avatar-deleted,
.profile-avatar-big.profile-avatar-deleted {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8edf4 !important;
  overflow: hidden;
}

.profile-avatar-deleted img,
.profile-avatar-big.profile-avatar-deleted img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-deleted-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #e8edf4;
}

.avatar-deleted-account img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.msg-avatar--deleted {
  background: #e8edf4;
  overflow: hidden;
}

.msg-avatar--deleted .avatar-deleted-account {
  width: 100%;
  height: 100%;
}
