:root {
  --bg: #0b1220;
  --card: #121a2b;
  --card-2: #182236;
  --fg: #f4f7fb;
  --muted: #94a3b8;
  --line: #243044;
  --teal: #22d3ee;
  --teal-2: #0e7490;
  --good: #34d399;
  --good-bg: rgba(52, 211, 153, .12);
  --bad: #fb7185;
  --bad-bg: rgba(251, 113, 133, .12);
  --warn: #fbbf24;
  --btn: #f8fafc;
  --shadow: 0 16px 40px rgba(0,0,0,.35);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --radius: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: Assistant, "Segoe UI", sans-serif; }
body { min-height: 100dvh; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--teal); }
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; padding: calc(12px + var(--safe-t)) 16px calc(20px + var(--safe-b)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 36px; height: 36px; border-radius: 10px; }
.brand h1 { font-size: 18px; margin: 0; letter-spacing: -.02em; }
.icon-btn, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--fg);
  border-radius: 12px; min-height: 44px; padding: 0 14px; font-weight: 600;
}
.icon-btn { width: 44px; padding: 0; }
.btn:disabled, .icon-btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--teal-2); border-color: transparent; color: #fff; }
.btn.good { border-color: color-mix(in oklab, var(--good) 50%, var(--line)); color: var(--good); background: var(--good-bg); }
.btn.bad { border-color: color-mix(in oklab, var(--bad) 50%, var(--line)); color: var(--bad); background: var(--bad-bg); }
.btn.lg { min-height: 56px; font-size: 18px; width: 100%; }
.btn.ghost { background: transparent; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.login { padding-top: 12vh; display: grid; gap: 16px; }
.login h1 { font-size: 28px; margin: 0; }
input[type=password], input[type=text], input[type=file] {
  width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--fg); padding: 0 14px;
}
.progress { display: grid; gap: 6px; margin-bottom: 12px; }
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--teal); width: 0; transition: width .25s; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.stage { position: relative; height: min(56dvh, 460px); min-height: 340px; overflow: hidden; }
.card, .shadow-card {
  position: absolute; inset: 0; border-radius: 24px; border: 1px solid var(--line);
  background: var(--card); box-shadow: var(--shadow); overflow: hidden;
  touch-action: pan-y;
}
.shadow-card { transform: translateY(8px) scale(.96); opacity: .55; pointer-events: none; }
.card.anim { transition: transform .2s ease-out; }
.stamp {
  position: absolute; top: 22px; padding: 4px 12px; border: 3px solid; border-radius: 10px;
  font-weight: 800; font-size: 22px; letter-spacing: .04em; pointer-events: none;
}
.stamp.keep { left: 18px; color: var(--good); border-color: var(--good); transform: rotate(12deg); }
.stamp.cancel { right: 18px; color: var(--bad); border-color: var(--bad); transform: rotate(-12deg); }
.body { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; height: 100%; padding: 64px 22px 22px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: 12px; background: #1e293b; color: var(--muted); border-radius: 8px; padding: 3px 8px; }
.pill.pending { color: var(--warn); background: rgba(251,191,36,.12); }
h2.merchant { margin: 0; font-size: 26px; line-height: 1.15; overflow-wrap: anywhere; }
.amount { font-size: 40px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.amount small { font-size: 18px; font-weight: 500; color: var(--muted); }
.facts { display: grid; gap: 8px; font-size: 15px; color: var(--muted); }
.facts div { display: flex; gap: 8px; align-items: center; }
.actions { direction: ltr; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; margin-top: 14px; align-items: center; }
.actions .btn { min-height: 56px; font-size: 17px; }
.sub { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.sheet {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center;
  z-index: 40; padding: 0;
}
.sheet .panel {
  width: min(100%, 520px); max-height: 90dvh; background: var(--card); border: 1px solid var(--line);
  border-radius: 24px 24px 0 0; display: flex; flex-direction: column; padding-bottom: var(--safe-b);
}
.sheet header { padding: 16px 18px 8px; }
.sheet header h3 { margin: 0 0 4px; }
.sheet .content { overflow: auto; padding: 8px 18px 16px; display: grid; gap: 12px; }
.sheet footer { display: flex; gap: 8px; padding: 12px 18px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); }
.sheet footer .btn { flex: 1; }
.sheet footer .btn.primary { flex: 2; }
.toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toggle button[aria-pressed="true"] { border-color: var(--teal-2); background: rgba(14,116,144,.25); color: var(--teal); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--fg); padding: 0 14px; font-weight: 600;
}
.chip.on { border-color: var(--teal); background: rgba(14,116,144,.25); color: var(--teal); }
.chip.dash { border-style: dashed; color: var(--teal); }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%);
  background: #0f172a; border: 1px solid var(--line); color: var(--fg);
  padding: 10px 16px; border-radius: 12px; z-index: 50; max-width: 90%; text-align: center;
  box-shadow: var(--shadow);
}
.report { display: grid; gap: 14px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.tile .n { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile.cancel .amt { color: var(--bad); }
.section { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.section h3 { margin: 0 0 4px; font-size: 16px; display: flex; justify-content: space-between; }
.item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.item:first-of-type { border-top: 0; }
.done { display: grid; gap: 12px; text-align: center; padding: 40px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; }
.error { background: var(--bad-bg); color: var(--bad); padding: 12px; border-radius: 12px; }
.menu { display: grid; gap: 8px; }
.hidden { display: none !important; }
