/* =============================================================================
   v12.370 — Shelf profile banner.
   Full-bleed image at the very top of the OWN shelf page. The header (settings
   cog + DM) renders transparent on top of it, and the profile avatar overlaps
   the banner's lower edge. Authored for iPhone 14 Pro Max (430x932), holds
   across the iPhone range via safe-area math.
   Own shelf only — hidden when viewing another user's shelf.
   ============================================================================= */

.shelf-banner { display: none; }

body.main-tab-mylist:not(.viewing-other-user) #app-container,
body.viewing-other-user #app-container {
  position: relative !important;
  overflow: visible !important;
  isolation: isolate;
}

/* Banner shows only on the user's own My Lists shelf. */
body.main-tab-mylist:not(.viewing-other-user) .shelf-banner,
body.viewing-other-user .shelf-banner {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 150px;
  z-index: 0 !important;
  background-color: #3b0764;
  background-image: linear-gradient(160deg, #7c3aed 0%, #4c1d95 45%, #1a0533 100%);
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  pointer-events: none;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

/* Hard 1px line at the banner bottom — edge to edge, no padding. */
body.main-tab-mylist:not(.viewing-other-user) .shelf-banner::after,
body.viewing-other-user .shelf-banner::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(255,255,255,0.18);
  pointer-events: none;
}

/* Upload button — bottom-right of the banner. The banner itself is
   pointer-events:none so it never blocks the cards; only this button is
   tappable. */
body.main-tab-mylist:not(.viewing-other-user) .shelf-banner .shelf-banner-edit-btn {
  position: absolute;
  right: 14px;
  bottom: 42px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(14,14,14,0.55);
  border: 1px solid rgba(255,255,255,0.22);
  color: #ffffff;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
  z-index: 3;
  transition: transform 0.27s ease, background 0.27s ease;
}
body.main-tab-mylist:not(.viewing-other-user) .shelf-banner .shelf-banner-edit-btn:active {
  transform: scale(0.93);
  background: rgba(14,14,14,0.75);
}
body.main-tab-mylist:not(.viewing-other-user) .shelf-banner .shelf-banner-edit-btn svg {
  width: 17px;
  height: 17px;
}

/* Header becomes transparent over the banner on the own shelf so the cog/DM
   icons read as overlaid controls (matches the reference layout). The
   17-auth-flow-setup rule (specificity 0,4,1) sets #0E0E0E on .header AND
   .header .container separately. We must target both.
   - ".header" override: use ID selector to hit (1,2,2) > (0,4,1)
   - ".header .container" override: (0,3,2) > the (0,3,1) container rule
   This file loads after 17, so same-specificity rules here also win. */
html body.main-tab-mylist #app-container > .header {
  position: relative !important;
  z-index: 2 !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border-bottom: 0 !important;
  pointer-events: none !important;
}
html body.main-tab-mylist #app-container > .header * {
  pointer-events: auto;
}
html body.main-tab-mylist .header .container,
html body.main-tab-mylist .header .header-top {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
}

body.main-tab-mylist:not(.viewing-other-user) #header-discover-dm-btn.header-discover-dm-btn {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-header-cog,
body.main-tab-mylist:not(.viewing-other-user) #header-dm-btn.header-dm-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,0.22) !important;
  background: rgba(18,18,18,0.36) !important;
  color: rgba(255,255,255,0.94) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    inset 0 -1px 0 rgba(0,0,0,0.22),
    0 6px 16px rgba(0,0,0,0.22) !important;
  backdrop-filter: blur(9px) saturate(1.12) !important;
  -webkit-backdrop-filter: blur(9px) saturate(1.12) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transform: translateY(-6px) !important;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-header-cog:hover,
body.main-tab-mylist:not(.viewing-other-user) #header-dm-btn.header-dm-btn:hover {
  background: rgba(18,18,18,0.44) !important;
  border-color: rgba(255,255,255,0.28) !important;
  color: #ffffff !important;
  transform: translateY(-6px) !important;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-header-cog:active,
