/* PREMIUM PROFILE HEADER V3 — One geometric layout for public and owner.
   Placed after legacy UI rules. Only this sheet controls responsive premium header.
   Online/offline uses the existing member_is_online() rule on the server. */

/* Avatar status applies to non-premium profile owners as well. */
html body.page-shell .public-profile-header>.public-profile-avatar.is-online{
  border:4px solid #20b56b!important;
  box-shadow:0 0 0 2px rgba(32,181,107,.15)!important;
}
html body.page-shell .public-profile-header>.public-profile-avatar.is-offline{
  border:4px solid #d95156!important;
  box-shadow:0 0 0 2px rgba(217,81,86,.14)!important;
}
html body.page-shell .public-profile-header>.public-profile-avatar>.profile-presence{
  display:none!important;
}

/* Shared structural rules: never anchor the badge to the content panel. */
html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
}
html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile>.premium-cover{
  position:relative!important;
  box-sizing:border-box!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  overflow:hidden!important;
  background:var(--surface)!important;
}
html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile>.premium-cover>img{
  display:block!important;
  width:100%!important;height:100%!important;
  object-fit:cover!important;
  object-position:center 35%!important;
}
html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-header{
  box-sizing:border-box!important;
  position:relative!important;
  display:grid!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  align-items:start!important;
  overflow:visible!important;
  z-index:20!important;
}
html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-header>.public-profile-avatar{
  position:relative!important;
  box-sizing:border-box!important;
  display:flex!important;
  justify-content:center!important;
  align-items:center!important;
  margin:0!important;
  padding:0!important;
  flex:0 0 auto!important;
  border-radius:50%!important;
  overflow:visible!important;
  background:var(--surface)!important;
  color:var(--text)!important;
  font-size:32px!important;
  z-index:5!important;
}
html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-header>.public-profile-avatar.is-online{
  border-color:#20b56b!important;
}
html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-header>.public-profile-avatar.is-offline{
  border-color:#d95156!important;
}
html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-avatar>img{
  display:block!important;
  box-sizing:border-box!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  object-fit:cover!important;
  border-radius:50%!important;
  overflow:hidden!important;
}
html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-avatar>.public-premium-status{
  position:absolute!important;
  inset:auto auto -15px 50%!important;
  left:50%!important;
  right:auto!important;
  top:auto!important;
  bottom:-15px!important;
  transform:translateX(-50%)!important;
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex-direction:row!important;
  gap:6px!important;
  width:max-content!important;
  max-width:180px!important;
  height:auto!important;
  min-height:30px!important;
  padding:5px 11px 5px 6px!important;
  margin:0!important;
  background:#e1f5e8!important;
  border:1px solid #97d7ac!important;
  border-radius:999px!important;
  box-shadow:0 4px 13px rgba(0,0,0,.12)!important;
  color:#167849!important;
  white-space:nowrap!important;
  text-align:center!important;
  font-size:11px!important;
  font-weight:800!important;
  line-height:1.2!important;
  letter-spacing:0!important;
  z-index:7!important;
}
html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-avatar>.public-premium-status:before{
  content:"✓"!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:17px!important;height:17px!important;flex:0 0 17px!important;
  background:#20a864!important;
  border-radius:50%!important;
  color:#fff!important;
  font-size:11px!important;
  font-weight:800!important;
}
html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-avatar>.public-premium-status span{
  display:inline!important;
  color:inherit!important;
  font:inherit!important;
  line-height:inherit!important;
  white-space:nowrap!important;
}
html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-title{
  display:block!important;
  box-sizing:border-box!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
}
html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-title h1{
  display:block!important;
  margin:0!important;
  padding:0!important;
  width:100%!important;
  min-width:0!important;
  color:var(--text)!important;
  font-weight:800!important;
  letter-spacing:-.035em!important;
  line-height:1.14!important;
  overflow-wrap:anywhere!important;
  white-space:normal!important;
}




/* PHONE: avatar overlaps cover. Children of .public-profile-info become grid items
   with explicit rows, preventing the badge/title/stats from drifting apart. */
