.wallet {
  appearance: none;
  position: relative;
  text-align: left;
  cursor: pointer;
}

.wallet:hover {
  border-color: #f1d79b;
  box-shadow: 0 8px 24px rgba(14, 38, 66, .18);
}

.wallet:focus-visible {
  outline: 3px solid rgba(212, 175, 55, .85);
  outline-offset: 3px;
}

.wallet.sandboxActive {
  color: #fff;
  border-color: #2d6bff;
  background: #174ab8;
}

.walletLayer {
  visibility: hidden;
  position: fixed;
  z-index: 340;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 23, 41, .76);
  opacity: 0;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.walletLayer.open {
  visibility: visible;
  opacity: 1;
}

.walletVault {
  position: relative;
  width: min(620px, 100%);
  max-height: min(760px, calc(100dvh - 32px));
  overflow: auto;
  color: #dbe4ee;
  border: 1px solid rgba(212, 175, 55, .35);
  border-radius: 8px;
  background: linear-gradient(180deg, #141c28, #101722);
  box-shadow: 0 28px 80px rgba(2, 6, 10, .6);
  transform: translateY(12px);
  transition: transform 180ms ease;
}

.walletLayer.open .walletVault {
  transform: translateY(0);
}

.walletClose {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  color: #fff8e8;
  border: 1px solid rgba(255, 248, 232, .42);
  border-radius: 6px;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}

.walletClose:hover,
.walletClose:focus-visible {
  border-color: #f1d79b;
  background: rgba(255, 255, 255, .08);
  outline: 0;
}

.vaultHeader {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 104px;
  padding: 18px 68px 18px 22px;
  color: #fff8e8;
  background: #091729;
}

.vaultHeader p,
.vaultHeader h2 {
  margin: 0;
}

.vaultHeader p {
  color: #89abff;
  font-family: var(--utility);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.vaultHeader h2 {
  margin-top: 4px;
  color: inherit;
  font-family: var(--display);
  font-size: clamp(25px, 5vw, 36px);
  line-height: 1;
}

.vaultCoin {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #fff;
  border: 2px solid #89abff;
  border-radius: 50%;
  background: #2d6bff;
  font: 900 23px/1 var(--utility);
  box-shadow: inset 0 0 0 4px #174ab8;
}

.sandboxSeal {
  padding: 6px 8px;
  color: #f1d79b;
  border: 1px solid #806730;
  border-radius: 4px;
  font-family: var(--utility);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.vaultIntro {
  margin: 0;
  padding: 18px 22px;
  color: #9aa8b8;
  border-bottom: 1px solid rgba(148, 163, 184, .2);
  font-size: 14px;
  line-height: 1.55;
}

.vaultBalance {
  padding: 20px 22px;
  border-bottom: 1px solid rgba(148, 163, 184, .2);
  background: rgba(10, 14, 20, .6);
}

.vaultBalance span,
.vaultBalance small {
  display: block;
  font-family: var(--utility);
}

.vaultBalance span {
  color: #9aa8b8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.vaultBalance strong {
  display: block;
  margin: 5px 0;
  color: #f0e6cd;
  font-size: clamp(28px, 7vw, 42px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.vaultBalance small {
  color: #2d6bff;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 560px) {
  .walletLayer { padding: 8px; }
  .walletVault { max-height: calc(100dvh - 16px); }
  .vaultHeader { grid-template-columns: 44px 1fr; padding: 16px 58px 16px 16px; }
  .vaultCoin { width: 40px; height: 40px; font-size: 19px; }
  .sandboxSeal { grid-column: 2; justify-self: start; }
  .vaultIntro,
  .vaultBalance { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .walletLayer,
  .walletVault { transition: none; }
}
