/* ==========================================================================
   Global UI Header — In The Cards (nthecards.com)
   Aesthetic: Dark/Black Lines, Elongated Wide Ovals, Expressive Iconography
   ========================================================================== */

:root {
  --hdr-black: #090d16;
  --hdr-border-width: 1.5px;
  --hdr-border: var(--hdr-border-width) solid var(--hdr-black);
  --hdr-bg-pill: #ffffff;
  --hdr-bg-hover: rgba(9, 13, 22, 0.04);
  --hdr-text-primary: #090d16;
  --hdr-text-muted: #64748b;
  --hdr-accent-emerald: #10b981;
  --hdr-accent-blue: #3b82f6;
  --hdr-radius-pill: 9999px;
  --hdr-font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --hdr-mono: "JetBrains Mono", monospace;
}

/* Header Container on Canvas */
.global-header-wrapper {
  width: 100%;
  padding: 1.75rem 2rem 1rem;
  font-family: var(--hdr-font);
  color: var(--hdr-text-primary);
  user-select: none;
  transition: padding 0.3s ease;
  position: relative;
}

/* Responsive Backdrop (Click-to-dismiss layer on mobile only — NO blur, NO desktop dimming) */
.hdr-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(9, 13, 22, 0.15);
  z-index: 80;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

@media (min-width: 769px) {
  /* On desktop, inline expansions and dropdowns do not dim or blur the screen */
  .hdr-backdrop,
  .hdr-backdrop.active {
    display: none !important;
    pointer-events: none !important;
  }
}

@media (max-width: 768px) {
  .hdr-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
}

.global-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  min-height: 42px;
}

/* ==========================================================================
   Iconography Base Styles
   ========================================================================== */
.hdr-icon {
  width: 18px;
  height: 18px;
  stroke: var(--hdr-black);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

/* ==========================================================================
   ZONE 1: Left Brand Anchor (Icon Only with Black Background)
   ========================================================================== */
.hdr-brand-icon-only {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--hdr-black);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(9, 13, 22, 0.18);
  z-index: 5;
}

.hdr-brand-icon-only:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(9, 13, 22, 0.25);
}

.hdr-brand-icon-only .hdr-icon {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
  stroke-width: 1.85;
}

/* ==========================================================================
   ZONE 2: Center Menu Item (Dead Centered in Canvas/Screen)
   ========================================================================== */
.hdr-center-dock {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 60;
}

.hdr-center-dock.expanded {
  z-index: 70;
}

/* Collapsed state: standalone circle button with a plus */
.hdr-plus-circle-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--hdr-bg-pill);
  border: var(--hdr-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(9, 13, 22, 0.05);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  flex-shrink: 0;
}

.hdr-plus-circle-btn:hover {
  background: var(--hdr-bg-hover);
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(9, 13, 22, 0.1);
}

.hdr-plus-icon,
.hdr-menu-icon {
  width: 20px;
  height: 20px;
  stroke: var(--hdr-black);
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Expanded container dock */
.hdr-expanded-dock {
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: var(--hdr-bg-pill);
  border: var(--hdr-border);
  border-radius: var(--hdr-radius-pill);
  padding: 0.3rem 0.45rem 0.3rem 0.35rem;
  box-shadow: 0 4px 20px rgba(9, 13, 22, 0.08);
  animation: hdrExpandDock 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hdr-center-dock.expanded .hdr-expanded-dock {
  display: flex;
}

.hdr-center-dock.expanded .hdr-standalone-plus {
  display: none;
}

/* Structural wrappers for desktop inline flow & mobile stacking */
.hdr-dock-top-row {
  display: contents;
}

.hdr-dock-nav-pills {
  display: contents;
}

.hdr-close-dock-btn {
  order: -1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(9, 13, 22, 0.15);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.hdr-close-dock-btn:hover {
  background: var(--hdr-bg-hover);
  border-color: var(--hdr-black);
}

.hdr-close-dock-btn svg {
  transform: none;
}

@keyframes hdrExpandDock {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Navigation items inside expanded dock */
.hdr-dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--hdr-radius-pill);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--hdr-text-primary);
  background: transparent;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.hdr-dock-btn:hover {
  background: var(--hdr-bg-hover);
  border-color: rgba(9, 13, 22, 0.1);
}

.hdr-dock-btn.active {
  background: var(--hdr-black);
  color: #ffffff;
}

.hdr-dock-btn.active .hdr-icon {
  stroke: #ffffff;
}

/* Search Bar Synced to Active Events / Profiles Nav */
.hdr-search-widget {
  display: flex;
  align-items: center;
  background: rgba(9, 13, 22, 0.03);
  border: 1.5px solid var(--hdr-black);
  border-radius: var(--hdr-radius-pill);
  padding: 0.2rem 0.35rem 0.2rem 0.65rem;
  gap: 0.35rem;
}

.hdr-search-input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--hdr-font);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--hdr-text-primary);
  width: 210px;
  padding: 0.25rem 0.2rem;
}

