/* Decor Studio staging v4 — overlays stay visible on self, visitor preview and public pop-up. */
.fhds-overlay {
  display:block!important;visibility:visible!important;
  position:absolute!important;pointer-events:none!important;user-select:none!important;
  object-fit:contain!important;max-width:none!important;max-height:none!important;
  height:var(--fhds-height,auto)!important;
  transform:translate(var(--fhds-shift-x,-50%),var(--fhds-shift-y,-50%)) rotate(var(--fhds-angle,0deg))!important;
  transform-origin:var(--fhds-origin-x,50%) var(--fhds-origin-y,50%)!important;
  opacity:var(--fhds-alpha,1)!important;
  width:var(--fhds-width,110px)!important;
  filter:drop-shadow(0 5px 8px #0004);
  animation-duration:var(--fhds-duration,3s)!important;
  animation-timing-function:var(--fhds-easing,ease-in-out)!important;
  animation-delay:var(--fhds-delay,0s)!important;
  animation-direction:var(--fhds-direction,normal)!important;
  animation-iteration-count:infinite!important;
}
#profile-card,#user-card,#visitor-card {position:relative!important;overflow:visible!important}
.fhds-overlay[data-motion="spin"] {animation-timing-function:var(--fhds-easing,ease-in-out)!important}
.fhds-overlay[data-motion="none"] {animation:none!important}
.fhds-overlay[data-motion="float"] {animation-name:fhds-float!important}
.fhds-overlay[data-motion="pulse"] {animation-name:fhds-pulse!important}
.fhds-overlay[data-motion="spin"] {animation-name:fhds-spin!important}
.fhds-overlay[data-motion="swing"] {animation-name:fhds-swing!important}
.fhds-overlay[data-motion="bounce"] {animation-name:fhds-bounce!important}
.fhds-overlay[data-motion="wiggle"] {animation-name:fhds-wiggle!important}
@keyframes fhds-float {50%{translate:var(--fhds-motion-x,0px) var(--fhds-motion-y,-12px)}}
@keyframes fhds-pulse {50%{scale:var(--fhds-motion-scale,1.09)}}
@keyframes fhds-spin {to{rotate:var(--fhds-motion-angle,360deg)}}
@keyframes fhds-swing {50%{rotate:var(--fhds-motion-angle,16deg)}}
@keyframes fhds-bounce {50%{translate:var(--fhds-motion-x,0px) var(--fhds-motion-y,-20px)}}
@keyframes fhds-wiggle {25%{rotate:calc(-1 * var(--fhds-motion-angle,10deg))}75%{rotate:var(--fhds-motion-angle,10deg)}}
@media(prefers-reduced-motion:reduce){.fhds-overlay{animation:none!important}}
/* Hide legacy avatar ring only while a customized avatar frame is equipped. */
#profile-card.fhds-has-custom-frame .fh265-avatar-ring,
#user-card.fhds-has-custom-frame .fh265-avatar-ring,
#visitor-card.fhds-has-custom-frame .fh265-avatar-ring{display:none!important}
/* Existing shop stock and tag treatments from v1. */
#view-fh81-shop .fhds-soldout{opacity:.72}
#view-fh81-shop .fhds-tags{display:flex;gap:5px;flex-wrap:wrap;margin-top:4px}
#view-fh81-shop .fhds-tag{font-size:10px;background:#283e60;color:#bed7ff;border:1px solid #3a5780;padding:3px 6px;border-radius:5px}

/* V4: True underlay is a sibling of the profile card (and its widgets),
   not a negative-z image trapped above the card's own background. */
.fhds-underlay-parent{position:relative!important;overflow:visible!important;isolation:isolate!important}
.fhds-underlay-parent>.fhds-underlay-layer{position:absolute!important;z-index:0!important;pointer-events:none!important;overflow:visible!important}
.fhds-underlay-parent>.fhds-underlay-card,
.fhds-underlay-parent>.fh266-widgets-panel{position:relative!important;z-index:1!important}
.fhds-underlay-layer>.fhds-overlay{z-index:0!important}
/* All FriendHub full profile views share the same outer width on desktop.
   Smaller viewports can shrink, but cards no longer use separate wide layouts. */
#view-profile .fh266-composite, #view-user .fh266-composite,
#view-profile #profile-card, #view-user #user-card, #visitor-card,
#view-user .fh266-sheet, #view-user .fh267-dialog {
  width:min(720px,100%)!important;max-width:720px!important;margin-left:auto!important;margin-right:auto!important;
}
#view-profile .fh266-composite>#profile-card,
#view-user .fh266-composite>#user-card{width:100%!important;max-width:none!important}
#visitor-dialog {width:min(770px,98vw)!important;max-width:770px!important;}
@media(max-width:740px){
  #view-profile .fh266-composite,#view-user .fh266-composite,#visitor-card,
  #view-profile #profile-card,#view-user #user-card{width:100%!important;max-width:100%!important}
}

/* Preserve scrolling of the visitor-preview dialog when an underlay is equipped. */
dialog.fhds-underlay-parent{overflow:auto!important}

/* Topmost decors may overlap the widgets panel, not only the card. */
.fhds-underlay-parent>.fhds-underlay-card.fhds-over-all,
#profile-card.fhds-over-all,#user-card.fhds-over-all,#visitor-card.fhds-over-all{z-index:3!important}

/* V5 — empty public profile message takes the whole widget grid, never 1/12th. */
#view-user.fh267-overlay .profile-board > :not(.widget),
#view-profile .profile-board > :not(.widget),
#visitor-board > :not(.widget) {
  grid-column:1/-1!important;width:100%!important;min-width:0!important;
  overflow-wrap:anywhere;
}