body.main-tab-mylist:not(.viewing-other-user) #header-dm-btn.header-dm-btn:active {
  transform: translateY(-6px) scale(0.94) !important;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-header-cog svg,
body.main-tab-mylist:not(.viewing-other-user) #header-dm-btn.header-dm-btn .header-dm-icon,
body.main-tab-mylist:not(.viewing-other-user) #header-dm-btn.header-dm-btn .header-dm-icon svg {
  width: 23px !important;
  height: 23px !important;
  transform: none !important;
}

/* Force content containers transparent so the banner bleeds through.
   overflow:visible so the negatively-margined profile block can overflow
   upward and still receive pointer events. */
html body.main-tab-mylist:not(.viewing-other-user) #mylist-view > .container,
html body.main-tab-mylist:not(.viewing-other-user) #mylist-view > .main-content,
html body.main-tab-mylist:not(.viewing-other-user) #mylist-view .main-content,
html body.viewing-other-user #mylist-view > .container,
html body.viewing-other-user #mylist-view > .main-content,
html body.viewing-other-user #mylist-view .main-content {
  background: transparent !important;
  background-color: transparent !important;
  overflow: visible !important;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-view > .container.main-content,
body.viewing-other-user #mylist-view > .container.main-content {
  padding-top: 6px !important;
}

/* overflow-x:clip on #mylist-view (13-e2ee-activity-post.css) creates a
   stacking context with z-index:auto (=0). The banner sits at z-index:1,
   so it paints OVER everything inside #mylist-view — that's why the avatar
   disappears behind the banner. Fix: give #mylist-view an explicit z-index
   above the banner (1) and header (2). background stays transparent so
   the banner still bleeds through underneath. */
body.main-tab-mylist:not(.viewing-other-user) #mylist-view,
body.viewing-other-user #mylist-view {
  position: relative !important;
  z-index: 30 !important;
  background: transparent !important;
  background-color: transparent !important;
  overflow: visible !important;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-view #mylist-profile-controls {
  margin-top: 0 !important;
  position: relative !important;
  z-index: 60 !important;
  overflow: visible !important;
  pointer-events: auto !important;
}

body.viewing-other-user #mylist-view #viewing-banner-area {
  margin-top: 0 !important;
  position: relative !important;
  z-index: 60 !important;
  overflow: visible !important;
  pointer-events: auto !important;
}

/* Keep the category card above the banner if they ever overlap. */
body.main-tab-mylist #mylist-view #mylist-header.mylist-section-card {
  position: relative;
  z-index: 1;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-view #mylist-header.mylist-section-card {
  margin-top: -32px !important;
}

body.viewing-other-user #mylist-view #mylist-header.mylist-section-card {
  margin-top: 0 !important;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-view #mylist-header.mylist-section-card,
body.main-tab-mylist:not(.viewing-other-user) #mylist-view #mylist-toolbar,
body.main-tab-mylist:not(.viewing-other-user) #mylist-view #mylist-stage,
body.viewing-other-user #mylist-view #mylist-header.mylist-section-card,
body.viewing-other-user #mylist-view #mylist-toolbar,
body.viewing-other-user #mylist-view #mylist-stage {
  position: relative !important;
  top: 9px !important;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-view #mylist-header .mylist-categories-section .section-toggle {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Hide the duplicate sort + search buttons in the toolbar below the status
   tabs — they are now consolidated into the profile action row above. */
body.main-tab-mylist #mylist-view #sort-dropdown-btn,
body.main-tab-mylist #mylist-view #mylist-search-toggle-btn {
  display: none !important;
}

body.main-tab-mylist #mylist-view #mylist-toolbar .toolbar-right {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

@media (max-width: 700px) {
  body.main-tab-mylist:not(.viewing-other-user) #mylist-view #mylist-profile-controls {
    margin-top: 0 !important;
    position: relative !important;
    z-index: 60 !important;
    overflow: visible !important;
    pointer-events: auto !important;
  }
}

/* Hide the Import pill on own shelf — 31-surface-default-overrides re-enables it
   with display:inline-flex !important but 35 loads after 31. */
