.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 6, 18, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
}

.auth-overlay[hidden] {
  display: none !important;
}

.auth-overlay--open {
  opacity: 1;
  animation: tb-overlay-in 0.26s ease both;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgb(12 16 43);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  padding: 28px 28px 24px;
  opacity: 0;
  transform: scale(0.96) translateY(10px);
}

.auth-card--open {
  animation: tb-scale-in 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-card__brand {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 8px;
}

.auth-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f8fafc;
  margin: 0 0 6px;
}

.auth-card__sub {
  margin: 0 0 20px;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: #94a3b8;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.auth-field label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #cbd5e1;
}

.auth-optional {
  font-weight: 500;
  color: #64748b;
}

.auth-hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #64748b;
}

.auth-field input {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgb(7 11 35);
  color: #f1f5f9;
  padding: 0 14px;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field input:focus {
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.auth-error {
  min-height: 1.25rem;
  font-size: 0.8125rem;
  color: #f87171;
  margin: 0 0 12px;
}

.auth-primary {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.auth-primary:hover {
  background: #3b82f6;
}

.auth-primary:active {
  transform: scale(0.98);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 16px;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.16);
}

.auth-google-wrap {
  min-height: 44px;
  width: 100%;
  display: flex;
  justify-content: stretch;
}

.auth-google-wrap > div {
  width: 100% !important;
  display: flex;
  justify-content: center;
}

.auth-google-fallback {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #fff;
  color: #1f2937;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-google-fallback[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 0.875rem;
  color: #94a3b8;
}

.auth-footer button {
  background: none;
  border: none;
  color: #60a5fa;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
}

.auth-close:hover {
  color: #f1f5f9;
  background: rgba(148, 163, 184, 0.2);
}

.auth-card-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
}

.auth-google-btn {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #fff;
  color: #1f2937;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-google-btn:hover {
  background: #f8fafc;
}

.auth-google-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-google-fallback .auth-google-btn__icon {
  display: inline-flex;
}

.currency-picker {
  position: relative;
  flex-shrink: 0;
}

.currency-picker__icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.currency-picker__icon .coin-icon {
  display: block;
  object-fit: contain;
}

.currency-picker__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px 0 8px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgb(18 23 49);
  color: #f1f5f9;
  cursor: pointer;
  font: inherit;
}

.currency-picker__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
  min-width: 0;
}

.currency-picker__sym {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.currency-picker__bal {
  font-size: 0.8125rem;
  font-weight: 700;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.currency-picker__chev {
  color: #64748b;
  flex-shrink: 0;
}

.currency-picker__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 120;
  min-width: 240px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgb(12 16 43);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.currency-picker__menu[hidden] {
  display: none;
}

.currency-picker__option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #e2e8f0;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.currency-picker__option:hover,
.currency-picker__option--active {
  background: rgba(59, 130, 246, 0.12);
}

.currency-picker__option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.currency-picker__option-name {
  font-size: 0.875rem;
  font-weight: 700;
}

.currency-picker__option-bal {
  font-size: 0.75rem;
  color: #94a3b8;
}

.topbar-auth-guest[hidden] {
  display: none !important;
}

body.is-logged-in .topbar-auth-guest {
  display: none !important;
}

.topbar-user-menu {
  position: relative;
}

.topbar-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px 0 4px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgb(18 23 49);
  color: #f1f5f9;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  max-width: 180px;
  cursor: pointer;
}

.topbar-user-chip:hover,
.topbar-user-menu:has(.topbar-user-dropdown:not([hidden])) .topbar-user-chip {
  border-color: rgba(59, 130, 246, 0.45);
}

.topbar-user-chip__chev {
  flex-shrink: 0;
  color: #64748b;
}

.topbar-user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 150;
  min-width: 200px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(52, 60, 100, 0.85);
  background: rgb(18 23 49);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.topbar-user-dropdown[hidden] {
  display: none;
}

.topbar-user-dropdown__item {
  display: flex;
  width: 100%;
  align-items: center;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #e2e8f0;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.topbar-user-dropdown__item:hover {
  background: rgb(12 16 43);
  color: #fff;
}

.topbar-user-dropdown__item--admin {
  color: #fbbf24;
}

.topbar-user-dropdown__item--danger {
  color: #f87171;
}

.topbar-user-chip__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.topbar-user-chip__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
