/* Nuffx account dropdown. Hover is paired with JS pointer events for reliable desktop behavior. */
.header-account-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.header-account-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1;
  user-select: none;
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.header-account-trigger:hover,
.header-account-trigger:focus-visible,
.header-account-dropdown.is-open > .header-account-trigger {
  border-color: rgba(107, 139, 255, .72);
  box-shadow: 0 0 0 3px rgba(91, 124, 255, .12), 0 8px 22px rgba(5, 8, 20, .25);
  outline: none;
}
.header-account-online {
  position: absolute;
  inset-inline-end: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 2px solid #0b1427;
  border-radius: 50%;
  background: #1de29b;
  box-shadow: 0 0 0 1px rgba(29, 226, 155, .25), 0 0 10px rgba(29, 226, 155, .22);
  z-index: 2;
}
.header-account-online > span {
  display: block;
  position: relative;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #eafff6;
}
.header-account-online::before,
.header-account-online::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(29, 226, 155, .72);
  border-radius: 50%;
  pointer-events: none;
  animation: nuffx-online-pulse 2.1s ease-out infinite;
}
.header-account-online::after { animation-delay: 1.05s; }
@keyframes nuffx-online-pulse {
  0% { transform: scale(.62); opacity: .86; }
  75%, 100% { transform: scale(1.55); opacity: 0; }
}
.header-account-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 10px);
  z-index: 130;
  width: min(276px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid rgba(115, 143, 198, .26);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(13, 23, 42, .99), rgba(7, 13, 25, .99));
  box-shadow: 0 20px 60px rgba(0, 0, 0, .42), 0 0 0 1px rgba(91, 124, 255, .035) inset;
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(5px) scale(.985);
  transform-origin: top right;
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
  direction: inherit;
}
.header-account-dropdown.is-open:not(.is-dismissed) > .header-account-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
@media (hover: hover) {
  .header-account-dropdown:not(.is-dismissed):hover > .header-account-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }
}

/* Keep the dropdown reachable after moving it below the header controls. */
.header-account-dropdown::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 100%;
  height: 10px;
  z-index: 129;
  pointer-events: auto;
}

/* Normalize the four authenticated header controls to the same vertical size. */
.header-actions > .locale-dropdown,
.header-actions > .nuffx-notification-center,
.header-actions > .wallet-pill,
.header-actions > .header-account-dropdown {
  height: 40px;
  min-height: 40px;
  box-sizing: border-box;
  align-self: center;
}
.header-actions .locale-current,
.header-actions .nuffx-notification-toggle,
.header-actions .wallet-pill,
.header-actions .avatar-btn {
  height: 40px;
  min-height: 40px;
  box-sizing: border-box;
}
.header-actions .nuffx-notification-toggle,
.header-actions .avatar-btn {
  width: 40px;
  min-width: 40px;
}
.header-actions .locale-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.header-actions .wallet-pill {
  padding-block: 0;
  align-items: center;
}
.header-account-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 8px 11px;
}
.header-account-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid rgba(108, 135, 255, .42);
  border-radius: 12px;
  background: linear-gradient(145deg, #1d3260, #111d3d);
  color: #e1e9ff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 7px 18px rgba(48, 75, 153, .18);
}
.header-account-identity { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.header-account-identity strong { color: #edf3ff; font-size: 13px; line-height: 1.3; font-weight: 850; }
.header-account-identity small { display: block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8294b4; font-size: 11px; line-height: 1.35; }
.header-account-divider { height: 1px; margin: 4px 3px 6px; background: linear-gradient(90deg, transparent, rgba(125, 153, 211, .18) 13%, rgba(125, 153, 211, .18) 87%, transparent); }
.header-account-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #c8d4eb;
  text-align: start;
  text-decoration: none;
  font: inherit;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
  cursor: pointer;
  transition: background .13s ease, color .13s ease, border-color .13s ease, transform .13s ease;
}
.header-account-item svg {
  display: block;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .9;
}
.header-account-item:hover,
.header-account-item:focus-visible {
  border-color: rgba(91, 124, 255, .16);
  background: linear-gradient(90deg, rgba(91, 124, 255, .13), rgba(118, 88, 255, .07));
  color: #fff;
  outline: none;
}
.header-account-item:active { transform: translateY(1px); }
.header-account-admin { color: #aebfff; }
.header-account-logout-form { margin: 0; }
.header-account-logout { color: #ffabb3; }
.header-account-logout:hover,
.header-account-logout:focus-visible {
  border-color: rgba(255, 108, 127, .18);
  background: rgba(255, 90, 115, .09);
  color: #ffd7db;
}
@media (max-width: 600px) {
  .header-account-menu { width: min(276px, calc(100vw - 20px)); }
}
@media (prefers-reduced-motion: reduce) {
  .header-account-trigger,
  .header-account-menu,
  .header-account-item { transition: none; }
  .header-account-online::before,
  .header-account-online::after { animation: none; }
}
html[dir="rtl"] .header-account-menu { transform-origin: top left; }