.hdr-search-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.hdr-search-submit-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--hdr-black);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.hdr-search-submit-btn:hover {
  transform: scale(1.05);
}

.hdr-search-submit-btn svg {
  width: 14px;
  height: 14px;
  stroke: #ffffff;
  stroke-width: 2;
}

/* ==========================================================================
   ZONE 3: Right Corner Login / Sign Up Cluster (Multi-State)
   ========================================================================== */
.hdr-auth-zone {
  position: relative;
  display: flex;
  align-items: center;
}

/* --- STATE A: Signed Out --- */
.hdr-signed-out-cluster {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hdr-btn-login {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border: var(--hdr-border);
  border-radius: var(--hdr-radius-pill);
  background: var(--hdr-bg-pill);
  color: var(--hdr-text-primary);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hdr-btn-login:hover {
  background: var(--hdr-bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(9, 13, 22, 0.06);
}

.hdr-btn-signup {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.15rem;
  border: var(--hdr-border);
  border-radius: var(--hdr-radius-pill);
  background: var(--hdr-black);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hdr-btn-signup .hdr-icon {
  stroke: #ffffff;
}

.hdr-btn-signup:hover {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(9, 13, 22, 0.2);
}

/* --- STATE B: Signed In — 42px Profile Circle (Expands on Hover) --- */
.hdr-signed-in-pill {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  background: var(--hdr-bg-pill);
  border: var(--hdr-border);
  border-radius: var(--hdr-radius-pill);
  box-shadow: 0 1px 3px rgba(9, 13, 22, 0.05);
  position: relative;
  height: 42px;
  min-width: 42px;
  max-width: 42px;
  padding: 0;
  cursor: pointer;
  overflow: visible;
  transition: max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s ease,
              background-color 0.2s ease,
              padding 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hdr-signed-in-pill:hover,
.hdr-signed-in-pill:focus-within,
.hdr-signed-in-pill.expanded,
.hdr-signed-in-pill.menu-open {
  max-width: 450px;
  padding-right: 0.65rem;
  box-shadow: 0 4px 18px rgba(9, 13, 22, 0.09);
  background: #ffffff;
}

/* 42px Profile Icon Circle Anchor */
.hdr-profile-circle-btn {
  width: 39px;
  height: 39px;
  box-sizing: border-box;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s ease;
}

.hdr-profile-circle-btn:hover {
  background: var(--hdr-bg-hover);
}

.hdr-profile-icon-wrap {
  position: relative;
  width: 20px;
  height: 20px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}

.hdr-profile-icon-wrap.has-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(9, 13, 22, 0.15);
  border: 1.5px solid var(--hdr-black);
}

.hdr-fallback-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.hdr-user-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hdr-profile-circle-btn:hover .hdr-user-avatar-img {
  transform: scale(1.08);
}

/* Celebrating photo replacement */
.avatar-pulse-success {
  animation: hdrAvatarSuccessPulse 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes hdrAvatarSuccessPulse {
  0% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: none;
  }
}

.hdr-profile-icon-wrap .hdr-icon {
  width: 18px;
  height: 18px;
  stroke: var(--hdr-black);
  stroke-width: 1.85;
  transition: transform 0.2s ease;
  display: block;
}

.hdr-signed-in-pill:hover .hdr-profile-icon-wrap .hdr-icon {
  transform: scale(1.05);
}

/* Micro Expandable Menu Affordance Badge */
.hdr-menu-indicator-badge {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--hdr-black);
  border: 1.5px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(9, 13, 22, 0.25);
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
}

.hdr-indicator-chevron {
  width: 8px;
  height: 8px;
  stroke: #ffffff;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  display: block;
}

.hdr-signed-in-pill.menu-open .hdr-menu-indicator-badge,
.hdr-signed-in-pill.expanded .hdr-menu-indicator-badge {
  transform: rotate(180deg);
}

/* Expandable Tray (Only revealed on hover/activation) */
.hdr-profile-tray {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
  margin-left: 0;
  transition: max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              margin 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hdr-signed-in-pill:hover .hdr-profile-tray,
.hdr-signed-in-pill:focus-within .hdr-profile-tray,
.hdr-signed-in-pill.expanded .hdr-profile-tray,
.hdr-signed-in-pill.menu-open .hdr-profile-tray {
  max-width: 380px;
  opacity: 1;
  pointer-events: auto;
  margin-left: 0.2rem;
}

.hdr-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.hdr-user-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--hdr-text-primary);
  white-space: nowrap;
}

.hdr-action-icons {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  border-left: 1px solid rgba(9, 13, 22, 0.12);
  padding-left: 0.5rem;
  margin-left: 0.15rem;
}

.hdr-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.hdr-icon-btn:hover {
  background: var(--hdr-bg-hover);
  border-color: rgba(9, 13, 22, 0.1);
}

.hdr-icon-btn .hdr-icon {
  width: 16px;
  height: 16px;
}

.hdr-notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
}

.hdr-profile-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.15s ease;
}

