.app-header { overflow: visible; z-index: 30; }
#account-menu { position: relative; flex: none; margin-left: 2px; }
#account-menu[data-official-account] > :not(.nav-actions) { display: none !important; }
#account-menu .nav-actions { display: flex; align-items: center; }
.app-header .header-actions #account-menu .sw-profile-trigger {
  display: inline-flex; flex: none; align-items: center; justify-content: center;
  width: 46px; height: 46px; min-height: 46px; padding: 11px;
  border: 1px solid #d9d9dd !important; border-radius: 50%;
  background: linear-gradient(145deg,#fafafa,#d9dbdf) !important; cursor: pointer;
}
.app-header .header-actions #account-menu .sw-profile-trigger[data-tier="standard"] { background: linear-gradient(145deg,#f4f6fa,#cfd9e8) !important; border-color: #d6e0ed !important; }
.app-header .header-actions #account-menu .sw-profile-trigger[data-tier="professional"] { background: linear-gradient(145deg,#ffe3cf,#efa77e) !important; border-color: #edc1a4 !important; }
.app-header .header-actions #account-menu .sw-profile-trigger[data-tier="enterprise"] { background: linear-gradient(145deg,#8f6ac7,#241b38) !important; border-color: #84649c !important; }
#account-menu .sw-profile-trigger img { display: block; width: 100%; height: 100%; object-fit: contain; opacity: .82; }
#account-menu .sw-profile-trigger[data-tier="enterprise"] img { filter: invert(1); opacity: .95; }
.app-header .header-actions #account-menu .sw-profile-trigger:hover { box-shadow: 0 5px 18px #3b3b461b; }
.app-header .header-actions .portal-home-link { gap: 7px; color: var(--portal-text); }
.app-header .header-actions .portal-home-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
#account-menu[hidden],#account-menu [hidden] { display: none !important; }
.app-header .header-actions #account-menu-toggle { display: flex; align-items: center; gap: 10px; height: auto; min-height: 48px; padding: 5px 8px; border: 1px solid transparent !important; border-radius: 10px; background: transparent !important; color: var(--portal-text); line-height: 1.4; text-align: left; cursor: pointer; }
.app-header .header-actions #account-menu-toggle:hover,.app-header .header-actions #account-menu-toggle[aria-expanded="true"] { background: var(--portal-selected) !important; border-color: #dfe3f9 !important; }
#account-menu .account-avatar { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--portal-selected); color: var(--portal-primary-hover); font-size: 15px; font-weight: 600; }
#account-menu .account-summary { display: grid; gap: 2px; min-width: 0; }
#account-menu [data-account-name] { max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; color: var(--portal-text); }
#account-menu [data-account-kind] { font-size: 12px; color: var(--portal-muted); }
.app-header .header-actions #account-menu .account-chevron { width: 16px; height: 16px; margin-left: 2px; fill: none; stroke: currentColor; stroke-width: 1.7; transition: transform .15s; }
#account-menu-toggle[aria-expanded="true"] .account-chevron { transform: rotate(180deg); }
#account-menu-panel { position: absolute; top: calc(100% + 8px); right: 0; width: 244px; max-width: calc(100vw - 32px); padding: 6px; border: 1px solid var(--portal-border); border-radius: 14px; background: #fff; box-shadow: 0 12px 36px #1822301a; z-index: 40; box-sizing: border-box; }
#account-menu .account-details { display: grid; gap: 6px; padding: 12px; border-bottom: 1px solid var(--portal-border); margin-bottom: 6px; }
#account-menu .account-caption { font-size: 12px; color: var(--portal-muted); }
#account-menu [data-account-role] { font-size: 14px; font-weight: 600; color: var(--portal-text); }
#account-menu [data-account-login] { font-size: 12px; color: var(--portal-muted); overflow-wrap: anywhere; }
#account-menu .account-actions { display: grid; gap: 2px; }
.app-header .header-actions #account-menu .account-actions button { display: flex; justify-content: flex-start; align-items: center; width: 100%; height: auto; min-height: 40px; padding: 10px 12px; margin: 0; gap: 8px; border: 0 !important; border-radius: 8px; color: var(--portal-text) !important; background: transparent !important; font-size: 14px; font-weight: 400; line-height: 1.5; cursor: pointer; text-align: left; }
.app-header .header-actions #account-menu .account-actions button:hover { background: var(--portal-hover) !important; }
.app-header .header-actions #account-menu .account-actions :is(#logout,#knowledge-logout) { color: #b42318 !important; }
#account-menu :is(button):focus-visible { outline: 3px solid #4f46e53d; outline-offset: 2px; }
@media(max-width:900px) {
  .app-header .header-actions { flex: 1; }
  .app-header .header-actions #account-menu { margin-left: auto; }
}
@media(max-width:640px) {
  .app-header .header-actions { min-width: 0; }
  .app-header .header-actions #account-menu { min-width: 0; max-width: 100%; flex: 0 1 auto; }
  .app-header .header-actions #account-menu-toggle { width: 100%; max-width: 100%; gap: 6px; padding-inline: 4px; }
  #account-menu .account-summary { flex: 1 1 auto; overflow: hidden; }
  #account-menu [data-account-name] { max-width: 100%; }
  #account-menu [data-account-kind] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app-header .header-actions #account-menu .account-chevron { flex: none; margin-left: 0; }
}
@media(prefers-reduced-motion:reduce) { .app-header .header-actions #account-menu .account-chevron { transition: none; } }
