body { background: #fafbf9; }
.account-header { min-height: 76px; padding: 18px max(24px, calc((100% - 1080px) / 2)); border-bottom: 1px solid #e9ece6; background: #fff; }
.account-brand { display: flex; align-items: center; gap: 15px; font-size: 20px; white-space: nowrap; }
.billing-brand-divider { height: 17px; width: 1px; background: #dedfdc; }
.billing-brand-label { color: #7b8178; font-size: 13px; font-weight: 400; letter-spacing: 0; }
.billing-header-links { display: flex; align-items: center; gap: 24px; }
.billing-header-links a { font-size: 13px; white-space: nowrap; }
.billing-back { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #384d35; }
.billing-main { width: min(100% - 48px, 1080px); margin: 36px auto 64px; }
.billing-loading { padding: 80px 24px; text-align: center; color: #707070; }
.billing-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.billing-page-heading { margin-bottom: 26px; }
.billing-page-heading h1 { font-size: 30px; letter-spacing: -.7px; margin-bottom: 9px; }
.billing-refresh { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; font-size: 12px; padding: 8px 14px; border-radius: 9px; }
.billing-heading .account-description { margin-bottom: 0; }
.billing-page-heading .account-description { font-size: 13px; color: #7c8178; }
.billing-heading h2 { margin-bottom: 0; }
.billing-notice { padding: 15px 18px; background: #f5f5f3; color: #626258; border-radius: 12px; font-size: 14px; line-height: 1.7; margin: 28px 0; }
.wallet-card { background: #f0f4ec; border: 1px solid #dfe6d8; border-radius: 18px; padding: 24px 28px 0; display: grid; grid-template-columns: 1fr 1.1fr; gap: 20px 40px; }
.wallet-label { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.wallet-card h2 { font-size: 13px; color: #5d6958; margin: 0; font-weight: 500; }
.wallet-state { padding: 3px 7px; background: #fff4de; color: #8d6020; border-radius: 5px; font-size: 11px; }
.wallet-total { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.wallet-total strong { font-size: clamp(30px, 4vw, 42px); letter-spacing: -1.6px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wallet-total span { font-size: 13px; color: #777; }
.wallet-caption { font-size: 11px; color: #7a8574; margin: 10px 0 0; }
.wallet-breakdown { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: center; gap: 24px; margin: 0; }
.wallet-breakdown dt { color: #777e71; font-size: 12px; margin-bottom: 10px; }
.wallet-breakdown dd { margin: 0; font-size: 20px; font-weight: 550; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wallet-details { grid-column: 1 / -1; border-top: 1px solid #dce4d5; }
.wallet-details summary, .billing-rules > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.wallet-details summary { min-height: 42px; font-size: 12px; color: #66745d; }
.wallet-details summary::-webkit-details-marker, .billing-rules > summary::-webkit-details-marker { display: none; }
.wallet-details[open] summary > span, .billing-rules[open] > summary > span { transform: rotate(180deg); }
.wallet-details .billing-muted { margin: 2px 0 10px; font-size: 12px; }
.grant-list { padding-left: 18px; margin: 0 0 18px; color: #666; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.grant-list:empty { display: none; }
.wallet-alert { grid-column: 1 / -1; margin: -6px 0 20px; padding: 11px 14px; border-radius: 9px; background: #fffbef; color: #8b652b; font-size: 12px; line-height: 1.8; }
.billing-tabs { display: flex; align-items: stretch; gap: 28px; margin: 28px 0; border-bottom: 1px solid #e1e5dc; }
.billing-tabs button { position: relative; min-height: 48px; padding: 0 2px 13px; background: transparent; border: 0; color: #7a8075; font-size: 14px; white-space: nowrap; }
.billing-tabs [aria-selected="true"] { color: #263b21; font-weight: 600; }
.billing-tabs [aria-selected="true"]::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 3px; background: #5b7350; border-radius: 3px 3px 0 0; }
button:focus-visible, a:focus-visible, summary:focus-visible, [role="tabpanel"]:focus-visible { outline: 2px solid #6d8b5a; outline-offset: 4px; }
.billing-section { margin-top: 32px; }
.plans-section, .records-section { margin-top: 0; }
.billing-section h2 { margin-bottom: 12px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading h2 { margin: 0 0 7px; font-size: 18px; }
.section-heading p { margin: 0; }
.section-tag { border: 1px solid #e1e5db; border-radius: 6px; background: #fff; color: #737c6b; padding: 6px 9px; font-size: 11px; white-space: nowrap; }
.billing-muted { color: #7a8075; font-size: 13px; line-height: 1.7; }
.billing-fineprint { color: #777; font-size: 12px; line-height: 1.8; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.plan-card { border: 1px solid #e0e5da; border-radius: 15px; padding: 23px; background: #fff; min-width: 0; }
.plan-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 20px; }
.plan-card h3 { margin: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin: 0 0 20px; }
.plan-price strong { font-size: 34px; font-weight: 600; letter-spacing: -1px; }
.plan-price span { font-size: 13px; color: #777; }
.plan-points { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 0 0 5px; }
.plan-points strong { font-size: 21px; font-weight: 600; letter-spacing: -.4px; }
.plan-points span { color: #777e71; font-size: 12px; }
.plan-discount { display: inline-block; border-radius: 5px; padding: 4px 7px; color: #526c40; background: #f0f5e9; font-size: 11px; white-space: nowrap; }
.plan-comparison { font-size: 11px; margin: 0; min-height: 20px; }
.plan-features { list-style: none; padding: 17px 0 0; margin: 17px 0 20px; border-top: 1px solid #edf0e9; color: #737b6a; font-size: 12px; line-height: 2; }
.plan-features li::before { content: '✓'; color: #789267; margin-right: 8px; }
.plan-card button { margin-top: auto; border-radius: 9px; min-height: 42px; padding: 10px 12px; font-size: 13px; background: #303d29; }
.plan-card button:hover:enabled { background: #445637; }
.plan-terms { text-align: center; font-size: 11px; margin: 16px 0 0; }
button:disabled { cursor: not-allowed; }
.topup-section { border: 1px solid #e1e5db; border-radius: 15px; padding: 24px; background: #fff; }
.topup-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.topup-heading h2 { margin: 0 0 8px; }
.topup-heading p { margin: 0; }
.topup-validity { font-size: 12px; color: #56614f; background: #f1f4ed; border-radius: 6px; padding: 6px 9px; white-space: nowrap; }
.topup-layout { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 28px; align-items: start; }
.topup-selection { min-width: 0; }
.topup-amounts { padding: 0; border: 0; margin: 0; min-width: 0; }
.topup-amounts legend { font-size: 13px; color: #666; padding: 0; margin-bottom: 12px; }
.topup-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.topup-option { position: relative; margin: 0; cursor: pointer; }
.topup-option input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.topup-option-body { position: relative; min-height: 90px; border: 1px solid #e1e1dd; border-radius: 12px; padding: 17px 18px; display: flex; flex-direction: column; gap: 7px; transition: background .15s, border-color .15s; }
.topup-option-body > strong { font-size: 22px; font-weight: 550; letter-spacing: -.4px; }
.topup-option-body > strong.topup-custom-title { font-size: 17px; line-height: 26px; letter-spacing: 0; }
.topup-option-body > span:not(.topup-check) { font-size: 12px; color: #717171; }
.topup-option:hover .topup-option-body { border-color: #aaa; }
.topup-option input:checked + .topup-option-body { border-color: #272727; background: #f7f7f5; box-shadow: inset 0 0 0 1px #272727; }
.topup-option input:focus-visible + .topup-option-body { outline: 2px solid #777; outline-offset: 3px; }
.topup-option input:disabled + .topup-option-body { opacity: .45; cursor: not-allowed; }
.topup-check { display: none; position: absolute; top: 13px; right: 13px; color: #fff; background: #272727; border-radius: 50%; width: 18px; height: 18px; font-size: 11px; align-items: center; justify-content: center; }
.topup-option input:checked + .topup-option-body .topup-check { display: flex; }
.topup-custom { margin-top: 18px; }
.topup-custom label { margin: 0 0 9px; font-size: 13px; color: #555; }
.topup-input { position: relative; }
.topup-input > span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #555; font-size: 18px; pointer-events: none; }
.topup-input input { padding-left: 38px; border-radius: 12px; }
.topup-input input[aria-invalid="true"] { border-color: #b63d34; box-shadow: 0 0 0 2px #f9eeec; }
.topup-custom .billing-fineprint { margin: 8px 0 0; }
.topup-custom .form-error { margin: 6px 0 0; font-size: 13px; }
.topup-rate { font-size: 13px; margin: 17px 0 6px; color: #555; }
.topup-note { margin: 0; }
.topup-summary { background: #f5f7f1; border-radius: 12px; padding: 20px; }
.topup-summary .account-primary { border-radius: 9px; min-height: 44px; background: #303d29; }
.topup-summary h3 { margin: 0 0 20px; font-size: 14px; font-weight: 550; }
.topup-totals { margin: 0; }
.topup-totals > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 15px; }
.topup-totals dt { color: #666; font-size: 13px; white-space: nowrap; }
.topup-totals dd { margin: 0; text-align: right; font-size: 12px; }
.topup-totals dd > strong { font-weight: 550; font-size: 20px; overflow-wrap: anywhere; }
#topup-total { font-size: 26px; font-weight: 550; letter-spacing: -.5px; }
.topup-balance { margin: 18px 0; padding-top: 14px; border-top: 1px solid #e4e4df; font-size: 12px; color: #777; line-height: 1.7; overflow-wrap: anywhere; }
.topup-balance strong { font-weight: 500; color: #444; }
.topup-summary .billing-fineprint { text-align: center; margin: 10px 0 0; }
.topup-summary button:disabled { background: #e7e7e3; color: #858580; opacity: 1; }
.admin-toggle { display: flex; flex-direction: row; align-items: center; font-size: 12px; gap: 8px; margin: 0; }
.admin-toggle input { width: 17px; min-height: 17px; height: 17px; }
.billing-rules { margin-top: 24px; border: 1px solid #e4e8dd; border-radius: 12px; background: #fff; }
.billing-rules > summary { padding: 18px 20px; color: #59634f; font-size: 13px; }
.billing-rules-content { padding: 0 20px 8px; }
.billing-rules-content h2 { font-size: 14px; margin: 22px 0 12px; }
.billing-rules .wallet-breakdown { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 15px 0; }
.billing-rules .wallet-breakdown dd { font-size: 16px; }
.usage-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 22px 0 15px; }
.usage-stats > div { padding: 18px 20px; background: #fff; border: 1px solid #e4e8dd; border-radius: 12px; font-size: 12px; color: #7c8475; }
.usage-stats > div > span:first-child { display: block; margin-bottom: 10px; }
.usage-stats strong { font-size: 26px; font-weight: 550; margin-right: 5px; letter-spacing: -.5px; color: #283323; }
.billing-status { display: inline-block; padding: 3px 7px; font-size: 11px; line-height: 1.6; border-radius: 5px; background: #f0f1ed; color: #7b8077; white-space: nowrap; font-weight: 400; }
.billing-status[data-status="succeeded"], .billing-status[data-status="paid"] { color: #587545; background: #edf4e8; }
.billing-status[data-status="in_progress"], .billing-status[data-status="pending"], .billing-status[data-status="unknown"] { color: #926e30; background: #fbf4e5; }
.billing-status[data-status="failed"], .billing-status[data-status="interrupted"] { color: #aa6960; background: #fbefec; }
.billing-table-wrap { overflow-x: auto; border: 1px solid #e8e8e5; border-radius: 14px; }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 13px; text-align: left; background: #fff; }
th { font-size: 12px; color: #737373; background: #f8f8f7; font-weight: 500; }
th, td { padding: 15px 14px; vertical-align: top; border-bottom: 1px solid #eee; }
tr:last-child td { border-bottom: 0; }
td:first-child, td:last-child { white-space: nowrap; }
td small { display: block; color: #777; margin-top: 5px; font-size: 11px; overflow-wrap: anywhere; }
td details { min-width: 155px; margin-top: 5px; }
td summary { color: #777; cursor: pointer; font-size: 12px; }
td details p { color: #666; margin: 8px 0 0; line-height: 1.8; font-size: 12px; }
.billing-empty { color: #8b9185; font-size: 13px; padding: 48px 20px; text-align: center; background: #fff; border: 1px dashed #dde3d5; border-radius: 12px; }
.billing-records { list-style: none; margin: 20px 0 0; padding: 0 20px; background: #fff; border: 1px solid #e4e8dd; border-radius: 12px; }
.billing-records:empty { display: none; }
.billing-records li { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #eee; padding: 16px 0; font-size: 14px; }
.billing-records li:last-child { border-bottom: 0; }
.billing-records li > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.ledger-amount { flex-shrink: 0; font-size: 13px; font-weight: 500; white-space: nowrap; }
.ledger-amount.is-positive { color: #64804e; }
.billing-records small { display: block; color: #777; margin-top: 7px; font-size: 12px; }
.record-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; font-size: 13px; }
.record-actions strong { font-weight: 550; }
.record-actions button { min-height: 40px; font-size: 12px; padding: 8px 12px; }
.more-button { margin-top: 18px; min-height: 40px; font-size: 13px; }
.checkout-dialog { border: 1px solid #eee; border-radius: 20px; padding: 28px; width: min(100% - 32px, 410px); max-height: calc(100dvh - 40px); overflow-y: auto; }
.checkout-dialog::backdrop { background: rgb(0 0 0 / 35%); }
.checkout-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: 0; background: transparent; font-size: 26px; color: #777; }
.checkout-dialog h2 { margin-right: 28px; }
.checkout-dialog fieldset { border: 0; margin: 24px 0 20px; padding: 0; }
.checkout-dialog legend { font-size: 13px; color: #666; }
#payment-channels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
#payment-channels label { flex-direction: row; align-items: center; justify-content: center; gap: 10px; margin: 0; padding: 15px 10px; border: 1px solid #ddd; border-radius: 12px; cursor: pointer; }
#payment-channels label:has(:checked) { border-color: #333; background: #f7f7f5; box-shadow: inset 0 0 0 1px #333; }
#payment-channels label:has(:focus-visible) { outline: 2px solid #777; outline-offset: 3px; }
#payment-channels input { min-height: 17px; width: 17px; height: 17px; margin: 0; accent-color: #242424; }
#payment-channels .payment-channel-icon { flex: none; width: 24px; height: 24px; }
#payment-channels .payment-channel-icon-alipay { color: #1677ff; }
#payment-channels .payment-channel-icon-wechat { color: #07c160; }
#checkout-description { font-size: 18px; line-height: 1.7; margin-bottom: 8px; }
.checkout-edit { border: 0; background: transparent; color: #555; font-size: 13px; padding: 10px 0; min-height: 40px; text-decoration: underline; text-underline-offset: 3px; }
#payment-qr { display: block; margin: 18px auto; max-width: 100%; height: auto; }
#order-status { font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
#order-status[data-state="paid"] { color: #287144; background: #f0f6ef; border-radius: 10px; padding: 14px; }
#check-payment { width: 100%; }
#payment-link { display: flex; align-items: center; justify-content: center; width: 100%; text-decoration: none; margin: 18px 0 10px; }
@media (prefers-reduced-motion: reduce) { .topup-option-body { transition: none; } }
@media (max-width: 700px) {
  .account-header { min-height: 64px; padding: max(16px, env(safe-area-inset-top)) 16px 16px; gap: 12px; }
  .account-brand { font-size: 18px; }
  .billing-brand-divider, .billing-brand-label, .billing-header-links .account-back { display: none; }
  .billing-header-links { gap: 12px; }
  .billing-main { width: calc(100% - 32px); margin-top: 24px; }
  .billing-heading h1 { font-size: 25px; }
  .billing-page-heading { margin-bottom: 20px; gap: 10px; }
  .billing-page-heading .account-description { font-size: 12px; }
  .billing-heading > button { padding: 8px 10px; min-height: 36px; font-size: 11px; white-space: nowrap; }
  .billing-refresh svg { display: none; }
  .wallet-card { padding: 20px 20px 0; grid-template-columns: 1fr; gap: 20px; border-radius: 14px; }
  .wallet-total strong { font-size: 36px; }
  .wallet-breakdown { gap: 12px; }
  .wallet-breakdown dt { font-size: 11px; }
  .wallet-breakdown dd { font-size: 17px; }
  .wallet-caption { margin-top: 8px; }
  .wallet-details summary { min-height: 42px; }
  .billing-tabs { gap: 0; justify-content: space-between; margin: 20px 0 24px; }
  .billing-tabs button { font-size: 12px; min-height: 44px; padding: 0 0 12px; }
  .section-heading { align-items: flex-start; gap: 10px; }
  .section-heading h2 { font-size: 17px; line-height: 1.5; }
  .section-heading .billing-muted { font-size: 12px; }
  .section-tag { display: none; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-card { padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; }
  .plan-card-heading { grid-column: 1 / -1; margin-bottom: 16px; }
  .plan-price { grid-column: 2; grid-row: 2 / 4; align-self: start; margin: 0; gap: 4px; }
  .plan-price strong { font-size: 29px; }
  .plan-price span { font-size: 11px; }
  .plan-points strong { font-size: 22px; }
  .plan-points { grid-column: 1; display: block; margin: 0 0 6px; }
  .plan-points span { display: block; margin-top: 4px; font-size: 11px; }
  .plan-comparison { grid-column: 1 / -1; margin-top: 10px; }
  .plan-features { grid-column: 1 / -1; margin: 12px 0 14px; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 11px; }
  .plan-card button { grid-column: 1 / -1; }
  .plan-terms { text-align: left; }
  .topup-section { padding: 20px; }
  .topup-heading { gap: 10px; margin-bottom: 20px; }
  .topup-heading .billing-muted { font-size: 13px; }
  .topup-layout { grid-template-columns: 1fr; gap: 20px; }
  .topup-option-body { padding: 16px 14px; }
  .topup-summary { padding: 18px; }
  .billing-records li { align-items: flex-start; }
  .record-actions { flex-direction: column; align-items: flex-end; gap: 8px; }
  .billing-heading { align-items: flex-start; }
  .usage-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .usage-stats > div { padding: 15px; }
  .usage-stats strong { font-size: 23px; }
  .billing-rules .wallet-breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .billing-records { padding: 0 14px; }
  .billing-records li { font-size: 12px; gap: 12px; }
  .billing-records small { font-size: 11px; line-height: 1.7; }
  .admin-toggle { font-size: 11px; white-space: nowrap; }
  .records-section .billing-heading { flex-wrap: wrap; }
  #payment-channels label { gap: 6px; padding: 13px 8px; font-size: 13px; }
  #payment-channels label > span { white-space: nowrap; }
  #payment-channels .payment-channel-icon { width: 20px; height: 20px; }
  #payment-channels input { width: 15px; height: 15px; min-height: 15px; }
}