body.main-tab-mylist:not(.viewing-other-user) .header-import-btn {
  display: none !important;
  transform: none !important;
}

/* =============================================================================
   v12.373 — New shelf profile block.
   Avatar left | name+stats right | bio full-width | action row | divider.
   Proportioned for iPhone 14 Pro Max (430 CSS px). Safe-top cancels in the
   padding-top math so the avatar straddles the banner bottom on all iPhones.
   ============================================================================= */

/* Reset old absolute/size overrides on the avatar button from 11-patch-notes */
body.main-tab-mylist:not(.viewing-other-user) #mylist-view .shelf-profile-top-row .mylist-own-profile-shortcut {
  margin-top: 0 !important;
  z-index: 100 !important;
}
body.main-tab-mylist:not(.viewing-other-user) #mylist-view .shelf-profile-identity {
  margin-top: 0 !important;
}
body.main-tab-mylist #mylist-view #mylist-profile-controls .mylist-own-profile-shortcut {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  width: 86px !important;
  height: 86px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  border: 2.5px solid rgba(255,255,255,0.22) !important;
  background: #1c1535 !important;
  padding: 0 !important;
  cursor: default !important;
  display: block !important;
  z-index: 1 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  contain: none !important;
  isolation: auto !important;
}
body.main-tab-mylist #mylist-view #mylist-profile-controls .mylist-own-profile-shortcut img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 0 !important;
  contain: none !important;
  transform: none !important;
  backface-visibility: visible !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-user-avatar,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-user-name,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-user-display-name,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-user-plus-badge,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-user-bio,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-social-counts {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.main-tab-mylist:not(.viewing-other-user) #shelf-profile-avatar-overlay {
  display: block !important;
  position: absolute !important;
  top: 114px !important;
  left: 16px !important;
  width: 86px !important;
  height: 86px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  border: 2.5px solid rgba(255,255,255,0.22) !important;
  background: #1c1535 !important;
  padding: 0 !important;
  cursor: pointer !important;
  z-index: 120 !important;
  pointer-events: auto !important;
  contain: none !important;
  isolation: auto !important;
  -webkit-tap-highlight-color: transparent;
}
body:not(.main-tab-mylist) #shelf-profile-avatar-overlay,
body.viewing-other-user #shelf-profile-avatar-overlay {
  display: none !important;
}
body.main-tab-mylist:not(.viewing-other-user) #shelf-profile-avatar-overlay img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 0 !important;
}

/* Outer block — padding-top=0 places the avatar at the very top of the block
   (~137px from screen top), fully inside the 224px banner so it reads as a
   layer on top of the banner image. Name/stats/bio flow below the avatar, which
   puts them just past the banner's bottom edge. */
body.main-tab-mylist:not(.viewing-other-user) #mylist-view .shelf-profile-block {
  padding: 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 70;
  overflow: visible;
  pointer-events: auto;
  min-height: 0;
}
@media (min-width: 701px) {
  body.main-tab-mylist:not(.viewing-other-user) #mylist-view .shelf-profile-block {
    padding-top: 0;
  }
}

/* Top row: avatar left, identity right, aligned to bottom of avatar */
body.main-tab-mylist #mylist-view .shelf-profile-top-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 86px;
  padding-left: 0;
  position: relative;
  z-index: 90;
  overflow: visible;
  pointer-events: auto;
}

/* Identity column: display name + handle + stats */
body.main-tab-mylist #mylist-view .shelf-profile-identity {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 0;
  min-width: 0;
  flex: 1;
}

/* Name + handle on the same line */
body.main-tab-mylist #mylist-view .shelf-profile-nameline {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  line-height: 1.2;
}
body.main-tab-mylist #mylist-view .shelf-profile-displayname {
  font-size: 17px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: 0;
  white-space: nowrap;
}
body.main-tab-mylist #mylist-view .shelf-profile-handle {
  margin-left: 4px;
  font-size: 15px;
  font-weight: 300;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0;
  white-space: nowrap;
}

