/* ========== Withdraw Crypto — send-style mobile flow ========== */
#section-withdraw {
  --nxwc-accent: #3179ff;
  --nxwc-accent-hover: #2563eb;
  --nxwc-accent-soft: rgba(49, 121, 255, 0.12);
  --nxwc-accent-muted: rgba(49, 121, 255, 0.45);
  --nxwc-card: #ffffff;
  --nxwc-page: #f4f5f7;
  --nxwc-border: #e8eaed;
  --nxwc-text: #0a0b0d;
  --nxwc-muted: #5b616e;
  --nxwc-soft: #f0f1f3;
  --nxwc-row-hover: #f7f8fa;
  --nxwc-info-bg: #eef5ff;
  --nxwc-info-text: #1a56db;
  --nxwc-info-body: #3b6fd9;
  --nxwc-danger: #dc2626;
  --nxwc-radius: 16px;
  --nxwc-radius-sm: 12px;
}

body.dark-mode #section-withdraw {
  --nxwc-card: #111111;
  --nxwc-page: #0c0c0c;
  --nxwc-border: #2a2a2a;
  --nxwc-text: #f3f4f6;
  --nxwc-muted: #9ca3af;
  --nxwc-soft: #1a1a1a;
  --nxwc-row-hover: #1a1a1a;
  --nxwc-info-bg: rgba(49, 121, 255, 0.12);
  --nxwc-info-text: #93c5fd;
  --nxwc-info-body: #bfdbfe;
  --nxwc-accent-soft: rgba(49, 121, 255, 0.18);
}

#section-withdraw h3 {
  font-weight: 500;
}

.nxwc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Match top/bottom content-wrapper padding on withdraw only */
.content-wrapper:has(#section-withdraw.active) {
  padding: 22px 16px;
}

.nxwc-root {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nxwc-main {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.nxwc-shell {
  --nxwc-chrome: 115px; /* sticky header (~71) + content-wrapper pads (22+22) */
  background: var(--nxwc-card);
  border: 1px solid var(--nxwc-border);
  border-radius: 20px;
  overflow: hidden;
  /*
   * Fit in the first viewport so content-wrapper bottom padding is visible
   * without scrolling the page. Never let min-height exceed available space.
   */
  height: calc(100dvh - var(--nxwc-chrome));
  max-height: calc(100dvh - var(--nxwc-chrome));
  min-height: min(560px, calc(100dvh - var(--nxwc-chrome)));
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
}

.nxwc-root.is-restricted .nxwc-main {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.2);
  min-width: 0;
}

/* Leave room for the banner; height tracks content so wrapping text stays in view */
.nxwc-root.is-restricted .nxwc-shell {
  height: auto;
  max-height: calc(100dvh - var(--nxwc-chrome) - 7.5rem);
  min-height: min(400px, calc(100dvh - var(--nxwc-chrome) - 7.5rem));
}

.nxwc-restriction {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: clamp(12px, 2vw, 16px);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: #fff8eb;
  border: 1px solid #f5d78e;
  border-radius: var(--nxwc-radius);
  padding: clamp(12px, 2.4vw, 18px) clamp(14px, 2.8vw, 20px);
}

/* Author display:flex overrides the UA [hidden] rule — restore hide behavior */
.nxwc-restriction[hidden] {
  display: none !important;
}

body.dark-mode .nxwc-restriction {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}

.nxwc-restriction-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(36px, 8vw, 42px);
  height: clamp(36px, 8vw, 42px);
  border-radius: 50%;
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
}

