/* A single background continues behind the centered workspace and feed. */
body[data-vsocial-view="app"],
body[data-vsocial-view="app"] #app.shell,
body[data-vsocial-view="app"] #app .topbar,
body[data-vsocial-view="app"] #app #socialView #vsFeed {
  background: #121724;
}

/* Keep the desktop workspace together on wide monitors; mobile rules stay local. */
@media (min-width: 1440px) {
  #app.shell {
    width: 100%;
    max-width: 1454px;
    margin-inline: auto;
  }

  #app.shell > main {
    box-sizing: border-box;
    width: 100%;
    max-width: 1280px;
    min-width: 0;
    justify-self: center;
    padding-inline: 16px !important;
  }

  #app #socialView .hero {
    min-height: 280px;
  }

  #app #socialView .hero .avatar {
    left: 24px;
    top: 24px;
    width: 128px;
    height: 128px;
  }

  #app #socialView .hero .avatar-edit {
    left: 124px;
    top: 124px;
    width: 36px;
    height: 36px;
  }

  #app #socialView .hero .identity {
    left: 184px;
    top: 28px;
    width: calc(100% - 320px);
    max-width: none;
  }

  #app #socialView .hero .identity h1 {
    font-size: 28px;
    line-height: 1.2;
  }

  #app #socialView .hero .identity > b {
    margin-top: 5px;
    font-size: 14px;
  }

  #app #socialView .hero .identity p {
    max-height: 44px;
    margin: 12px 0;
    font-size: 14px;
    line-height: 1.5;
  }

  #app #socialView .hero .identity-meta {
    gap: 8px 18px;
    font-size: 12px;
  }

  #app #socialView .hero > .stats,
  #app #socialView .hero .vs-metrics-drawer {
    left: 184px;
    bottom: 20px;
    width: min(430px, calc(100% - 420px));
  }
}

/* Separate the cover from the profile information while retaining existing controls. */
#app #socialView .hero,
#app #socialView .hero:has(#editHero),
#app #socialView .hero.privacy-limited-hero {
  --profile-cover-height: 200px;
  position: relative; display: grid; height: auto; min-height: 0;
  grid-template-columns: 128px minmax(0, 1fr); grid-template-areas: 'cover cover' 'avatar identity' 'actions actions' 'stats stats';
  column-gap: 22px; row-gap: 14px; align-items: center;
  padding: 0 22px 18px; background: #202638; overflow: hidden;
}
#app #socialView .hero .cover { position: relative; grid-area: cover; inset: auto; width: calc(100% + 44px); height: var(--profile-cover-height); margin: 0 -22px; }
#app #socialView .hero .hero-shade { display: none; }
#app #socialView .hero .avatar { position: static; grid-area: avatar; width: 128px; height: 128px; margin: 0; justify-self: start; }
#app #socialView .hero .identity { position: static; grid-area: identity; width: auto; max-width: none; min-width: 0; text-align: left; }
#app #socialView .hero .identity h1 { font-size: 28px; line-height: 1.2; }
#app #socialView .hero .identity p { max-height: none; margin: 10px 0; }
#app #socialView .hero .identity-meta { display: flex; flex-wrap: wrap; justify-content: flex-start; }
#app #socialView .hero .profile-actions,
#app #socialView .hero .profile-actions:has(#editHero),
#app #socialView .hero .profile-actions:not(:has(#editHero)) { position: static; grid-area: actions; justify-self: end; width: auto; }
#app #socialView .hero .profile-actions #editHero { width: auto; min-width: 0; height: auto; font-size: 12px; color: #fff; padding: 10px 20px; border-radius: 9px; }
#app #socialView .hero .profile-actions #editHero::before { content: none; }
#app #socialView .hero .vs-metrics-drawer { position: relative; grid-area: stats; left: auto; right: auto; bottom: auto; width: min(430px,100%); height: 48px; justify-self: start; }
#app #socialView .hero .vs-metrics-handle { height: 48px; }
#app #socialView .hero .avatar-edit { left: 120px; top: calc(var(--profile-cover-height) + 102px); width: 36px; height: 36px; }
#app #socialView .hero .avatar-menu { left: 24px; top: calc(var(--profile-cover-height) + 145px); }
#app #socialView .hero .cover-edit { top: 18px; right: 18px; left: auto; }
@media(max-width: 600px) {
  #app #socialView .hero, #app #socialView .hero:has(#editHero), #app #socialView .hero.privacy-limited-hero { --profile-cover-height: 135px; grid-template-columns: 84px minmax(0,1fr); gap: 12px; padding: 0 14px 14px; }
  #app #socialView .hero .cover { width: calc(100% + 28px); margin-inline: -14px; }
  #app #socialView .hero .avatar { width: 84px; height: 84px; }
  #app #socialView .hero .identity h1 { font-size: 22px; }
  #app #socialView .hero .identity p { font-size: 13px; }
  #app #socialView .hero .avatar-edit { left: 72px; top: calc(var(--profile-cover-height) + 67px); }
  #app #socialView .hero .avatar-menu { left: 14px; top: calc(var(--profile-cover-height) + 100px); }
  #app #socialView .hero .profile-actions { max-width: 100%; }
}

