:root {
  --bg: #f9f4f4; --card: #ffffff; --text: #1d0e02; --soft: #5e4e42; --muted: #948a83;
  --line: #ece4e0; --accent: #fe8714; --accent-text: #ffffff; --ok: #2e9e5b; --bad: #c8442f;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { padding: 0 0 calc(64px + env(safe-area-inset-bottom)); min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 18px; color: var(--soft); }
.balance { font-size: 14px; color: var(--soft); }
.balance b { color: var(--text); }
main { padding: 12px 16px; }
.muted { color: var(--muted); }
.search { width: 100%; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); font: inherit; color: var(--text); outline: none; }
.search:focus { border-color: var(--accent); }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: 14px;
  background: var(--card); font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.row:active { background: #fff3e6; }
.avatar { flex: 0 0 36px; height: 36px; border-radius: 10px; background: #fde9d3; color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 700; }
.flag { flex: 0 0 36px; font-size: 26px; text-align: center; }
.row .name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { display: block; font-size: 12px; color: var(--muted); }
.row .price { flex: 0 0 auto; font-weight: 700; color: var(--soft); }
.back { border: 0; background: none; padding: 4px 0 12px; font: inherit; color: var(--accent); cursor: pointer; }
h2 { margin: 0 0 12px; font-size: 20px; }
.card { background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.big { font-size: 28px; font-weight: 700; letter-spacing: .02em; margin: 2px 0 10px; word-break: break-all; }
.code { color: var(--ok); }
.btn { display: block; width: 100%; padding: 14px; border: 0; border-radius: 14px; font: inherit; font-weight: 600;
  background: var(--accent); color: var(--accent-text); cursor: pointer; }
.btn.secondary { background: #f1e9e5; color: var(--soft); }
.btn.danger { background: #fbe9e6; color: var(--bad); }
.btn:disabled { opacity: .55; cursor: default; }
.btn + .btn { margin-top: 8px; }
.note { font-size: 13px; color: var(--soft); margin: 10px 0 0; }
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: #f1e9e5; color: var(--soft); }
.status.completed { background: #e3f4ea; color: var(--ok); }
.status.waiting_code, .status.creating { background: #fff0df; color: var(--accent); }
.spinner { width: 18px; height: 18px; border: 2px solid #f1d9bf; border-top-color: var(--accent); border-radius: 50%;
  display: inline-block; vertical-align: -3px; margin-right: 8px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1; padding: 16px 8px; border: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; }
.tab.active { color: var(--accent); font-weight: 600; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); padding: 12px 14px;
  border-radius: 12px; background: #1d0e02; color: #fff; font-size: 14px; z-index: 10; }
