:root {
  --bg: #f4f5f7;
  --card: #fff;
  --text: #15171a;
  --muted: #6b7280;
  --accent: #2b6af3;
  --ok: #16a34a;
  --line: #e5e7eb;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111214; --card: #1c1e22; --text: #f3f4f6; --muted: #9ca3af; --line: #2c2f35; }
}
body.pay { --accent: #0f9d76; }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.app { max-width: 480px; margin: 0 auto; padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
.screen { display: flex; flex-direction: column; gap: 14px; }
.screen[hidden] { display: none; }
.center { align-items: center; text-align: center; padding-top: 48px; }
h1 { margin: 0; font-size: 26px; }
h2 { margin: 8px 0 0; font-size: 22px; }
.head { display: flex; flex-direction: column; gap: 4px; }
.muted { color: var(--muted); margin: 0; }
.brand { margin: 0; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.items, .receipt { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; width: 100%; }
.item { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 14px; padding: 12px; }
.icon { font-size: 30px; width: 44px; text-align: center; }
.info { flex: 1; display: flex; flex-direction: column; }
.info small, .card-pick small { color: var(--muted); }
.qty { display: flex; align-items: center; gap: 8px; }
.qty output { min-width: 18px; text-align: center; font-weight: 600; }
.step { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 18px; }
.total-row { display: flex; justify-content: space-between; width: 100%; padding: 12px 4px; border-top: 1px solid var(--line); font-size: 18px; }
.receipt li { text-align: left; background: var(--card); border-radius: 12px; padding: 10px 12px; }
.btn { width: 100%; border: 0; border-radius: 14px; padding: 15px; font-size: 17px; font-weight: 600; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:disabled { opacity: .45; }
.btn.ghost { background: transparent; color: var(--accent); }
.notice { background: #fff4e5; color: #8a4b00; border-radius: 12px; padding: 10px 12px; }
.hint { color: #b45309; font-size: 13px; margin: 0; }
.card-pick { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 14px; padding: 14px; }
.card-pick span:last-child { display: flex; flex-direction: column; }
.card-chip { width: 42px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, var(--accent), #7dd3c0); }
.spinner { width: 52px; height: 52px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.check { width: 72px; height: 72px; border-radius: 50%; background: var(--ok); position: relative; }
.check::after { content: ""; position: absolute; left: 25px; top: 14px; width: 18px; height: 34px; border: solid #fff; border-width: 0 5px 5px 0; transform: rotate(45deg); }
.log-box { margin-top: 28px; font-size: 12px; color: var(--muted); }
.log-box pre { white-space: pre-wrap; word-break: break-all; margin: 8px 0 0; }