/* Metrics and profile actions share one compact row. */
#app #socialView .hero,
#app #socialView .hero:has(#editHero),
#app #socialView .hero.privacy-limited-hero {
  grid-template-columns: 128px minmax(0, 1fr) auto;
  grid-template-areas: 'cover cover cover' 'avatar identity identity' 'stats stats actions';
  row-gap: 10px;
  padding-bottom: 12px;
}
#app #socialView .hero .profile-actions { min-width: 0; }
#app #socialView .hero .vs-metrics-drawer { max-width: 100%; }
@media (max-width: 600px) {
  #app #socialView .hero,
  #app #socialView .hero:has(#editHero),
  #app #socialView .hero.privacy-limited-hero {
    grid-template-columns: 84px minmax(0, 1fr) auto;
    row-gap: 10px;
  }
  #app #socialView .hero .profile-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  #app #socialView .hero .profile-actions button { min-width: 0; width: auto; }
}

/* Larger profile portrait, with a proportionate edit control. */
#app #socialView .hero,
#app #socialView .hero:has(#editHero),
#app #socialView .hero.privacy-limited-hero { grid-template-columns: 160px minmax(0, 1fr) auto; }
#app #socialView .hero .avatar { width: 160px; height: 160px; }
#app #socialView .hero .avatar-edit { left: 145px; top: calc(var(--profile-cover-height) + 132px); }
#app #socialView .hero .avatar-menu { top: calc(var(--profile-cover-height) + 180px); }
@media (max-width: 600px) {
  #app #socialView .hero,
  #app #socialView .hero:has(#editHero),
  #app #socialView .hero.privacy-limited-hero { grid-template-columns: 100px minmax(0, 1fr) auto; }
  #app #socialView .hero .avatar { width: 100px; height: 100px; }
  #app #socialView .hero .avatar-edit { left: 86px; top: calc(var(--profile-cover-height) + 83px); }
  #app #socialView .hero .avatar-menu { top: calc(var(--profile-cover-height) + 120px); }
}

/* Align the metrics handle with the start of the profile text. */
#app #socialView .hero .vs-metrics-drawer { grid-area: auto; grid-column: 2; grid-row: 3; min-width: 0; }
@media (max-width: 420px) {
  #app #socialView .hero .vs-metrics-drawer { grid-column: 1 / 3; }
}

/* Decorative location and joined-date icons preserve the text and privacy rendering. */
#app #socialView .hero .identity-meta #location,#app #socialView .hero .identity-meta #joined{display:inline-flex;align-items:center;gap:7px;min-width:0;max-width:100%}
#app #socialView .hero .identity-meta #location::before,#app #socialView .hero .identity-meta #joined::before{content:"";display:inline-block;flex:0 0 17px;width:17px;height:17px;background-position:center;background-size:contain;background-repeat:no-repeat}
#app #socialView .hero .identity-meta #location::before{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23B66AFF%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M20%2010c0%205-8%2012-8%2012S4%2015%204%2010a8%208%200%201%201%2016%200Z%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2210%22%20r%3D%223%22%2F%3E%3C%2Fsvg%3E")}
#app #socialView .hero .identity-meta #joined::before{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23B66AFF%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%2218%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M8%202v4m8-4v4M3%2010h18%22%2F%3E%3C%2Fsvg%3E")}

/* Extend the cover behind the profile and fade it into the profile background. */
#app #socialView .hero .cover {
  height: calc(var(--profile-cover-height) + 170px);
  margin-bottom: -170px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(var(--profile-cover-height) - 35px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(var(--profile-cover-height) - 35px), transparent 100%);
}
#app #socialView .hero .cover::after {
  content: "";
  position: absolute;
  inset: calc(var(--profile-cover-height) - 30px) 0 0;
  pointer-events: none;
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 65%);
  mask-image: linear-gradient(to bottom, transparent, #000 65%);
}
#app #socialView .hero .avatar,
#app #socialView .hero .identity { position: relative; inset: auto; z-index: 1; }
@media (max-width: 600px) {
  #app #socialView .hero .cover { height: calc(var(--profile-cover-height) + 110px); margin-bottom: -110px; }
}