/* BayesPeaQ / GenRx shared account popover — single-surface, theme-aware design.
 * Explicit scoping prevents legacy QMS and GenRx button/text rules from leaking in. */
#bp-auth-widget {
  --bpq-menu-bg: #fff;
  --bpq-menu-text: #172740;
  --bpq-menu-muted: #53647d;
  --bpq-menu-border: #d8e1ef;
  --bpq-menu-card: #f6f8fd;
  --bpq-menu-card-hover: #eef3ff;
  --bpq-menu-link: #fff;
  --bpq-menu-accent: #4c4bb5;
  --bpq-menu-accent-soft: #e9e9fe;
  --bpq-menu-verified: #086a4d;
  --bpq-menu-verified-bg: #eaf7f0;
  --bpq-menu-verified-border: #cceadd;
  --bpq-menu-avatar-start: #6254cb;
  --bpq-menu-avatar-end: #346aa8;
  --bpq-menu-signout: #ae3042;
  --bpq-menu-shadow: 0 22px 70px rgba(25, 46, 83, .16), 0 5px 20px rgba(25, 46, 83, .06);
}
html[data-bpq-theme="dark"] #bp-auth-widget,
html[data-theme="dark"] #bp-auth-widget {
  --bpq-menu-bg: #192436;
  --bpq-menu-text: #f2f6fd;
  --bpq-menu-muted: #bbc7d9;
  --bpq-menu-border: #3e4c64;
  --bpq-menu-card: #23334a;
  --bpq-menu-card-hover: #314668;
  --bpq-menu-link: #2c3b55;
  --bpq-menu-accent: #aaa2ff;
  --bpq-menu-accent-soft: #38385c;
  --bpq-menu-verified: #b3f4d6;
  --bpq-menu-verified-bg: #213d39;
  --bpq-menu-verified-border: #3d7060;
  --bpq-menu-avatar-start: #7364d8;
  --bpq-menu-avatar-end: #378aa4;
  --bpq-menu-signout: #ffadb3;
  --bpq-menu-shadow: 0 22px 70px rgba(4, 11, 25, .45);
}
#bp-auth-widget .bp-auth-menu,
#bp-auth-widget[data-bpq-docked="true"] .bp-auth-menu {
  box-sizing: border-box !important;
  width: min(362px, calc(100vw - 24px)) !important;
  min-width: 0 !important;
  max-width: calc(100vw - 24px) !important;
  max-height: min(610px, calc(100dvh - 100px)) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--bpq-menu-border) transparent;
  padding: 14px !important;
  color: var(--bpq-menu-text) !important;
  background: var(--bpq-menu-bg) !important;
  border: 1px solid var(--bpq-menu-border) !important;
  border-radius: 18px !important;
  box-shadow: var(--bpq-menu-shadow) !important;
  backdrop-filter: none !important;
  isolation: isolate;
}
#bp-auth-widget .bp-auth-menu *,
#bp-auth-widget .bp-auth-menu *::before,
#bp-auth-widget .bp-auth-menu *::after { box-sizing: border-box; }
#bp-auth-widget .bp-auth-menu [data-bpq-role-display],
#bp-auth-widget .bp-auth-menu [data-bpq-native-admin] { display: none !important; }

