.auth-buttons.intelx-profile-enhanced {
  position: relative;
}

.auth-buttons.intelx-profile-enhanced .profile-source-hidden {
  display: none !important;
}

.profile-menu {
  position: relative;
}

.profile-trigger {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 230px;
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.96));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  color: #f8fafc;
  cursor: pointer;
  user-select: none;
}

/* ── Performance: GPU-promote dropdown animation, remove tap delay ──── */
.profile-trigger {
  touch-action: manipulation;
}

.profile-caret {
  will-change: transform;
}

.profile-dropdown {
  will-change: transform, opacity;
  contain: layout;
  backface-visibility: hidden;
}

.profile-item {
  touch-action: manipulation;
}

.profile-trigger::-webkit-details-marker {
  display: none;
}

.profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  overflow: hidden;
}

.profile-avatar--image {
  color: transparent;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.profile-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  line-height: 1;
}

.profile-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-caret {
  font-size: 0.8rem;
  color: #93c5fd;
  transition: transform 0.2s ease;
}

.profile-menu[open] .profile-caret {
  transform: rotate(180deg);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 250px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(10, 15, 28, 0.98));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1200;
}

.profile-menu[open] .profile-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.profile-item {
  width: 100%;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px 14px;
  font-size: 0.92rem;
  font-weight: 500;
  color: #e2e8f0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.profile-item + .profile-item {
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.profile-item:hover {
  background: rgba(59, 130, 246, 0.18);
}

.profile-item-username {
  align-items: center;
  justify-content: space-between;
}

.profile-item-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.profile-item-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: #f8fafc;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-item-danger {
  color: #fda4af;
}

.profile-item-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ffe4e6;
}

.hero#hero-section .hero-content {
  padding-top: 56px;
}

.hero#hero-section .hero-content h1 {
  margin-top: 0;
}

@media (max-width: 768px) {
  .hero#hero-section .hero-content {
    padding-top: 32px;
  }
}

@media (max-width: 1250px) {
  .profile-trigger {
    min-width: 205px;
  }
}

@media (max-width: 1024px) {
  .navbar .auth-buttons.intelx-profile-enhanced {
    display: flex !important;
    position: fixed;
    top: 78px;
    right: 14px;
    z-index: 1400;
  }

  .navbar .auth-buttons.intelx-profile-enhanced .profile-trigger {
    min-width: 220px;
    border-radius: 12px;
    padding: 8px 11px;
  }

  .navbar .auth-buttons.intelx-profile-enhanced .profile-dropdown {
    min-width: 220px;
    right: 0;
  }
}

@media (max-width: 560px) {
  .navbar .auth-buttons.intelx-profile-enhanced {
    left: 12px;
    right: 12px;
    justify-content: flex-end;
  }

  .navbar .auth-buttons.intelx-profile-enhanced .profile-trigger {
    min-width: min(100%, 240px);
  }

  .navbar .auth-buttons.intelx-profile-enhanced .profile-dropdown {
    width: 100%;
    min-width: 0;
  }
}