/* Stats row */
body.main-tab-mylist #mylist-view .shelf-profile-stats {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  position: relative;
  top: -0.5px;
  z-index: 8;
  pointer-events: auto;
}
body.main-tab-mylist #mylist-view .shelf-stat-item,
body.main-tab-mylist #mylist-view .shelf-stat-btn,
body.main-tab-mylist #mylist-view .shelf-stat-sep {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
}
body.main-tab-mylist #mylist-view .shelf-stat-item {
  color: #ffffff;
}
body.main-tab-mylist #mylist-view .shelf-stat-sep {
  color: rgba(255,255,255,0.3);
  margin: 0 1px;
}
body.main-tab-mylist #mylist-view .shelf-stat-btn {
  background: none;
  border: none;
  padding: 0;
  color: #ffffff;
  font-weight: 400;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 8;
  pointer-events: auto;
}
body.main-tab-mylist #mylist-view .shelf-stat-btn:active {
  color: rgba(255,255,255,0.7);
}
body.main-tab-mylist #mylist-view .shelf-stat-num {
  font-weight: 500;
}
body.main-tab-mylist #mylist-view .shelf-stat-label {
  font-weight: 300;
}

/* Bio — full width below the top row */
body.main-tab-mylist #mylist-view #mylist-profile-controls .mylist-own-profile-bio {
  display: block !important;
  position: static !important;
  width: calc(100% / 0.875) !important;
  max-width: none !important;
  margin: 3px 0 0 !important;
  padding: 0 !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  text-align: left !important;
  transform: translate(3px, -3px) scale(0.875) !important;
  transform-origin: top left !important;
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
  touch-action: manipulation;
  color: rgba(255,255,255,0.72) !important;
  min-height: 18px;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
body.main-tab-mylist #mylist-view #mylist-profile-controls .mylist-own-profile-bio.is-empty:empty::before {
  content: attr(data-placeholder);
  color: rgba(255,255,255,0.26);
  pointer-events: none;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-user-profile-center {
  display: none !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block {
  padding: 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  margin-top: 0 !important;
  z-index: 70;
  overflow: visible;
  pointer-events: auto;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-profile-top-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 86px;
  padding-left: 0;
  position: relative;
  z-index: 90;
  overflow: visible;
  pointer-events: auto;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .mylist-own-profile-shortcut {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  width: 86px !important;
  height: 86px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  border: 2.5px solid rgba(255,255,255,0.22) !important;
  background: #1c1535 !important;
  padding: 0 !important;
  display: block !important;
  z-index: 1 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  cursor: default !important;
  contain: none !important;
  isolation: auto !important;
  -webkit-tap-highlight-color: transparent;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .mylist-own-profile-shortcut img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 0 !important;
  contain: none !important;
  transform: none !important;
  backface-visibility: visible !important;
}

body.viewing-other-user #friend-shelf-avatar-overlay {
  display: block !important;
  position: absolute !important;
  top: 117px !important;
  left: 13px !important;
  width: 86px !important;
  height: 86px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  border: 2.5px solid rgba(255,255,255,0.22) !important;
  background: #1c1535 !important;
  padding: 0 !important;
  cursor: pointer !important;
  z-index: 120 !important;
  pointer-events: auto !important;
  contain: none !important;
  isolation: auto !important;
  -webkit-tap-highlight-color: transparent;
}

body:not(.viewing-other-user) #friend-shelf-avatar-overlay {
  display: none !important;
}

