:root {
  --ink: #0f1111;
  --muted: #565959;
  --primary: #0f766e;
  --paper: #eaeded;
  --card: #ffffff;
  --line: #d5d9d9;
  --danger: #b12704;
  --warn: #7a4e00;
  --ok: #067d62;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Segoe UI", sans-serif;
}
.top, footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
footer { border-bottom: 0; border-top: 1px solid var(--line); margin-top: 28px; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand img { width: 36px; height: 36px; }
.brand span, footer { color: var(--muted); font-size: 13px; }
.brand strong { display: block; font-size: 16px; }
main { width: min(980px, calc(100% - 32px)); margin: 20px auto 32px; }
.layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); gap: 16px; align-items: start; }
.banner, .return-row { grid-column: 1 / -1; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(15, 17, 17, .06);
}
.eyebrow { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.amount { font-size: 42px; font-weight: 750; letter-spacing: -0.03em; margin: 4px 0 8px; }
.merchant { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.logo, .logo-fallback {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 8px; object-fit: cover;
  background: var(--primary); color: white; display: grid; place-items: center; font-weight: 700;
}
label { display: block; font-size: 13px; margin: 14px 0 6px; font-weight: 650; }
input, select { width: 100%; border: 1px solid #a6acb2; border-radius: 8px; padding: 10px 12px; font: inherit; background: #fff; }
button, .app-link {
  border: 0; border-radius: 8px; padding: 10px 12px; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--primary); color: white; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
button.ghost { background: #fff; color: var(--ink); border: 1px solid #888; }
.qr-wrap { display: grid; justify-items: center; gap: 8px; margin: 8px 0 14px; }
.qr { width: min(240px, 100%); height: auto; border-radius: 8px; background: white; padding: 8px; border: 1px solid var(--line); }
.timer { font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 750; }
.pill { display: inline-flex; border-radius: 4px; padding: 3px 8px; background: #fff4d6; color: var(--warn); font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.pill.ok { background: #e5f6ef; color: var(--ok); }
.pill.bad { background: #fde8e4; color: var(--danger); }
.upi { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 8px; background: #f7f8f8; margin-bottom: 12px; }
.upi code { overflow-wrap: anywhere; flex: 1 1 140px; min-width: 0; }
.apps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.apps .app-link { width: 100%; }
.apps .app-link:last-child:nth-child(odd) { grid-column: 1 / -1; }
.notice { font-size: 13px; color: var(--muted); line-height: 1.45; margin: 8px 0 0; }
.summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.summary-line strong { text-align: right; }
.return-row .app-link, .text-link {
  width: auto; background: #fff; color: #007185; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
}
.env { display: flex; gap: 8px; align-items: center; }
.env select, .env input { width: auto; }
.error { color: var(--danger); font-size: 14px; }
.result { max-width: 560px; margin: 12px auto; padding: 32px 28px 26px; text-align: center; }
.result h2 { margin: 14px 0 6px; font-size: 26px; letter-spacing: -0.02em; }
.result.success h2 { color: var(--ok); }
.result.failed h2 { color: var(--danger); }
.result-lead { margin: 0 auto 18px; max-width: 420px; color: var(--muted); line-height: 1.5; }
.result-icon { width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; }
.result-icon.ok { background: #e5f6ef; }
.result-icon.bad { background: #fde8e4; }
.result-icon svg { width: 52px; height: 52px; fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.result-icon.ok svg { stroke: var(--ok); }
.result-icon.bad svg { stroke: var(--danger); }
.result-icon circle { stroke-width: 3; opacity: .35; }
.result-icon path { stroke-dasharray: 60; animation: draw .55s ease-out; }
@keyframes draw { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }
.result-details { text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 2px 14px; margin: 0 0 18px; }
.result-details .summary-line:last-child { border-bottom: 0; }
.result-details strong { overflow-wrap: anywhere; }
.result-steps { text-align: left; margin: 0 0 18px; padding: 14px 14px 14px 34px; border-radius: 10px; background: #f3faf7; color: #24433b; font-size: 14px; line-height: 1.6; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; min-width: 180px; padding: 12px 18px;
  border-radius: 8px; font-weight: 700; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.result.success .btn-primary { background: var(--ok); }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid #a6acb2; }
.result-countdown { margin: 14px 0 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.refund-box { text-align: left; margin: 0 0 18px; padding: 14px 16px; border-radius: 10px; background: #fff8e6; border: 1px solid #f3d892; }
.refund-box strong { display: block; color: var(--warn); margin-bottom: 4px; }
.refund-box p { margin: 0; color: #4d3a0a; font-size: 14px; line-height: 1.5; }
.result .notice { margin-top: 14px; }
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .result { padding: 26px 18px 22px; }
  .btn-primary, .btn-secondary { width: 100%; }
  .top { align-items: flex-start; flex-direction: column; }
  .amount { font-size: 36px; }
}
