.pc-auth-widget {
  position: relative;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  font-family: inherit;
  color: inherit;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  --pc-auth-surface: var(--card, rgba(18, 20, 26, 0.96));
  --pc-auth-surface-strong: var(--background-subtle, var(--card, rgba(16, 18, 24, 0.98)));
  --pc-auth-border: var(--border, rgba(255, 255, 255, 0.14));
  --pc-auth-hover: var(--muted, rgba(255, 255, 255, 0.08));
  --pc-auth-muted: var(--muted-foreground, rgba(248, 248, 251, 0.68));
  --pc-auth-text: var(--card-foreground, var(--foreground, #f8f8fb));
  --pc-auth-shadow: var(--shadow-lg, 0 18px 40px rgba(0, 0, 0, 0.35));
}

.pc-auth-widget .material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
}

.pc-auth-widget:not(.pc-auth-ms-ready) .material-symbols-outlined {
  visibility: hidden;
}

.pc-auth-widget.pc-auth-loading {
  opacity: 0.7;
  transform: translateY(0);
}

.pc-auth-widget.pc-auth-ready {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.pc-auth-widget.pc-auth-ready.pc-auth-fade {
  opacity: 0;
  transform: translateY(6px);
}

.pc-auth-skeleton {
  width: 140px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  background-size: 200% 100%;
  animation: pc-auth-shimmer 1.6s ease infinite;
}

.pc-auth-compact .pc-auth-skeleton {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.pc-auth-login,
.pc-auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--pc-auth-border);
  background: var(--pc-auth-hover);
  color: var(--pc-auth-text);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.pc-auth-login {
  justify-content: center;
  padding: 6px 12px;
  text-align: center;
}

.pc-auth-login:hover,
.pc-auth-chip:hover,
.pc-auth-chip[aria-expanded="true"] {
  border-color: var(--pc-auth-border);
  background: var(--pc-auth-hover);
}

.pc-auth-compact .pc-auth-chip {
  padding: 4px;
  width: 36px;
  height: 36px;
  justify-content: center;
}

.pc-auth-login-compact {
  justify-content: center;
  padding: 6px 12px;
  text-align: center;
}

.pc-auth-avatar {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--pc-auth-text);
  box-sizing: border-box;
  padding: 0;
}

.pc-auth-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.pc-auth-avatar[data-fallback="true"] {
  background: var(--pc-auth-hover);
}

.pc-auth-avatar[data-fallback="true"]::after {
  content: "";
  width: 12px;
  height: 12px;
  display: block;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a4 4 0 1 0-4-4 4 4 0 0 0 4 4zm0 2c-4.4 0-8 2-8 4.5V22h16v-3.5c0-2.5-3.6-4.5-8-4.5z'/%3E%3C/svg%3E") no-repeat center / contain;
}

.pc-auth-avatar-button {
  width: 24px;
  height: 24px;
  padding: 0;
}

.pc-auth-compact .pc-auth-avatar-button {
  width: 28px;
  height: 28px;
}

.pc-auth-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-auth-caret svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  opacity: 0.7;
}

.pc-auth-menu {
  position: relative;
}

.pc-auth-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 260px;
  max-width: 320px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--pc-auth-border);
  background: linear-gradient(180deg, var(--pc-auth-surface), var(--pc-auth-surface-strong));
  color: var(--pc-auth-text);
  backdrop-filter: blur(14px);
  box-shadow: var(--pc-auth-shadow);
  z-index: 10000;
  animation: pc-auth-pop 0.18s ease;
}

.pc-auth-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--pc-auth-border);
  margin-bottom: 6px;
  text-align: center;
}

.pc-auth-avatar.pc-auth-avatar-xl {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  padding: 0;
  box-shadow: none;
}

.pc-auth-greeting {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.pc-auth-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pc-auth-item {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  text-align: left;
}

.pc-auth-item:hover {
  background: var(--pc-auth-hover);
}

.pc-auth-item-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pc-auth-item-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  opacity: 0.85;
}

.pc-auth-item-icon .material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
  opacity: 0.85;
}

.pc-auth-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.pc-auth-item-label {
  font-weight: 600;
}

.pc-auth-item-value {
  font-size: 12px;
  color: var(--pc-auth-muted);
}

.pc-auth-item-chevron {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pc-auth-item-chevron svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
}

.pc-auth-item-chevron .material-symbols-outlined {
  font-size: 18px;
  line-height: 1;
  opacity: 0.7;
}

.pc-auth-item[aria-expanded="true"] .pc-auth-item-chevron {
  transform: rotate(90deg);
}

.pc-auth-sublist {
  display: grid;
  gap: 2px;
  padding: 2px 6px 6px 40px;
}

.pc-auth-sublist[hidden] {
  display: none;
}

.pc-auth-subitem {
  background: transparent;
  border: none;
  color: var(--pc-auth-muted);
  font-size: 12px;
  text-align: left;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.pc-auth-subitem:hover {
  background: var(--pc-auth-hover);
  color: var(--pc-auth-text);
}

.pc-auth-subitem.is-selected {
  color: var(--pc-auth-text);
  background: var(--pc-auth-hover);
}

.pc-auth-subdivider {
  height: 1px;
  background: var(--pc-auth-border);
  margin: 4px 8px;
}

.pc-auth-divider {
  height: 1px;
  background: var(--pc-auth-border);
  margin: 6px 8px;
}

.pc-auth-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--pc-auth-border);
}

.pc-auth-item-danger {
  color: #fca5a5;
}

.pc-auth-item-danger:hover {
  background: rgba(248, 113, 113, 0.16);
}

.pc-auth-item-compact {
  padding: 8px 10px;
  font-size: 12px;
}

.pc-auth-item-compact .pc-auth-item-icon svg {
  width: 18px;
  height: 18px;
}

.pc-auth-item-compact .pc-auth-item-icon .material-symbols-outlined {
  font-size: 18px;
}

@keyframes pc-auth-shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

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

@media (max-width: 640px) {
  .pc-auth-dropdown {
    right: 0;
    left: auto;
    min-width: 220px;
    max-width: 92vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pc-auth-skeleton {
    animation: none;
  }

  .pc-auth-dropdown {
    animation: none;
  }
}