body.viewing-other-user #friend-shelf-avatar-overlay img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 0 !important;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-profile-identity {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 0;
  min-width: 0;
  flex: 1;
  margin-top: -2px !important;
  margin-left: -4px !important;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-profile-nameline {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  line-height: 1.2;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-profile-displayname {
  font-size: 17px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: 0;
  white-space: nowrap;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-profile-inline-badges {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 5px;
  line-height: 0;
  vertical-align: middle;
  flex-shrink: 0;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-profile-inline-badges .shelfd-pro-badge {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-profile-inline-badges .shelfd-pro-badge svg {
  height: 13px;
  width: auto;
  display: block;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-profile-inline-badges .creative-team-role {
  margin-left: 0;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-profile-handle {
  margin-left: 4px;
  font-size: 15px;
  font-weight: 300;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0;
  white-space: nowrap;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-profile-stats {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  position: relative;
  top: -3px;
  z-index: 8;
  pointer-events: auto;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-stat-item,
body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-stat-btn,
body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-stat-sep {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-stat-item {
  color: #ffffff;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-stat-sep {
  color: rgba(255,255,255,0.3);
  margin: 0 1px;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-stat-btn {
  appearance: none;
  -webkit-appearance: none;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  color: #ffffff !important;
  font-weight: 400;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 8;
  pointer-events: auto;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-stat-btn:active {
  color: rgba(255,255,255,0.7) !important;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-stat-num {
  font-weight: 500;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .shelf-stat-label {
  font-weight: 300;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .friend-shelf-profile-bio {
  display: block !important;
  position: static !important;
  width: calc(100% / 0.875) !important;
  max-width: none !important;
  margin: 3px 0 0 !important;
  padding: 0 !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  text-align: left !important;
  transform: translate(3px, -3px) scale(0.875) !important;
  transform-origin: top left !important;
  color: rgba(255,255,255,1) !important;
  min-height: 18px;
  outline: none;
  cursor: default !important;
  pointer-events: none !important;
  user-select: text;
}

body.viewing-other-user #viewing-banner-area .friend-shelf-profile-block .friend-shelf-profile-bio.is-empty {
  font-weight: 300 !important;
  color: rgba(255,255,255,0.45) !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 5px !important;
  flex-wrap: nowrap !important;
  width: calc(100% - 32px) !important;
  margin: 16px 16px 20px !important;
  padding: 0 !important;
  transform: none !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-divider {
  display: block !important;
  width: 100% !important;
  height: 1px !important;
  margin: 0 !important;
  background: rgba(255,255,255,0.18) !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-follow-slot {
  display: inline-flex !important;
  width: auto !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .shelf-action-spacer {
  flex: 1 1 4px !important;
  min-width: 0 !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions .friend-list-follow-btn,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-viewprofile-btn,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-dm-btn {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 28px !important;
  height: 28px !important;
  padding: 0 11px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,0.16) !important;
  background: rgba(255,255,255,0.08) !important;
  color: #ffffff !important;
  box-shadow: none !important;
  font-family: 'Sohne', 'DM Sans', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  cursor: pointer !important;
  backdrop-filter: blur(8px) saturate(1.08) !important;
  -webkit-backdrop-filter: blur(8px) saturate(1.08) !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions .friend-list-follow-btn.is-follow,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions .friend-list-follow-btn.is-followback,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions .friend-list-follow-btn.is-following,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions .friend-list-follow-btn.is-requested {
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.16) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions .friend-list-follow-btn:hover,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-viewprofile-btn:hover,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-dm-btn:hover {
  background: rgba(255,255,255,0.14) !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-shelf-sort-btn,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-shelf-search-btn {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,0.16) !important;
  background: rgba(255,255,255,0.08) !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #ffffff !important;
  flex: 0 0 34px !important;
  position: relative !important;
  z-index: 26 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-shelf-sort-btn .sort-btn-icon,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-shelf-search-btn svg {
  width: 17px !important;
  height: 17px !important;
  color: inherit !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-shelf-search-btn.mylist-search-toggle-active {
  color: #ffffff !important;
  background: rgba(255,255,255,0.18) !important;
  border-color: rgba(255,255,255,0.16) !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions.is-search-open .friend-list-follow-slot,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions.is-search-open .friend-list-viewprofile-btn,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions.is-search-open .friend-list-dm-btn,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions.is-search-open .friend-shelf-sort-btn {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: scale(0.96) !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  flex-basis: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border-width: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions #mylist-search-row {
  display: flex !important;
  align-items: center !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: 0 !important;
  width: auto !important;
  gap: 6px !important;
  padding: 0 !important;
  margin: 0 -7px 0 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  transform: scaleX(0.08) translateX(8px) !important;
  transform-origin: right center !important;
  pointer-events: none !important;
  animation: none !important;
  transition:
    max-width 220ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 150ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    margin 220ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions #mylist-search-row[hidden] {
  display: none !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions #mylist-search-row.is-open {
  max-width: min(390px, calc(100vw - 94px)) !important;
  margin-right: 0 !important;
  opacity: 1 !important;
  transform: scaleX(1) translateX(0) !important;
  pointer-events: auto !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions #mylist-search-row .search-input {
  display: block !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 36px !important;
  padding: 0 13px !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions #mylist-search-row .mylist-search-clear-btn {
  flex: 0 0 30px !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions .friend-list-follow-btn:active,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-viewprofile-btn:active,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-dm-btn:active {
  transform: scale(0.97) !important;
}

body.viewing-other-user #mylist-view #mylist-toolbar .toolbar-right,
body.viewing-other-user #mylist-view #mylist-toolbar #sort-dropdown-btn,
body.viewing-other-user #mylist-view #mylist-toolbar #mylist-search-toggle-btn {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

@media (max-width: 380px) {
  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions {
    gap: 4px !important;
  }

  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions .friend-list-follow-btn,
  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-viewprofile-btn,
  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-dm-btn {
    padding: 0 9px !important;
    font-size: 12px !important;
  }

  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-shelf-sort-btn,
  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-shelf-search-btn {
    width: 32px !important;
    min-width: 32px !important;
    flex-basis: 32px !important;
  }
}

/* Action row: pills left, spacer, icons right */
body.main-tab-mylist #mylist-view .shelf-profile-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  width: 100%;
  position: relative;
  z-index: 25;
  pointer-events: auto;
}
body.main-tab-mylist #mylist-view .shelf-profile-actions.is-search-open .shelf-action-pill:not([data-shelf-profile-action="open"]),
body.main-tab-mylist #mylist-view .shelf-profile-actions.is-search-open #shelf-profile-sort-btn {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: scale(0.96) !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  flex-basis: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border-width: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
}
body.main-tab-mylist #mylist-view .shelf-action-spacer {
  flex: 1;
}
body.main-tab-mylist #mylist-view .shelf-profile-actions.is-search-open .shelf-action-spacer {
  flex: 0 0 0 !important;
  width: 0 !important;
  min-width: 0 !important;
}

/* Pill buttons */
body.main-tab-mylist #mylist-view .shelf-action-pill {
  height: 34px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s, opacity 0.18s ease, transform 0.18s ease;
  flex-shrink: 0;
  position: relative;
  z-index: 26;
  pointer-events: auto;
}
body.main-tab-mylist #mylist-view .shelf-action-pill:active {
  background: rgba(255,255,255,0.18);
}

/* Icon circle buttons */
body.main-tab-mylist #mylist-view .shelf-action-icon {
  width: 40px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s;
}
body.main-tab-mylist #mylist-view .shelf-action-icon:active {
  background: rgba(255,255,255,0.2);
}
body.main-tab-mylist #mylist-view .shelf-action-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.9;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-profile-controls .shelf-profile-actions #sort-dropdown-btn,
body.main-tab-mylist:not(.viewing-other-user) #mylist-profile-controls .shelf-profile-actions #mylist-search-toggle-btn,
body.main-tab-mylist:not(.viewing-other-user) #mylist-profile-controls .shelf-profile-actions #shelf-profile-sort-btn,
body.main-tab-mylist:not(.viewing-other-user) #mylist-profile-controls .shelf-profile-actions #shelf-profile-search-btn {
  width: 40px !important;
  min-width: 40px !important;
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,0.16) !important;
  background: rgba(255,255,255,0.08) !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #ffffff !important;
  flex-shrink: 0 !important;
  position: relative !important;
  z-index: 26 !important;
  pointer-events: auto !important;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-profile-controls .shelf-profile-actions #sort-dropdown-btn .sort-btn-label {
  display: none !important;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-profile-controls .shelf-profile-actions #sort-dropdown-btn .sort-btn-icon,
body.main-tab-mylist:not(.viewing-other-user) #mylist-profile-controls .shelf-profile-actions #shelf-profile-sort-btn .sort-btn-icon {
  width: 17px !important;
  height: 17px !important;
  font-size: 17px !important;
  color: inherit !important;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-profile-controls .shelf-profile-actions #mylist-search-toggle-btn svg,
body.main-tab-mylist:not(.viewing-other-user) #mylist-profile-controls .shelf-profile-actions #shelf-profile-search-btn svg {
  width: 17px !important;
  height: 17px !important;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-profile-controls .shelf-profile-actions #shelf-profile-search-btn.mylist-search-toggle-active {
  color: #ffffff !important;
  background: rgba(255,255,255,0.18) !important;
  border-color: rgba(255,255,255,0.16) !important;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-profile-controls .shelf-profile-actions #mylist-search-row {
  display: flex !important;
  align-items: center !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: 0 !important;
  width: auto !important;
  gap: 6px !important;
  padding: 0 !important;
  margin: 0 -7px 0 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  transform: scaleX(0.08) translateX(8px) !important;
  transform-origin: right center !important;
  pointer-events: none !important;
  animation: none !important;
  transition:
    max-width 220ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 150ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    margin 220ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-profile-controls .shelf-profile-actions #mylist-search-row[hidden] {
  display: none !important;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-profile-controls .shelf-profile-actions #mylist-search-row.is-open {
  max-width: min(390px, calc(100vw - 94px)) !important;
  margin-right: 0 !important;
  opacity: 1 !important;
  transform: scaleX(1) translateX(0) !important;
  pointer-events: auto !important;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-profile-controls .shelf-profile-actions #mylist-search-row .search-input {
  display: block !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 36px !important;
  padding: 0 13px !important;
}

body.main-tab-mylist:not(.viewing-other-user) #mylist-profile-controls .shelf-profile-actions #mylist-search-row .mylist-search-clear-btn {
  flex: 0 0 30px !important;
}

/* Divider */
body.main-tab-mylist #mylist-view .shelf-profile-divider {
  display: block;
  height: 1px;
  background: rgba(255,255,255,0.11);
  margin: 20px -16px 0;
  width: calc(100% + 32px);
}

/* Banner upload button — absolutely positioned inside .shelf-profile-block so it
   sits in the lower-right of the banner area above the avatar, at a z-index that
   actually receives taps (higher than the block's own z-index). */
body.main-tab-mylist:not(.viewing-other-user) #mylist-view .shelf-banner-upload-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(14,14,14,0.55);
  border: 1px solid rgba(255,255,255,0.22);
  color: #ffffff;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
  z-index: 6;
  transition: transform 0.27s ease, background 0.27s ease;
}
body.main-tab-mylist:not(.viewing-other-user) #mylist-view .shelf-banner-upload-btn:active {
  transform: scale(0.93);
  background: rgba(14,14,14,0.75);
}
body.main-tab-mylist:not(.viewing-other-user) #mylist-view .shelf-banner-upload-btn svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

/* Final friend shelf header alignment. Keep this at the literal end of the file
   so visible avatar/name/stat deltas are not neutralized by shared shelf rules. */
body.viewing-other-user #app-container #friend-shelf-avatar-overlay {
  top: 114.67px !important;
  left: 16px !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-shelf-profile-block .shelf-profile-identity {
  margin-top: 0 !important;
  margin-left: 0 !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-shelf-profile-block .shelf-profile-nameline {
  transform: translate(-14.33px, -6px) !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-shelf-profile-block .shelf-profile-stats {
  top: 0 !important;
  transform: translate(-14.67px, -6.33px) !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions {
  transform: translateX(3px) !important;
  margin-top: 33px !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-follow-slot,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-viewprofile-btn,
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-dm-btn {
  transform: translateX(-17px) !important;
}
