:root {
  --bg: #18181b;
  --bg-elev: #2a2a2e;
  --bg-elev-2: #323237;
  --purple: #ab9ff2;
  --purple-deep: #6549c4;
  --text: #ffffff;
  --text-dim: #999ba1;
  --green: #4caf82;
  --red: #e05c5c;
  --btc: #f7931a;
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(1200px 800px at 50% -10%, #2b2540 0%, #131316 55%, #0c0c0e 100%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.phone {
  width: 390px;
  height: 844px;
  max-height: 100vh;
  background: var(--bg);
  border-radius: 44px;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 11px #050507, 0 0 0 13px #1c1c20;
}

@media (max-width: 430px) {
  .phone { width: 100vw; height: 100vh; border-radius: 0; box-shadow: none; }
}

/* Status bar */
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px 6px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}
.statusbar .notch {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 30px;
  background: #050507;
  border-radius: 0 0 18px 18px;
}
.indicators { display: flex; align-items: center; gap: 6px; }

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 6px;
}
.account-pill {
  display: flex; align-items: center; gap: 9px;
  background: transparent; border: none; color: var(--text);
  font-size: 16px; font-weight: 600; cursor: pointer;
  padding: 6px 8px; border-radius: 30px;
}
.account-pill:active { background: var(--bg-elev); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #ffb347, #ff7b42);
  display: grid; place-items: center; font-size: 17px;
}
.chev { color: var(--text-dim); font-size: 13px; }
.top-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: transparent; border: none; color: var(--text);
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn:active { background: var(--bg-elev); }

.content { flex: 1; overflow-y: auto; padding: 0 16px 16px; scrollbar-width: none; }
.content::-webkit-scrollbar { display: none; }

/* Balance */
.balance-block { text-align: center; padding: 22px 0 26px; }
.balance-amount { font-size: 44px; font-weight: 700; letter-spacing: -1px; }
.balance-change { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; }
.change-pill, .change-pct { font-size: 15px; font-weight: 600; }
.change-pill.up, .change-pct.up { color: var(--green); }
.change-pill.down, .change-pct.down { color: var(--red); }
.change-pct { background: rgba(76,175,130,0.14); padding: 2px 8px; border-radius: 8px; }
.change-pct.down { background: rgba(224,92,92,0.14); }

/* Actions */
.actions { display: flex; justify-content: space-between; padding: 0 6px 26px; }
.action { background: none; border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 9px; flex: 1; }
.action-icon {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--bg-elev); color: var(--purple);
  display: grid; place-items: center;
  transition: transform .12s, background .12s;
}
.action:active .action-icon { transform: scale(0.92); background: var(--bg-elev-2); }
.action-label { font-size: 13px; font-weight: 500; color: var(--text-dim); }

/* Tabs */
.tabs { display: flex; gap: 8px; padding-bottom: 10px; }
.tab {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 15px; font-weight: 600;
  padding: 6px 0; position: relative;
  margin-right: 14px;
}
.tab.active { color: var(--text); }
.tab.active::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 3px; background: var(--purple); border-radius: 3px;
}

