/* Keep checkout layout independent from the shared dashboard and QR widgets. */
#checkout {
  --checkout-muted: #667e85;
  min-height: 100vh;
  padding: 30px 28px 24px;
  background: radial-gradient(ellipse at 20% 0, #e0f3ed 0, transparent 54%), #f4f8f7;
  color: #122e38;
}
#checkout [hidden], #checkout .hidden { display: none !important; }
#checkout .checkout-top {
  width: min(920px, 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 0 auto;
}
#checkout .checkout-top .brand { margin: 0; }
#checkout .checkout-top .brand img { width: 34px; height: 34px; }
#checkout-mode-label { color: #667d82; font-size: 12px; text-align: right; }
#checkout .checkout-card {
  width: min(920px, 100%);
  margin: clamp(28px, 6vh, 68px) auto 20px;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #d9e6e2;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 22px 65px #183d4510, 0 2px 5px #183d4503;
}
#checkout .checkout-summary {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 42px 38px 34px;
  background: linear-gradient(150deg, #f0f8f5, #e8f2f0);
  border-right: 1px solid #e0eae6;
}
#checkout .checkout-eyebrow { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: #168875; }
#checkout .checkout-eyebrow > span { width: 6px; height: 6px; border-radius: 50%; background: #16b69a; }
#checkout h1 { margin: 12px 0 10px; font-size: 30px; line-height: 1.25; letter-spacing: -.04em; }
#checkout .checkout-summary-intro { margin: 0; max-width: 300px; font-size: 12px; line-height: 1.8; color: var(--checkout-muted); }
#checkout .checkout-total { padding: 34px 0 29px; }
#checkout-amount-label, #checkout .checkout-detail-label { display: block; font-size: 11px; line-height: 1.5; color: var(--checkout-muted); }
#checkout-amount { display: block; margin: 9px 0 6px; font-size: clamp(36px, 4.2vw, 48px); line-height: 1.2; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.045em; overflow-wrap: anywhere; }
#checkout .checkout-currency { font-size: 10px; color: #7d9398; letter-spacing: .06em; }
#checkout .checkout-order-summary { padding: 23px 0 25px; border-top: 1px solid #d7e5df; }
#checkout-subject { margin: 8px 0 10px; font-size: 14px; font-weight: 700; line-height: 1.7; overflow-wrap: anywhere; }
#checkout-order-no { display: block; font: 10px/1.8 'DM Mono', monospace; overflow-wrap: anywhere; color: #788f95; }
#checkout .checkout-merchant { margin-top: auto; padding-top: 22px; border-top: 1px solid #d7e5df; display: flex; align-items: center; gap: 12px; }
#checkout-merchant-initial { display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 13px; background: #173b43; color: #65dfc6; font-size: 17px; }
#checkout .checkout-merchant > div { min-width: 0; }
#checkout-merchant-name { display: block; margin-top: 3px; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
#checkout-merchant-note { display: block; margin-top: 3px; color: #7d9398; font-size: 10px; }
#checkout .checkout-payment { min-width: 0; padding: 36px 38px 25px; }
#checkout .checkout-payment-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
#checkout .checkout-payment-heading h2 { margin: 0; font-size: 15px; line-height: 1.5; }
#checkout .checkout-payment-heading > span { font-size: 10px; color: #8aa09f; }
#checkout .checkout-channels { display: flex; justify-content: flex-start; gap: 9px; }
#checkout .checkout-channels button { display: flex; align-items: center; justify-content: center; flex: 1; gap: 7px; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #e1e9e7; border-radius: 10px; background: #fff; color: #597177; font: inherit; font-size: 12px; font-weight: 600; }
#checkout .checkout-channels button.active { background: #effaf6; border-color: #31b79b; color: #167762; box-shadow: 0 0 0 1px #31b79b12; }
#checkout .checkout-channel-symbol { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 5px; color: #fff; font-size: 13px; font-weight: 700; }
#checkout .checkout-channel-alipay { background: #1677ff; }
#checkout .checkout-channel-wechat { background: #17af62; }
#checkout .checkout-channel-check { margin-left: auto; color: #198d75; opacity: 0; font-size: 13px; }
#checkout .checkout-channels button.active .checkout-channel-check { opacity: 1; }
#checkout .checkout-scan { padding: 22px 0 0; text-align: center; }
#checkout .checkout-qr-frame { width: 244px; min-height: 244px; max-width: 100%; margin: 0 auto; padding: 11px; display: grid; place-items: center; border: 1px solid #e0e9e5; border-radius: 15px; background: #fff; }
#checkout-qr-image { display: block; width: 220px; height: 220px; max-width: 100%; object-fit: contain; background: #fff; }
#checkout-qr-placeholder { display: flex; min-height: 220px; flex-direction: column; justify-content: center; align-items: center; gap: 16px; color: #a4b9b5; }
#checkout-qr-placeholder svg { width: 58px; height: 58px; }
#checkout-qr-placeholder small { font-size: 11px; color: #7a9396; }
#checkout-qr-value { display: block; width: 220px; max-width: 100%; max-height: 220px; overflow: auto; overflow-wrap: anywhere; white-space: normal; font: 11px/1.7 'DM Mono', monospace; text-align: left; color: #4d6971; }
#checkout-qr-label { display: block; margin-top: 15px; font-size: 13px; color: #284950; }
#checkout-instruction { margin: 6px 0 0; font-size: 11px; line-height: 1.7; color: #7a8f94; }
#checkout .checkout-pay-links { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 17px 0 0; }
#checkout .checkout-pay-links .btn { min-height: 40px; box-shadow: none; }
#checkout .checkout-text-action { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 0; border: 0; background: transparent; color: #327c71; font-size: 11px; line-height: 1.5; cursor: pointer; }
#checkout .checkout-text-action:hover { color: #0d5a4f; text-decoration: underline; }
#checkout .checkout-text-action svg { width: 15px; height: 15px; flex-shrink: 0; }
#checkout-pay { display: block; width: 100%; min-height: 43px; margin-top: 17px; font-size: 12px; box-shadow: none; }
#checkout .checkout-payment-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 17px; border-top: 1px solid #edf1ef; }
#checkout-status { display: flex; align-items: center; gap: 7px; margin: 0; min-height: 0; font-size: 11px; line-height: 1.6; color: #668079; }
#checkout-status::before { content: ''; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: #c49a46; }
#checkout-status.success::before { background: #19a587; }
#checkout-status.danger::before, #checkout-status.error::before { background: #c27861; }
#checkout-message { margin: 11px 0 0; min-height: 0; font-size: 10px; line-height: 1.8; color: #809399; }
#checkout-message.error { color: #ab5848; border-radius: 8px; background: #fff5f1; padding: 9px 11px; }
#checkout .checkout-result { min-height: 368px; padding: 70px 12px 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
#checkout .checkout-result-symbol { width: 66px; height: 66px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 50%; background: #e6f8f1; color: #1d9d7f; }
#checkout .checkout-result-symbol svg { width: 31px; height: 31px; }
#checkout .checkout-result-check { display: none; }
#checkout-result[data-state='paid'] .checkout-result-check, #checkout-result[data-state='refunded'] .checkout-result-check { display: block; }
#checkout-result[data-state='paid'] .checkout-result-info, #checkout-result[data-state='refunded'] .checkout-result-info { display: none; }
#checkout-result-title { margin: 0; font-size: 23px; }
#checkout-result-description { max-width: 270px; margin: 13px 0 0; color: #71878c; font-size: 12px; line-height: 1.8; }
#checkout .checkout-return { margin-top: 20px; }
#checkout-return-countdown { margin: 0 0 12px; color: var(--checkout-muted); font-size: 11px; line-height: 1.7; font-variant-numeric: tabular-nums; }
#checkout-return-now { min-height: 42px; min-width: 136px; justify-content: center; box-shadow: none; }
#checkout-result[data-state='closed'] .checkout-result-symbol, #checkout-result[data-state='expired'] .checkout-result-symbol, #checkout-result[data-state='error'] .checkout-result-symbol, #checkout-result[data-state='failed'] .checkout-result-symbol { color: #8a7966; background: #f3eee7; }
#checkout .checkout-footer { display: flex; justify-content: space-between; align-items: center; width: min(920px, 100%); margin: 0 auto; padding: 0 5px; gap: 15px; color: #809297; font-size: 10px; line-height: 1.8; }
#checkout .checkout-footer nav { display: flex; align-items: center; gap: 12px; }
#checkout .checkout-footer a { color: #627c82; }
#checkout .checkout-footer a:hover { color: #158771; }
#checkout :is(button, a):focus-visible { outline: 3px solid #62c7b3; outline-offset: 4px; }
#checkout button:disabled { cursor: default; }
#checkout .checkout-text-action:disabled { color: #8da19f; }
@media (max-width: 700px) {
  #checkout { padding: 20px 16px 22px; }
  #checkout .checkout-card { grid-template-columns: 1fr; max-width: 480px; margin-top: 24px; border-radius: 19px; }
  #checkout .checkout-top, #checkout .checkout-footer { max-width: 480px; }
  #checkout .checkout-summary { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; column-gap: 12px; padding: 22px 24px 18px; border-right: 0; border-bottom: 1px solid #dfe9e4; }
  #checkout .checkout-eyebrow { grid-column: 1; grid-row: 1; align-self: end; font-size: 10px; }
  #checkout h1 { grid-column: 1; grid-row: 2; font-size: 23px; margin: 7px 0 0; }
  #checkout .checkout-summary-intro { display: none; }
  #checkout .checkout-total { grid-column: 2; grid-row: 1 / 3; align-self: center; min-width: 0; padding: 0; text-align: right; }
  #checkout-amount { font-size: 34px; margin: 5px 0 0; }
  #checkout .checkout-currency { display: none; }
  #checkout .checkout-order-summary { grid-column: 1 / -1; margin-top: 18px; padding: 12px 0; }
  #checkout-subject { font-size: 13px; margin: 5px 0; }
  #checkout .checkout-merchant { grid-column: 1 / -1; margin-top: 0; padding-top: 12px; gap: 10px; }
  #checkout-merchant-initial { width: 34px; height: 34px; border-radius: 10px; font-size: 14px; }
  #checkout .checkout-merchant > div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center; }
  #checkout-merchant-name { margin: 0; font-size: 12px; }
  #checkout-merchant-note { display: none; }
  #checkout .checkout-payment { padding: 24px 24px 20px; }
  #checkout .checkout-qr-frame { width: 224px; min-height: 224px; }
  #checkout-qr-image { width: 200px; height: 200px; }
  #checkout-qr-placeholder { min-height: 200px; }
  #checkout .checkout-scan { padding-top: 20px; }
  #checkout .checkout-result { min-height: 285px; padding: 36px 0; }
  #checkout .checkout-footer { flex-wrap: wrap; justify-content: center; gap: 5px 16px; text-align: center; }
}
@media (max-width: 370px) {
  #checkout { padding-inline: 12px; }
  #checkout .checkout-summary, #checkout .checkout-payment { padding-inline: 20px; }
  #checkout-mode-label { max-width: 135px; font-size: 10px; }
  #checkout .checkout-channels button { padding-inline: 8px; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  #checkout *, #checkout *::before, #checkout *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
