:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1a1f24;
  --muted: #56606b;
  --border: #c9d1d9;
  --accent: #0b5cad;
  --accent-text: #ffffff;
  --ok-bg: #e6f4ea; --ok: #1e6b34;
  --warn-bg: #fff4e0; --warn: #7a4b00;
  --err-bg: #fdecea; --err: #a1261b;
  --info-bg: #e8f0fb; --info: #0b4a8c;
  --focus: #ffbf47;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161a; --card: #1c2228; --text: #e8edf2; --muted: #a6b0ba; --border: #3a444e;
    --accent: #5aa2f0; --accent-text: #0b1520;
    --ok-bg: #173622; --ok: #8fe0a8; --warn-bg: #3a2c10; --warn: #f5c97a;
    --err-bg: #3d1a17; --err: #ffaba3; --info-bg: #15283f; --info: #9cc6f5;
  }
}
* { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5;
  display: flex; justify-content: center; align-items: flex-start; padding: 24px 16px;
}
.card {
  width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px;
}
h1 { font-size: 1.5rem; margin: 0 0 16px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
.amount-row { display: flex; align-items: stretch; }
.prefix {
  display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--border); border-right: 0;
  border-radius: 8px 0 0 8px; background: var(--bg); font-weight: 600;
}
input[type="text"] {
  flex: 1; min-width: 0; font-size: 1.25rem; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 0 8px 8px 0; background: var(--card); color: var(--text);
}
input[aria-invalid="true"] { border-color: var(--err); }
button {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 8px; padding: 12px 18px;
  background: var(--accent); color: var(--accent-text); min-height: 44px;
}
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button[disabled] { opacity: .6; cursor: progress; }
#submit { width: 100%; margin-top: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.help, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.error { color: var(--err); min-height: 1.5em; margin: 6px 0; font-weight: 600; }
.amount { font-size: 2rem; font-weight: 700; margin: 0 0 12px; }
.qr { margin: 0 0 16px; text-align: center; }
.qr img {
  width: 100%; max-width: 280px; height: auto; image-rendering: pixelated; background: #fff;
  padding: 8px; border-radius: 8px; border: 1px solid var(--border);
}
.qr figcaption { font-size: .875rem; color: var(--muted); margin-top: 6px; }
.status { border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 2px; }
.status-pending, .status-processing, .status-unknown { background: var(--info-bg); color: var(--info); }
.status-done { background: var(--ok-bg); color: var(--ok); }
.status-review { background: var(--warn-bg); color: var(--warn); }
.status-expired, .status-cancelled, .status-failed, .status-gone { background: var(--err-bg); color: var(--err); }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.share p { flex-basis: 100%; margin: 0; min-height: 1.5em; }
.hidden { display: none !important; }
a { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
