/* Trainer profile stacking contract — TEST build 1096. */
body.trainer-profile-layer-open .trainer-panel.client-open{
  position:fixed!important;
  z-index:42000!important;
  isolation:isolate;
}

/* A Teamboard context card must never escape above an opened profile. */
body.trainer-profile-layer-open #player-context-menu.player-context-menu{
  display:none!important;
}

/* Panels and dialogs intentionally launched from the profile stay usable. */
body.trainer-profile-layer-open .inventory-panel.client-open{
  z-index:42100!important;
}
body.trainer-profile-layer-open #profession-system:not(.hidden),
body.trainer-profile-layer-open #pokelog-system:not(.hidden),
body.trainer-profile-layer-open #trainer-item-modal:not(.hidden){
  z-index:42500!important;
}
body.trainer-profile-layer-open #unified-refinement-modal:not(.hidden){
  z-index:2147483200!important;
}
body.trainer-profile-layer-open #trainer-equipment-slot-preview.visible{
  z-index:2147483000!important;
}

@media(max-width:780px),(max-height:500px) and (max-width:1024px){
  body.trainer-profile-layer-open .trainer-panel.client-open{
    max-width:calc(100vw - 12px)!important;
    max-height:calc(100dvh - 12px)!important;
  }
}
