/* Wallet modal — isolated, loads LAST after user_profile.css */
#walletModal.bp-wallet {
  --bg: #1c1c1e;
  --field: #000000;
  --track: #3a3a3c;
  --on: #2c2c2e;
  --text: #ffffff;
  --muted: #8e8e93;
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 16px 16px;
  background: rgba(0, 0, 0, 0.65);
  box-sizing: border-box;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
}
#walletModal.bp-wallet *,
#walletModal.bp-wallet *::before,
#walletModal.bp-wallet *::after {
  box-sizing: border-box;
}
#walletModal.bp-wallet.is-open,
#walletModal.bp-wallet:not([hidden]) {
  display: flex !important;
}
#walletModal.bp-wallet[hidden] {
  display: none !important;
}

#walletModal .bp-wallet__sheet {
  width: min(320px, 100%);
  max-width: 320px;
  flex: 0 0 auto;
  align-self: center;
  background: var(--bg);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  height: auto !important;
  min-height: 0 !important;
  max-height: min(86vh, 640px);
}

#walletModal .bp-wallet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#walletModal .bp-wallet__head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
#walletModal .bp-wallet__x {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: var(--track);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

#walletModal .bp-wallet__chrome {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
}
#walletModal .bp-wallet__body {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0 !important;
  height: auto !important;
  margin-top: 0;
  position: static !important;
}
#walletModal .bp-wallet__methods-slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-height: 40px;
}
#walletModal .bp-wallet__methods-slot > .bp-wallet__methods {
  grid-area: 1 / 1;
}
#walletModal .bp-wallet__methods-slot > .bp-wallet__methods:not(.is-on) {
  visibility: hidden;
  pointer-events: none;
  z-index: 0;
}
#walletModal .bp-wallet__methods-slot > .bp-wallet__methods.is-on {
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

#walletModal .bp-wallet__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: var(--track);
}
#walletModal .bp-wallet__tab {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.7;
}
#walletModal .bp-wallet__tab.is-on {
  background: #fff;
  color: #000;
  opacity: 1;
}

#walletModal .bp-wallet__stack {
  display: block;
  width: 100%;
  min-width: 0;
}

/* Panels: kill ALL legacy #topUpModal overlay styles */
#walletModal .bp-wallet__panel,
#walletModal #topUpModal,
#walletModal #withdrawModal {
  display: none !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  position: static !important;
  inset: auto !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: visible !important;
  float: none !important;
  transform: none !important;
  z-index: auto !important;
  color: inherit !important;
}
#walletModal .bp-wallet__panel.is-on,
#walletModal #topUpModal.is-on,
#walletModal #withdrawModal.is-on {
  display: flex !important;
}

#walletModal .bp-wallet__lbl {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  color: var(--muted) !important;
  line-height: 1.2 !important;
  background: transparent !important;
}

/* Methods — same for topup & withdraw: black / selected charcoal */
#walletModal .bp-wallet__methods {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 6px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
#walletModal .bp-wallet__method,
#walletModal label.bp-wallet__method,
#walletModal button.bp-wallet__method,
#walletModal #topUpModal .bp-wallet__method,
#walletModal #withdrawModal .bp-wallet__method {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  min-height: 40px !important;
  height: 40px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 8px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #000000 !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  position: relative !important;
  box-shadow: none !important;
  transform: none !important;
  text-align: center !important;
}
#walletModal .bp-wallet__method.is-on,
#walletModal .bp-wallet__method.is-selected,
#walletModal #topUpModal .bp-wallet__method.is-on,
#walletModal #withdrawModal .bp-wallet__method.is-on,
#walletModal label.bp-wallet__method:has(.payment-method-input:checked) {
  background: #3a3a3c !important;
  color: #ffffff !important;
}
/* Top up radios: always follow checked state even if is-on class is stale */
#walletModal label.bp-wallet__method:not(:has(.payment-method-input:checked)) {
  background: #000000 !important;
  color: #ffffff !important;
}
#walletModal .bp-wallet__method input {
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  pointer-events: none !important;
}
#walletModal .bp-wallet__method img {
  width: 16px !important;
  height: 16px !important;
  object-fit: contain !important;
  flex: 0 0 auto !important;
  display: block !important;
  background: transparent !important;
  border: 0 !important;
}

