.global-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
  min-height: 72px;
  padding: 0 5vw;
  border-bottom: 1px solid rgba(207, 170, 93, 0.24);
  background: rgba(7, 17, 29, 0.96);
  box-shadow: 0 10px 36px rgba(2, 8, 14, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.global-header *,
.global-header *::before,
.global-header *::after {
  box-sizing: border-box;
}

.global-header .global-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.7rem;
  color: #fffaf0;
  font: 700 1.02rem/1.2 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.global-header .global-brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid rgba(222, 190, 119, 0.78);
  border-radius: 50%;
  color: #efd394;
  background: linear-gradient(145deg, rgba(239, 211, 148, 0.16), rgba(239, 211, 148, 0.03));
  font-size: 0.95rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.global-header .global-mode-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.global-header .global-mode-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.65rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(255, 250, 240, 0.72);
  background: transparent;
  font: 650 0.84rem/1 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.global-header .global-mode-nav a:hover,
.global-header .global-mode-nav a:focus-visible {
  color: #fffaf0;
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.global-header .global-mode-nav a[aria-current="page"] {
  color: #07111d;
  border-color: #efd394;
  background: linear-gradient(135deg, #f5dfab, #cda655);
  box-shadow: 0 6px 18px rgba(205, 166, 85, 0.22);
}

.global-header .global-mode-nav .global-all-calculators {
  margin-left: 0.25rem;
  color: #f4ddb0;
  border-color: rgba(239, 211, 148, 0.46);
  background: rgba(239, 211, 148, 0.07);
}

.global-header .global-mode-nav .global-all-calculators[aria-current="page"] {
  color: #07111d;
  border-color: #efd394;
  background: linear-gradient(135deg, #f5dfab, #cda655);
}

@media (max-width: 940px) {
  .global-header {
    position: relative;
    display: block;
    min-height: 0;
    padding: 0.8rem 0 0;
  }

  .global-header .global-brand {
    width: max-content;
    margin: 0 1rem 0.72rem;
  }

  .global-header .global-mode-nav {
    justify-content: flex-start;
    gap: 0.35rem;
    width: 100%;
    padding: 0 1rem 0.78rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    scroll-snap-type: inline proximity;
    -webkit-overflow-scrolling: touch;
  }

  .global-header .global-mode-nav::-webkit-scrollbar {
    display: none;
  }

  .global-header .global-mode-nav a {
    flex: 0 0 auto;
    min-height: 42px;
    padding-inline: 0.88rem;
    scroll-snap-align: start;
  }
}

@media (max-width: 520px) {
  .global-header .global-brand {
    font-size: 0.96rem;
  }

  .global-header .global-mode-nav a {
    font-size: 0.8rem;
  }
}

@media print {
  .global-header {
    display: none !important;
  }
}
