/* Wallet-only acceptance styling. Payment controls and handlers are unchanged. */
#wallet-add-funds .wallet-backup-button { gap: 10px; }
#wallet-add-funds .wallet-backup-label { white-space: nowrap; }
#wallet-add-funds .wallet-wechat-badge {
  --wallet-wechat-badge-bg: #e8f3ec;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 3px 7px;
  border: 1px solid rgba(21, 140, 80, 0.15);
  border-radius: 999px;
  background: var(--wallet-wechat-badge-bg);
  color: #16834f;
  font-size: 11px;
  font-weight: 500;
  line-height: 14px;
  white-space: nowrap;
}

#wallet-add-funds .wallet-wechat-icon { width: 15px; height: 15px; }
.dark #wallet-add-funds .wallet-wechat-badge {
  --wallet-wechat-badge-bg: #193d2b;
  border-color: rgba(110, 210, 153, 0.22);
  color: #82d8aa;
}
@media (max-width: 639px) {
  #wallet-add-funds .wallet-backup-button { flex-direction: column; gap: 1px; }
  #wallet-add-funds .wallet-backup-label { line-height: 18px; }
  #wallet-add-funds .wallet-wechat-badge { padding: 0 6px; font-size: 10px; line-height: 13px; }
  #wallet-add-funds .wallet-wechat-icon { width: 12px; height: 12px; }
}
#wallet-redemption {
  border-color: rgba(31, 126, 115, 0.24);
  background: rgba(31, 126, 115, 0.045);
  border-radius: 14px;
  padding: 10px 12px 12px;
}
#wallet-redemption > .flex {
  flex-wrap: wrap;
  color: #257d73;
}
#wallet-redemption .wallet-redemption-hint {
  color: #257d73;
  font-size: 12px;
  font-weight: 400;
}
#wallet-redemption label { color: #257d73; }

@media (min-width: 768px) {
  main:has(#wallet-add-funds) > div:first-child {
    padding-top: 12px;
    padding-bottom: 8px;
  }
  div:has(> #wallet-add-funds) { gap: 12px; }
  /* The three account summary cells immediately precede the recharge section. */
  div:has(> #wallet-add-funds) > div:first-child > div > div {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  div:has(> #wallet-add-funds) > div:first-child .font-mono {
    margin-top: 4px;
    line-height: 28px;
  }
  #wallet-add-funds > div > div:first-child > [data-slot="card"]:first-child > [data-slot="card-header"] {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
  #wallet-add-funds > div > div:first-child > [data-slot="card"]:first-child > [data-slot="card-content"] {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  #wallet-add-funds > div > div:first-child > [data-slot="card"]:first-child > [data-slot="card-content"] > * {
    margin-block: 0 !important;
  }
  #wallet-add-funds [data-slot="card-content"] > .space-y-2\.5 > :not(:last-child) {
    margin-bottom: 6px;
  }
  #wallet-add-funds [data-slot="card-content"] > .space-y-2\.5 > .grid.grid-cols-2 > button {
    height: 40px;
    min-height: 40px;
  }
  #wallet-add-funds [data-slot="card-content"] > .grid.grid-cols-3 > div {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  #wallet-redemption { padding-top: 8px; padding-bottom: 10px; }
  #wallet-redemption > :not(:last-child) { margin-bottom: 6px; }
  #wallet-add-funds > div > div:first-child > [data-slot="card"]:nth-child(2) {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  #wallet-add-funds > div > div:first-child > [data-slot="card"]:nth-child(2) .space-y-2\.5 > :not(:last-child) {
    margin-bottom: 7px;
  }
}

/* Desktop wallet: use the right column for the two secondary explanations. */
@media (min-width: 1280px) {
  #wallet-add-funds > div {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: stretch;
  }
  #wallet-add-funds > div > div:first-child { display: contents; }
  #wallet-add-funds > div > div:first-child > [data-slot="card"]:first-child {
    grid-column: 1;
    grid-row: 1 / span 2;
  }
  #wallet-add-funds > div > div:first-child > [data-slot="card"]:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    height: auto;
    min-height: 0;
  }
  #wallet-add-funds > div > div:first-child > [data-slot="card"]:nth-child(2) > [data-slot="card-content"] { height: auto; }
  #wallet-add-funds > div > [data-slot="card"] {
    grid-column: 2;
    grid-row: 2;
    margin-block: 0 !important;
    padding-block: 0;
  }
  #wallet-add-funds > div > [data-slot="card"] > [data-slot="card-content"] {
    gap: 12px;
    padding: 12px 14px;
  }
}

@media (min-width: 1280px) and (max-height: 860px) {
  div:has(> #wallet-add-funds) { gap: 10px; }
  div:has(> #wallet-add-funds) > div:first-child > div > div {
    padding-top: 6px;
    padding-bottom: 6px;
  }
  #wallet-add-funds > div > div:first-child > [data-slot="card"]:first-child > [data-slot="card-header"] {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }
  #wallet-add-funds > div > div:first-child > [data-slot="card"]:first-child > [data-slot="card-content"] {
    gap: 8px;
  }
}

/* Reserve space for the expanded custom amount and its validation hint. */
@media (min-width: 1280px) {
  main:has(#wallet-add-funds),
  main:has(#wallet-add-funds) > div:nth-child(2) {
    overscroll-behavior: none;
  }
  main:has(#wallet-add-funds) > div:nth-child(2) { padding-bottom: 8px; }
}
@media (min-width: 1280px) and (max-height: 860px) {
  main:has(#wallet-add-funds) > div:first-child { padding-top: 8px; padding-bottom: 6px; }
  #wallet-add-funds > div > div:first-child > [data-slot="card"]:first-child > [data-slot="card-content"] {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  #wallet-add-funds .grid-rows-\[1fr\] > div > div {
    padding-top: 6px;
    padding-bottom: 6px;
  }
}

/* Display-only payment badges beside the existing card-store link. */
#wallet-add-funds .wallet-payment-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
#wallet-add-funds .wallet-alipay-badge {
  --wallet-wechat-badge-bg: #eaf3fc;
  color: #1677c8;
  border-color: rgba(22,119,200,.16);
}
.dark #wallet-add-funds .wallet-alipay-badge {
  --wallet-wechat-badge-bg: #193448;
  color: #8bc8fa;
  border-color: rgba(139,200,250,.22);
}