#bp-auth-widget .bp-auth-menu .bpq-unified-identity {
  display: flex; align-items: center; gap: 11px; padding: 2px 3px 12px;
  border-bottom: 1px solid var(--bpq-menu-border);
}
#bp-auth-widget .bpq-unified-avatar {
  width: 43px; height: 43px; border-radius: 13px; flex: 0 0 43px;
  display: grid; place-items: center; color: #fff; font: 800 17px/1 Inter, system-ui, sans-serif;
  background: linear-gradient(140deg, var(--bpq-menu-avatar-start), var(--bpq-menu-avatar-end));
  box-shadow: 0 5px 13px rgba(63, 83, 150, .16);
}
#bp-auth-widget .bpq-unified-identity-copy { min-width: 0; flex: 1; }
#bp-auth-widget .bp-auth-menu button.bpq-account-close {
  display: inline-flex !important; align-items: center; justify-content: center;
  flex: 0 0 44px; width: 44px !important; height: 44px; min-height: 44px;
  padding: 10px !important; align-self: flex-start; border-radius: 10px;
  border: 1px solid var(--bpq-menu-border) !important;
  background: var(--bpq-menu-card) !important; color: var(--bpq-menu-text) !important;
  cursor: pointer;
}
#bp-auth-widget .bpq-account-close svg { display: block; flex: none; width: 22px; height: 22px; }
#bp-auth-widget .bpq-account-close:focus-visible { outline: 3px solid var(--bpq-menu-accent); outline-offset: 2px; }
#bp-auth-widget .bp-auth-menu .bpq-unified-identity-copy > strong {
  display: block !important; padding: 0 !important; margin: 0 0 3px !important;
  color: var(--bpq-menu-text) !important; font: 800 15px/1.3 Inter, system-ui, sans-serif !important;
  overflow-wrap: anywhere;
}
#bp-auth-widget .bp-auth-menu .bpq-unified-identity-copy > small {
  display: block !important; padding: 0 !important; margin: 0 !important;
  color: var(--bpq-menu-muted) !important; font: 500 12px/1.4 Inter, system-ui, sans-serif !important;
  overflow-wrap: anywhere; word-break: normal !important;
}
#bp-auth-widget .bpq-unified-verify {
  display: flex; align-items: center; gap: 8px; width: fit-content;
  padding: 6px 10px; margin: 11px 2px 12px;
  border-radius: 999px; border: 1px solid var(--bpq-menu-verified-border);
  background: var(--bpq-menu-verified-bg); color: var(--bpq-menu-verified);
  font: 750 11px/1.4 Inter, system-ui, sans-serif; letter-spacing: .005em;
}
#bp-auth-widget .bpq-unified-verify[data-verified="false"] {
  color: #9b611a; background: #fff5df; border-color: #e8c98a;
}
#bp-auth-widget .bpq-unified-verify-icon {
  display: grid; place-items: center; width: 15px; height: 15px;
  border: 1.5px solid currentColor; border-radius: 50%; font-size: 9px; font-weight: 900;
}
#bp-auth-widget .bpq-unified-admin {
  background: var(--bpq-menu-card); border: 1px solid var(--bpq-menu-border);
  border-radius: 14px; padding: 11px; margin: 0 0 13px;
}
#bp-auth-widget .bpq-unified-admin-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 0 1px 9px; color: var(--bpq-menu-muted); letter-spacing: .09em;
  text-transform: uppercase; font: 850 10px/1.5 Inter, system-ui, sans-serif;
}
#bp-auth-widget .bpq-unified-badge {
  background: var(--bpq-menu-accent-soft); border: 1px solid transparent;
  border-radius: 999px; padding: 4px 8px; color: var(--bpq-menu-accent);
  letter-spacing: 0; text-transform: none; white-space: nowrap;
  font: 750 10px/1.3 Inter, system-ui, sans-serif;
}
#bp-auth-widget .bp-auth-menu a.bpq-unified-link {
  display: flex !important; gap: 10px; align-items: center; justify-content: space-between;
  width: 100%; min-height: 61px; padding: 10px 11px; margin-top: 7px;
  color: var(--bpq-menu-text) !important; background: var(--bpq-menu-link) !important;
  border: 1px solid var(--bpq-menu-border); border-radius: 11px;
  text-decoration: none !important; transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