/* List */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 8px; border-radius: 14px; cursor: pointer;
}
.row:active { background: var(--bg-elev); }
.coin {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px; font-weight: 700;
  flex-shrink: 0; position: relative;
}
.coin.btc { background: var(--btc); color: #fff; }
.coin.eth { background: #627eea; color: #fff; }
.coin.usdc { background: #2775ca; color: #fff; }
.coin.sol { background: linear-gradient(135deg,#9945ff,#14f195); color:#fff; }
.coin .net-badge {
  position: absolute; bottom: -2px; right: -2px;
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid var(--bg); font-size: 9px;
  display: grid; place-items: center;
}
.row-main { flex: 1; min-width: 0; }
.row-name { font-size: 16px; font-weight: 600; }
.row-sub { font-size: 13.5px; color: var(--text-dim); margin-top: 2px; }
.row-right { text-align: right; }
.row-value { font-size: 16px; font-weight: 600; }
.row-chg { font-size: 13.5px; margin-top: 2px; }
.row-chg.up { color: var(--green); }
.row-chg.down { color: var(--red); }

/* Activity rows */
.act-icon {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--bg-elev); display: grid; place-items: center;
  color: var(--purple); flex-shrink: 0;
}

.manage-row { display: flex; justify-content: center; padding: 22px 0 10px; }
.manage-btn {
  background: none; border: none; color: var(--text-dim);
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.manage-btn:active { color: var(--text); }

.empty { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty-art { font-size: 46px; margin-bottom: 14px; }
.empty p { font-size: 17px; font-weight: 600; color: var(--text); }
.empty span { font-size: 14px; display: block; margin-top: 6px; }

/* Bottom nav */
.bottomnav {
  display: flex; justify-content: space-around; align-items: center;
  padding: 12px 14px 26px; border-top: 1px solid #232327;
}
.nav-item {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); padding: 6px; border-radius: 12px;
}
.nav-item.active { color: var(--purple); }

/* Modal / sheet */
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-end; z-index: 50;
  animation: fade .2s ease;
}
.sheet {
  background: #232327; width: 100%;
  border-radius: 26px 26px 0 0; padding: 12px 20px 34px;
  animation: slideup .28s cubic-bezier(.2,.8,.2,1);
  max-height: 78%;
}
.sheet-handle { width: 38px; height: 4px; border-radius: 4px; background: #4a4a50; margin: 4px auto 18px; }
.sheet-body h2 { font-size: 21px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.sheet-sub { color: var(--text-dim); text-align: center; font-size: 14px; margin-bottom: 22px; }
.qr {
  width: 210px; height: 210px; margin: 0 auto 22px;
  background: #fff; border-radius: 18px; padding: 14px;
  display: grid; place-items: center;
}
.qr svg { width: 100%; height: 100%; }
.addr-box {
  background: var(--bg-elev); border-radius: 14px; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}
.addr-text { font-size: 14px; font-family: ui-monospace, monospace; word-break: break-all; color: var(--text); }
.copy-btn {
  background: var(--purple); color: #1a1a1d; border: none;
  font-weight: 700; font-size: 15px; padding: 15px; width: 100%;
  border-radius: 14px; cursor: pointer;
}
.copy-btn:active { opacity: .85; }
.sheet .field {
  background: var(--bg-elev); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
}
.sheet .field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.sheet .field input {
  background: none; border: none; color: var(--text); font-size: 17px; width: 100%; outline: none;
  font-family: inherit;
}
.toast {
  position: absolute; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: #fff; color: #18181b; padding: 11px 20px; border-radius: 30px;
  font-size: 14px; font-weight: 600; z-index: 99;
  animation: fade .2s ease; box-shadow: 0 10px 30px rgba(0,0,0,.4);
}

/* ---- interactive sheet elements ---- */
.coin.sm { width: 28px; height: 28px; font-size: 14px; }
.muted { color: var(--text-dim); font-size: 13px; }
.mono { font-family: ui-monospace, monospace; }

.token-select {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--bg-elev); border: none; color: var(--text);
  padding: 12px 14px; border-radius: 14px; cursor: pointer;
  font-size: 15px; font-weight: 600; margin-bottom: 12px;
}
.token-select:active { background: var(--bg-elev-2); }
.token-select .muted { margin-left: auto; font-weight: 500; }
.token-select .chev { margin-left: 4px; }

.amount-field .amount-row, .swap-card .amount-row { display: flex; align-items: center; gap: 8px; }
.amount-row input { background: none; border: none; color: var(--text); font-size: 26px; font-weight: 700; width: 100%; outline: none; font-family: inherit; }
.amount-row input[readonly] { color: var(--text-dim); }
.max-btn {
  background: rgba(171,159,242,0.16); color: var(--purple); border: none;
  font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 20px; cursor: pointer; flex-shrink: 0;
}
.amount-field .muted { margin-top: 6px; }

.swap-card { background: var(--bg-elev); border-radius: 16px; padding: 14px; margin-bottom: 8px; }
.swap-card .token-select { background: transparent; padding: 0 0 8px; margin: 0; }
.swap-flip {
  display: block; margin: -2px auto 6px; width: 40px; height: 40px; border-radius: 12px;
  background: var(--bg-elev-2); border: 4px solid #232327; color: var(--purple);
  font-size: 18px; cursor: pointer; position: relative; z-index: 2;
}
.swap-flip:active { background: var(--purple); color: #18181b; }

.preset-row { display: flex; gap: 8px; margin-bottom: 16px; }
.preset { flex: 1; background: var(--bg-elev); border: none; color: var(--text); font-weight: 600; padding: 11px 0; border-radius: 12px; cursor: pointer; }
.preset:active { background: var(--purple); color: #18181b; }

.picker-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; max-height: 46vh; overflow-y: auto; }
.picker-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: none; border: none; color: var(--text); padding: 11px 8px; border-radius: 12px; cursor: pointer; text-align: left;
}
.picker-row:active { background: var(--bg-elev); }
.picker-row .row-right { margin-left: auto; }

.review-amount { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 24px; font-weight: 700; margin-bottom: 4px; }

.detail-head { text-align: center; }
.detail-head .coin { margin: 0 auto; width: 50px; height: 50px; font-size: 24px; }
.detail-price { font-size: 30px; font-weight: 700; margin-top: 4px; }
.spark { width: 100%; height: 90px; margin: 16px 0 18px; display: block; }
.detail-actions { display: flex; gap: 10px; }
.detail-actions .copy-btn { flex: 1; }
.copy-btn.ghost { background: var(--bg-elev); color: var(--text); }
.copy-btn.ghost:active { background: var(--bg-elev-2); }

.success { text-align: center; padding: 14px 0 8px; }
.success-check {
  width: 70px; height: 70px; border-radius: 50%; margin: 0 auto 18px;
  background: rgba(76,175,130,0.18); color: var(--green);
  display: grid; place-items: center; font-size: 34px; font-weight: 700;
  animation: pop .35s cubic-bezier(.2,.9,.3,1.4);
}

.hidden { display: none !important; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideup { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
