:root {
  --profile-bg: #e6e2da;
  --profile-text: #141210;
  --profile-muted: #5e594f;
  --profile-card-bg: #faf8f4;
  --profile-card-border: #c9c2b6;
  --profile-card-shadow: 0 14px 32px rgba(20, 18, 16, 0.08);
  --profile-subcard-bg: #f3f0ea;
  --profile-subcard-border: #c9c2b6;
  --profile-primary: #a63b00;
  --profile-primary-solid: #a63b00;
  --profile-primary-text: #ffffff;
  --profile-secondary-bg: #ebe6dd;
  --profile-secondary-text: #3a3028;
  --profile-danger: #b42318;
}

.my-profile-page {
  --tg-surface: #faf8f4;
  --tg-surface-soft: #f3f0ea;
  --tg-border: #c9c2b6;
  --tg-title: #141210;
}

.my-profile-page .profile-layout {
  max-width: 760px;
  padding-top: 8px;
}

.my-profile-page .tg-topbar {
  position: static;
  background: transparent;
  border-bottom: 0;
  backdrop-filter: none;
  margin-bottom: 8px;
}

.my-profile-page .tg-topbar h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--tg-title);
}

.my-profile-page .tg-profile-head {
  border-radius: 18px;
  background: var(--tg-surface);
  border: 1px solid var(--tg-border);
  padding: 16px;
  box-shadow: 0 8px 24px rgba(32, 44, 76, 0.07);
}

.my-profile-page .tg-avatar {
  width: 88px;
  height: 88px;
  margin: 0;
  border-radius: 50%;
  font-size: 34px;
}

.my-profile-page .tg-name-wrap {
  margin-top: 10px;
  min-width: 0;
}

.my-profile-page .tg-name-row {
  font-size: clamp(22px, 4vw, 30px);
}

.my-profile-page .tg-username-line {
  margin-top: 4px;
  font-size: 14px;
  color: #7384a8;
}

.my-profile-page .tg-bio-preview {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.4;
  color: #34415f;
  word-break: break-word;
}

