.keyra-account-menu {
  position: relative;
  flex-shrink: 0;
  margin-right: 0.125rem;
  display: flex;
  align-items: center;
}

.keyra-account-menu__trigger {
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  max-width: 2.5rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--keyra-border) 90%, transparent);
  border-radius: var(--keyra-radius-pill);
  background: #f8f8f8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: var(--keyra-primary);
  font-family: var(--keyra-font-sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition:
    border-color 150ms ease-out,
    background-color 150ms ease-out,
    box-shadow 150ms ease-out,
    transform 150ms ease-out;
}

.keyra-account-menu__trigger:hover {
  border-color: rgba(0, 0, 0, 0.14);
  background: var(--keyra-bg);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.keyra-account-menu__trigger:active {
  transform: scale(0.99);
}

.keyra-account-menu__trigger--open {
  border-color: color-mix(in srgb, var(--keyra-accent) 35%, transparent);
  background: var(--keyra-bg);
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 0 0 1px color-mix(in srgb, var(--keyra-accent) 20%, transparent);
}

.keyra-account-menu__trigger:focus-visible {
  outline: 2px solid var(--keyra-primary);
  outline-offset: 3px;
}

.keyra-account-menu__label {
  display: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #171717;
}

.keyra-account-menu__chevron {
  display: none;
  flex-shrink: 0;
  color: var(--keyra-text-2);
  transition: transform 150ms ease-out, color 150ms ease-out;
}

.keyra-account-menu__chevron--open {
  transform: rotate(180deg);
  color: var(--keyra-accent);
}

.keyra-account-menu__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: linear-gradient(
    135deg,
    var(--keyra-profile-avatar-from, #1a1a1a) 0%,
    var(--keyra-profile-avatar-to, #e0e0e0) 100%
  );
  color: #ffffff;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 0 2px rgba(255, 255, 255, 0.9);
}

.keyra-account-menu__mark--md {
  width: 2.5rem;
  height: 2.5rem;
}

.keyra-account-menu__initials {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  transform: translate(-50%, -50%);
}

.keyra-account-menu__initials--md {
  font-size: 13px;
}

.keyra-account-menu__person-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 0.875rem;
  height: 0.875rem;
  color: #ffffff;
  transform: translate(-50%, -50%);
}

.keyra-account-menu__status-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  z-index: 1;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  border: 1.5px solid #ffffff;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.55);
  pointer-events: none;
}

.keyra-account-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  min-width: 220px;
  overflow: hidden;
  border: 1px solid var(--keyra-border);
  border-radius: var(--keyra-radius-sheet);
  background: var(--keyra-bg);
  padding: 8px 0;
  box-shadow: var(--keyra-shadow-hover);
}

.keyra-account-menu__panel[hidden] {
  display: none !important;
}

.keyra-account-menu__panel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--keyra-border);
  background: linear-gradient(
    to bottom right,
    color-mix(in srgb, var(--keyra-accent) 8%, transparent),
    color-mix(in srgb, var(--keyra-accent) 3%, transparent),
    transparent
  );
  padding: 13.5px 16px;
}

.keyra-account-menu__panel-meta {
  min-width: 0;
  flex: 1;
}

.keyra-account-menu__panel-name {
  margin: 1px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--keyra-font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #171717;
}

.keyra-account-menu__panel-phone {
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--keyra-font-sans);
  font-size: 12px;
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.55);
}

.keyra-account-menu__panel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: fit-content;
  max-width: 100%;
  height: 19px;
  margin: 5px 0 0;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.06);
  padding: 0 8px;
  font-family: var(--keyra-font-sans);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.8);
}

.keyra-account-menu__panel-badge-dot {
  width: 6px;
  height: 6px;
  align-self: center;
  flex-shrink: 0;
  border-radius: 9999px;
  background: #10b981;
  transform: translateY(-0.5px);
}

.keyra-account-menu__panel-badge-text {
  display: inline-flex;
  align-items: center;
  height: 100%;
  line-height: 0.9;
  transform: translateY(-0.5px);
}

.keyra-account-menu__item {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 0;
  box-sizing: border-box;
  font-family: var(--keyra-font-sans);
  font-size: 14px;
  line-height: 1.4;
  color: #171717;
  text-decoration: none;
  transition: background-color 150ms ease-out;
}

.keyra-account-menu__item--button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font-family: var(--keyra-font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  cursor: pointer;
}

.keyra-account-menu__item:hover {
  background: var(--keyra-bg);
}

.keyra-account-menu--inspect {
  position: relative;
  display: inline-flex;
}

.keyra-account-menu--inspect .keyra-account-menu__panel {
  position: static;
  margin-top: 0;
}

@media (min-width: 640px) {
  .keyra-account-menu__trigger {
    width: auto;
    max-width: 16.25rem;
    gap: 0.625rem;
    justify-content: flex-start;
    padding: 0 0.625rem 0 0.25rem;
    font-size: 14px;
  }

  .keyra-account-menu__label {
    display: inline;
    max-width: 14rem;
    font-size: 0.875rem;
    font-weight: 500;
  }

  .keyra-account-menu__chevron {
    display: block;
  }
}

@media (max-width: 640px) {
  .keyra-account-menu__panel {
    right: -0.2rem;
    width: min(20rem, calc(100vw - 1rem));
  }

  .ev-landing-header .keyra-account-menu__trigger {
    width: 2.5rem;
    max-width: 2.5rem;
    min-width: 2.5rem;
    padding: 0;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .keyra-account-menu__trigger,
  .keyra-account-menu__chevron,
  .keyra-account-menu__item {
    transition: none;
  }

  .keyra-account-menu__trigger:active {
    transform: none;
  }
}
