:root {
  --auth-chip-bg: rgba(255, 255, 255, 0.05);
  --auth-chip-border: rgba(255, 255, 255, 0.2);
  --auth-overlay-bg: rgba(4, 5, 12, 0.94);
}

.auth-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.auth-controls button {
  border: 1px solid var(--border, rgba(255, 255, 255, 0.2));
  border-radius: 999px;
  padding: 0.4rem 1.2rem;
  background: var(--accent-2, #44c5f5);
  color: #04050c;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.auth-controls button.secondary {
  background: transparent;
  color: var(--text, #f5f6fb);
}

.auth-controls button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.auth-user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--auth-chip-border);
  background: var(--auth-chip-bg);
  font-size: 0.85rem;
  color: var(--text, #f5f6fb);
}

.auth-user-chip .avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.auth-user-chip small {
  display: block;
  font-size: 0.7rem;
  color: var(--muted, rgba(255, 255, 255, 0.7));
}

.auth-guard {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--auth-overlay-bg);
  backdrop-filter: blur(10px);
}

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

.auth-guard-card {
  width: min(440px, 100%);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(9, 11, 22, 0.95);
  padding: 2rem;
  text-align: center;
  color: #f5f6fb;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.auth-guard-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.auth-guard-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}

.auth-guard-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-guard-actions button {
  width: 100%;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.auth-guard-actions button.primary {
  background: var(--accent-2, #44c5f5);
  color: #04050c;
}

.auth-guard-actions button.secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #f5f6fb;
}

.auth-guard-actions button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.auth-debug {
  margin-top: 1rem;
  text-align: left;
}

.auth-debug-toggle {
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.75rem;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
}

.auth-debug-panel {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(5, 7, 16, 0.65);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.72rem;
  max-height: 180px;
  overflow: auto;
}

.auth-debug-meta {
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.7rem;
}

.auth-debug-log {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