.hdr-profile-trigger:hover {
  background: var(--hdr-bg-hover);
}

.hdr-signed-in-pill.menu-open .hdr-profile-trigger svg {
  transform: rotate(180deg);
}

/* --- STATE C: Profile Dropdown Popover --- */
.hdr-profile-popover {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  width: 260px;
  background: #ffffff;
  border: var(--hdr-border);
  border-radius: 16px;
  box-shadow: 0 16px 36px -8px rgba(9, 13, 22, 0.15), 0 0 0 1px rgba(9, 13, 22, 0.05);
  padding: 0.75rem;
  z-index: 100;
  display: none;
  animation: hdrPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hdr-profile-popover.open {
  display: block;
}

@keyframes hdrPopIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hdr-popover-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(9, 13, 22, 0.08);
  margin-bottom: 0.5rem;
}

.hdr-popover-avatar-img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--hdr-black);
  box-shadow: 0 1px 3px rgba(9, 13, 22, 0.1);
  flex-shrink: 0;
}

.hdr-popover-avatar-fallback {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--hdr-black);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.hdr-popover-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.hdr-popover-email {
  font-family: var(--hdr-mono);
  font-size: 0.72rem;
  color: var(--hdr-text-muted);
  word-break: break-all;
}

.hdr-popover-role {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.hdr-popover-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--hdr-text-primary);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.hdr-popover-item:hover {
  background: var(--hdr-bg-hover);
}

.hdr-popover-partner-switch {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 8px;
  cursor: pointer;
  margin: 0.35rem 0;
  text-decoration: none;
  transition: all 0.15s ease;
}

.hdr-popover-partner-switch:hover {
  background: rgba(37, 99, 235, 0.15);
}

.hdr-popover-partner-switch .hdr-icon {
  stroke: #2563eb;
}

.hdr-popover-item.danger {
  color: #ef4444;
}

.hdr-popover-item.danger .hdr-icon {
  stroke: #ef4444;
}

.hdr-popover-divider {
  height: 1px;
  background: rgba(9, 13, 22, 0.08);
  margin: 0.4rem 0;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 820px) {
  .global-header-wrapper {
    padding: 1rem 1.25rem 0.65rem;
  }
}

