/* Shared auth bar — folding left drawer */
:root {
  --auth-bar-z: 1000;
  --auth-bar-radius: 10px;
  --auth-bar-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  --auth-bar-fg: var(--fg, #e6edf3);
  --auth-bar-bg: var(--bg-card, #161b22);
  --auth-bar-border: var(--border, #30363d);
  --auth-bar-muted: var(--fg-subtle, #6e7681);
  --auth-bar-accent: var(--accent, #58a6ff);
  --auth-bar-red: var(--red, #f85149);
}

.auth-bar {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: var(--auth-bar-z);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-family: var(--font-ui, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
}

.auth-bar__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.auth-bar__tabs {
  display: flex;
  gap: 4px;
  background: var(--auth-bar-bg);
  border: 1px solid var(--auth-bar-border);
  border-radius: var(--auth-bar-radius);
  padding: 4px;
  box-shadow: var(--auth-bar-shadow);
  backdrop-filter: blur(8px);
}

.auth-bar__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--auth-bar-fg);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.auth-bar__tab:hover {
  background: rgba(255, 255, 255, 0.06);
}

.auth-bar__tab.active {
  background: var(--auth-bar-accent);
  color: #fff;
}

.auth-bar__tab--contact.active { background: var(--auth-bar-accent); }
.auth-bar__tab--login.active { background: #238636; }
.auth-bar__tab--user {
  padding: 4px 8px 4px 4px;
}

.auth-bar__role-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--auth-bar-muted);
  margin-left: 4px;
}

.auth-bar__role-badge--godadmin {
  background: var(--auth-bar-red);
  color: #fff;
}

.auth-bar__panels {
  position: relative;
}

.auth-bar__panel {
  width: min(360px, calc(100vw - 32px));
  background: var(--auth-bar-bg);
  border: 1px solid var(--auth-bar-border);
  border-radius: var(--auth-bar-radius);
  padding: 16px;
  box-shadow: var(--auth-bar-shadow);
  backdrop-filter: blur(8px);
  animation: auth-bar-slide 0.2s ease-out;
}

@keyframes auth-bar-slide {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.auth-bar__panel p {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--auth-bar-fg);
  line-height: 1.5;
}

.auth-bar__contact-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-bar__contact-form textarea {
  width: 100%;
  min-height: 80px;
  max-height: 200px;
  background: var(--bg, #0d1117);
  border: 1px solid var(--auth-bar-border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--auth-bar-fg);
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
}

.auth-bar__contact-form textarea:focus {
  outline: none;
  border-color: var(--auth-bar-accent);
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.auth-bar__contact-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auth-bar__char-count {
  font-size: 0.75rem;
  color: var(--auth-bar-muted);
}

.auth-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--auth-bar-accent);
  border: 1px solid var(--auth-bar-accent);
  border-radius: 6px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  font-family: inherit;
}

.auth-bar__btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.auth-bar__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.auth-bar__btn--github {
  background: #238636;
  border-color: #238636;
  width: 100%;
  justify-content: center;
  padding: 8px 14px;
}

.auth-bar__btn--primary {
  background: var(--auth-bar-accent);
}

.auth-bar__btn--ghost {
  background: transparent;
  color: var(--auth-bar-fg);
  border-color: var(--auth-bar-border);
}

.auth-bar__btn--ghost:hover {
  border-color: var(--auth-bar-accent);
  color: var(--auth-bar-accent);
  background: transparent;
  filter: none;
}

.auth-bar__login-note {
  font-size: 0.75rem;
  color: var(--auth-bar-muted);
  margin-top: 8px;
  margin-bottom: 0;
}

.auth-bar__dashboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-bar__dashboard .auth-bar__btn {
  justify-content: center;
  width: 100%;
}

.auth-bar__user-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-bar__user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-bar__user-info > div {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
}

.auth-bar__user-login {
  color: var(--auth-bar-muted);
  font-size: 0.75rem;
}

.auth-bar__user-actions {
  display: flex;
  gap: 6px;
}

.auth-bar__user-actions .auth-bar__btn {
  flex: 1;
  justify-content: center;
  font-size: 0.8rem;
  padding: 6px 10px;
}

.auth-bar__contact-success,
.auth-bar__contact-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  padding: 8px 10px;
  border-radius: 6px;
}

.auth-bar__contact-success {
  color: #3fb950;
  background: rgba(63, 185, 80, 0.1);
}

.auth-bar__contact-error {
  color: var(--auth-bar-red);
  background: rgba(248, 81, 73, 0.1);
}

.auth-bar__overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--auth-bar-z) - 1);
  background: transparent;
}

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

@media (max-width: 480px) {
  .auth-bar {
    top: 8px;
    right: 8px;
    left: 8px;
    align-items: stretch;
  }
  .auth-bar__inner { align-items: stretch; }
  .auth-bar__tabs {
    justify-content: center;
  }
  .auth-bar__panel {
    width: 100%;
  }
  .auth-bar__tab span {
    display: none;
  }
  .auth-bar__tab {
    padding: 8px 10px;
  }
}

/* svg-embed cross-repo truth */
.svg-embed {
  margin: 1rem 0;
  text-align: center;
}
.svg-embed img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border, #30363d);
  border-radius: 6px;
  display: block;
  margin: 0 auto;
}
.svg-embed figcaption {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted, #6e7681);
}
