:root {
  --nav-bg: rgba(8, 12, 22, 0.84);
  --nav-line: rgba(148, 163, 184, 0.14);
  --nav-text: #f8fafc;
  --nav-muted: #94a3b8;
  --nav-accent: #fdba74;
}

.global-nav-shell {
  position: sticky;
  top: 14px;
  z-index: 60;
  margin: 0 auto 18px;
}

.global-nav {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: 20px;
  border: 1px solid var(--nav-line);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.94), var(--nav-bg));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.global-nav-brand {
  display: grid;
  gap: 2px;
  min-width: 210px;
}

.global-nav-brand strong {
  color: var(--nav-text);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.global-nav-brand span {
  color: var(--nav-muted);
  font-size: 0.84rem;
}

.global-nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.global-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--nav-text);
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.66);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.global-nav-link:hover {
  transform: translateY(-1px);
  border-color: rgba(253, 186, 116, 0.3);
  background: rgba(15, 23, 42, 0.9);
}

.global-nav-link.is-active {
  border-color: rgba(253, 186, 116, 0.34);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.18), rgba(15, 23, 42, 0.78));
  color: #fff7ed;
}

.global-nav-link small {
  color: var(--nav-muted);
  font-size: 0.74rem;
}

.global-nav-link.is-active small {
  color: #fed7aa;
}

.auth-form,
.auth-stack {
  display: grid;
  gap: 12px;
}

.secret-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.secret-field input {
  min-width: 0;
}

.secret-toggle {
  min-width: 108px;
  white-space: nowrap;
}

button.is-loading,
.button-like.is-loading {
  position: relative;
  cursor: progress;
}

button.is-loading::after,
.button-like.is-loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: currentColor;
  display: inline-block;
  margin-left: 10px;
  vertical-align: -2px;
  animation: shared-spin 0.85s linear infinite;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.66;
  cursor: not-allowed;
}

.tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.tab-button {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 16px;
  min-width: 180px;
  background: transparent;
  color: inherit;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.tab-button:hover {
  transform: translateY(-1px);
  border-color: rgba(253, 186, 116, 0.22);
}

.tab-button.is-active {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.16), rgba(15, 23, 42, 0.88));
  border-color: rgba(253, 186, 116, 0.28);
}

.tab-button strong,
.tab-button span {
  display: block;
}

.tab-button span {
  margin-top: 4px;
  color: var(--nav-muted);
  font-size: 0.82rem;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes shared-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .global-nav {
    padding: 12px 14px;
  }

  .global-nav-links {
    width: 100%;
  }

  .global-nav-link {
    flex: 1 1 180px;
    justify-content: center;
  }

  .secret-field {
    grid-template-columns: 1fr;
  }

  .secret-toggle,
  .tab-button {
    min-width: 0;
    width: 100%;
  }

  .tabs {
    width: 100%;
    display: grid;
  }
}
