:root {
  color-scheme: light;
  --paper: #f3f5f2;
  --white: #fff;
  --ink: #17241d;
  --muted: #52665b;
  --line: #dce5de;
  --green: #176047;
  font: 15px/1.55 Inter, system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.checkout { max-width: 860px; margin: auto; padding: 24px 24px 48px; }
.brand, .order-summary, footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { padding: 0 0 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.brand strong { color: var(--green); font-size: 26px; letter-spacing: -.045em; }
.order-summary { padding: 20px 0 18px; align-items: flex-end; }
.label, label { display: block; color: var(--muted); font-size: 13px; }
#amount { display: block; font-size: clamp(32px, 5vw, 45px); line-height: 1.15; letter-spacing: -.035em; }
.expiry { text-align: right; }
#countdown, #usdt-amount { font-variant-numeric: tabular-nums; }
#countdown { font-weight: 650; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
#fixed { margin-top: 20px; }
h1 { margin: 0 0 14px; font-size: 21px; line-height: 1.3; }
input, select, button, .primary {
  font: inherit;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #b9cbbf;
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
}
input, select { width: 100%; margin: 5px 0 14px; }
button, .primary { font-weight: 620; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  text-decoration: none;
}
.primary:hover { background: #0e4c36; }
.transfer-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px 30px; align-items: start; }
figure {
  margin: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: center;
}
#qr img, #qr canvas { margin: 0 auto; }
figcaption { margin-top: 8px; font-size: 12px; color: var(--muted); }
.transfer-fields { display: grid; gap: 12px; min-width: 0; }
.transfer-fields > div + div { padding-top: 10px; border-top: 1px solid var(--line); }
.copy-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.copy-field button { min-height: 32px; padding: 4px 8px; font-size: 13px; flex: none; }
code { font-family: "IBM Plex Mono", ui-monospace, monospace; overflow-wrap: anywhere; }
#transfer-note { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
#hosted-checkout { margin-top: 12px; }
#merchant-return { margin-bottom: 14px; }
.status { margin: 14px 0; color: var(--muted); }
.status:empty { display: none; }
.status[data-state="paid"] { color: var(--green); font-size: 18px; font-weight: 720; }
.status[data-state="error"] { color: #8f352a; }
footer { padding: 14px 0 0; border-top: 1px solid var(--line); }
footer code { font-size: 12px; }
footer button { flex-shrink: 0; }
@media (max-width: 560px) {
  .checkout { padding: 16px 16px 32px; }
  .panel { padding: 16px; }
  .transfer-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  figure { justify-self: center; }
  .panel > .primary { width: 100%; }
  footer { align-items: flex-start; flex-wrap: wrap; }
}

.brand-actions { display: flex; align-items: center; gap: 12px; }
#checkout-language { width: auto; min-height: 32px; margin: 0; font-size: 13px; }
.fixed-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fixed-choices > :only-child, .fixed-choices > [hidden] + div { grid-column: 1 / -1; }
#paid-result h1 { color: var(--green); }
#paid-result p { margin: 0; }

.picker-trigger { display: none; }
#mobile-picker {
  width: min(420px, calc(100% - 24px));
  max-height: 85vh;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
}
#mobile-picker::backdrop { background: rgb(23 36 29 / 48%); }
.picker-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.picker-header h2 { font-size: 18px; margin: 0; }
#mobile-picker-options { display: grid; gap: 8px; }
#mobile-picker-options button { min-height: 44px; text-align: start; overflow-wrap: anywhere; }
#mobile-picker-options [aria-pressed="true"] { color: var(--green); border-color: var(--green); background: var(--paper); }
@media (max-width: 560px) {
  select.has-mobile-picker { display: none; }
  select.has-mobile-picker:not([hidden]) + .picker-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    margin: 5px 0 14px;
    text-align: start;
    overflow-wrap: anywhere;
  }
  .picker-trigger::after {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    border-right: 1px solid;
    border-bottom: 1px solid;
    transform: rotate(45deg);
  }
  #checkout-language:not([hidden]) + .picker-trigger { width: auto; margin: 0; }
  .fixed-choices { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