body.dark-mode .nxwc-restriction-icon {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.nxwc-restriction-icon svg {
  width: clamp(18px, 4vw, 22px);
  height: clamp(18px, 4vw, 22px);
  display: block;
}

.nxwc-restriction-body {
  flex: 1 1 auto;
  min-width: 0;
}

.nxwc-restriction h3 {
  margin: 0 0 6px;
  font-size: clamp(15px, 2.6vw, 16px);
  font-weight: 600;
  color: var(--nxwc-text);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.nxwc-restriction p {
  margin: 0;
  font-size: clamp(13px, 2.4vw, 14px);
  color: var(--nxwc-muted);
  line-height: 1.45;
  overflow-wrap: break-word;
}

.nxwc-restriction-btn {
  position: relative;
  display: inline-block;
  border: 0;
  background: transparent;
  color: var(--nxwc-accent);
  font-weight: 600;
  font-size: 15px;
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
  padding: 0;
  margin: 0;
  white-space: nowrap;
  vertical-align: baseline;
  overflow: hidden;
  isolation: isolate;
}

.nxwc-restriction-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0) 28%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0) 72%,
    transparent 100%
  );
  transform: translateX(-130%);
  animation: nxwc-restriction-btn-sweep 2.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes nxwc-restriction-btn-sweep {
  0% {
    transform: translateX(-130%);
  }
  100% {
    transform: translateX(240%);
  }
}

/* Top bar — send chrome (pinned; list scrolls below) */
.nxwc-topbar {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 8px;
}

.nxwc-back {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: var(--nxwc-soft);
  color: var(--nxwc-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.nxwc-back[hidden] {
  visibility: hidden !important;
  display: inline-flex !important;
  pointer-events: none;
}

.nxwc-back svg {
  width: 18px;
  height: 18px;
}

.nxwc-topbar-title {
  margin: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: var(--nxwc-text);
  letter-spacing: -0.01em;
}

.nxwc-topbar-spacer {
  width: 36px;
  height: 36px;
}

.nxwc-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.nxwc-screen {
  display: none;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  padding: 8px 16px 20px;
  overflow: hidden;
}

.nxwc-screen.is-active {
  display: flex;
}

/* Asset / network: pin chrome, scroll only the list */
.nxwc-screen[data-nxwc-screen="asset"].is-active,
.nxwc-screen[data-nxwc-screen="network"].is-active {
  overflow: hidden;
}

.nxwc-screen[data-nxwc-screen="destination"].is-active,
.nxwc-screen[data-nxwc-screen="verify"].is-active {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Search */
.nxwc-search {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--nxwc-soft);
  border-radius: 999px;
  padding: 0 14px;
  height: 44px;
  margin-bottom: 8px;
}

.nxwc-search-icon {
  width: 18px;
  height: 18px;
  color: var(--nxwc-muted);
  flex-shrink: 0;
}

.nxwc-search input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 15px;
  color: var(--nxwc-text);
  outline: none;
  min-width: 0;
}

.nxwc-search input::placeholder {
  color: #9aa0a6;
}

.nxwc-avail-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 4px 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--nxwc-soft);
}

.nxwc-avail-chip span {
  font-size: 13px;
  color: var(--nxwc-muted);
}

.nxwc-avail-chip strong {
  font-size: 15px;
  font-weight: 500;
  color: var(--nxwc-text);
}

/* Asset / network rows — only this region scrolls */
.nxwc-list {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  /* Match wallet portfolio: thin overlay scrollbar at the container edge */
  margin: 0 -16px;
  padding: 4px 0 8px;
  scrollbar-gutter: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.35) transparent;
}

body.dark-mode #section-withdraw .nxwc-list {
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.nxwc-screen[data-nxwc-screen="network"] .nxwc-info-callout {
  flex-shrink: 0;
}

.nxwc-row,
.nxwc-recent-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  /* Horizontal pad clears thin edge scrollbar (same idea as .nxw-asset-row) */
  padding: 14px 20px;
  border-radius: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  box-sizing: border-box;
}

.nxwc-row:hover,
.nxwc-recent-row:hover {
  background: var(--nxwc-row-hover);
}

.nxwc-row-logo {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--nxwc-soft);
}

.nxwc-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nxwc-row-title {
  font-size: 15px;
  font-weight: 400;
  color: var(--nxwc-text);
  line-height: 1.25;
}

.nxwc-row-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--nxwc-muted);
  line-height: 1.25;
  text-transform: none;
}

.nxwc-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  min-width: 0;
}

