:root {
  --bg: #000;
  --card: #1c1c1e;
  --card-2: #2c2c2e;
  --line: rgba(255, 255, 255, .08);
  --text: #fff;
  --muted: #8e8e93;
  --orange: #ff8a00;
  --orange-2: #ffb14d;
  --ink: #1a0d00;
  --green: #32d74b;
  --danger: #ff453a;
  --warn: #ffd60a;
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(112px + env(safe-area-inset-bottom));
}
.screen { animation: rise .42s cubic-bezier(.16, 1, .3, 1); }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes glow {
  0%, 100% { opacity: .75; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}
@keyframes pop {
  from { transform: scale(.86); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.top {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  margin-bottom: 8px;
  min-height: 44px;
}
.top h1 { margin: 0; text-align: center; font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.back {
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--card); color: #fff; display: grid; place-items: center; padding: 0;
}
.back svg, .tab-ico svg, .act svg, .item-ico svg, .tx-ico svg { width: 22px; height: 22px; display: block; }
.back:active, .act:active i, .tx:active, .item:active { transform: scale(.94); }

.who { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; text-align: left; }
.brand b { display: block; font-size: 17px; }
.avatar, .avatar-lg {
  border-radius: 50%; display: grid; place-items: center; overflow: hidden; font-weight: 700;
  background: linear-gradient(160deg, #ffc56b, #ff7a00); color: var(--ink);
}
.avatar { width: 36px; height: 36px; }
.avatar-lg { width: 84px; height: 84px; font-size: 32px; box-shadow: 0 12px 30px rgba(255, 122, 0, .35); animation: pop .45s cubic-bezier(.16, 1, .3, 1); }
.avatar img, .avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.bell {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--card);
  display: grid; place-items: center; position: relative;
}
.bell .badge { position: absolute; top: -2px; right: -2px; }

.hero { position: relative; text-align: center; padding: 28px 0 8px; }
.hero::before {
  content: ""; position: absolute; left: 50%; top: 0; width: 240px; height: 180px;
  background: radial-gradient(circle, rgba(255, 138, 0, .38), transparent 68%);
  filter: blur(6px); animation: glow 4.8s ease-in-out infinite; pointer-events: none;
}
.balance {
  position: relative; margin: 0; font-size: clamp(40px, 12vw, 52px); font-weight: 720; letter-spacing: -.055em;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.currency { position: relative; color: var(--muted); margin-top: 8px; font-size: 15px; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 26px; }
.act {
  background: none; border: 0; color: #fff; display: flex; flex-direction: column;
  align-items: center; gap: 8px; font-size: 12px; padding: 0;
}
.act i {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); transition: transform .16s ease;
}
.act.primary i {
  background: linear-gradient(180deg, #ffb14d, #ff7a00);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(255, 122, 0, .34);
}
.section {
  margin: 28px 4px 10px; color: var(--muted); font-size: 13px; font-weight: 650;
  letter-spacing: .06em; text-transform: uppercase;
}
.muted { color: var(--muted); }
.tiny { font-size: 13px; }
.bad { color: var(--danger); }
.ok { color: var(--green); }

.list, .tx-list { background: var(--card); border-radius: 18px; overflow: hidden; }
.tx, .item, .method {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  background: transparent; border: 0; color: inherit; padding: 14px;
  border-bottom: 1px solid var(--line); animation: rise .45s both;
}
.tx:last-child, .item:last-child, .method:last-child { border-bottom: 0; }
.tx-ico, .item-ico, .mark {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 750; font-size: 16px;
  background: #2a2a2c;
}
.mark svg { width: 20px; height: 20px; }
.tx-ico.in, .mark { background: rgba(255, 138, 0, .16); color: var(--orange-2); }
.tx-ico.out { background: rgba(255, 255, 255, .06); color: #fff; }
.tx-main, .item-body { flex: 1; min-width: 0; }
.tx-main b, .item-body b, .method b { display: block; font-size: 16px; font-weight: 620; }
.tx-main span, .item-body span, .method span { display: block; }
.tx-amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-amt.in { color: var(--green); }
.chev { color: #636366; font-size: 20px; line-height: 1; }

.warn, .note, .card, .quote {
  background: var(--card); border-radius: 18px; padding: 14px 16px;
}
.warn { background: rgba(255, 138, 0, .12); color: #ffd7a8; margin-top: 16px; }
.note { margin-top: 12px; }
.card, .quote { margin-top: 14px; }
.quote strong { display: block; margin: 6px 0; font-size: 28px; letter-spacing: -.04em; color: var(--orange-2); }
.formula, .rate-line { color: var(--muted); font-size: 13px; }
.got { margin-top: 8px; font-weight: 650; }

.btn, .btn-ghost, .btn-danger {
  border: 0; border-radius: 16px; min-height: 52px; padding: 14px 18px; font-weight: 720;
  width: 100%; margin-top: 14px;
}
.btn {
  background: linear-gradient(180deg, #ffb14d, #ff7a00);
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(255, 122, 0, .28);
}
.btn-ghost { background: var(--card-2); color: #fff; box-shadow: none; }
.btn-danger { background: rgba(255, 69, 58, .14); color: #ffb4ae; box-shadow: none; }
.btn:active, .btn-ghost:active, .btn-danger:active { transform: scale(.98); }

label { display: block; margin: 16px 0 8px; color: var(--muted); font-size: 13px; }
input, select, textarea {
  width: 100%; background: var(--card); border: 1px solid transparent; border-radius: 16px; padding: 16px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(255, 138, 0, .7); }
textarea { min-height: 88px; }
.amount-wrap { text-align: center; padding: 28px 0 8px; }
.amount-input {
  background: transparent; border: 0; text-align: center; font-size: clamp(42px, 16vw, 64px); font-weight: 720;
  letter-spacing: -.06em; padding: 0; border-radius: 0; caret-color: var(--orange);
}
.amount-input:focus { border: 0; }
.amount-unit { color: var(--muted); font-size: 16px; margin-top: 4px; }
.pin-input { letter-spacing: .6em; text-align: center; font-size: 28px; font-weight: 700; }
.check { display: flex; gap: 10px; align-items: flex-start; color: #d1d1d6; line-height: 1.35; }
.check input { width: auto; margin-top: 2px; accent-color: var(--orange); }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv span { color: var(--muted); }
.kv b { text-align: right; word-break: break-all; }
.timer { font-variant-numeric: tabular-nums; font-size: 40px; font-weight: 720; letter-spacing: -.04em; }
.timer.late { color: var(--danger); }
.qr {
  width: 220px; height: 220px; background: #fff; border-radius: 22px; padding: 12px;
  display: block; margin: 16px auto; animation: pop .4s cubic-bezier(.16, 1, .3, 1);
}
.chip {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px;
  background: var(--card-2); color: #fff; font-size: 13px; font-weight: 650;
}
.chip-completed { background: rgba(50, 215, 75, .16); color: var(--green); }
.chip-cancelled, .chip-rejected { background: rgba(255, 69, 58, .16); color: #ffb4ae; }
.chip-waiting_payment, .chip-in_progress, .chip-new, .chip-aml, .chip-pending { background: rgba(255, 138, 0, .16); color: #ffc56b; }
.addr { font-size: 15px; word-break: break-all; }

.profile-head { text-align: center; padding: 12px 0 8px; }
.pname { font-size: 24px; font-weight: 720; margin-top: 12px; letter-spacing: -.03em; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty b { display: block; color: #fff; margin-bottom: 4px; }

.gate { min-height: calc(100vh - 80px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.coin {
  width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(160deg, #ffc56b, #ff7a00); color: var(--ink);
  font-size: 46px; font-weight: 800; box-shadow: 0 18px 40px rgba(255, 122, 0, .38);
  animation: float 3.4s ease-in-out infinite; margin-bottom: 18px;
}
.gate h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: -.04em; }
.gate p { color: var(--muted); max-width: 280px; line-height: 1.4; }
.gate .btn { width: min(280px, 100%); text-decoration: none; display: inline-grid; place-items: center; }

#tabs[hidden] { display: none; }
#tabs {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(480px, 100%); display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: rgba(18, 18, 18, .88); border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
#tabs button {
  background: transparent; border: 0; color: #636366; padding: 6px 0 4px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600;
}
#tabs button.on { color: var(--orange); }
#tabs .tab-ico { transition: transform .2s cubic-bezier(.16, 1, .3, 1); }
#tabs button.on .tab-ico { transform: translateY(-1px) scale(1.06); }

#toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px); opacity: 0; pointer-events: none;
  background: #2c2c2e; color: #fff; padding: 12px 16px; border-radius: 14px;
  max-width: min(420px, calc(100% - 24px)); z-index: 8;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4); transition: .28s cubic-bezier(.16, 1, .3, 1);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; background: var(--orange); color: var(--ink); font-size: 11px; font-weight: 800;
}
.center { text-align: center; padding-top: 18vh; }
a.item { text-decoration: none; color: inherit; }