#bp-auth-widget .bp-auth-menu a.bpq-unified-link:hover {
  background: var(--bpq-menu-card-hover) !important;
  border-color: var(--bpq-menu-accent); transform: translateY(-1px);
}
#bp-auth-widget .bp-auth-menu a.bpq-unified-link > span:first-child { display: block; min-width: 0; flex: 1; }
#bp-auth-widget .bp-auth-menu a.bpq-unified-link .bpq-link-title {
  display: block; color: var(--bpq-menu-text) !important; font: 780 13px/1.35 Inter, system-ui, sans-serif !important;
}
#bp-auth-widget .bp-auth-menu a.bpq-unified-link small {
  display: block !important; padding: 3px 0 0 !important;
  color: var(--bpq-menu-muted) !important; font: 500 11px/1.4 Inter, system-ui, sans-serif !important;
  word-break: normal !important; overflow-wrap: anywhere;
}
#bp-auth-widget .bp-auth-menu a.bpq-unified-link .bpq-link-arrow {
  display: grid; place-items: center; flex: 0 0 27px; width: 27px; height: 27px;
  border-radius: 9px; font: 850 14px/1 system-ui, sans-serif;
  color: var(--bpq-menu-accent) !important; background: var(--bpq-menu-accent-soft);
}

#bp-auth-widget .bpq-unified-appearance {
  padding: 2px 1px 12px; margin-bottom: 2px;
  border-bottom: 1px solid var(--bpq-menu-border);
}
#bp-auth-widget .bp-auth-menu .bpq-unified-appearance-title {
  display: block !important; margin: 0 0 9px; padding: 0 2px !important;
  color: var(--bpq-menu-text) !important; font: 750 12px/1.5 Inter, system-ui, sans-serif !important;
}
#bp-auth-widget .bpq-unified-theme-buttons {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 7px;
  border-radius: 11px;
}
#bp-auth-widget .bp-auth-menu button.bpq-unified-theme {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 8px;
  width: 100% !important; min-width: 0; min-height: 40px; padding: 8px 11px !important;
  border: 1px solid var(--bpq-menu-border) !important; border-radius: 10px !important;
  background: var(--bpq-menu-card) !important; color: var(--bpq-menu-text) !important;
  text-align: center !important; font: 740 12px/1.3 Inter, system-ui, sans-serif !important;
  transition: background .16s ease, border-color .16s ease;
}
#bp-auth-widget .bp-auth-menu button.bpq-unified-theme[aria-pressed="true"] {
  background: var(--bpq-menu-accent-soft) !important; color: var(--bpq-menu-accent) !important;
  border-color: var(--bpq-menu-accent) !important;
}
#bp-auth-widget .bp-auth-menu button.bpq-unified-theme:hover {
  background: var(--bpq-menu-card-hover) !important; border-color: var(--bpq-menu-accent) !important;
}
#bp-auth-widget .bp-auth-menu button.bpq-unified-theme .bpq-theme-icon { font: 700 16px/1 system-ui, sans-serif; }
#bp-auth-widget .bp-auth-menu > [data-bp-signout] {
  display: block; width: 100%; min-height: 38px; margin: 3px 0 0 !important;
  padding: 9px 11px !important; border: 0 !important; border-radius: 9px !important;
  text-align: left; background: transparent !important;
  color: var(--bpq-menu-signout) !important; font: 760 12px/1.4 Inter, system-ui, sans-serif !important;
}
#bp-auth-widget .bp-auth-menu > [data-bp-signout]:hover {
  background: var(--bpq-menu-card) !important;
}
#bp-auth-widget .bp-auth-menu :is(a,button):focus-visible {
  outline: 3px solid var(--bpq-menu-accent) !important; outline-offset: 2px !important;
}
@media (max-width: 700px) {
  #bp-auth-widget .bp-auth-menu,
  #bp-auth-widget[data-bpq-docked="true"] .bp-auth-menu {
    position: fixed !important;
    top: 67px !important;
    right: 10px !important;
    left: auto !important;
    width: min(362px, calc(100vw - 20px)) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 80px) !important;
    padding: 12px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  #bp-auth-widget .bp-auth-menu a.bpq-unified-link,
  #bp-auth-widget .bp-auth-menu button.bpq-unified-theme { transition: none !important; }
  #bp-auth-widget .bp-auth-menu a.bpq-unified-link:hover { transform: none !important; }
}