/* Inputs */
#walletModal .bp-wallet__input,
#walletModal #paypalEmail,
#walletModal #withdrawPhone,
#walletModal #withdrawBankSearch,
#walletModal #withdrawCardNumber {
  display: block !important;
  width: 100% !important;
  min-height: 40px !important;
  height: 40px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #000000 !important;
  background-color: #000000 !important;
  color: #ffffff !important;
  font-size: 14px !important;
  line-height: 40px !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
#walletModal .bp-wallet__input::placeholder,
#walletModal #paypalEmail::placeholder,
#walletModal #withdrawCardNumber::placeholder {
  color: #636366 !important;
  opacity: 1 !important;
}
#walletModal .bp-wallet__input:-webkit-autofill,
#walletModal .bp-wallet__input:-webkit-autofill:hover,
#walletModal .bp-wallet__input:-webkit-autofill:focus,
#walletModal #withdrawCardNumber:-webkit-autofill,
#walletModal #withdrawCardNumber:-webkit-autofill:hover,
#walletModal #withdrawCardNumber:-webkit-autofill:focus,
#walletModal #paypalEmail:-webkit-autofill {
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff !important;
  box-shadow: 0 0 0 1000px #000000 inset !important;
  transition: background-color 99999s ease-out 0s !important;
}

/* Amount row — forced horizontal */
#walletModal .bp-wallet__money,
#walletModal label.bp-wallet__money {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  width: 100% !important;
  min-height: 44px !important;
  height: 44px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #000000 !important;
  box-shadow: none !important;
  cursor: text;
}
#walletModal .bp-wallet__cur {
  flex: 0 0 auto !important;
  display: inline-block !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  color: #fff !important;
  background: transparent !important;
}
#walletModal .bp-wallet__money input,
#walletModal #topUpAmount,
#walletModal #withdrawAmount {
  flex: 1 1 auto !important;
  display: block !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #ffffff !important;
  font-size: 22px !important;
  font-weight: 600 !important;
  line-height: 28px !important;
  outline: none !important;
  box-shadow: none !important;
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}
#walletModal .bp-wallet__money input::-webkit-outer-spin-button,
#walletModal .bp-wallet__money input::-webkit-inner-spin-button,
#walletModal #topUpAmount::-webkit-outer-spin-button,
#walletModal #topUpAmount::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}
#walletModal .bp-wallet__max {
  flex: 0 0 auto !important;
  min-height: 24px !important;
  height: 24px !important;
  padding: 0 8px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--track) !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
}
#walletModal .bp-wallet__rub-val {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  color: #fff !important;
  line-height: 1 !important;
}

/* FX / approx rubles */
#walletModal .bp-wallet__fx {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  min-height: 0 !important;
}
#walletModal .bp-wallet__fx:empty {
  display: none !important;
}
#walletModal .bp-wallet__rate {
  margin: 0 !important;
  font-size: 11px !important;
  color: var(--muted) !important;
}
#walletModal .bp-wallet__rub {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
#walletModal #ruSbpCalc[hidden],
#walletModal #topUpRubRow[hidden],
#walletModal .bp-wallet__fx [hidden] {
  display: none !important;
}

#walletModal .bp-wallet__slot {
  display: block;
  width: 100%;
  min-width: 0;
}
#walletModal .bp-wallet__slot-pane {
  display: none !important;
  flex-direction: column !important;
  gap: 6px !important;
  width: 100%;
  min-width: 0;
}
#walletModal .bp-wallet__slot-pane.is-on {
  display: flex !important;
}