@media(max-width:640px){
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile{
    max-width:none!important;
    overflow:visible!important;
    padding-top:0!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile>.premium-cover{
    left:50%!important;
    right:auto!important;
    transform:translateX(-50%)!important;
    width:100vw!important;
    max-width:none!important;
    height:clamp(190px,54vw,250px)!important;
    min-height:190px!important;
    border:0!important;
    border-radius:0!important;
    padding:0!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile>.premium-cover:after{border-radius:0!important}
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-header{
    grid-template-columns:108px minmax(0,1fr)!important;
    column-gap:14px!important;
    row-gap:0!important;
    margin:-55px 0 22px!important;
    padding:0!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-header>.public-profile-avatar{
    grid-column:1!important;grid-row:1!important;
    width:108px!important;height:108px!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-info{
    display:contents!important;
    padding:0!important;
    margin:0!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-title{
    grid-column:2!important;grid-row:1!important;
    align-self:start!important;
    padding:59px 0 0!important;
    min-width:0!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-title h1{
    font-size:clamp(19px,5.5vw,25px)!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-stats{
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    grid-column:1/-1!important;grid-row:2!important;
    box-sizing:border-box!important;
    width:100%!important;max-width:none!important;
    margin:27px 0 0!important;
    padding:8px 0!important;
    gap:0!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-bio{
    grid-column:1/-1!important;grid-row:3!important;
    width:100%!important;min-width:0!important;
    margin:12px 0 0!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-actions{
    grid-column:1/-1!important;grid-row:4!important;
    width:100%!important;min-width:0!important;
    margin:14px 0 0!important;
    position:relative!important;
  }
}
@media(max-width:359px){
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-header{
    grid-template-columns:98px minmax(0,1fr)!important;
    column-gap:11px!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-header>.public-profile-avatar{
    width:98px!important;height:98px!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-title{padding-top:54px!important}
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-avatar>.public-premium-status{
    font-size:10px!important;
    min-height:27px!important;
    padding:4px 8px 4px 5px!important;
  }
}

/* TABLET + DESKTOP: the avatar and info occupy one stable two-column grid.
   Stats, bio and actions are inside the same info column, regardless of title length. */
@media(min-width:641px){
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile{
    padding-top:20px!important;
    max-width:none!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile>.premium-cover{
    width:100%!important;
    height:clamp(245px,29vw,365px)!important;
    max-width:none!important;
    border-radius:17px!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-header{
    grid-template-columns:138px minmax(0,1fr)!important;
    column-gap:24px!important;
    row-gap:0!important;
    margin:-73px 0 26px!important;
    padding:0 12px 10px!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-header>.public-profile-avatar{
    grid-column:1!important;grid-row:1!important;
    width:138px!important;height:138px!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-info{
    grid-column:2!important;grid-row:1!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:12px!important;
    min-width:0!important;
    margin:0!important;
    padding:80px 0 0!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-title h1{
    font-size:clamp(24px,2.8vw,36px)!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-stats{
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    width:100%!important;
    max-width:820px!important;
    margin:0!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-bio{
    width:100%!important;
    max-width:820px!important;
    margin:0!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-actions{
    width:100%!important;
    max-width:570px!important;
    margin:0!important;
  }
}
@media(min-width:641px) and (max-width:1023px){
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile>.premium-cover{
    height:clamp(225px,32vw,310px)!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-header{
    grid-template-columns:112px minmax(0,1fr)!important;
    column-gap:18px!important;
    margin-top:-62px!important;
    padding:0 5px 10px!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-header>.public-profile-avatar{
    width:112px!important;height:112px!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-info{
    padding-top:68px!important;
  }
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile .public-profile-stats{
    max-width:none!important;
  }
}

/* BASIC MEMBER PROFILE V2 — compact without a cover, public and connected.
   Premium cover/badge layout above is intentionally untouched. */
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile){
  --basic-profile-max:1120px;
  box-sizing:border-box!important;
  min-width:0!important;
}
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile)>.public-profile-header{
  position:relative!important;
  display:grid!important;
  box-sizing:border-box!important;
  width:100%!important;
  max-width:var(--basic-profile-max)!important;
  min-width:0!important;
  overflow:visible!important;
  z-index:15!important;
  grid-template-columns:132px minmax(0,1fr)!important;
  column-gap:23px!important;
  row-gap:0!important;
  align-items:start!important;
  margin:22px 0 26px!important;
  padding:0 14px 0!important;
  text-align:left!important;
}
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile)>.public-profile-header>.public-profile-avatar{
  position:relative!important;
  grid-row:1!important;grid-column:1!important;
  box-sizing:border-box!important;
  flex:none!important;
  width:132px!important;height:132px!important;
  min-width:0!important;
  margin:0!important;
  border-radius:50%!important;
  overflow:visible!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:var(--surface)!important;
}
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile)>.public-profile-header>.public-profile-avatar>img{
  display:block!important;
  width:100%!important;height:100%!important;
  object-fit:cover!important;
  border-radius:50%!important;
}
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile)>.public-profile-header>.public-profile-info{
  grid-row:1!important;grid-column:2!important;
  box-sizing:border-box!important;
  min-width:0!important;
  padding:0!important;
  margin:0!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:13px!important;
}
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-title{
  display:block!important;
  min-width:0!important;
  padding:0!important;
  margin:0!important;
  text-align:left!important;
}
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-title h1{
  display:block!important;
  margin:0!important;
  padding:0!important;
  color:var(--text)!important;
  font-size:clamp(24px,2.5vw,34px)!important;
  font-weight:850!important;
  line-height:1.12!important;
  letter-spacing:-.045em!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-stats{
  box-sizing:border-box!important;
  width:100%!important;
  max-width:650px!important;
  margin:0!important;
  padding:8px 5px!important;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:0!important;
  border:1px solid var(--line)!important;
  border-radius:16px!important;
  background:var(--surface)!important;
  box-shadow:0 6px 23px color-mix(in srgb,var(--text) 6%,transparent)!important;
}
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-stats>:is(a,span){
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:49px!important;
  min-width:0!important;
  gap:5px!important;
  box-sizing:border-box!important;
  padding:5px 7px!important;
  text-decoration:none!important;
  text-align:center!important;
  font-size:11px!important;
  font-weight:500!important;
  color:var(--muted)!important;
  border:0!important;
}
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-stats>*+*{
  border-left:1px solid var(--line)!important;
}
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-stats strong{
  display:block!important;
  margin:0!important;
  color:var(--text)!important;
  font-size:19px!important;
  font-weight:850!important;
  line-height:1!important;
}
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-bio{
  width:100%!important;
  max-width:650px!important;
  margin:0!important;
  min-width:0!important;
  color:var(--muted)!important;
  line-height:1.55!important;
  font-size:13px!important;
  overflow-wrap:anywhere!important;
  text-align:left!important;
}
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-actions{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:stretch!important;
  gap:10px!important;
  box-sizing:border-box!important;
  width:100%!important;
  max-width:570px!important;
  margin:0!important;
  padding:0!important;
  min-width:0!important;
  overflow:visible!important;
  position:relative!important;
}
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-actions>:is(form,a,button){
  box-sizing:border-box!important;
  min-width:0!important;
  flex:1 1 150px!important;
  margin:0!important;
}
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-actions :is(.profile-action-primary,.profile-action-secondary,.profile-premium-action){
  display:flex!important;
  justify-content:center!important;
  align-items:center!important;
  gap:9px!important;
  box-sizing:border-box!important;
  width:100%!important;
  min-height:44px!important;
  margin:0!important;
  padding:0 16px!important;
  border-radius:999px!important;
  font-size:12px!important;
  font-weight:750!important;
  text-align:center!important;
}
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-actions>.profile-more{
  align-self:center!important;
  position:relative!important;
  flex:0 0 44px!important;
  width:44px!important;
  min-width:44px!important;
  height:44px!important;
}
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-actions>.profile-more>summary{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:44px!important;
  height:44px!important;
  border-radius:50%!important;
}
html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-actions>.profile-more>div{
  position:absolute!important;top:calc(100% + 7px)!important;
  right:0!important;left:auto!important;z-index:35!important;
}
@media(max-width:640px){
  html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile)>.public-profile-header{
    grid-template-columns:96px minmax(0,1fr)!important;
    column-gap:14px!important;row-gap:0!important;
    max-width:none!important;
    margin:4px 0 20px!important;
    padding:0!important;
  }
  html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile)>.public-profile-header>.public-profile-avatar{
    width:96px!important;height:96px!important;
  }
  html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile)>.public-profile-header>.public-profile-info{
    display:contents!important;
    padding:0!important;
  }
  html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-title{
    grid-column:2!important;grid-row:1!important;
    align-self:center!important;
    padding:0!important;
  }
  html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-title h1{
    font-size:clamp(19px,5.5vw,25px)!important;
    line-height:1.14!important;
  }
  html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-stats{
    grid-column:1/-1!important;grid-row:2!important;
    width:100%!important;max-width:none!important;
    margin:15px 0 0!important;
    padding:9px 3px!important;
  }
  html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-bio{
    grid-column:1/-1!important;grid-row:3!important;
    margin:12px 0 0!important;
  }
  html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-actions{
    grid-column:1/-1!important;grid-row:4!important;
    margin:13px 0 0!important;
    flex-wrap:nowrap!important;
    gap:8px!important;
  }
  html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-actions>:is(form,a,button){
    flex:1 1 0!important;min-width:0!important;
  }
  html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile) .public-profile-actions>.profile-more{
    flex:0 0 42px!important;min-width:42px!important;width:42px!important;height:42px!important;
  }
}
@media(min-width:641px) and (max-width:1023px){
  html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile)>.public-profile-header{
    grid-template-columns:112px minmax(0,1fr)!important;
    column-gap:18px!important;margin-top:20px!important;
  }
  html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile)>.public-profile-header>.public-profile-avatar{
    width:112px!important;height:112px!important;
  }
  html body.page-shell :is(.public-profile-page:not(.premium-profile),.member-basic-profile)>.public-profile-header>.public-profile-info{
    padding-top:0!important;
  }
}


/* Profils classiques : éviter le double vide (padding de page + marge d'en-tête)
   après la suppression de la couverture. Les profils boutique restent intacts. */
@media(max-width:640px){
  html body.page-shell>main.public-profile-page:not(.premium-profile),
  html body.page-shell>main.member-basic-profile{
    padding-top:8px!important;
  }
}


/* AVATAR EDIT OWNER V1 — bottom center; menu remains fully functional.
   Scoped to signed-in owner's avatar, never the visitor's avatar. */
html body.page-shell .public-profile-header>.public-profile-avatar>.public-avatar-edit.profile-avatar-menu{
  position:absolute!important;
  left:50%!important;
  right:auto!important;
  top:auto!important;
  bottom:-12px!important;
  transform:translateX(-50%)!important;
  width:30px!important;
  height:30px!important;
  margin:0!important;
  z-index:50!important;
}
html body.page-shell .public-profile-header>.public-profile-avatar>.public-avatar-edit.profile-avatar-menu>summary{
  box-sizing:border-box!important;
  display:flex!important;
  justify-content:center!important;
  align-items:center!important;
  width:30px!important;
  height:30px!important;
  min-width:30px!important;
  min-height:30px!important;
  padding:0!important;
  margin:0!important;
  border-radius:50%!important;
  border:1px solid var(--line)!important;
  background:var(--surface)!important;
  color:var(--text)!important;
  font-size:21px!important;
  font-weight:500!important;
  line-height:1!important;
  box-shadow:none!important;
  cursor:pointer!important;
}
html body.page-shell .public-profile-header>.public-profile-avatar>.public-avatar-edit.profile-avatar-menu>summary:hover{
  border-color:var(--accent)!important;
  color:var(--accent-text)!important;
}
html body.page-shell .public-profile-header>.public-profile-avatar>.public-avatar-edit.profile-avatar-menu>summary:focus-visible{
  outline:3px solid color-mix(in srgb,var(--accent) 44%,transparent)!important;
  outline-offset:2px!important;
}
html body.page-shell .public-profile-header>.public-profile-avatar>.public-avatar-edit.profile-avatar-menu>div{
  left:0!important;
  right:auto!important;
  top:calc(100% + 7px)!important;
  bottom:auto!important;
  transform:none!important;
  z-index:55!important;
  box-shadow:none!important;
}
/* Both controls can coexist: the edit button stays at the lower center of the
   avatar, and the shop badge sits one row farther down. */
html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile
.public-profile-avatar:has(>.public-avatar-edit)>.public-premium-status{
  bottom:-46px!important;
}
@media(max-width:640px){
  html body.page-shell :is(.public-profile-page,.member-shop-page).premium-profile
  .public-profile-header:has(>.public-profile-avatar>.public-avatar-edit) .public-profile-stats{
    margin-top:58px!important;
  }
}
/* Flat action popup from the supplied screenshot: keep borders and readability,
   remove only the raised shadow, including theme-specific global overrides. */
html body.page-shell .account-offer-actions>div{
  box-shadow:none!important;
  filter:none!important;
}
