.header-account {
  position: absolute;
  z-index: 20;
  top: 1.25rem;
  right: 1.5rem;
  text-align: left;
}

.page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auth-menu {
  position: relative;
  font-family: var(--sans, 'Inter', sans-serif);
}

.auth-menu summary {
  list-style: none;
}

.auth-menu summary::-webkit-details-marker {
  display: none;
}

.auth-trigger {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(90, 75, 63, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text, #1a1a1a);
  box-shadow: 0 4px 18px rgba(42, 35, 30, 0.06);
  backdrop-filter: blur(12px);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 22px rgba(42, 35, 30, 0.1);
}

.auth-trigger:focus-visible,
.provider-btn:focus-visible,
.auth-link:focus-visible,
.auth-privacy:focus-visible {
  outline: 2px solid #a96743;
  outline-offset: 3px;
}

.auth-user-trigger {
  padding: 0.3rem 0.35rem 0.3rem 0.75rem;
}

.auth-avatar-wrap {
  position: relative;
  width: 30px;
  height: 30px;
  display: inline-block;
  flex-shrink: 0;
}

.auth-avatar-wrap.large {
  width: 46px;
  height: 46px;
}

.auth-avatar {
  position: absolute;
  inset: 0;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: #a96743;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.auth-avatar.large {
  width: 46px;
  height: 46px;
  font-size: 0.76rem;
}

.auth-photo {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #eee9e2;
  object-fit: cover;
}

.auth-user-label {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-popover {
  position: absolute;
  z-index: 100;
  top: calc(100% + 0.65rem);
  right: 0;
  width: 260px;
  padding: 0.65rem;
  border: 1px solid rgba(90, 75, 63, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 55px rgba(42, 35, 30, 0.16);
}

.auth-signin {
  width: 280px;
  padding: 1rem;
}

.auth-title {
  margin-bottom: 0.25rem;
  color: var(--text, #1a1a1a);
  font-family: var(--serif, Georgia, serif);
  font-size: 1.2rem;
}

.auth-copy {
  margin-bottom: 0.85rem;
  color: var(--text-secondary, #6b6b6b);
  font-size: 0.78rem;
  line-height: 1.5;
}

.provider-btn {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(90, 75, 63, 0.14);
  border-radius: 9px;
  color: var(--text, #1a1a1a);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.provider-btn:hover {
  border-color: rgba(90, 75, 63, 0.3);
  background: #f8f5f0;
}

.provider-mark {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
}

.provider-btn.microsoft .provider-mark {
  background: #eef4ff;
  color: #2563a7;
}

.provider-btn.google .provider-mark {
  background: #fff1ee;
  color: #c74434;
}

.auth-privacy {
  display: inline-block;
  margin-top: 0.9rem;
  color: var(--text-tertiary, #999);
  font-size: 0.7rem;
  text-decoration: none;
}

.auth-privacy:hover {
  color: var(--text, #1a1a1a);
}

.auth-profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.45rem;
  padding: 0.55rem;
}

.auth-profile-copy {
  min-width: 0;
}

.auth-profile-name {
  max-width: 175px;
  overflow: hidden;
  color: var(--text, #1a1a1a);
  font-size: 0.82rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-profile-email {
  max-width: 175px;
  overflow: hidden;
  margin-top: 0.1rem;
  color: var(--text-secondary, #6b6b6b);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-provider {
  margin-top: 0.18rem;
  color: var(--text-tertiary, #999);
  font-size: 0.67rem;
}

.auth-link {
  display: block;
  padding: 0.65rem 0.7rem;
  border-radius: 8px;
  color: var(--text-secondary, #6b6b6b);
  text-decoration: none;
  font-size: 0.78rem;
}

.auth-link:hover {
  background: #f5f1eb;
  color: var(--text, #1a1a1a);
}

.auth-admin-links {
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid #eee9e2;
}

.auth-section-label {
  padding: 0.4rem 0.7rem 0.2rem;
  color: var(--text-tertiary, #999);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-signout {
  margin-top: 0.25rem;
  border-top: 1px solid #eee9e2;
  border-radius: 0 0 8px 8px;
}

@media (max-width: 600px) {
  .header-account {
    top: 0.8rem;
    right: 0.8rem;
  }

  .auth-user-label {
    display: none;
  }

  .auth-user-trigger {
    padding-left: 0.35rem;
  }

  .auth-popover {
    position: fixed;
    top: 4rem;
    right: 0.8rem;
    left: 0.8rem;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-trigger,
  .provider-btn {
    transition: none;
  }
}
