:root {
  --ink: #16202b;
  --ink-2: #26323f;
  --accent: #4f46e5;
  --accent-600: #4338ca;
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #e4e9f2;
  --muted: #6b7686;
  --ok: #10876b;
  --err: #d1435b;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(22, 32, 43, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
#app {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 2px 8px;
}
.logo { height: 34px; }
main#view { flex: 1; padding: 8px 0 24px; }
.foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 2px; font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--line);
}
.muted { color: var(--muted); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin: 14px 0;
}
h1 { font-size: 22px; margin: 6px 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
p.lead { color: var(--muted); margin: 0 0 18px; line-height: 1.5; }

.balance { text-align: center; padding: 10px 0 4px; }
.balance .amount { font-size: 44px; font-weight: 700; letter-spacing: -1px; }
.balance .cap { color: var(--muted); font-size: 13px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
input[type=tel], input[type=text], input[type=number] {
  width: 100%; padding: 14px; font-size: 17px;
  border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe;
}
input:focus { outline: 2px solid var(--accent); border-color: transparent; }

button {
  font: inherit; cursor: pointer; border: none; border-radius: 12px;
  padding: 14px 16px; font-weight: 600; width: 100%;
  background: var(--accent); color: #fff; margin-top: 16px;
  transition: background .15s;
}
button:hover { background: var(--accent-600); }
button:disabled { opacity: .5; cursor: default; }
button.ghost { width: auto; background: transparent; color: var(--muted); padding: 8px 10px; margin: 0; font-weight: 500; }
button.ghost:hover { background: var(--line); }
button.sec { background: var(--ink); }
button.sec:hover { background: var(--ink-2); }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.tier {
  border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe;
  padding: 18px 0; text-align: center; font-size: 20px; font-weight: 700; color: var(--ink);
  margin: 0;
}
.tier.active { border-color: var(--accent); background: #eef0fe; color: var(--accent-600); }

.row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.row:last-child { border-bottom: none; }
.row .amt.pos { color: var(--ok); } .row .amt.neg { color: var(--ink); }

.code-wait { text-align: center; padding: 10px 0; }
.code-wait .big { font-size: 15px; line-height: 1.5; }
.countdown { font-size: 34px; font-weight: 700; color: var(--accent); margin: 10px 0; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-size: 14px; box-shadow: var(--shadow); z-index: 10; max-width: 90%;
}
.toast.err { background: var(--err); }
.toast.ok { background: var(--ok); }
.hint { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.center { text-align: center; }
