:root {
  color-scheme: light dark;
  --background: #f4f6fa;
  --surface: #fff;
  --surface-muted: #f7f8fc;
  --text: #19243b;
  --muted: #65718a;
  --border: #e1e6f0;
  --primary: #335fe9;
  --primary-hover: #254bc7;
  --primary-soft: #edf2ff;
  --danger: #ad303c;
  --danger-bg: #fff0f2;
  --warning: #80530e;
  --warning-bg: #fff6df;
  --success: #127657;
  --radius: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); line-height: 1.65; }
[hidden] { display: none !important; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .52; cursor: not-allowed; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #7a9aff; outline-offset: 4px; }
.skip-link { position: fixed; top: -60px; left: 16px; z-index: 5; background: var(--surface); padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1040px; min-height: 82px; margin: auto; padding: 0 28px; display: flex; align-items: center; gap: 38px; }
.brand { display: flex; gap: 12px; align-items: center; color: var(--text); font-weight: 750; font-size: 19px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-icon { width: 36px; height: 36px; background: var(--primary); color: #fff; display: grid; place-items: center; border-radius: 11px; font-size: 25px; }
nav { display: flex; gap: 28px; align-self: stretch; align-items: center; }
nav a { color: var(--muted); display: flex; align-items: center; height: 100%; border-bottom: 3px solid transparent; padding-top: 3px; white-space: nowrap; }
nav a[aria-current="page"] { color: var(--primary); border-color: var(--primary); font-weight: 650; }
.demo-label { font-size: 12px; color: var(--muted); padding: 3px 10px; border: 1px solid var(--border); border-radius: 30px; margin-left: auto; white-space: nowrap; }
.main-content { width: min(100%, 880px); min-height: calc(100vh - 190px); margin: 0 auto; padding: 44px 28px 28px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 26px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; letter-spacing: -.6px; line-height: 1.35; }
h2 { font-size: 19px; margin-bottom: 8px; }
.eyebrow { font-size: 12px; color: var(--muted); letter-spacing: 1px; margin-bottom: 6px; }
.primary, .secondary { display: inline-flex; justify-content: center; align-items: center; border: 1px solid transparent; border-radius: 11px; min-height: 44px; padding: 10px 20px; font-size: 14px; font-weight: 650; }
.primary { background: var(--primary); color: #fff; }
.primary:hover:not(:disabled) { background: var(--primary-hover); text-decoration: none; }
.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.secondary:hover:not(:disabled) { background: var(--surface-muted); }
.link-button { border: 0; padding: 3px 0; color: var(--primary); background: transparent; font-size: 13px; }
.wide { width: 100%; }
.balance-card { border-radius: var(--radius); background: linear-gradient(115deg, #315ce4, #486ff0); color: #fff; min-height: 198px; padding: 28px 32px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 10px 26px #315ce41a; }
.balance-card p { color: #e2eaff; font-size: 14px; margin-bottom: 4px; }
.balance-card strong { font-size: clamp(26px, 5vw, 44px); letter-spacing: -1px; font-weight: 700; overflow-wrap: anywhere; }
.balance-unit { font-size: 13px; margin-left: 10px; color: #e2eaff; }
.balance-card .balance-caption { font-size: 12px; margin: 10px 0 0; }
.panel { margin-top: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.section-heading p { font-size: 13px; color: var(--muted); margin-bottom: 0; }
.pill { white-space: nowrap; border-radius: 30px; padding: 4px 10px; background: var(--warning-bg); color: var(--warning); font-size: 11px; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 13px; margin-top: 26px; }
.recharge-option { position: relative; display: flex; flex-direction: column; gap: 9px; align-items: center; border-radius: 13px; border: 1px solid var(--border); padding: 21px 12px; cursor: pointer; background: var(--surface); }
.recharge-option input { position: absolute; top: 10px; right: 10px; accent-color: var(--primary); margin: 0; }
.recharge-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.recharge-option:has(input:disabled) { cursor: default; }
.recharge-option strong { font-size: 19px; }
.recharge-option span { color: var(--muted); font-size: 14px; }
.purchase-summary { font-size: 14px; text-align: center; margin: 24px 0 14px; }
.message { padding: 12px 15px; border-radius: 10px; font-size: 13px; margin: 16px 0; overflow-wrap: anywhere; }
.message.error { background: var(--danger-bg); color: var(--danger); }
.message.warning { background: var(--warning-bg); color: var(--warning); }
.message.subtle { color: var(--success); padding-left: 0; }
.recovery-panel { border-color: #b9c9f7; }
.recovery-panel p { font-size: 14px; color: var(--muted); }
.records-link { display: flex; justify-content: space-between; color: var(--text); font-size: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 17px 22px; margin-top: 20px; }
.records-link:hover { text-decoration: none; border-color: var(--primary); }
.footnote { margin: 18px 3px; color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.records-panel { padding: 0 26px; }
.record-row { display: flex; gap: 18px; justify-content: space-between; padding: 22px 0; color: var(--text); border-bottom: 1px solid var(--border); }
.record-row:last-child { border-bottom: 0; }
.record-row:hover { text-decoration: none; }
.record-row > div { display: flex; flex-direction: column; gap: 5px; }
.record-row strong { font-size: 16px; }
.record-row span { font-size: 12px; }
.record-ending { text-align: right; }
.status-label[data-status="CREDITED"] { color: var(--success); }
.status-label[data-status="CONFIRMING"], .status-label[data-status="EXCEPTION"] { color: var(--warning); }
.load-more { display: flex; margin: 12px auto 24px; }
.empty-state { text-align: center; padding: 45px 20px; }
.empty-state p { font-size: 14px; color: var(--muted); }
.back-link { display: inline-block; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.order-panel { margin-top: 0; }
.order-status { font-size: 25px; font-weight: 700; margin: 3px 0 8px; }
.order-status[data-status="CREDITED"] { color: var(--success); }
.order-status[data-status="EXCEPTION"] { color: var(--warning); }
.order-panel > p { font-size: 14px; }
.order-facts { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 24px; }
.order-facts > div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 16px; padding: 9px 0; font-size: 14px; }
.order-facts dt { color: var(--muted); }
.order-facts dd { text-align: right; margin: 0; overflow-wrap: anywhere; }
.order-number { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.order-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; }
.payment-panel { border-color: #d9c590; }
.payment-amount { font-weight: 650; font-size: 19px; }
.payment-panel > .muted { font-size: 12px; }
.native-payment { text-align: center; font-size: 14px; }
.native-qr { display: flex; justify-content: center; margin: 20px auto; }
.native-qr canvas { display: block; width: min(280px, 100%); height: auto; background: #fff; border-radius: 8px; }
.site-footer { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; align-items: center; padding: 18px 20px 26px; color: var(--muted); font-size: 11px; }
.session-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 34px; }
.session-panel h1 { font-size: 23px; margin-bottom: 18px; }
.error-request-id { overflow-wrap: anywhere; font-size: 12px; }
.error-diagnostic-text { box-sizing: border-box; width: 100%; max-width: 100%; margin-top: 12px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.frozen-balance { font-size: 13px; color: #e2eaff; margin-top: 18px; }
.frozen-balance strong { font-size: 20px; margin: 0 6px; letter-spacing: 0; }
.task-form > label { display: block; font-size: 14px; margin-bottom: 8px; }
.task-input-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-input-row input { min-width: 0; flex: 1 1 220px; }
.task-input-row input, .task-input-row select { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); }
.consumption-confirm { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; margin: 18px 0; }
.consumption-confirm input { margin-top: 6px; accent-color: var(--primary); }
.consumption-record { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); padding: 18px 0; }
.consumption-record:last-child { border-bottom: 0; }
.consumption-record > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.consumption-record span { font-size: 12px; }
.order-status[data-status="SETTLED"], .order-status[data-status="RELEASED"] { color: var(--success); }
.order-status[data-status="HELD"] { color: var(--warning); }

@media (max-width: 600px) {
  .header-inner { padding: 0 18px; gap: 18px; min-height: 72px; }
  .brand { font-size: 16px; gap: 8px; }
  .brand-icon { width: 30px; height: 30px; border-radius: 9px; font-size: 21px; }
  nav { gap: 12px; font-size: 13px; }
  .header-inner { flex-wrap: wrap; gap: 0 18px; padding-top: 12px; }
  nav { min-height: 45px; }
  .task-input-row > button { flex: 1 1 auto; }
  .demo-label { display: none; }
  .main-content { padding: 28px 18px 16px; }
  h1 { font-size: 25px; }
  .page-heading { margin-bottom: 22px; }
  .page-heading .secondary { padding: 8px 12px; font-size: 12px; }
  .balance-card { min-height: 180px; padding: 24px; }
  .panel { padding: 22px; border-radius: 16px; }
  .section-heading { flex-wrap: wrap; }
  .option-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .recharge-option { padding: 22px 8px 16px; }
  .recharge-option strong { font-size: 17px; }
  .records-panel { padding: 0 19px; }
  .record-row { padding: 20px 0; gap: 12px; }
  .order-facts > div { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; font-size: 13px; }
  .order-status { font-size: 23px; }
  .site-footer { gap: 6px 14px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #101622;
    --surface: #1a2333;
    --surface-muted: #212d40;
    --text: #edf2ff;
    --muted: #a0aec7;
    --border: #303d54;
    --primary: #8faeff;
    --primary-hover: #7498f0;
    --primary-soft: #273a61;
    --danger: #ffafb9;
    --danger-bg: #422735;
    --warning: #f1cc86;
    --warning-bg: #3c3322;
    --success: #88dcba;
  }
  .primary { color: #12203c; }
  .brand-icon { color: #12203c; }
  .balance-card { background: linear-gradient(115deg, #274bbf, #385acb); }
  .recovery-panel { border-color: #476495; }
}

/* Checkout: quiet surfaces, visible totals and native keyboard radio controls. */
.recharge-page .page-heading { align-items: flex-start; }
.page-description { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.heading-records { font-size: 13px; white-space: nowrap; padding-top: 29px; }
.recharge-page .balance-card { flex-direction: row; align-items: center; min-height: 140px; padding: 25px 30px; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.recharge-page .balance-card p, .recharge-page .balance-unit { color: var(--muted); }
.recharge-page .balance-card strong { font-size: clamp(30px, 5vw, 42px); letter-spacing: -.9px; }
.balance-card-ending { text-align: right; }
.balance-card-ending .link-button { min-height: 36px; }
.recharge-panel { padding: 27px 28px 0; overflow: visible; }
.recharge-panel .pill { background: var(--surface-muted); color: var(--muted); border: 1px solid var(--border); font-size: 12px; }
.recharge-page .option-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 12px; margin-top: 23px; }
.recharge-page .recharge-option { min-width: 0; min-height: 156px; align-items: stretch; gap: 5px; padding: 16px; border-radius: 12px; transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease; }
.recharge-page .recharge-option:hover:not(:has(input:disabled)) { border-color: var(--primary); }
.recharge-page .recharge-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.recharge-page .recharge-option:has(input:focus-visible) { outline: 3px solid #7a9aff; outline-offset: 3px; }
.recharge-page .recharge-option:has(input:disabled) { cursor: not-allowed; }
.recharge-page .recharge-option input { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; opacity: 0; }
.recharge-page .option-topline { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 20px; }
.recharge-page .option-name { color: var(--muted); font-size: 12px; }
.recharge-page .option-check { display: grid; place-items: center; flex-shrink: 0; width: 19px; height: 19px; background: var(--primary); color: #fff; border-radius: 50%; opacity: 0; font-size: 12px; transition: opacity 180ms ease; }
.recharge-page .recharge-option:has(input:checked) .option-check { opacity: 1; }
.recharge-page .option-price { display: block; color: var(--text); font-size: 28px; font-weight: 750; line-height: 1.4; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.recharge-page .option-points { color: var(--text); font-size: 13px; }
.recharge-page .option-pages { color: var(--muted); font-size: 12px; line-height: 1.5; }
.selection-note { margin: 14px 0 23px; color: var(--muted); font-size: 13px; min-height: 22px; }
.payment-method-section { border-top: 1px solid var(--border); padding-top: 19px; }
.payment-method-section h3 { font-size: 14px; font-weight: 650; margin: 0 0 13px; }
.payment-method { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 11px; }
.payment-method-icon { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-size: 17px; font-weight: 650; }
.payment-method strong { font-size: 14px; }
.payment-method p { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 3px 0 0; }
.method-selected { margin-left: auto; color: var(--primary); font-weight: 700; }
.checkout-assurance { display: flex; align-items: flex-start; gap: 7px; margin: 15px 0 19px; color: var(--muted); }
.assurance-icon { color: var(--success); font-size: 13px; line-height: 1.7; }
.checkout-assurance p { margin: 0; font-size: 12px; line-height: 1.7; }
.checkout-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 0; border-top: 1px solid var(--border); }
.recharge-page .purchase-summary { min-width: 0; text-align: left; margin: 0; }
.summary-label { color: var(--muted); font-size: 12px; margin-right: 9px; }
.summary-amount { color: var(--text); font-size: 28px; letter-spacing: -.7px; font-variant-numeric: tabular-nums; line-height: 1.35; }
.summary-credit { color: var(--muted); font-size: 12px; margin: 2px 0 0; }
.summary-credit strong { color: var(--text); font-weight: 650; }
.checkout-bar > .primary { min-width: 176px; min-height: 48px; flex-shrink: 0; font-size: 15px; gap: 8px; transition: background-color 180ms ease, opacity 180ms ease; }
.button-progress { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: checkout-spin 800ms linear infinite; }
@keyframes checkout-spin { to { transform: rotate(360deg); } }
.recharge-help { margin-top: 21px; padding: 0 3px; font-size: 13px; color: var(--muted); }
.recharge-help summary { cursor: pointer; min-height: 38px; padding: 8px 0; color: var(--text); }
.recharge-help > div { padding: 8px 0 1px; }
.recharge-help p { margin-bottom: 10px; line-height: 1.8; }
.recharge-footnote { line-height: 1.75; }
@media (max-width: 600px) {
  body:has(.recharge-page) { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .recharge-page .page-heading { gap: 12px; }
  .recharge-page .eyebrow { font-size: 11px; letter-spacing: .4px; }
  .page-description { font-size: 13px; }
  .heading-records { padding-top: 25px; font-size: 12px; }
  .recharge-page .balance-card { align-items: flex-start; flex-direction: column; gap: 8px; padding: 20px; min-height: 148px; }
  .balance-card-ending { text-align: left; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .recharge-page .balance-card .balance-caption { margin: 0; }
  .recharge-panel { padding: 20px; }
  .recharge-page .option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
  .recharge-page .recharge-option { min-height: 139px; padding: 12px 10px; gap: 5px; }
  .recharge-page .option-price { font-size: clamp(21px, 5.6vw, 27px); letter-spacing: -.6px; }
  .recharge-page .option-name { font-size: 11px; }
  .recharge-page .option-points { font-size: 12px; }
  .recharge-page .option-pages { font-size: 11px; }
  .payment-method { padding: 13px 11px; gap: 9px; }
  .payment-method-icon { width: 31px; height: 31px; }
  .checkout-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 3; background: var(--surface); padding: 13px 18px calc(13px + env(safe-area-inset-bottom)); box-shadow: 0 -3px 14px #19243b08; gap: 10px; }
  .checkout-bar > .primary { min-width: 122px; min-height: 46px; padding: 10px 12px; font-size: 14px; }
  .summary-amount { font-size: 25px; }
  .summary-label { display: block; font-size: 11px; margin: 0 0 2px; }
  .summary-credit { font-size: 11px; }
  .selection-note { margin-bottom: 20px; }
}
@media (prefers-color-scheme: dark) {
  .recharge-page .balance-card { background: var(--surface); }
  .recharge-page .option-check { color: #12203c; }
}
@media (prefers-reduced-motion: reduce) {
  .recharge-option, .option-check, .checkout-bar > .primary { transition: none !important; }
  .button-progress { animation: none; }
}

/* Card redemption shares the existing points centre surfaces and typography. */
.card-purchase { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.card-purchase h2, .card-redeem h2 { margin-top: 14px; }
.card-purchase p { margin-bottom: 0; font-size: 14px; }
.card-purchase > a { flex-shrink: 0; }
.card-input-label { display: block; margin: 24px 0 8px; font-weight: 650; font-size: 14px; }
.card-code-input { width: 100%; min-height: 52px; border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; color: var(--text); background: var(--surface-muted); font-family: ui-monospace, Consolas, monospace; font-size: 16px; }
.card-code-input:disabled { opacity: .65; }
.card-redeem .footnote { margin: 8px 0 18px; }
.card-confirm, .card-receipt { border: 1px solid var(--border); border-radius: 14px; padding: 22px; margin-top: 24px; background: var(--surface-muted); }
.card-confirm h3, .card-receipt h3 { margin-top: 0; }
.card-receipt { border-color: var(--success); }
.card-receipt h3, .card-receipt > p { color: var(--success); }
.redemption-record { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .card-purchase { align-items: stretch; flex-direction: column; gap: 18px; }
  .card-confirm, .card-receipt { padding: 16px; }
  .redemption-record { flex-direction: column; gap: 10px; }
  .redemption-record .record-ending { text-align: left; }
}
.card-purchase a[aria-disabled="true"] { opacity: .52; cursor: not-allowed; }