.nxwc-row-side .nxwc-row-title {
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.nxwc-row-side .nxwc-row-sub {
  font-variant-numeric: tabular-nums;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*
 * USD fiat row — highlighted, not withdrawable.
 * Shell is ~500px beside pending panel, so use a clean 2-band card:
 * top = identity + balance (like crypto rows), bottom = hint + Exchange.
 */
.nxwc-usd-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: auto;
  box-sizing: border-box;
  margin: 4px 16px 10px;
  padding: 14px;
  border-radius: 16px;
  background: #eef5ff;
  border: 0;
  color: inherit;
  font: inherit;
}

body.dark-mode .nxwc-usd-row {
  background: rgba(49, 121, 255, 0.14);
}

.nxwc-usd-top {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.nxwc-usd-flag {
  width: 40px;
  height: 40px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.nxwc-usd-top .nxwc-row-title,
.nxwc-usd-top .nxwc-row-sub {
  font-weight: 400;
}

.nxwc-usd-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.nxwc-usd-hint {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  flex: 1 1 0;
  max-width: 100%;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  color: #2f6fed;
}

body.dark-mode .nxwc-usd-hint {
  color: #93c5fd;
}

.nxwc-usd-hint svg {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  flex-shrink: 0;
}

.nxwc-usd-hint span {
  min-width: 0;
  flex: 1 1 auto;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.nxwc-usd-exchange {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--nxwc-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.22);
  transition: background 0.15s ease, transform 0.12s ease;
}

.nxwc-usd-exchange:hover {
  background: var(--nxwc-accent-hover);
}

.nxwc-usd-exchange:active {
  transform: translateY(0.5px);
}

.nxwc-usd-exchange svg {
  width: 15px;
  height: 15px;
}

.nxwc-empty {
  padding: 32px 12px;
  text-align: center;
  color: var(--nxwc-muted);
  font-size: 14px;
}

/* Info callouts */
.nxwc-info-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--nxwc-soft);
  border-radius: var(--nxwc-radius-sm);
  padding: 14px 14px;
  margin: 4px 0 12px;
}

.nxwc-info-callout--blue {
  background: var(--nxwc-info-bg);
}

.nxwc-info-callout--blue strong {
  color: var(--nxwc-info-text);
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.nxwc-info-callout--blue p {
  margin: 0;
  color: var(--nxwc-info-body);
  font-size: 13px;
  line-height: 1.4;
}

.nxwc-info-callout p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--nxwc-muted);
}

.nxwc-info-ico {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--nxwc-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin-top: 1px;
}

.nxwc-info-callout--blue .nxwc-info-ico {
  background: var(--nxwc-accent);
}

/* Destination */
.nxwc-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--nxwc-text);
}

.nxwc-recent-head[hidden] {
  display: none !important;
}

.nxwc-recent-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--nxwc-accent);
}

.nxwc-recent-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: auto;
}

.nxwc-recent-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--nxwc-soft);
  color: var(--nxwc-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nxwc-recent-icon svg {
  width: 20px;
  height: 20px;
}

.nxwc-recent-row {
  grid-template-columns: 40px 1fr;
}

#nxwcDestContinue {
  margin-top: auto;
}

/* Amount screen */
.nxwc-screen--amount {
  padding-bottom: 12px;
}

.nxwc-amount-hero {
  padding: 28px 4px 8px;
}

.nxwc-amount-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.nxwc-amount-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.nxwc-amount-big {
  font-size: clamp(40px, 9vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--nxwc-text);
  line-height: 1;
  word-break: break-all;
}

.nxwc-amount-unit {
  font-size: 26px;
  font-weight: 500;
  color: #9aa0a6;
}

.nxwc-max-pill {
  border: 0;
  background: var(--nxwc-soft);
  color: var(--nxwc-text);
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  margin-top: 8px;
  flex-shrink: 0;
}

.nxwc-amount-toggle {
  border: 0;
  background: transparent;
  color: var(--nxwc-accent);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 0 0;
  cursor: pointer;
}

.nxwc-asset-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  margin-top: 8px;
}

.nxwc-asset-bar img {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--nxwc-soft);
}