@media (max-width: 768px) {
  .global-header-wrapper {
    padding: 0.85rem 1rem 0.65rem;
  }

  .global-header {
    position: relative;
    min-height: 40px;
  }

  /* Left Brand Icon */
  .hdr-brand-icon-only {
    width: 40px;
    height: 40px;
  }

  /* Center Menu Collapsed Circle Button */
  .hdr-plus-circle-btn {
    width: 40px;
    height: 40px;
  }

  /* Center Dock Expanded: transforms into a floating mobile navigation card */
  .hdr-center-dock.expanded {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    width: 100%;
    transform: none;
    z-index: 150;
  }

  .hdr-expanded-dock {
    width: 100%;
    box-sizing: border-box;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    border-radius: 20px;
    border: var(--hdr-border);
    background: #ffffff;
    box-shadow: 0 16px 42px -10px rgba(9, 13, 22, 0.22), 0 0 0 1px rgba(9, 13, 22, 0.06);
    animation: hdrMobileSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes hdrMobileSlideDown {
    from {
      opacity: 0;
      transform: translateY(-8px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  /* Top Row inside Mobile Dock */
  .hdr-dock-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    width: 100%;
  }

  /* Segmented Pills for Events / Profiles */
  .hdr-dock-nav-pills {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 0.35rem;
    background: rgba(9, 13, 22, 0.04);
    border: 1.5px solid rgba(9, 13, 22, 0.12);
    border-radius: var(--hdr-radius-pill);
    padding: 0.2rem;
    order: 1;
  }

  .hdr-dock-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.84rem;
    font-weight: 700;
    border-radius: var(--hdr-radius-pill);
    border: 1.5px solid transparent;
  }

  .hdr-dock-btn.active {
    background: var(--hdr-black);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(9, 13, 22, 0.15);
  }

  /* Close Button in Mobile Dock */
  .hdr-close-dock-btn {
    order: 2;
    width: 38px;
    height: 38px;
    border: 1.5px solid rgba(9, 13, 22, 0.2);
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .hdr-close-dock-btn:active {
    background: var(--hdr-bg-hover);
    transform: scale(0.95);
  }

  /* Search Widget in Mobile Dock */
  .hdr-search-widget {
    width: 100%;
    box-sizing: border-box;
    height: 44px;
    padding: 0.25rem 0.35rem 0.25rem 0.85rem;
    gap: 0.5rem;
    background: rgba(9, 13, 22, 0.03);
  }

  .hdr-search-input {
    width: 100%;
    flex: 1;
    font-size: 0.95rem; /* ~15px prevents iOS Safari auto-zoom */
    padding: 0.2rem 0;
  }

  .hdr-search-submit-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  .hdr-search-submit-btn svg {
    width: 15px;
    height: 15px;
  }

  /* Auth Zone on Mobile */
  .hdr-signed-in-pill {
    width: 40px;
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    padding: 0;
  }

  /* Disable horizontal hover expansion on mobile */
  .hdr-signed-in-pill:hover,
  .hdr-signed-in-pill:focus-within,
  .hdr-signed-in-pill.expanded,
  .hdr-signed-in-pill.menu-open {
    max-width: 40px;
    padding-right: 0;
  }

  .hdr-profile-circle-btn {
    width: 38px;
    height: 38px;
  }

  .hdr-profile-tray {
    display: none !important;
  }

  /* Profile Popover on Mobile */
  .hdr-profile-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(300px, calc(100vw - 2rem));
    border-radius: 18px;
    padding: 0.75rem;
    box-shadow: 0 18px 42px -8px rgba(9, 13, 22, 0.22), 0 0 0 1px rgba(9, 13, 22, 0.05);
    z-index: 150;
  }

  .hdr-popover-item {
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
  }

  .hdr-popover-partner-switch {
    padding: 0.65rem 0.75rem;
    font-size: 0.82rem;
  }

  /* Signed Out Cluster on Mobile */
  .hdr-signed-out-cluster {
    gap: 0.4rem;
  }

  .hdr-btn-login {
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    gap: 0.35rem;
  }

  .hdr-btn-signup {
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    gap: 0.35rem;
  }
}

/* Extra small mobile screens (< 420px) */
@media (max-width: 420px) {
  .global-header-wrapper {
    padding: 0.75rem 0.75rem 0.5rem;
  }

  .hdr-brand-icon-only {
    width: 38px;
    height: 38px;
  }

  .hdr-plus-circle-btn {
    width: 38px;
    height: 38px;
  }

  .hdr-signed-in-pill {
    width: 38px;
    height: 38px;
    min-width: 38px;
    max-width: 38px;
  }

  .hdr-profile-circle-btn {
    width: 36px;
    height: 36px;
  }

  .hdr-btn-login {
    padding: 0.38rem 0.55rem;
    font-size: 0.74rem;
  }

  .hdr-btn-signup {
    padding: 0.38rem 0.65rem;
    font-size: 0.74rem;
  }
}
