/* Payment surface only; casting and account styles retain their ownership. */
.account #recharge-entry {
  min-height: 36px; padding: 7px 14px; border-radius: 4px;
  color: #fff; background: var(--accent); border-color: var(--accent); font-size: 13px;
}
.account #recharge-entry:hover { background: #823b31; border-color: #823b31; }
.account .wallet { cursor: pointer; flex-shrink: 0; }
.account .wallet:hover { background: #f6eee0; border-color: #c8ac77; }
.account .wallet { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: auto; padding: 3px 6px; }
#recharge-wallet-balance { max-width: 64px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-variant-numeric: tabular-nums; }
html.recharge-open { overflow: hidden; scrollbar-gutter: stable; }
#recharge-dialog {
  width: min(740px, calc(100% - 40px)); max-width: none; max-height: calc(100dvh - 40px);
  margin: auto; padding: 0; overflow: auto; overscroll-behavior: contain;
  border: 1px solid #dedbd7; border-radius: 8px; background: #fff; color: #2f2a27;
  box-shadow: 0 24px 90px #151b263b; font-size: 14px; letter-spacing: 0;
}
#recharge-dialog::backdrop { background: #19212c66; }
#recharge-dialog p, #recharge-dialog h2, #recharge-dialog h3, #recharge-dialog dl { margin: 0; }
#recharge-dialog [hidden] { display: none !important; }
.recharge-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 26px 28px 22px; }
#recharge-dialog .recharge-eyebrow { margin-bottom: 9px; color: #77716d; font-size: 12px; }
#recharge-title { font: 700 25px/1.35 'Songti SC', SimSun, serif; }
#recharge-dialog #recharge-rate { margin-top: 10px; color: #77716d; font-size: 13px; }
#recharge-dialog .recharge-icon-button {
  width: 36px; height: 36px; min-height: 36px; padding: 0; flex-shrink: 0;
  display: grid; place-items: center; border: 1px solid transparent; border-radius: 4px;
  background: transparent; color: #746e69; font: 26px/1 Arial, sans-serif;
}
#recharge-dialog .recharge-icon-button:hover { background: #f3f4f5; color: #242a30; }
.recharge-account-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 13px 28px; border-block: 1px solid #ecebea; background: #f8f9fa; color: #6c7279; font-size: 12px; }
.recharge-account-row strong { font-weight: 500; color: #40464e; overflow-wrap: anywhere; }
.recharge-balance-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 12px 28px; border-bottom: 1px solid #ecebea; font-size: 12px; color: #69716c; }
#recharge-balance { color: #276c4d; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.recharge-history-row { display: grid; gap: 8px; margin-bottom: 20px; font-size: 12px; color: #646a72; min-width: 0; }
#recharge-history { min-width: 0; width: 100%; min-height: 40px; padding: 8px 26px 8px 9px; font-size: 12px; border: 1px solid #d8dddf; border-radius: 4px; color: #3c454d; background: #fff; }
.recharge-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.recharge-selection { padding: 25px 26px 26px 28px; min-width: 0; }
.recharge-amounts { padding: 0; border: 0; margin: 0; min-width: 0; }
.recharge-amounts legend { margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.recharge-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.recharge-options label { position: relative; cursor: pointer; min-width: 0; }
.recharge-options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.recharge-options span {
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
  height: 64px; padding-top: 17px; border: 1px solid #dedfe1; border-radius: 5px;
  color: #64676b; font-size: 12px; background: #fff;
}
.recharge-options b { color: #343638; font-size: 21px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; }
.recharge-options input:checked + span { background: #fcf4f1; border-color: #a1483b; box-shadow: inset 0 0 0 1px #a1483b; color: #8e4035; }
.recharge-options input:checked + span b { color: #8e4035; }
.recharge-options input:focus-visible + span { outline: 2px solid #a1483b; outline-offset: 3px; }
.recharge-options label:hover span { border-color: #a1483b; }
.recharge-options input:disabled + span { opacity: .65; cursor: default; }
.recharge-options input:disabled:checked + span { opacity: 1; }
.recharge-custom { display: grid; gap: 9px; margin-top: 19px; font-size: 12px; color: #6c6d70; }
.recharge-channels { margin: 22px 0 0; padding: 0; border: 0; min-width: 0; }
.recharge-channels legend { margin-bottom: 10px; font-size: 12px; color: #646a72; }
.recharge-channels > div { display: flex; flex-wrap: wrap; gap: 8px; }
.recharge-channels label { display: flex; align-items: center; gap: 7px; min-height: 40px; flex: 1 1 110px;
  padding: 8px 10px; border: 1px solid #d8dddf; border-radius: 4px; background: #fff; cursor: pointer; font-size: 12px; }
.recharge-channels input { width: 15px; height: 15px; margin: 0; flex-shrink: 0; accent-color: #296b4d; }
.recharge-channel-icon { display: block; width: 24px; height: 24px; flex: 0 0 24px; }
.recharge-channel-icon--wechat { color: #07b75b; }
.recharge-channel-icon--alipay { color: #1677ff; }
.recharge-channels label > span { white-space: nowrap; }
.recharge-channels label:has(input:checked) { border-color: #296b4d; background: #f1f8f4; }
.recharge-channels label:has(input[value="alipay"]:checked) { border-color: #1677d2; background: #f0f7fe; }
.recharge-channels input[value="alipay"] { accent-color: #1677d2; }
.recharge-channels label:has(input:disabled) { cursor: default; }
.recharge-channels label:has(input:disabled:not(:checked)) { opacity: .6; }
.recharge-channels label:has(input:focus-visible) { outline: 2px solid #296b4d; outline-offset: 2px; }
#recharge-custom { min-height: 43px; border-color: #dedfe1; border-radius: 4px; padding: 9px 12px; font-size: 14px; }
#recharge-custom[aria-invalid="true"] { border-color: #b43c31; }
#recharge-dialog .recharge-error { color: #a3382f; font-size: 12px; margin-top: 7px; line-height: 1.5; }
.recharge-summary { min-width: 0; padding: 25px 28px 25px 24px; background: #f8f9fa; border-left: 1px solid #ecebea; }
#recharge-summary-title { font-size: 14px; font-weight: 600; }
.recharge-receipt { display: flex; align-items: center; gap: 14px; padding-block: 22px; }
.recharge-receipt img { flex: 0 0 48px; }
.recharge-receipt > div { min-width: 0; }
.recharge-receipt span { color: #6e7279; font-size: 12px; }
#recharge-dialog .recharge-receipt p { margin-top: 4px; line-height: 1.25; }
#recharge-coins { font-size: 32px; font-weight: 650; color: #363537; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#recharge-coins.is-compact { font-size: 20px; }
.recharge-total-row { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid #e1e4e7; }
.recharge-total-row dt { color: #696d74; font-size: 13px; }
.recharge-total-row dd { margin: 0; color: #934639; text-align: right; overflow-wrap: anywhere; min-width: 0; }
#recharge-total { font-size: 18px; font-variant-numeric: tabular-nums; }
#recharge-total.is-compact { font-size: 14px; }
.recharge-provider { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 19px 0 15px; font-size: 12px; color: #7c8086; }
.recharge-provider-name { display: flex; align-items: center; gap: 7px; color: #3e4843; }
.recharge-provider-name i { width: 7px; height: 7px; border-radius: 50%; background: #3e9766; }
#recharge-dialog .recharge-status { font-size: 12px; line-height: 1.7; color: #777b82; min-height: 42px; overflow-wrap: anywhere; }
#recharge-dialog[data-state="unavailable"] .recharge-status { color: #a3382f; }
#recharge-dialog #recharge-pay { margin-top: 17px; width: 100%; min-height: 44px; background: #e5e8ec; color: #666e78; border-color: #e0e4e8; opacity: 1; font-size: 14px; }
#recharge-dialog #recharge-pay:not(:disabled) { background: #296b4d; border-color: #296b4d; color: #fff; cursor: pointer; }
#recharge-dialog #recharge-pay:hover:not(:disabled) { background: #20553d; }
#recharge-dialog[data-provider="alipay"] #recharge-pay:not(:disabled) { background: #166bb4; border-color: #166bb4; }
#recharge-checkout { display: block; text-align: center; margin: 0 0 6px; padding: 9px 6px;
  min-height: 36px; border-radius: 4px; color: #166bb4; text-underline-offset: 3px; font-size: 12px; }
#recharge-checkout:hover { background: #eaf3fc; }
#recharge-dialog[data-state="paid"] .recharge-status { color: #276c4d; font-weight: 600; }
#recharge-dialog[data-state="uncertain"] .recharge-status,
#recharge-dialog[data-state="review"] .recharge-status { color: #984730; }
#recharge-login { display: block; text-align: center; margin-top: 12px; padding: 12px; border-radius: 4px; background: #296b4d; color: #fff; text-decoration: none; }
#recharge-retry { display: block; width: 100%; min-height: 38px; margin-top: 8px; border: 1px solid #b9cfc2; border-radius: 4px; background: #fff; color: #276c4d; font-size: 12px; }
#recharge-dialog button:disabled { cursor: default; }
#recharge-dialog button:focus-visible, #recharge-dialog a:focus-visible, #recharge-history:focus-visible { outline: 2px solid #296b4d; outline-offset: 3px; }
.recharge-order { min-width: 0; }
.recharge-qr-frame { width: 204px; max-width: 100%; aspect-ratio: 1; margin: 0 auto 8px; padding: 6px; background: #fff; border: 1px solid #dce1de; border-radius: 4px; }
#recharge-qr { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
#recharge-alipay-qr { display: block; width: 192px; height: 192px; border: 0; background: #fff; }
#recharge-dialog[data-provider="alipay"] .recharge-qr-frame { width: 206px; height: 206px; }
#recharge-dialog #recharge-expiry { min-height: 18px; text-align: center; font-size: 11px; color: #6e7772; }
#recharge-dialog #recharge-order-id { margin: 8px 0 12px; overflow-wrap: anywhere; font-size: 10px; line-height: 1.5; color: #7c8188; }
#recharge-dialog.has-order .recharge-heading { padding-top: 18px; padding-bottom: 16px; }
#recharge-dialog.has-order .recharge-receipt { padding-block: 14px; }
#recharge-dialog.has-order .recharge-total-row { padding-bottom: 14px; }
#recharge-dialog.has-order .recharge-status { min-height: 28px; }
#recharge-dialog #recharge-refresh { display: block; margin: 8px auto 0; min-height: 34px; padding: 5px 10px; border-color: transparent; color: #854c43; background: transparent; font-size: 12px; }
#recharge-dialog #recharge-refresh:hover:not(:disabled) { background: #f2edeb; }
#recharge-dialog .recharge-disclosure { margin-top: 6px; text-align: center; color: #84888e; font-size: 11px; line-height: 1.6; }
@media (max-width: 800px) {
  .topnav { flex-wrap: wrap; }
  .topnav > .brand { order: 0; }
  .topnav > .account { order: 1; margin-left: auto; }
  .topnav > nav { order: 2; flex-basis: 100%; justify-content: flex-start; }
}
@media (max-width: 580px) {
  #recharge-dialog { width: min(430px, calc(100% - 24px)); max-height: calc(100dvh - 24px); }
  .recharge-heading { padding: 16px 18px 14px; }
  #recharge-dialog .recharge-eyebrow { margin-bottom: 6px; font-size: 11px; }
  #recharge-title { font-size: 23px; }
  #recharge-dialog #recharge-rate { margin-top: 7px; }
  .recharge-account-row { padding: 10px 18px; }
  .recharge-balance-row { padding: 9px 18px; }
  .recharge-layout { grid-template-columns: minmax(0, 1fr); }
  .recharge-selection { padding: 16px 18px; }
  .recharge-amounts legend { margin-bottom: 10px; }
  .recharge-options { gap: 8px; }
  .recharge-options span { height: 48px; padding-top: 9px; }
  .recharge-custom { margin-top: 12px; gap: 7px; }
  .recharge-channels { margin-top: 16px; }
  .recharge-summary { padding: 16px 18px; border-left: 0; border-top: 1px solid #ecebea; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; }
  .recharge-summary > * { grid-column: 1 / -1; }
  .recharge-receipt { grid-column: 1; padding-block: 14px; gap: 10px; }
  .recharge-receipt img { width: 36px; height: 36px; flex-basis: 36px; }
  #recharge-coins { font-size: 28px; }
  #recharge-coins.is-compact { font-size: 16px; }
  .recharge-total-row { grid-column: 2; padding: 0; border: 0; flex-direction: column; align-items: flex-end; justify-content: center; gap: 4px; }
  .recharge-provider { padding-block: 13px 10px; border-top: 1px solid #e1e4e7; }
  #recharge-dialog #recharge-pay { margin-top: 12px; }
  #recharge-dialog.has-order .recharge-amounts,
  #recharge-dialog.has-order .recharge-custom,
  #recharge-dialog.has-order .recharge-channels { display: none; }
  #recharge-dialog.has-order .recharge-selection { padding-block: 12px; }
  #recharge-dialog.has-order .recharge-history-row { margin-bottom: 0; }
  #recharge-dialog.has-order .recharge-receipt { padding-block: 10px; }
  #recharge-dialog.has-order .recharge-total-row { padding-bottom: 0; }
  #recharge-dialog.has-order .recharge-provider { padding-block: 10px; }
}
@media (max-width: 400px) {
  .account #recharge-entry { min-height: 34px; padding: 6px 9px; font-size: 12px; }
  .topnav > .brand { font-size: 18px; gap: 5px; }
  .topnav .brand-seal { width: 28px; height: 28px; }
  .topnav > .account { gap: 4px; }
  .topnav .account .wallet { width: auto; height: 34px; min-height: 34px; padding-inline: 3px; gap: 2px; }
  #recharge-wallet-balance { max-width: 38px; font-size: 11px; }
  .topnav .coin-icon { width: 25px; height: 25px; }
}
