:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
  background: #f4f5f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
a { color: #153d83; }
.topbar { min-height: 56px; background: #111827; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .03em; }
.brand img { width: 38px; height: 38px; object-fit: contain; border-radius: 5px; }
.secure { font-size: 13px; color: #f3f4f6; }
.layout { width: 100%; max-width: 680px; margin: 16px auto; padding: 0 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.checkout-card, .trust-card, .return-card { background: #fff; border: 1px solid #d1d5db; border-radius: 14px; box-shadow: 0 5px 18px #1118270a; }
.checkout-card { min-width: 0; padding: 20px 16px; }
.eyebrow { color: #4b5563; font-size: 11px; letter-spacing: .1em; font-weight: 700; margin: 0 0 6px; }
h1 { font-size: 25px; line-height: 1.2; margin: 0 0 4px; letter-spacing: -.025em; }
.product-summary { background: #f8f9fb; border-radius: 9px; padding: 12px; margin: 12px 0 4px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.product-name { min-width: 0; overflow-wrap: anywhere; color: #374151; margin: 0; font-weight: 600; }
.product-summary strong { flex: none; text-align: right; }
fieldset { min-width: 0; border: 0; border-top: 1px solid #e5e7eb; padding: 16px 0 11px; margin: 0; }
legend { padding: 0 8px 0 0; font-weight: 700; }
.step { display: inline-grid; place-items: center; background: #fff1a6; border-radius: 50%; width: 26px; height: 26px; margin-right: 5px; font-size: 13px; }
label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
input, select { display: block; width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px; border: 1px solid #9ca3af; border-radius: 8px; background: #fff; color: #111827; font: inherit; font-size: 16px; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible, .method:focus-within { outline: 3px solid #9a7400; outline-offset: 2px; }
.method-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.method { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 58px; padding: 8px; border: 1px solid #9ca3af; border-radius: 9px; cursor: pointer; margin: 0; }
.method:has(input:checked) { border: 2px solid #b38a00; background: #fff9df; padding: 7px; }
.method:has(input:checked)::after { content: "✓"; position: absolute; right: 7px; top: 5px; color: #594400; font-weight: 800; }
.method input { width: 20px; height: 20px; min-height: 20px; padding: 0; flex: none; accent-color: #705600; }
.method-identity { flex: none; display: flex; align-items: center; gap: 4px; }
.method-logo { display: grid; place-items: center; width: 72px; height: 36px; object-fit: contain; border-radius: 5px; background: #f3f4f6; font-weight: 700; font-size: 11px; color: #111827; }
.method-logo.dark { background: #0d2c6c; }
.card-logo { width: 34px; height: 32px; padding: 2px; }
.method-name { min-width: 0; padding-right: 18px; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.phone-row { display: flex; gap: 8px; }
.phone-row input { flex: 1; }
.prefix { display: grid; place-items: center; min-width: 62px; padding: 0 8px; background: #f3f4f6; border: 1px solid #9ca3af; border-radius: 8px; font-weight: 600; }
.summary { background: #f8f9fb; border-radius: 10px; padding: 14px; margin: 12px 0; }
.summary h2 { font-size: 15px; margin: 0 0 10px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin: 8px 0; }
.summary .total { border-top: 1px solid #9ca3af; padding-top: 10px; margin-top: 10px; font-size: 16px; }
.total strong { font-size: 19px; }
.hint { color: #4b5563; font-size: 13px; line-height: 1.45; margin: 8px 0 0; }
.otp-wrap { margin: 12px 0; }
.ussd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.ussd-actions code { flex: 1 0 100%; padding: 12px; border-radius: 8px; background: #111827; color: #fff; font: 700 20px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.compose-link, .copy-button, .refresh-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 14px; border: 1px solid #374151; border-radius: 8px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.compose-link { color: #111827; background: #fff; }
.copy-button { color: #fff; background: #1f2937; }
.status { min-height: 0; font-size: 14px; line-height: 1.5; color: #374151; }
.status:empty { display: none; }
.status.error { color: #9b1c1c; }
.status.success { color: #176b3a; }
.trust-card { overflow: hidden; }
.trust-card summary { min-height: 48px; display: flex; align-items: center; padding: 12px 16px; cursor: pointer; font-weight: 700; }
.trust-content { border-top: 1px solid #e5e7eb; padding: 16px; }
.trust-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fff1a6; font-size: 20px; font-weight: 700; }
.trust-card h2 { font-size: 17px; margin: 12px 0 7px; }
.trust-card p { color: #4b5563; font-size: 14px; line-height: 1.55; }
.support { border-top: 1px solid #e5e7eb; padding-top: 12px; margin-top: 16px; }
footer { text-align: center; color: #4b5563; font-size: 12px; padding: 8px 16px 20px; }
.pay-dock { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #d1d5db; box-shadow: 0 -5px 18px #11182712; }
.dock-total { min-width: 0; flex: 1; display: grid; gap: 3px; }
.dock-total small { color: #4b5563; font-size: 12px; }
.dock-total strong { overflow-wrap: anywhere; font-size: 16px; }
.pay-button { flex: 1.2; min-width: 0; min-height: 52px; border: 0; border-radius: 9px; padding: 8px 12px; background: #f5c400; color: #111827; font: inherit; font-weight: 750; cursor: pointer; }
.pay-button:disabled { color: #374151; background: #d1d5db; cursor: not-allowed; }
.waiting-screen { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: 24px 16px; background: #f4f5f7; }
.waiting-screen[hidden] { display: none; }
.waiting-card { width: 100%; max-width: 440px; padding: 28px 20px; text-align: center; background: #fff; border: 1px solid #d1d5db; border-radius: 16px; }
.waiting-card h1 { margin: 6px 0 12px; }
.waiting-card p { line-height: 1.55; }
.spinner { display: block; width: 42px; height: 42px; margin: 0 auto 20px; border: 4px solid #e5e7eb; border-top-color: #8a6900; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.countdown { color: #374151; }
.waiting-fallback { font-weight: 700; }
.refresh-button { min-width: 180px; background: #f5c400; color: #111827; }
.return-card { max-width: 500px; margin: 35px 16px; padding: 28px 20px; text-align: center; }
.return-card .trust-icon { margin: 0 auto 16px; }
.return-card h1 { font-size: 24px; }
.back-link { display: inline-flex; align-items: center; min-height: 48px; color: #153d83; font-weight: 600; margin-top: 12px; }
@media (min-width: 400px) {
  .method-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .method { gap: 6px; }
  .method-logo { width: 60px; }
  .card-logo { width: 29px; }
}
@media (min-width: 720px) {
  body { padding-bottom: 0; }
  .topbar { min-height: 64px; padding-right: max(24px, calc((100% - 1050px) / 2)); padding-left: max(24px, calc((100% - 1050px) / 2)); }
  .layout { max-width: 980px; grid-template-columns: minmax(0, 600px) minmax(220px, 1fr); gap: 22px; margin: 30px auto; padding: 0 24px; align-items: start; }
  .checkout-card { padding: 28px 32px; }
  .trust-card { margin-top: 24px; }
  .trust-card summary { display: none; }
  .trust-card:not([open]) > .trust-content { display: block; }
  .trust-card .trust-content { border: 0; padding: 22px; }
  .method-logo { width: 72px; }
  .card-logo { width: 34px; }
  .pay-dock { position: static; max-width: 932px; margin: -14px auto 24px; padding: 0 24px; border: 0; box-shadow: none; background: transparent; justify-content: flex-end; }
  .dock-total { display: none; }
  .pay-button { flex: 0 1 260px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
