/* Shared BayesPharma platform fixes */

/* Account dropdown chevron: do not depend on Font Awesome being present. */
#bp-auth-widget .bp-auth-pill i.fa-chevron-down {
  display: inline-grid !important;
  place-items: center;
  width: 14px;
  height: 14px;
  min-width: 14px;
  margin-left: 2px;
  font-size: 0 !important;
  color: transparent !important;
  overflow: visible;
}

#bp-auth-widget .bp-auth-pill i.fa-chevron-down::before {
  content: "" !important;
  display: block;
  width: 7px;
  height: 7px;
  box-sizing: border-box;
  border-right: 2px solid #cbd5e1;
  border-bottom: 2px solid #cbd5e1;
  transform: translateY(-2px) rotate(45deg);
  transform-origin: center;
  transition: transform 160ms ease, border-color 160ms ease;
}

#bp-auth-widget .bp-auth-pill:hover i.fa-chevron-down::before,
#bp-auth-widget .bp-auth-pill:focus-visible i.fa-chevron-down::before {
  border-color: #f8fafc;
}

#bp-auth-widget.open .bp-auth-pill i.fa-chevron-down::before {
  transform: translateY(2px) rotate(225deg);
}

/*
 * Single account surface, globally.
 * shared/auth.js converts any signed-in login/account link into
 * [data-bp-auth-trigger]. Once any such trigger exists anywhere on the page,
 * the fallback floating pill must disappear. This deliberately does not
 * depend on page-specific nav/header wrapper classes.
 */
body:has([data-bp-auth-trigger]) #bp-auth-widget .bp-auth-pill {
  display: none !important;
}

/* The shared dropdown still exists and is opened by the remaining trigger. */
body:has([data-bp-auth-trigger]) #bp-auth-widget {
  top: 76px;
  right: 14px;
  width: 0;
  height: 0;
}

@media (max-width: 700px) {
  body:has([data-bp-auth-trigger]) #bp-auth-widget {
    top: max(70px, calc(env(safe-area-inset-top) + 58px));
    right: max(10px, env(safe-area-inset-right));
  }
}