#walletModal .bp-wallet__picked,
#walletModal button.bp-wallet__picked {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  min-height: 40px !important;
  height: 40px !important;
  margin: 0 !important;
  padding: 0 10px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #000000 !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-align: left !important;
  cursor: pointer !important;
}
#walletModal .bp-wallet__picked[hidden] {
  display: none !important;
}
#walletModal .bp-wallet__picked-ico {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 20px !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  background: #1c1c1e !important;
}
#walletModal .bp-wallet__picked-ico[hidden] {
  display: none !important;
}
#walletModal .bp-wallet__picked-ico img,
#walletModal #withdrawBankPickIcon {
  display: block !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 6px !important;
  object-fit: cover !important;
}
#walletModal .bp-wallet__picked-name {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
#walletModal .bp-wallet__picked-edit {
  flex: 0 0 auto !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #8e8e93 !important;
}

#walletModal .bp-wallet__bank-picker {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  width: 100% !important;
}
#walletModal .bp-wallet__bank-picker[hidden] {
  display: none !important;
}

#walletModal .bp-wallet__banks {
  list-style: none;
  margin: 0;
  padding: 4px;
  height: 140px;
  min-height: 140px;
  max-height: 140px;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 10px;
  background: #000;
}
#walletModal .bp-wallet__bank-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
#walletModal .bp-wallet__bank-item:hover,
#walletModal .bp-wallet__bank-item.is-selected {
  background: var(--track);
}
#walletModal .bp-wallet__bank-item img {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  object-fit: contain;
}
#walletModal .bp-wallet__bank-empty {
  padding: 12px 8px;
  color: var(--muted);
  font-size: 12px;
}

/* withdrawCalc — black block */
#walletModal .bp-wallet__sum,
#walletModal #withdrawCalc {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #000000 !important;
}
#walletModal .bp-wallet__sum > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
#walletModal .bp-wallet__sum strong {
  color: #fff;
  font-weight: 600;
}
#walletModal .bp-wallet__sum .is-total {
  color: #fff;
}
#walletModal #withdrawRateRow,
#walletModal #withdrawRateDisplay,
#walletModal #withdrawCommissionLocal,
#walletModal #withdrawNetLocal {
  display: none !important;
}

#walletModal .bp-wallet__cta,
#walletModal .bp-pay__submit,
#walletModal #stripeTopUpBtn,
#walletModal #ruSbpStartBtn {
  width: 100% !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  color: #000000 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: none !important;
}
#walletModal .bp-wallet__cta--ghost {
  background: var(--track) !important;
  color: #fff !important;
}

#walletModal .bp-wallet__foot,
#walletModal .bp-wallet__flow,
#walletModal .payment-panel:not([hidden]),
#walletModal #withdrawFlowContent:not([hidden]),
#walletModal #withdrawSuccessStep:not([hidden]) {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
#walletModal .payment-panel[hidden],
#walletModal #withdrawFlowContent[hidden],
#walletModal #withdrawSuccessStep[hidden],
#walletModal .bp-wallet__status[hidden],
#walletModal .bp-wallet__picked[hidden],
#walletModal .bp-wallet__panel:not(.is-on),
#walletModal .bp-wallet__slot-pane:not(.is-on),
#walletModal [hidden] {
  display: none !important;
}
#walletModal .bp-wallet__panel.is-on,
#walletModal .bp-wallet__slot-pane.is-on {
  display: flex !important;
}

#walletModal .bp-wallet__status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  font-size: 13px;
}
#walletModal .bp-wallet__status h3 {
  margin: 0;
  font-size: 16px;
}
#walletModal .bp-wallet__status p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

#walletModal #withdrawBankSheet,
#walletModal #withdrawBankPickBtn,
#walletModal #withdrawBankSheetClose {
  display: none !important;
}

#walletModal .payment-method-option,
#walletModal .payment-method-content,
#walletModal .finance-method-card,
#walletModal .finance-modal-card,
#walletModal .finance-money-input,
#walletModal .payment-panels,
#walletModal .finance-float-item {
  all: unset;
  display: contents;
}
#walletModal #ruSbpCalc,
#walletModal #topUpRubRow {
  position: static !important;
  transform: none !important;
  filter: none !important;
  opacity: 1 !important;
  width: 100% !important;
  max-width: 100% !important;
}
