/* Account menu → kit x-ddm. Compact (anh): narrow, 12px, tight pad. Clip-path var(--st) reveal. */
/* pu-5: preview wallet chip + overlay popup (no scrim). */

/* Connected top-bar wallet chip. JS adds .v2-wallet-fit (acctmenu paintWalletBtn).
   Preview: inverted block (--tx bg / --ink text) + pixel wallet icon + short addr. */
.v2-nav .v2-wallet.v2-wallet-fit,
.v2-prof-nav .v2-wallet.v2-wallet-fit,
.v2-tab-nav .v2-wallet.v2-wallet-fit,
body.v2-land .v2-nav .v2-wallet.v2-wallet-fit,
.v2-inv .v2-nav .v2-wallet.v2-wallet-fit,
.v2-nf-bar .v2-wallet.v2-wallet-fit {
  max-width: min(56vw, 18em);
  min-width: 0;
  flex: 0 1 auto;
  background: var(--tx);
  color: var(--ink);
  border-right: 0;
}
.v2-nav .v2-wallet.v2-wallet-fit .v2-wallet-go,
.v2-prof-nav .v2-wallet.v2-wallet-fit .v2-wallet-go,
.v2-tab-nav .v2-wallet.v2-wallet-fit .v2-wallet-go,
body.v2-land .v2-nav .v2-wallet.v2-wallet-fit .v2-wallet-go,
.v2-inv .v2-nav .v2-wallet.v2-wallet-fit .v2-wallet-go,
.v2-nf-bar .v2-wallet.v2-wallet-fit .v2-wallet-go {
  /* ~90px short addr; never shrink below that (Trade copy sits beside this). */
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  min-width: 7.5em;
  max-width: 100%;
  flex: 1 1 auto;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 12px;
  background: transparent;
  color: var(--ink);
}
.v2-nav .v2-wallet.v2-wallet-fit .v2-wallet-go:hover,
.v2-prof-nav .v2-wallet.v2-wallet-fit .v2-wallet-go:hover,
.v2-tab-nav .v2-wallet.v2-wallet-fit .v2-wallet-go:hover,
body.v2-land .v2-nav .v2-wallet.v2-wallet-fit .v2-wallet-go:hover,
.v2-inv .v2-nav .v2-wallet.v2-wallet-fit .v2-wallet-go:hover,
.v2-nf-bar .v2-wallet.v2-wallet-fit .v2-wallet-go:hover,
.v2-nav .v2-wallet.v2-wallet-fit .v2-wallet-go:hover b,
[data-tile="nav"] .v2-wallet.v2-wallet-fit:hover b {
  color: var(--ink);
}
.v2-wallet.v2-wallet-fit .v2-wallet-go > span[hidden] {
  display: none;
}
.v2-wallet.v2-wallet-fit .v2-wallet-go > span:not([hidden]) {
  flex: 0 0 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
/* body.v2-land: landing.css colours the addr --v2-text at (0,3,1); keep it --ink on the filled chip. */
.v2-wallet.v2-wallet-fit .v2-wallet-addr,
body.v2-land .v2-nav .v2-wallet.v2-wallet-fit .v2-wallet-addr {
  flex: 0 1 auto;
  min-width: 7.5em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink);
  font-weight: 400;
}
.v2-wallet-ico {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: currentColor;
  color: inherit;
  shape-rendering: crispEdges;
}
/* Link status on the top-bar chip. pending uses the kit spinner; it must not stick. */
.v2-wallet-go .v2-wstat-spin {
  flex: 0 0 10px;
  min-width: 10px;
  overflow: visible;
}
.v2-wallet.v2-wallet-fit .v2-wallet-go > .v2-wstat-spin:not([hidden]) {
  flex: 0 0 10px;
  min-width: 10px;
  overflow: visible;
}
.v2-wstat-spin[hidden] {
  display: none;
}
.v2-wallet-go .v2-wstat-spin i,
#tdModal .wli .x-spin i {
  background: currentColor;
}
.v2-wallet[data-v2-wstat="error"] .v2-wallet-go,
.v2-wallet[data-v2-wstat="error"] .v2-wallet-go b {
  color: var(--crit-tx);
}
.v2-wallet.v2-wallet-fit .v2-copy {
  color: var(--ink);
}
.v2-wallet.v2-wallet-fit .v2-copy:hover {
  color: var(--acc-hi);
}

