/* Three groups: brand, primary navigation, and wallet/profile actions. */
.hd {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 20px;
  height: 64px;
  padding-inline: clamp(16px, 2.4vw, 32px);
  background: #101012ed;
  border-bottom: 1px solid #29292e;
}
.header-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-brand .logo { flex: none; gap: 8px; font-size: 20px; letter-spacing: -.04em; }
.header-demo { padding: 4px 7px; border: 1px solid #34c58f35; border-radius: 6px; color: var(--ac); background: #34c58f0b; font-size: 9px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.hd .nav {
  position: static;
  left: auto;
  right: auto;
  transform: none;
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 5px;
  height: 40px;
  padding: 3px;
  border: 1px solid #ffffff07;
  border-radius: 12px;
  background: #ffffff03;
}
.hd .nav a { display: flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 16px; border: 1px solid transparent; border-radius: 8px; color: var(--mut); font-size: 12px; font-weight: 600; letter-spacing: 0; transition: color .15s, background .15s, border-color .15s; }
.hd .nav a::after { display: none; }
.hd .nav a.on {
  color: var(--ac);
  border-color: #34c58f55;
  background: linear-gradient(180deg, #34c58f2e, #34c58f14);
  box-shadow: inset 0 1px 0 #ffffff24, inset 0 -1px 0 #00000025,
    0 3px 0 #123b2d, 0 5px 9px #00000035;
  transform: translateY(-2px);
}
.hd .nav a:hover:not([aria-disabled="true"]) { color: var(--tx); background: #ffffff07; }
.hd .nav a.on:hover { color: var(--ac); background: linear-gradient(180deg, #34c58f3a, #34c58f20); }
.hd .nav a.on:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 3px #00000025, 0 1px 0 #123b2d;
}
.hd .nav a[aria-disabled="true"] { color: #777780; cursor: default; }
.header-soon { padding: 2px 4px; border-radius: 4px; background: #ffffff06; font-size: 8px; font-weight: 500; color: #81818b; }
.hd .hr { margin-left: 0; justify-self: end; display: flex; align-items: center; gap: 10px; min-width: 0; }
.hd .header-wallet { flex: none; }
.hd .ib, .hd .av { flex: none; }
.hd .av { width: 38px; height: 38px; font-size: 12px; }
.hd .menu { top: 59px; }
@media (min-width: 1001px) and (max-width: 1200px) {
  .hd { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; }
  .header-brand { gap: 8px; }
  .header-brand .logo { font-size: 18px; }
  .hd .nav a { padding-inline: 8px; }
}
@media (max-width: 1000px) {
  .hd { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 60px 44px; height: 108px; gap: 0 12px; padding-bottom: 4px; }
  .header-brand { grid-column: 1; grid-row: 1; }
  .hd .hr { grid-column: 2; grid-row: 1; }
  .hd .nav { grid-column: 1 / -1; grid-row: 2; height: 38px; }
  .hd .nav a { height: 30px; min-width: 80px; }
  .shell { min-height: calc(100dvh - 108px); }
}
@media (max-width: 600px) {
  .header-wordmark { display: none; }
  .header-brand { gap: 8px; }
  .header-brand .logo svg { width: 27px; height: 27px; }
  .hd .hr { gap: 7px; }
  .hd .ib, .hd .av { width: 34px; height: 34px; }
  .hd .header-wallet { height: 36px; border-radius: 10px; }
  .hd .header-wallet .balp, .hd .header-wallet .topup { height: 34px; }
  .hd .header-wallet .balp { padding-inline: 8px; font-size: 12px; max-width: 150px; }
  .hd #bal { overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 440px) {
  .hd { padding-inline: 12px; gap: 0 8px; }
  .topup-label { display: none; }
  .hd .header-wallet .topup { width: 36px; padding: 0; justify-content: center; }
  .hd .nav a { min-width: 92px; padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) { .hd .nav a { transition: none; } }

/* A shared surface morphs its position and width instead of swapping tab boxes. */
.hd .nav.nav-morph { position: relative; isolation: isolate; }
.nav-active-surface {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  pointer-events: none;
  width: var(--nav-width, 0px);
  height: var(--nav-height, 32px);
  transform: translate3d(var(--nav-x, 0px), var(--nav-y, 0px), 0);
  border: 1px solid #34c58f55;
  border-radius: 8px;
  background: linear-gradient(180deg, #34c58f2e, #34c58f14);
  box-shadow: inset 0 1px 0 #ffffff24, inset 0 -1px 0 #00000025,
    0 3px 0 #123b2d, 0 5px 9px #00000035;
  opacity: 0;
  transition: transform 420ms cubic-bezier(.22, 1, .36, 1),
    width 420ms cubic-bezier(.22, 1, .36, 1),
    height 420ms cubic-bezier(.22, 1, .36, 1), opacity 160ms ease;
}
.nav-morph.has-active-tab .nav-active-surface { opacity: 1; }
.hd .nav.nav-morph a { position: relative; z-index: 1; transition: color 240ms ease, background 160ms ease; }
.hd .nav.nav-morph a.on,
.hd .nav.nav-morph a.on:hover,
.hd .nav.nav-morph a.on:active { border-color: transparent; background: transparent; box-shadow: none; transform: none; }
.hd .nav.nav-morph a:hover:not(.on):not([aria-disabled="true"]) { background: #ffffff04; }
.nav-measuring .nav-active-surface { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .nav-active-surface, .hd .nav.nav-morph a { transition: none; }
}
@media (max-width: 600px) {
  .hd .nav { width: 100%; max-width: 420px; }
  .hd .nav a { min-width: 0; flex: 1; padding-inline: 8px; }
}
@media (max-width: 440px) {
  .hd .nav a { padding-inline: 6px; gap: 3px; font-size: 11px; }
  .header-soon { display: none; }
}