.my-profile-page .tg-chips {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.my-profile-page .tg-chip {
  min-height: 32px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-profile-page .tg-card {
  margin-top: 10px;
  border-radius: 16px;
  background: var(--tg-surface);
  border-color: var(--tg-border);
}

.my-profile-page .tg-block-title {
  font-size: 14px;
  color: #63759b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.my-profile-page .tg-edit-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

.my-profile-page .tg-actions {
  margin-top: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.my-profile-page .tg-list {
  gap: 6px;
}

.my-profile-page .tg-list-item,
.my-profile-page .profile-tag-button {
  border-radius: 10px;
}

.my-profile-page .profile-tag-list {
  display: grid;
  gap: 6px;
}

.my-profile-page .profile-tag-button {
  width: 100%;
  text-align: left;
  min-height: 42px;
  padding: 0 12px;
  background: var(--tg-surface-soft);
  border-color: #dbe4f5;
}

.my-profile-page .profile-empty {
  padding: 8px 2px;
}

.profile-shell {
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  margin: 0;
  background: var(--profile-bg);
  color: var(--profile-text);
  font-family: var(--font-body, "Inter", "Segoe UI", Roboto, Arial, sans-serif);
  overflow-y: auto;
  overflow-x: hidden;
}

.profile-layout {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 18px 34px;
}

.profile-dashboard {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
}

.profile-card-main {
  grid-column: 1 / 2;
}

.profile-card-side {
  grid-column: 2 / 3;
}

.profile-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
}

.profile-topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--profile-text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-top-meta {
  font-size: 12px;
  color: var(--profile-muted);
  margin-bottom: 2px;
}

.icon-btn.profile-back {
  flex-shrink: 0;
}

.profile-shell .icon-btn {
  border: 1px solid var(--profile-card-border);
  background: rgba(255, 255, 255, 0.8);
  color: #3a4f86;
}

.profile-shell .icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-shell .icon-btn:hover {
  background: #f0f5ff;
}

.profile-menu-anchor {
  margin-left: auto;
  position: relative;
}

.profile-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--profile-card-border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 40px rgba(28, 51, 103, 0.2);
}

.profile-menu-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #ebeff9;
  background: transparent;
  color: #213058;
  font-size: 14px;
  padding: 11px 13px;
  cursor: pointer;
}

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

.profile-menu-item:hover {
  background: var(--bg-hover, #ebe6dd);
}

.profile-hero {
  margin-top: 4px;
  padding: 18px 18px 18px;
  border-radius: 28px;
  background: var(--bg-card, #faf8f4);
  border: 1px solid var(--border, #c9c2b6);
  display: grid;
  gap: 12px;
}

.profile-hero-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border, #c9c2b6);
  background: var(--bg-hover, #ebe6dd);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #141210);
}

.profile-chip-orbs img {
  width: 14px;
  height: 14px;
}

.profile-avatar-big {
  width: 118px;
  height: 118px;
  margin: 0 auto 14px;
  border-radius: 32px;
  border: 1px solid var(--border, #c9c2b6);
  box-shadow: none;
  background-color: var(--bg-hover, #ebe6dd);
  color: var(--text-primary, #141210);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  line-height: 1;
}

.profile-avatar-big svg {
  width: 56%;
  height: 56%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-avatar-big.profile-avatar-img {
  background-size: cover;
  background-position: center;
  font-size: 0;
}

.profile-avatar-big.profile-avatar-fallback {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.profile-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary, #141210);
}

.profile-title-row .verified-check--before,
.profile-title-row .verified-check-slot.verified-check--before {
  margin: 0 2px 0 0;
}

.profile-title-row .verified-check--after,
.profile-title-row .verified-check-slot.verified-check--after {
  margin: 0 0 0 2px;
}

.verified-check-placeholder {
  display: none !important;
}

.verified-check,
.profile-title-row .verified-check,
.profile-title-row .verified-check-slot {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.profile-title-row .verified-check {
  width: auto;
  height: auto;
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: middle;
  margin: 0;
  font-size: 12px;
  line-height: 1;
  color: #7ad4ff;
}

.profile-title-row 

.profile-title-row .verified-check.verified-check-verify {
  width: var(--badge-lg-verify);
  height: var(--badge-lg-verify);
  transform: translateY(2px);
  font-size: 0;
  color: transparent;
  background: center / contain no-repeat url("/static/img/verifed.svg");
}

.profile-title-row .verified-check.verified-check-premium,
.profile-title-row .verified-check.verified-check-hi-plus {
  width: var(--badge-lg-plus);
  height: var(--badge-lg-plus);
  transform: translateY(2px);
  font-size: 0;
  color: transparent;
  background: center / contain no-repeat url("/static/img/community-premium-icon.svg");
}

.profile-title-row .verified-check.verified-check-tester {
  width: var(--badge-lg-tester);
  height: var(--badge-lg-tester);
  transform: translateY(2px);
  font-size: 0;
  color: transparent;
  background: center / contain no-repeat url("/static/img/Tester Icon.svg");
}

.profile-title-row .verified-check.verified-check-scam {
  width: var(--badge-lg-scam-w);
  height: var(--badge-lg-scam-h);
  transform: translateY(2px);
  font-size: 0;
  color: transparent;
  background: center / contain no-repeat url("/static/img/SCAM-BADGE.svg");
}

.profile-title-row .verified-check.verified-check-spec { width: var(--badge-sm-verify); height: var(--badge-sm-verify); background: center / contain no-repeat url('/static/img/spec.svg'); color: transparent; font-size: 0; }
.verified-check.verified-check-group { width: var(--badge-sm-creator); height: var(--badge-sm-creator); background: center / contain no-repeat url('/static/img/creator-verified.svg'); color: transparent; font-size: 0; }

.verified-check.verified-check-group.verified-check--before { margin-left: 0; margin-right: 6px; }
.verified-check.verified-check-music { width: var(--badge-sm-verify); height: var(--badge-sm-verify); background: center / contain no-repeat url('/static/img/music-verifed.svg'); color: transparent; font-size: 0; }

.verified-check.verified-check-fake {
  width: var(--badge-lg-fake-w);
  height: var(--badge-lg-fake-h);
  transform: translateY(2px);
  font-size: 0;
  color: transparent;
  background: center / contain no-repeat url("/static/img/FAKE-BADGE.svg");
}

.profile-sub {
  margin-top: 4px;
  color: #5f6f93;
  font-size: 14px;
}

.profile-card {
  margin: 0;
  padding: 16px;
  background: var(--profile-card-bg);
  border: 1px solid var(--profile-card-border);
  border-radius: 18px;
  box-shadow: var(--profile-card-shadow);
}

.profile-handle,
.profile-my-verified {
  margin: 0 0 9px;
  font-size: 14px;
  font-weight: 600;
  color: #4a5f96;
}

.profile-bio {
  margin: 0;
  color: var(--text, #ffffff); /* v45: было #1e2a49 — тёмно-синий выглядел чёрным на тёмном фоне */
  font-size: 17px;
  line-height: 1.45;
}

.profile-stats {
  margin: 16px 0 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-stat {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--profile-subcard-border);
  background: var(--profile-subcard-bg);
}

.profile-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #21386d;
}

.profile-stat-label {
  margin-top: 3px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7082aa;
}

.profile-section-title {
  margin: 8px 0 10px;
  color: #5f7198;
  font-size: 13px;
  font-weight: 700;
}

.profile-block-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
  color: #2a3f71;
}

.profile-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--profile-muted);
}

.profile-list-wrap {
  display: grid;
  gap: 8px;
}

.profile-list-item {
  border: 1px solid var(--profile-subcard-border);
  border-radius: 12px;
  background: var(--profile-subcard-bg);
  padding: 9px 10px;
  font-size: 13px;
  color: #233c73;
}

.profile-item-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--profile-muted);
}

.profile-empty {
  font-size: 12px;
  color: var(--profile-muted);
}

.profile-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-tag-button {
  min-height: 34px;
  border: 1px solid #d9e4ff;
  background: var(--profile-secondary-bg);
  color: var(--profile-secondary-text);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.profile-members {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 250px;
  overflow-y: auto;
}

.profile-members li {
  margin-bottom: 7px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--profile-subcard-border);
  background: var(--profile-subcard-bg);
  font-size: 14px;
  color: #223964;
}

.profile-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-actions button,
.profile-row-actions button {
  min-height: 46px;
  border: 0;
  border-radius: 13px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.profile-actions button:not(.secondary),
.profile-row-actions button:not(.secondary) {
  background: var(--profile-primary);
  color: var(--profile-primary-text);
  box-shadow: 0 9px 20px rgba(79, 125, 255, 0.3);
}

.profile-actions button.secondary,
.profile-row-actions button.secondary {
  background: var(--profile-secondary-bg);
  color: var(--profile-secondary-text);
  border: 1px solid #d9e4ff;
}

.profile-error {
  margin-top: 10px;
  color: var(--profile-danger);
  font-size: 14px;
}

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

.profile-edit-field-full {
  grid-column: 1 / -1;
}

.profile-edit-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #6378a9;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.profile-edit-field input,
.profile-edit-field textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid #dbe4ff;
  background: #f7f9ff;
  color: #1c2b50;
  font-size: 14px;
  font-family: inherit;
}

.profile-edit-field input[readonly],
.profile-edit-field input:disabled {
  background: #edf2ff;
  color: #7083ad;
}

.profile-edit-field textarea {
  resize: vertical;
  min-height: 84px;
}

.profile-row-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hidden-file {
  display: none;
}

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

body.embed-panel.profile-shell {
  min-height: 100%;
  height: 100%;
  background: transparent;
  overflow-y: auto;
  overflow-x: hidden;
}

body.embed-panel.profile-shell .profile-layout {
  max-width: none;
  padding: 10px 14px 18px;
}

body.embed-panel.profile-shell .profile-topbar {
  position: static;
  padding: 8px 0 12px;
}

body.embed-panel.profile-shell .profile-back,
body.embed-panel.profile-shell .mobile-bottom-nav {
  display: none !important;
}

@media (max-width: 860px) {
  .profile-layout {
    padding: 0 12px 24px;
  }

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

  .profile-card-main,
  .profile-card-side {
    grid-column: 1 / -1;
  }

  .profile-topbar {
    padding: 12px 0;
  }

  .profile-topbar h1 {
    font-size: 20px;
  }

  .profile-hero {
    border-radius: 24px;
    padding: 14px 10px 14px;
  }

  .profile-hero-main {
    align-items: flex-start;
  }

  .profile-avatar-big {
    width: 98px;
    height: 98px;
    border-radius: 24px;
    font-size: 34px;
  }

  .profile-title-row {
    font-size: 28px;
  }

  .profile-card {
    border-radius: 18px;
    padding: 14px;
  }

  .profile-bio {
    font-size: 15px;
  }

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

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

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

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

  .profile-edit-field-full {
    grid-column: 1;
  }
}

@media (max-width: 560px) {
  .my-profile-page .tg-actions {
    grid-template-columns: 1fr;
  }

  .my-profile-page .tg-avatar {
    width: 76px;
    height: 76px;
  }

  .my-profile-page .tg-name-row {
    font-size: 24px;
  }
}

@media (max-width: 460px) {
  .profile-actions,
  .profile-row-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) and (hover: none), (max-width: 768px) and (pointer: coarse) {
  .profile-layout {
    padding-bottom: 98px;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-radius: 999px;
    padding: 5px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #d8e3ff;
    box-shadow: var(--rd-tabbar-shadow, 0 12px 28px rgba(40, 64, 130, 0.2), var(--rd-btn-bevel));
    z-index: 60;
  }

  .mobile-bottom-nav button:not(.active) {
    border: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: #5b6690;
    min-height: 58px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 999px;
    line-height: 1.1;
  }

  .mobile-bottom-nav button img {
    width: 18px;
    height: 18px;
  }

  .mobile-bottom-nav button .nav-label {
    white-space: nowrap;
  }

  .mobile-bottom-nav button.active {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 58px;
    font-size: 12px;
    border-radius: 999px;
    line-height: 1.1;
    background: color-mix(in srgb, var(--rd-nav-active, var(--bg-active, #e0d9ce)) 92%, transparent);
    color: var(--accent, #a63b00);
    font-weight: 700;
    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, #d8e3ff) 35%, transparent);
  }
}

@media (hover: hover) and (pointer: fine) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

body[data-theme="dark"].profile-shell,
body[data-theme="midnight"].profile-shell,
body[data-theme="graphite"].profile-shell {
  --profile-bg: #0f0d0b;
  --profile-text: #f2ede6;
  --profile-muted: #9a9288;
  --profile-card-bg: #1a1714;
  --profile-card-border: #3d3832;
  --profile-card-shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
  --profile-subcard-bg: #141210;
  --profile-subcard-border: #3d3832;
  --profile-primary: #e0702c;
  --profile-secondary-bg: #252220;
  --profile-secondary-text: #e8e2da;
  --profile-danger: #f09090;
}

body[data-theme="graphite"].profile-shell {
  --profile-bg: #111214;
  --profile-text: #eceff4;
  --profile-muted: #8f96a3;
  --profile-card-bg: #1c1f24;
  --profile-card-border: #3a3f47;
  --profile-subcard-bg: #15171a;
  --profile-subcard-border: #3a3f47;
  --profile-primary: #c9a227;
  --profile-secondary-bg: #25282e;
  --profile-secondary-text: #dce0e8;
}

body[data-theme="dark"].profile-shell .icon-btn,
body[data-theme="midnight"].profile-shell .icon-btn,
body[data-theme="graphite"].profile-shell .icon-btn {
  background: var(--bg-hover, #252220);
  color: var(--text-primary, #f2ede6);
}

body[data-theme="dark"].my-profile-page,
body[data-theme="midnight"].my-profile-page,
body[data-theme="graphite"].my-profile-page {
  --tg-surface: #1a1714;
  --tg-surface-soft: #252220;
  --tg-border: #3d3832;
  --tg-title: #f2ede6;
}

body[data-theme="graphite"].my-profile-page {
  --tg-surface: #1c1f24;
  --tg-surface-soft: #25282e;
  --tg-border: #3a3f47;
  --tg-title: #eceff4;
}

body[data-theme="dark"].my-profile-page .tg-username-line,
body[data-theme="midnight"].my-profile-page .tg-username-line,
body[data-theme="graphite"].my-profile-page .tg-username-line {
  color: var(--text-muted, #9a9288);
}

body[data-theme="dark"].my-profile-page .tg-bio-preview,
body[data-theme="midnight"].my-profile-page .tg-bio-preview,
body[data-theme="graphite"].my-profile-page .tg-bio-preview {
  color: var(--text-secondary, #d4cdc4);
}

body[data-theme="dark"].profile-shell .profile-chip,
body[data-theme="midnight"].profile-shell .profile-chip,
body[data-theme="graphite"].profile-shell .profile-chip {
  background: #252220;
  color: #f2ede6;
  border-color: #3d3832;
}

body[data-theme="graphite"].profile-shell .profile-chip {
  background: #25282e;
  color: #eceff4;
  border-color: #3a3f47;
}

body[data-theme="dark"].profile-shell .profile-title-row,
body[data-theme="midnight"].profile-shell .profile-title-row,
body[data-theme="graphite"].profile-shell .profile-title-row,
body[data-theme="dark"].profile-shell .profile-bio,
body[data-theme="midnight"].profile-shell .profile-bio,
body[data-theme="graphite"].profile-shell .profile-bio,
body[data-theme="dark"].profile-shell .profile-stat-value,
body[data-theme="midnight"].profile-shell .profile-stat-value,
body[data-theme="graphite"].profile-shell .profile-stat-value,
body[data-theme="dark"].profile-shell .profile-members li,
body[data-theme="midnight"].profile-shell .profile-members li,
body[data-theme="graphite"].profile-shell .profile-members li {
  color: var(--profile-text, #f2ede6);
}

body[data-theme="dark"].profile-shell .mobile-bottom-nav,
body[data-theme="midnight"].profile-shell .mobile-bottom-nav,
body[data-theme="graphite"].profile-shell .mobile-bottom-nav {
  background: var(--profile-card-bg, #1a1714);
  border-color: var(--profile-card-border, #3d3832);
}

body[data-theme="dark"].profile-shell .mobile-bottom-nav button,
body[data-theme="midnight"].profile-shell .mobile-bottom-nav button,
body[data-theme="graphite"].profile-shell .mobile-bottom-nav button {
  color: var(--profile-muted, #9a9288);
}

body[data-theme="dark"].profile-shell .mobile-bottom-nav button.active,
body[data-theme="midnight"].profile-shell .mobile-bottom-nav button.active,
body[data-theme="graphite"].profile-shell .mobile-bottom-nav button.active {
  background: color-mix(
    in srgb,
    var(--rd-nav-active, var(--profile-secondary-bg, #252220)) 88%,
    transparent
  );
  color: var(--profile-primary, #e0702c);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--profile-card-border, #3d3832) 45%, transparent);
}

/* v20 unified profile badge sizing */
.profile-name .verified-check,
.profile-name .verified-check-slot,
.profile-title-row .verified-check,
.profile-title-row .verified-check-slot { width:22px !important; height:22px !important; min-width:22px !important; min-height:22px !important; background-size:contain !important; background-position:center !important; background-repeat:no-repeat !important; display:inline-block !important; vertical-align:middle !important; }

/* ── v45: композер личного профиля — превью фото и редактор опроса ── */
#composer .pf-attachment-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0 52px;
  font-size: 13px;
  color: var(--muted, #a3a3a3);
}
#composer .pf-attachment-preview button {
  border: 0;
  background: transparent;
  color: var(--accent, #8b7cf7);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
}
#composer .pf-poll-editor {
  margin: 10px 0 0 52px;
  padding: 12px;
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 14px;
  background: var(--surface, #161616);
}
#composer .pf-poll-editor input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 7px 0;
  padding: 10px 11px;
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text, #ffffff);
  outline: none;
  font-size: 14px;
}
#composer .pf-poll-editor input:focus {
  border-color: var(--accent, #8b7cf7);
}
#composer .poll-add-option {
  border: 0;
  background: transparent;
  color: var(--accent, #8b7cf7);
  cursor: pointer;
  padding: 5px 0;
  font-size: 13px;
}

/* ── v45: опросы в постах личного профиля ── */
.post-poll { margin-top: 12px; padding: 14px; border: 1px solid var(--border, #2a2a2a); border-radius: 16px; background: var(--surface, #161616); }
.post-poll-question { font-weight: 700; margin-bottom: 10px; color: var(--text, #fff); }
.post-poll-option { position: relative; display: flex; width: 100%; min-height: 42px; align-items: center; gap: 8px; overflow: hidden; margin: 7px 0; padding: 9px 11px; border: 1px solid var(--border, #2a2a2a); border-radius: 11px; background: rgba(255, 255, 255, 0.04); color: var(--text, #fff); cursor: pointer; text-align: left; }
.post-poll-option-fill { position: absolute; inset: 0 auto 0 0; background: rgba(139, 124, 247, 0.18); pointer-events: none; }
.post-poll-option-text, .post-poll-option-votes { position: relative; z-index: 1; }
.post-poll-option-text { flex: 1; }
.post-poll-option-votes { opacity: 0.72; font-size: 12px; }
.post-poll-option.is-selected { border-color: var(--accent, #8b7cf7); }
.post-poll-total { margin-top: 8px; font-size: 12px; color: var(--muted, #a3a3a3); }

/* ═══════════════════════════════════════════════════════════════════════════
   v54: ПРОФИЛЬ В СТИЛЕ TIKTOK (по скриншоту пользователя)
   Обложка full-bleed → имя/статистика слева + аватар с кольцом справа →
   кнопка «Редактировать профиль» → био → дата регистрации →
   табы-колонки с подчёркиванием → сетка контента.
   Все ID сохранены (pfBanner, pfAvatar, pfDisplayName…), JS не тронут.
   ═══════════════════════════════════════════════════════════════════════════ */

.pf-tt .profile-banner-wrap {
  position: relative;
  margin: 0 0 14px;
}

/* v55: градиентная обложка — глубокий синий → фиолет → розовый (палитра сайта) */
.pf-tt .profile-banner {
  height: 200px;
  border-radius: 0;
  background:
    radial-gradient(120% 130% at 82% 0%, rgba(254, 82, 134, 0.28) 0%, rgba(254, 82, 134, 0) 52%),
    radial-gradient(130% 120% at 12% 100%, rgba(64, 92, 255, 0.30) 0%, rgba(64, 92, 255, 0) 55%),
    linear-gradient(115deg, #0f1230 0%, #1d2470 42%, #452a86 72%, #8f3a72 100%);
}

.pf-tt .profile-banner.has-image {
  background: #111827;
}

/* Водяной знак с именем внутри обложки больше не нужен — как в TikTok */
.pf-tt .profile-banner-text {
  display: none;
}

.pf-tt .profile-banner-actions {
  top: 12px;
  right: 12px;
  bottom: auto;
}

/* ── Верхний блок: слева текст, справа аватар ── */
.pf-tt-top {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 0 2px;
}

.pf-tt-left {
  flex: 1 1 auto;
  min-width: 0;
}

.pf-tt-right {
  flex: 0 0 auto;
  padding-top: 2px;
}

.pf-tt .profile-name {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0;
  overflow-wrap: anywhere;
}

.pf-tt .profile-username {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ── Статистика в ряд: число сверху, подпись снизу ── */
.pf-tt-stats {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 13px 0 2px;
}

.pf-tt-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  min-width: 0;
}

.pf-tt-stat b {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text, #fff);
}

.pf-tt-stat span {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── Кнопка «Редактировать профиль» — во всю ширину колонки ── */
.pf-tt .profile-toolbar {
  position: static;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 12px 0 0;
  justify-content: stretch;
  z-index: auto;
}

.pf-tt .profile-btn-edit {
  width: 100%;
  padding: 11px 18px;
  border-radius: 12px;
  background: var(--surface, #1c1c22);
  border: 1px solid var(--border, #2a2a2a);
  box-shadow: none;
  font-weight: 700;
}

.pf-tt .profile-btn-edit:hover {
  border-color: var(--muted, #555);
}

.pf-tt .profile-secondary {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.875rem;
}

.pf-tt .profile-bio {
  margin: 10px 0 0;
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.pf-tt .profile-meta {
  margin: 8px 0 0;
  font-size: 0.85rem;
}

.pf-tt .profile-meta .icon {
  width: 17px;
  height: 17px;
}

/* ── Аватар: крупный, БЕЗ обводки/кольца (v55) ── */
.pf-tt-avatar {
  position: relative;
  width: 116px;
  height: 116px;
  border-radius: 50%;
}

.pf-tt-avatar .avatar-wrap {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.pf-tt-avatar .avatar {
  width: 100%;
  height: 100%;
  font-size: 2.6rem;
  border: none;
}

.pf-tt-avatar-edit {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 3;
  width: 32px;
  height: 32px;
  border: 2px solid var(--bg, #0a0a0a);
  border-radius: 50%;
  background: var(--pill-gradient, #7c6cf2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pf-tt-avatar-edit .icon {
  width: 15px;
  height: 15px;
  filter: brightness(0) invert(1);
}

/* ── Табы в стиле TikTok: равные колонки, иконка + подпись, нижнее подчёркивание ── */
.pf-tt-tabs {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  gap: 0;
  border-bottom: 1px solid var(--border, #26262c);
  margin-bottom: 14px;
}

.pf-tt-tabs .tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 6px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  opacity: 0.85;
}

.pf-tt-tabs .tab img {
  opacity: 0.75;
}

.pf-tt-tabs .tab:hover {
  background: transparent;
  color: var(--text);
  opacity: 1;
}

.tabs.pf-tt-tabs button.tab.active,
.pf-tt-tabs .tab.active {
  background: transparent;
  box-shadow: none;
  color: var(--text, #fff);
  border-bottom-color: var(--text, #fff);
  opacity: 1;
}

.pf-tt-tabs .tab.active img {
  opacity: 1;
}

/* ── Расположение аватарки (настройка v52): слева — зеркалим блок ── */
html[data-avatar-pos="left"] .pf-tt-top {
  flex-direction: row-reverse;
}

/* ── v54: ошибка загрузки подарков — честный блок с «Повторить»/«Диагностика» ── */
.pf-gifts-error {
  padding: 30px 18px;
  text-align: center;
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 16px;
  background: var(--surface, #161616);
}

.pf-gifts-error__emoji {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 10px;
}

.pf-gifts-error h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  color: var(--text, #fff);
}

.pf-gifts-error__detail {
  margin: 0 auto;
  max-width: 460px;
  color: var(--muted, #a3a3a3);
  font-size: 0.83rem;
  word-break: break-word;
}

.pf-gifts-error__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pf-gifts-error__btn {
  min-height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--border, #2a2a2a);
  background: var(--pill-gradient, #7c6cf2);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
}

.pf-gifts-error__btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.pf-gifts-error__btn--diag {
  background: transparent;
  color: var(--text, #fff);
}

.pf-gifts-error__btn--diag:hover {
  border-color: var(--muted, #555);
}

.pf-gifts-error__diag {
  margin-top: 14px;
  text-align: left;
  border-top: 1px solid var(--border, #2a2a2a);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pf-gifts-error__diag-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text, #fff);
  flex-wrap: wrap;
}

.pf-gifts-error__diag-mark {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  color: #22c55e;
}

.pf-gifts-error__diag-row.is-fail .pf-gifts-error__diag-mark {
  background: rgba(239, 68, 68, 0.16);
  color: #ef4444;
}

.pf-gifts-error__diag-name {
  font-weight: 700;
}

.pf-gifts-error__diag-info {
  color: var(--muted, #a3a3a3);
  font-size: 0.74rem;
  word-break: break-word;
  width: 100%;
}

.pf-gifts-error__diag-note {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--muted, #a3a3a3);
}

/* ── Мобильная версия: обложка от края до края, как в приложении TikTok ── */
@media (max-width: 768px) {
  .pf-tt .profile-banner-wrap {
    margin: -12px calc(-16px - env(safe-area-inset-right, 0px)) 14px
      calc(-16px - env(safe-area-inset-left, 0px));
  }

  .pf-tt .profile-banner {
    height: 216px;
    border-radius: 0;
  }

  .pf-tt .profile-banner-actions {
    top: calc(12px + 12px);
    right: 16px;
  }

  .pf-tt-top {
    gap: 14px;
    padding: 0 2px;
  }

  .pf-tt .profile-name {
    font-size: 1.4rem;
  }

  .pf-tt-stats {
    gap: 20px;
    margin-top: 11px;
  }

  .pf-tt-avatar {
    width: 104px;
    height: 104px;
  }

  .pf-tt-avatar .avatar {
    font-size: 2.3rem;
  }

  .pf-tt-avatar-edit {
    width: 29px;
    height: 29px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   v56: баннер — впритык к краям (без зазоров) + плавный переход между
   фоном страницы и баннером (мягкое затухание внизу обложки).
   Работает и для градиентной обложки, и для загруженной картинки.
   ═══════════════════════════════════════════════════════════════════════════ */
.pf-tt .profile-banner-wrap {
  margin: 0;
}
.pf-tt .profile-banner {
  position: relative;
  margin: 0;
}
/* v86: растворение стало выше и плавнее (S-кривая из 5 стопов) —
   нижний край обложки не имеет видимой линии, как в TikTok */
.pf-tt .profile-banner::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 46%;
  z-index: 1;
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--bg, #000) 0%, transparent) 0%,
    color-mix(in srgb, var(--bg, #000) 16%, transparent) 32%,
    color-mix(in srgb, var(--bg, #000) 46%, transparent) 58%,
    color-mix(in srgb, var(--bg, #000) 80%, transparent) 82%,
    var(--bg, #000) 100%);
  pointer-events: none;
}
/* контент шапки заходит чуть выше — баннер «дышит» в фон без жёсткой линии */
.pf-tt .pf-tt-top { margin-top: -34px; position: relative; z-index: 2; }

/* ═══════════════════════════════════════════════════════════════════════════
   v58/v61: баннер профиля — от края до края на мобильных.
   v56-блок выше (margin: 0) случайно убил мобильный вынос (-12px -16px) —
   возвращаем его; на десктопе обложка остаётся в контентной колонке
   (как в TikTok web — вынос перекрывал левый сайдбар).
   ═══════════════════════════════════════════════════════════════════════════ */
/* v58 (уточнение v61): полный breakout на десктопе не нужен — обложка перекрывала
   левый сайдбар (в TikTok web баннер тоже внутри контентной колонки).
   Full-bleed оставлен только на мобильных: там он и был сломан v56-блоком margin:0. */
@media (max-width: 768px) {
  .pf-tt .profile-banner-wrap {
    margin: -12px -16px 14px;
  }
}


/* ═══ v64: баннер профиля упирается в САМЫЙ ВЕРХ страницы (ПК) ═══
   community.css даёт .app padding 24px сверху — на профилях pf-tt обложка
   должна начинаться от верхней границы вьюпорта. Мобайл не затронут: там
   padding-top и так 0, а full-bleed делают отрицательные маргины wrap. */
.app:has(.profile-header.pf-tt) {
  padding-top: 0;
}

/* ═══ v68: ФИНАЛЬНОЕ СЛОВО — full-bleed баннера pf-tt на мобильных ═══
   Точная копия значений, которые на РЕАЛЬНОМ устройстве дают идеальный
   full-bleed у групп/каналов (community.css, mobile-блок для :not(.pf-tt)).
   Гасит .feed { padding: 12px 16px 8px }. Стоит в самом конце файла с
   !important — выше по каскаду ничего перебить не может. */
@media (max-width: 768px) {
  .profile-header.pf-tt { overflow: visible !important; }
  .pf-tt .profile-banner-wrap {
    margin: -12px calc(-16px - env(safe-area-inset-right, 0px)) 14px
      calc(-16px - env(safe-area-inset-left, 0px)) !important;
  }

  .pf-tt .profile-banner {
    border-radius: 0 !important;
  }
}