/* A reserved arrow column prevents overlap at narrow widths and long translations. */
#bp-auth-widget .bp-auth-menu a.bpq-unified-link {
 display:grid!important;grid-template-columns:minmax(0,1fr) 32px!important;
 align-items:center!important;column-gap:12px!important;justify-content:initial!important;
}
#bp-auth-widget .bp-auth-menu a.bpq-unified-link>span:first-child {
 display:block!important;min-width:0!important;max-width:100%!important;grid-column:1!important;
}
#bp-auth-widget .bp-auth-menu a.bpq-unified-link .bpq-link-arrow {
 position:static!important;inset:auto!important;grid-column:2!important;
 justify-self:end!important;align-self:center!important;margin:0!important;
 width:32px!important;height:32px!important;min-width:32px!important;flex:none!important;
}
#bp-auth-widget .bp-auth-menu a.bpq-unified-link small {
 max-width:100%!important;overflow-wrap:anywhere!important;
}

/* Defensive geometry for cross-product menus, zoom and long account identities.
   The arrow/close button live in their own columns, never over text. */
#bp-auth-widget .bp-auth-menu .bpq-unified-identity {
 display:grid!important;grid-template-columns:43px minmax(0,1fr) 44px!important;
 align-items:center!important;gap:10px!important;min-width:0!important;
}
#bp-auth-widget .bp-auth-menu .bpq-unified-identity-copy {
 display:block!important;grid-column:2!important;min-width:0!important;
 width:100%!important;max-width:100%!important;overflow:hidden!important;
}
#bp-auth-widget .bp-auth-menu .bpq-unified-identity-copy > strong,
#bp-auth-widget .bp-auth-menu .bpq-unified-identity-copy > small {
 width:100%!important;max-width:100%!important;min-width:0!important;
 white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
 overflow-wrap:normal!important;
}
#bp-auth-widget .bp-auth-menu button.bpq-account-close {
 position:static!important;grid-column:3!important;justify-self:end!important;
 align-self:center!important;inset:auto!important;margin:0!important;
 width:44px!important;min-width:44px!important;max-width:44px!important;
 height:44px!important;flex:none!important;z-index:1;
}
#bp-auth-widget .bp-auth-menu a.bpq-unified-link {
 display:grid!important;grid-template-columns:minmax(0,1fr) 36px!important;
 gap:12px!important;align-items:center!important;min-width:0!important;
 overflow:hidden!important;text-align:left!important;
}
#bp-auth-widget .bp-auth-menu a.bpq-unified-link > .bpq-unified-link-copy {
 display:block!important;grid-column:1!important;grid-row:1!important;
 min-width:0!important;width:100%!important;max-width:100%!important;
 overflow-wrap:anywhere!important;
}
#bp-auth-widget .bp-auth-menu a.bpq-unified-link .bpq-unified-link-caption {
 display:block!important;max-width:100%!important;min-width:0!important;
 width:100%!important;white-space:normal!important;overflow-wrap:anywhere!important;
 word-break:normal!important;margin:0!important;
}
#bp-auth-widget .bp-auth-menu a.bpq-unified-link > .bpq-link-arrow {
 display:grid!important;position:static!important;grid-column:2!important;grid-row:1!important;
 justify-self:end!important;align-self:center!important;inset:auto!important;
 margin:0!important;width:36px!important;height:36px!important;min-width:36px!important;
 max-width:36px!important;flex:none!important;
}
@media(max-width:390px){
 #bp-auth-widget .bp-auth-menu a.bpq-unified-link {padding-inline:9px!important;gap:8px!important}
 #bp-auth-widget .bp-auth-menu .bpq-unified-identity {column-gap:7px!important}
}
