/* Shared public header; wallet dialogs retain their own styles. */
.voltra-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.voltra-header,
.voltra-header * {
  box-sizing: border-box;
}

.voltra-header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  inline-size: 100%;
  max-inline-size: 1216px;
  margin-inline: auto;
  padding: 24px 16px;
}

.voltra-header-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-inline-size: 0;
}

.voltra-header-brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  min-inline-size: 0;
  min-block-size: 42px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-sans), sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.voltra-header-brand img {
  display: block;
  flex: 0 0 26px;
  inline-size: 26px;
  block-size: 26px;
}

.voltra-header-dock {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: 3px;
  inline-size: 492px;
  min-inline-size: 0;
  padding: 4px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: var(--panel);
  box-shadow: 0 12px 34px rgb(0 0 0 / 30%), inset 0 1px rgb(255 255 255 / 3%);
}

.voltra-header .voltra-header-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 36px;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--mute);
  font-family: var(--font-jetbrains), ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.025em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.voltra-header-tab svg {
  display: block;
  flex: 0 0 16px;
  inline-size: 16px;
  block-size: 16px;
}

.voltra-header-more {
  position: relative;
  min-inline-size: 0;
}

.voltra-header-more > summary {
  list-style: none;
}

.voltra-header-more > summary::-webkit-details-marker {
  display: none;
}

.voltra-header-more > summary::marker {
  content: '';
}

.voltra-header-more[open] > .voltra-header-tab {
  background: var(--panel-3);
  color: var(--ink);
}

body[data-public-page] .voltra-header .voltra-header-tab:is([aria-current="page"], [data-current-section]) {
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}

.voltra-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 8px;
  min-inline-size: 0;
}

.voltra-header .voltra-header-create,
.voltra-header .voltra-header-connect[data-public-connect] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  block-size: 42px;
  min-block-size: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--font-sans), sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.voltra-header .voltra-header-create {
  gap: 8px;
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-ink);
}

.voltra-header .voltra-header-connect[data-public-connect] {
  min-inline-size: 94px;
  background: transparent;
  color: var(--ink-2);
}

.voltra-header .voltra-header-connect:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* Keep hover continuous while the pointer crosses into the open menu. */
.voltra-header-more[open]::after {
  content: '';
  position: absolute;
  inset-block-start: 100%;
  inset-inline-end: 0;
  inline-size: min(320px, calc(100vw - 32px));
  block-size: 12px;
}

.voltra-header-dropdown {
  position: absolute;
  inset-block-start: calc(100% + 12px);
  inset-inline-end: 0;
  z-index: 1;
  inline-size: min(320px, calc(100vw - 32px));
  max-block-size: calc(100dvh - 160px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 18px 48px rgb(0 0 0 / 40%);
}

.voltra-header-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.voltra-header .voltra-header-links a {
  display: flex;
  align-items: center;
  min-inline-size: 0;
  min-block-size: 40px;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--ink-2);
  font-family: var(--font-jetbrains), ui-monospace, monospace;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background-color 140ms ease, color 140ms ease;
}

body[data-public-page] .voltra-header .voltra-header-links a[aria-current="page"] {
  background: var(--panel-3);
  color: var(--ink);
  text-decoration: none;
}

.voltra-header-utilities {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.voltra-header .voltra-header-ca,
.voltra-header .voltra-header-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-inline-size: 0;
  min-block-size: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-jetbrains), ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.voltra-header-ca {
  flex: 0 0 130px;
  inline-size: 130px;
}

.voltra-header-ca > span:first-child {
  color: var(--brand);
}

.voltra-header-ca > span:nth-child(2) {
  min-inline-size: 0;
  font-size: 11px;
}

.voltra-header .voltra-header-ca:disabled {
  opacity: 0.6;
  cursor: default;
}

.voltra-header .voltra-header-social {
  flex: 0 0 38px;
  inline-size: 38px;
}

/* These two captured controls are replaced by the always-visible header. */
body[data-public-page]:has(.voltra-header) nav[aria-label="Sections"],
body[data-public-page] .voltra-header + div[class~="xl:hidden"]:has(> button[data-site-ca]) {
  display: none;
}

html:has(.voltra-header) {
  scroll-padding-block-start: 114px;
  scroll-padding-block-end: 24px;
}

@media (hover: hover) {
  .voltra-header .voltra-header-tab:hover {
    background: var(--panel-3);
    color: var(--ink);
  }

  body[data-public-page] .voltra-header .voltra-header-tab:is([aria-current="page"], [data-current-section]):hover {
    background: var(--ink-2);
    color: var(--bg);
  }

  .voltra-header .voltra-header-create:hover {
    background: color-mix(in srgb, var(--brand) 90%, white);
    transform: translateY(-1px);
  }

  .voltra-header .voltra-header-connect:not(:disabled):hover {
    border-color: var(--line-3);
    background: var(--panel);
    transform: translateY(-1px);
  }

  .voltra-header .voltra-header-links a:hover,
  .voltra-header .voltra-header-ca:not(:disabled):hover,
  .voltra-header .voltra-header-social:hover {
    background: var(--panel-3);
    color: var(--ink);
  }
}

/* Scale the entire dock without changing layout or animating pointer tracking. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .voltra-header-dock {
    --dock-hover-scale: 1.05;
    transform: scale(1);
    transform-origin: center;
    transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .voltra-header-dock:hover {
    transform: scale(var(--dock-hover-scale));
  }
}

@media (max-width: 1180px) {
  .voltra-header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px 16px;
    padding-block: 12px;
  }

  .voltra-header-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .voltra-header-dock {
    --dock-hover-scale: 1.015;
    grid-column: 1 / -1;
    grid-row: 2;
    inline-size: 100%;
  }

  html:has(.voltra-header) {
    scroll-padding-block-start: 150px;
  }
}

@media (max-width: 640px) {
  .voltra-header-inner {
    row-gap: 10px;
  }

  .voltra-header-identity {
    display: contents;
  }

  .voltra-header-brand {
    grid-column: 1;
    grid-row: 1;
  }

  .voltra-header-utilities {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
  }

  .voltra-header-dock {
    grid-row: 3;
  }

  .voltra-header-dropdown {
    max-block-size: calc(100dvh - 208px);
  }

  html:has(.voltra-header) {
    scroll-padding-block-start: 202px;
  }
}

@media (max-width: 600px) {
  .voltra-header .voltra-header-tab {
    flex-direction: column;
    gap: 2px;
    min-block-size: 44px;
    padding: 5px 2px;
    font-size: 8.5px;
    line-height: 12px;
    letter-spacing: 0.02em;
  }

  .voltra-header-brand {
    font-size: 13px;
    letter-spacing: 0.15em;
  }

}

@media (max-width: 480px) {
  .voltra-header .voltra-header-create {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-public-page] .voltra-header :is(.voltra-header-tab, .voltra-header-create, .voltra-header-connect, .voltra-header-links a, .voltra-header-ca, .voltra-header-social) {
    transition: none;
  }

  body[data-public-page] .voltra-header :is(.voltra-header-tab, .voltra-header-create, .voltra-header-connect):hover {
    transform: none;
  }
}
