/* Profile layout: keep the identity card and the existing collections distinct. */
@media (max-width:820px) {
  html:not([data-sd-native]) body.phone-own-profile #app > .main {
    padding-inline: 9px;
  }
  #page-profile .profile-workspace { width:100%; max-width:540px; }
  #page-profile #own-profile-card {
    background:transparent!important; border:0; border-radius:0; box-shadow:none; overflow:visible;
  }
  #page-profile #own-profile-card .profile-card-bar {
    height:52px; padding-inline:12px; border-radius:14px 14px 0 0;
  }
  #page-profile #own-profile-card .profile-card-bar > strong { font-size:16px; }
  #page-profile #own-profile-card .profile-cover { height:145px; }
  #page-profile #own-profile-card .profile-showcase-body {
    width:100%; box-sizing:border-box; align-items:center; margin-top:-58px;
    padding:0 14px; background:linear-gradient(to bottom,transparent 0 58px,var(--identity-surface) 58px);
  }
  #page-profile #own-profile-card .profile-avatar { width:118px; height:118px; }
  #page-profile #own-profile-card .profile-name-row { margin-top:14px; min-height:32px; }
  #page-profile #own-profile-card #profile-identity-handle {
    width:min(100%,360px); min-height:48px; margin:12px auto 0!important;
    padding:12px 16px; border-radius:14px;
  }
  #page-profile #own-profile-card .profile-stats { margin:18px 0 12px; padding:2px 0; }
  #page-profile #own-profile-card .profile-stat { min-height:50px!important; }
  #page-profile #own-league-profile { margin:10px 0 14px; }
  #page-profile #own-profile-details {
    position:relative; width:calc(100% + 28px); box-sizing:border-box;
    margin:0 -14px; padding:28px 0 0; background:var(--bg,#101718);
  }
  #page-profile #own-profile-details::before {
    content:""; position:absolute; inset:0 0 auto; height:13px;
    background:var(--identity-surface); border-radius:0 0 14px 14px;
  }
  #page-profile #own-profile-details .sd-collection-section,
  #page-profile #own-profile-details .sd-game-statistics { margin-inline:0; }
  #page-profile #own-profile-details .sd-detail-heading { margin-inline:5px; }
  #page-profile #own-profile-details .sd-collection-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,105px),1fr)); gap:8px; }
  #page-profile #own-profile-details .sd-owned-card { min-height:130px; padding:10px 8px; }
  #page-profile #own-profile-details .sd-owned-card img { height:62px; }
  #page-profile #own-profile-details .sd-collection-more { min-height:40px; }
}

/* Preserve the compact preview, with even spacing and full-width actions. */
#community-profile-modal:not(.sd-profile-expanded) .community-public-profile-shell {
  width:min(440px,100%); border-radius:16px;
}
#community-profile-modal:not(.sd-profile-expanded) .community-public-profile-card {
  width:100%; max-width:none; border-radius:16px;
}
#community-profile-modal:not(.sd-profile-expanded) .profile-showcase-body {
  padding:0 16px 16px; box-sizing:border-box;
}
#community-profile-modal:not(.sd-profile-expanded) .profile-name-row {
  margin-top:15px; margin-bottom:0;
}
#community-profile-modal:not(.sd-profile-expanded) .community-public-profile-handle {
  margin:12px 0 0!important; line-height:1.5; max-width:100%;
}
#community-profile-modal:not(.sd-profile-expanded) .profile-stats {
  width:100%; margin:18px 0 10px; padding:5px 0;
}
#community-profile-modal:not(.sd-profile-expanded) .profile-stat { min-height:52px!important; }
#community-profile-modal:not(.sd-profile-expanded) .sd-featured-rank { margin:9px 0 0; }
#community-profile-modal:not(.sd-profile-expanded) .pl-league-list { margin:9px 0 0; }
#community-profile-modal:not(.sd-profile-expanded) .sd-open-full { min-height:40px; margin:12px 0 0; }
#community-profile-modal:not(.sd-profile-expanded) #community-profile-actions { margin:12px 0 0!important; }
@media (max-width:360px) {
  #community-profile-modal:not(.sd-profile-expanded) .profile-showcase-body { padding-inline:12px; }
  #community-profile-modal:not(.sd-profile-expanded) #community-profile-actions { gap:6px!important; }
  #community-profile-modal:not(.sd-profile-expanded) #community-profile-friend { font-size:14px!important; }
}
/* Only the middle statistic owns dividers, on either side. */
#own-profile-card .profile-stats .profile-stat,
#community-profile-modal .profile-stats .profile-stat { border:0!important; }
#own-profile-card .profile-stats .profile-stat-since,
#community-profile-modal .profile-stats .profile-stat-since {
  border-left:1px solid var(--identity-line)!important;
  border-right:1px solid var(--identity-line)!important;
}
#own-profile-card .sd-collection-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,105px),1fr)); }