.nxwc-asset-bar-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nxwc-asset-bar-text strong {
  font-size: 15px;
  font-weight: 500;
  color: var(--nxwc-text);
}

.nxwc-asset-bar-text span {
  font-size: 13px;
  color: var(--nxwc-muted);
}

.nxwc-amount-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
}

.nxwc-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 8px;
  user-select: none;
}

.nxwc-keypad button {
  border: 0;
  background: transparent;
  color: var(--nxwc-text);
  font-size: 26px;
  font-weight: 400;
  height: 56px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nxwc-keypad button:active {
  background: var(--nxwc-soft);
}

.nxwc-keypad button svg {
  width: 26px;
  height: 26px;
}

/* Buttons */
.nxwc-btn {
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.nxwc-btn--primary {
  background: var(--nxwc-accent);
  color: #fff;
}

.nxwc-btn--primary:hover {
  background: var(--nxwc-accent-hover);
}

.nxwc-btn--primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.nxwc-btn--block {
  width: 100%;
}

.nxwc-btn--ghost {
  background: var(--nxwc-soft);
  color: var(--nxwc-text);
}

.nxwc-btn--soft {
  background: var(--nxwc-accent-soft);
  color: var(--nxwc-accent);
}

.nxwc-btn--soft.is-disabled,
.nxwc-btn--soft:disabled {
  color: var(--nxwc-accent-muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.nxwc-field-error {
  display: block;
  min-height: 0;
  margin: 6px 4px 0;
  font-size: 12px;
  color: var(--nxwc-danger);
}

.nxwc-field-error:empty {
  display: none;
}

/* Confirm */
.nxwc-screen--confirm {
  padding-bottom: 16px;
}

.nxwc-confirm-hero {
  text-align: center;
  padding: 12px 8px 20px;
}

.nxwc-confirm-logo {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  object-fit: cover;
  margin-bottom: 14px;
  background: var(--nxwc-soft);
}

.nxwc-confirm-hero h4 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
  color: var(--nxwc-text);
  letter-spacing: -0.02em;
}

.nxwc-confirm-hero p {
  margin: 0;
  font-size: 15px;
  color: var(--nxwc-muted);
}

.nxwc-confirm-rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 4px 4px;
}

.nxwc-confirm-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  font-size: 14px;
}

.nxwc-confirm-row > span {
  color: var(--nxwc-muted);
  flex-shrink: 0;
}

.nxwc-confirm-row > strong {
  color: var(--nxwc-text);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
  max-width: 68%;
}

.nxwc-confirm-net {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nxwc-confirm-net img {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  object-fit: cover;
}

.nxwc-confirm-footer {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nxwc-confirm-total {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: 0 4px;
}

.nxwc-confirm-total > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nxwc-confirm-total strong {
  font-size: 15px;
  font-weight: 500;
  color: var(--nxwc-text);
}

.nxwc-confirm-total span {
  font-size: 12px;
  color: var(--nxwc-muted);
}

.nxwc-confirm-total > strong {
  font-size: 17px;
  font-weight: 600;
}

/* Verify */
.nxwc-verify-panel {
  background: var(--nxwc-soft);
  border-radius: var(--nxwc-radius);
  padding: 20px 16px;
  margin-top: 8px;
}

.nxwc-verify-panel h4 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--nxwc-text);
}

.nxwc-verify-panel > p {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--nxwc-muted);
  line-height: 1.45;
}

.nxwc-code-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--nxwc-border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-align: center;
  background: var(--nxwc-card);
  color: var(--nxwc-text);
  outline: none;
}

.nxwc-code-input:focus {
  border-color: var(--nxwc-accent);
  box-shadow: 0 0 0 3px var(--nxwc-accent-soft);
}

.nxwc-code-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 12px 0 16px;
  font-size: 13px;
  color: var(--nxwc-muted);
}

