/* =============================================================================
   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; }

/* Banner shows only on the user's own My Lists shelf. */
body.main-tab-mylist:not(.viewing-other-user) .shelf-banner {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: calc(165px + var(--shelfd-safe-top, 0px));
  z-index: 1;
  background-color: #1c1535;
  background-image: linear-gradient(135deg, #2a2350 0%, #1c1535 55%, #0E0E0E 100%);
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  pointer-events: none;
}

/* Fade the banner's bottom into the page background so the avatar/name sit on
   a clean canvas. */
body.main-tab-mylist:not(.viewing-other-user) .shelf-banner::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34px;
  background: linear-gradient(to bottom, rgba(14,14,14,0), #0E0E0E);
  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 pins the header to position:static — re-promote it to
   relative + z-index so the cog/DM paint ABOVE the absolute banner. This file
   loads after 17, so equal-specificity + !important wins. */
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;
}

/* The avatar/name/bio block already runs position:relative; z-index:7
   (11-patch-notes-friends-refinements.css) so it paints over the banner.
   Drop it lower so the avatar straddles the banner's bottom edge instead of
   tucking up into the header. */
body.main-tab-mylist:not(.viewing-other-user) #mylist-view #mylist-profile-controls {
  margin-top: 6px !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;
}

@media (max-width: 700px) {
  body.main-tab-mylist:not(.viewing-other-user) #mylist-view #mylist-profile-controls {
    margin-top: 2px !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 #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: pointer !important;
  display: block !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;
}

/* Outer block — padding-top positions avatar to straddle the banner's bottom edge.
   Math: banner_below_header(165px) - half_avatar(43px) - mobile_margin(2px) = 120px.
   Use 118px after accounting for the block's own border/padding offset. */
body.main-tab-mylist:not(.viewing-other-user) #mylist-view .shelf-profile-block {
  padding: 118px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 5;
}
@media (min-width: 701px) {
  body.main-tab-mylist:not(.viewing-other-user) #mylist-view .shelf-profile-block {
    padding-top: 114px;
  }
}

/* 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-end;
  gap: 12px;
  width: 100%;
}

/* Identity column: display name + handle + stats */
body.main-tab-mylist #mylist-view .shelf-profile-identity {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-bottom: 4px;
  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: 16px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0;
  white-space: nowrap;
}
body.main-tab-mylist #mylist-view .shelf-profile-handle {
  font-size: 13px;
  font-weight: 400;
  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;
}
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: 12px;
  letter-spacing: 0;
  line-height: 1.4;
}
body.main-tab-mylist #mylist-view .shelf-stat-item {
  color: rgba(255,255,255,0.6);
}
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: rgba(255,255,255,0.6);
  font-weight: 400;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
body.main-tab-mylist #mylist-view .shelf-stat-btn:active {
  color: #ffffff;
}

/* 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: 100% !important;
  margin: 10px 0 0 !important;
  padding: 0 !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  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;
}

/* 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: 14px;
  width: 100%;
}
body.main-tab-mylist #mylist-view .shelf-action-spacer {
  flex: 1;
}

/* 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;
  flex-shrink: 0;
}
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: 34px;
  height: 34px;
  border-radius: 50%;
  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;
}

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

/* 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: 78px;
  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;
}