@keyframes x-pop {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* Wallet menu overlays the terminal — no dim / hide / reflow; root ignores hits. */
.v2-ac {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: block;
  pointer-events: none;
  background: transparent;
}
.v2-ac[hidden] {
  display: none;
}
.v2-ac-panel.x-ddm,
.v2-ac-panel {
  position: fixed;
  z-index: 1;
  top: calc(var(--v2-nav-h, 44px) + 4px);
  right: 12px;
  width: min(280px, calc(100vw - 24px));
  max-height: calc(100vh - 64px);
  overflow: auto;
  background: var(--tile);
  border: 1px solid var(--acc);
  box-shadow: var(--v2-shadow-4) var(--acc);
  color: var(--tx);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  font: 400 12px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  clip-path: inset(0 0 100% 0);
}
.v2-ac:not([hidden]) .v2-ac-panel {
  animation: x-pop 160ms var(--st) forwards;
}
.v2-ac-hd {
  height: var(--v2-hd-h);
  flex: 0 0 var(--v2-hd-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  background: var(--alt);
  border-bottom: 1px solid var(--line);
  color: var(--mute);
  font-size: var(--fs-12);
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.v2-ac-x {
  margin-left: auto;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
}
.v2-ac-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  padding: 0;
}
.v2-ac-top,
.v2-ac-g {
  background: var(--tile);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.v2-ac-id {
  display: flex;
  align-items: center;
  gap: 8px;
}
.v2-ac-id .v2-copy {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--mute);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  cursor: var(--cur-pointer);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.v2-ac-id .v2-copy:hover {
  color: var(--acc-hi);
}
.v2-ac-id .v2-copy svg,
.v2-ac-id .v2-copy .x-ico {
  width: 16px;
  height: 16px;
}
.v2-ac-val {
  font-size: var(--v2-fs-equity);
}
.v2-ac-sub {
  color: var(--mute);
}
.v2-ac-row {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  width: 100%;
  min-height: 44px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: var(--cur-pointer);
  text-align: left;
}
.v2-ac-row.st {
  cursor: var(--cur-default);
}
button.v2-ac-row:hover,
button.v2-ac-row:focus-visible {
  background: var(--acc-hi);
  color: var(--ink);
  outline: 0;
}
.v2-ac-n {
  flex: 1 1 auto;
  min-width: 0;
}
.v2-ac-v {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.v2-ac-v.mut,
.mut {
  color: var(--mute);
  font-weight: 400;
}
.v2-ac-v.up {
  color: var(--acc-hi);
}
.v2-ac-tog {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 20px;
  padding: 0 6px;
  background: var(--alt);
  color: var(--mute);
  font-weight: 700;
}
.v2-ac-tog.on {
  background: var(--acc-hi);
  color: var(--ink);
}
.mono {
  font-variant-numeric: tabular-nums;
}

.v2-ac-cex {
  display: flex;
  align-items: stretch;
  min-height: 44px;
}
.v2-ac-cex > .v2-ac-row {
  flex: 1 1 auto;
  min-width: 0;
}
.v2-cexdlg.v2-veil {
  z-index: 140;
}
.v2-cexdlg-logo {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 8px;
}
.v2-cexdlg .v2-modal {
  max-height: calc(100vh - 32px);
  overflow: auto;
}
.v2-cexdlg .x-field {
  width: 100%;
}
.v2-cex-ref {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.v2-cex-ref-i {
  flex: 0 0 auto;
  color: var(--acc-hi);
}
.v2-cex-ref a {
  display: flex;
  align-items: center;
  min-height: 22px;
  color: inherit;
  text-decoration: none;
}
.v2-cex-ref a:hover,
.v2-cex-ref a:focus-visible {
  color: var(--tx);
  text-decoration: underline;
}
.v2-cex-ref a:focus-visible {
  outline: 1px solid var(--acc);
  outline-offset: 2px;
}
@media (pointer: coarse) {
  .v2-cex-ref a {
    min-height: 44px;
  }
}
/* Key terms line + note (kit x-tip, opened under the line so it never leaves the modal). */
.v2-cex-tos {
  display: flex;
  margin: 0 0 8px;
}
.v2-cex-tos-b {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--mute);
  text-align: left;
  cursor: help;
}
.v2-cex-tos-b:hover,
.v2-cex-tos-b:focus-visible,
.v2-cex-tos.on .v2-cex-tos-b {
  color: var(--tx);
  text-decoration: underline;
}
.v2-cex-tos-b:focus-visible {
  outline: 1px solid var(--acc);
  outline-offset: 2px;
}
.v2-cex-tos [role="tooltip"] {
  top: calc(100% + 4px);
  bottom: auto;
  right: 0;
  display: grid;
  gap: 4px;
  white-space: normal;
  padding: 8px;
  box-shadow: var(--v2-shadow-4) var(--acc);
  z-index: 6;
}
.v2-cex-tos.on [role="tooltip"] {
  clip-path: inset(0);
}
@media (pointer: coarse) {
  .v2-cex-tos-b {
    min-height: 44px;
  }
}
.v2-cex-err {
  margin: 8px 0 0;
  color: var(--crit-tx);
  font-family: var(--mono);
  font-size: var(--fs-12);
  font-weight: 400;
}
.v2-cexdlg [hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .v2-ac:not([hidden]) .v2-ac-panel {
    animation: none;
    clip-path: none;
  }
}

.v2-ac-who {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