.nxwc-resend-btn {
  border: 0;
  background: transparent;
  color: var(--nxwc-accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.nxwc-resend-btn:disabled {
  color: var(--nxwc-muted);
  cursor: not-allowed;
}

/* Pending sidebar */
.nxwc-pending {
  background: var(--nxwc-card);
  border: 1px solid var(--nxwc-border);
  border-radius: 20px;
  padding: 16px;
  min-height: 200px;
}

.nxwc-pending-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.nxwc-pending-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--nxwc-text);
}

.nxwc-pending-refresh {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--nxwc-soft);
  color: var(--nxwc-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.nxwc-pending-refresh svg {
  width: 16px;
  height: 16px;
}

.nxwc-pending-refresh.is-spinning svg {
  animation: nxwc-spin 0.6s linear;
}

@keyframes nxwc-spin {
  to {
    transform: rotate(360deg);
  }
}

.nxwc-pending-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nxwc-pending-empty {
  padding: 28px 8px;
  text-align: center;
  color: var(--nxwc-muted);
  font-size: 13px;
}

.nxwc-pending-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: var(--nxwc-soft);
}

.nxwc-pending-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--nxwc-card);
  flex-shrink: 0;
}

.nxwc-pending-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nxwc-pending-body {
  min-width: 0;
  flex: 1;
}

.nxwc-pending-amount {
  font-size: 15px;
  font-weight: 500;
  color: var(--nxwc-text);
}

.nxwc-pending-sub {
  font-size: 12px;
  color: var(--nxwc-muted);
}

.nxwc-pending-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--nxwc-muted);
}

.nxwc-pending-status {
  text-transform: capitalize;
  font-weight: 500;
}

.nxwc-pending-status.pending {
  color: #d97706;
}

.nxwc-pending-status.approved,
.nxwc-pending-status.completed {
  color: #16a34a;
}

.nxwc-pending-status.rejected,
.nxwc-pending-status.failed {
  color: var(--nxwc-danger);
}

/* Responsive — tablet: stack shell + pending */
@media (max-width: 960px) {
  .nxwc-main {
    grid-template-columns: 1fr;
    /* Base rule uses align-items:start which shrink-wraps the shell */
    align-items: stretch;
  }

  .nxwc-shell {
    width: 100%;
    max-width: none;
    height: calc(100dvh - var(--nxwc-chrome));
    max-height: calc(100dvh - var(--nxwc-chrome));
    min-height: min(480px, calc(100dvh - var(--nxwc-chrome)));
  }
}

/*
 * Mobile immersive send chrome (≤768):
 * Match screenshot — full-bleed flow, no app top header / bottom nav.
 * Desktop layout above is unchanged.
 */
@media (max-width: 768px) {
  body:has(#section-withdraw.active) .top-header {
    display: none !important;
  }

  body:has(#section-withdraw.active) .mobile-bottom-nav {
    display: none !important;
  }

  body:has(#section-withdraw.active) .main-content {
    padding-bottom: 0 !important;
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  body:has(#section-withdraw.active) .content-wrapper {
    padding: 0 !important;
    flex: 1 1 0%;
    min-height: 0;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #section-withdraw.active {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 0%;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--nxwc-card);
  }

  #section-withdraw.active .nxwc-root {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  #section-withdraw.active .nxwc-main {
    flex: 1 1 0%;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  /* Pending list is desktop/sidebar chrome — hide on phone send flow */
  #section-withdraw.active .nxwc-pending {
    display: none !important;
  }

  #section-withdraw.active .nxwc-shell {
    flex: 1 1 0%;
    align-self: stretch;
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 0;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
    background: var(--nxwc-card);
    overflow: hidden;
  }

  #section-withdraw.active .nxwc-root {
    width: 100%;
    max-width: none;
  }

  #section-withdraw.active .nxwc-form {
    flex: 1 1 0%;
    width: 100%;
    max-width: none;
    min-height: 0;
    overflow: hidden;
  }

  #section-withdraw.active .nxwc-topbar {
    flex-shrink: 0;
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    padding-left: 12px;
    padding-right: 12px;
    background: var(--nxwc-card);
  }

  /* Always show back on mobile (exits to wallet from first screen) */
  #section-withdraw.active .nxwc-back[hidden] {
    visibility: visible !important;
    display: inline-flex !important;
    pointer-events: auto;
  }

  /*
   * Restricted mobile: dim/block only the form — not the topbar back control.
   * Parent opacity on .nxwc-main would make the arrow look disabled and untappable.
   */
  #section-withdraw.active .nxwc-root.is-restricted .nxwc-main {
    opacity: 1;
    pointer-events: auto;
    filter: none;
  }

  #section-withdraw.active .nxwc-root.is-restricted .nxwc-form {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.2);
  }

  #section-withdraw.active .nxwc-root.is-restricted .nxwc-back,
  #section-withdraw.active .nxwc-root.is-restricted .nxwc-back[hidden] {
    opacity: 1;
    filter: none;
    pointer-events: auto;
    cursor: pointer;
  }

  #section-withdraw.active .nxwc-screen {
    padding-left: 16px;
    padding-right: 16px;
  }

  #section-withdraw.active .nxwc-screen.is-active {
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  #section-withdraw.active .nxwc-screen[data-nxwc-screen="asset"].is-active .nxwc-search {
    flex-shrink: 0;
  }

  #section-withdraw.active .nxwc-screen[data-nxwc-screen="asset"].is-active .nxwc-list,
  #section-withdraw.active .nxwc-screen[data-nxwc-screen="network"].is-active .nxwc-list {
    flex: 1 1 0%;
    min-height: 0;
    margin-left: -16px;
    margin-right: -16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, 0.35) transparent;
  }

  body.dark-mode #section-withdraw.active .nxwc-list {
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
  }

  #section-withdraw.active .nxwc-row {
    padding-left: 16px;
    /* Keep amounts clear of the edge scrollbar */
    padding-right: 24px;
  }

  #section-withdraw.active .nxwc-usd-row {
    margin: 4px 12px 10px;
  }

  #section-withdraw.active .nxwc-usd-action {
    flex-wrap: wrap;
  }

  #section-withdraw.active .nxwc-usd-exchange {
    margin-left: auto;
  }

  #section-withdraw.active .nxwc-screen[data-nxwc-screen="destination"].is-active,
  #section-withdraw.active .nxwc-screen[data-nxwc-screen="verify"].is-active {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* Amount: pin keypad to bottom of viewport */
  #section-withdraw.active .nxwc-screen--amount.is-active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  #section-withdraw.active .nxwc-screen--amount .nxwc-amount-hero {
    padding-top: 20px;
  }

  #section-withdraw.active .nxwc-screen--amount .nxwc-keypad {
    margin-top: auto;
    flex-shrink: 0;
  }

  #section-withdraw.active .nxwc-screen--confirm.is-active {
    display: flex;
    flex-direction: column;
  }

  #section-withdraw.active .nxwc-confirm-footer {
    margin-top: auto;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  #section-withdraw.active .nxwc-restriction {
    /* width:auto + stretch avoids 100%+margin horizontal overflow */
    width: auto;
    align-self: stretch;
    max-width: none;
    margin: 12px 16px 0;
    border-radius: 12px;
    padding: 14px 16px;
  }

  #section-withdraw.active .nxwc-root.is-restricted .nxwc-shell {
    /* Immersive shell already flex-fills; don't fight it with desktop max-height */
    height: 100%;
    max-height: none;
    min-height: 0;
  }

  @media (max-width: 400px) {
    #section-withdraw.active .nxwc-restriction {
      margin: 10px 12px 0;
      padding: 12px 14px;
    }

    #section-withdraw.active .nxwc-restriction-btn {
      white-space: normal;
    }
  }

  .nxwc-amount-big {
    font-size: 48px;
  }

  .nxwc-keypad button {
    height: 52px;
  }
}

@media (max-width: 360px) {
  #section-withdraw.active .nxwc-screen {
    padding-left: 12px;
    padding-right: 12px;
  }

  .nxwc-amount-big {
    font-size: 40px;
  }

  .nxwc-keypad button {
    height: 48px;
    font-size: 24px;
  }
}
