/* Non-Custodial Wallet — Tatum Powered */
:root {
    --primary: #3375BB; --primary-l: #5DADE2;
    --bg: #0B0E11; --card: #1E2329; --card-h: #2B3139;
    --input: #0B0E11; --border: rgba(255,255,255,0.06);
    --border-h: rgba(255,255,255,0.12);
    --text: #EAECEF; --text2: #848E9C; --muted: #474D57;
    --green: #0ECB81; --red: #F6465D; --orange: #F0B90B;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Plus Jakarta Sans', -apple-system, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased; }
#app { max-width: 430px; margin: 0 auto; min-height: 100vh; position: relative; }
::-webkit-scrollbar { width: 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Header */
.hdr { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; position: sticky; top: 0; background: var(--bg); z-index: 10; }
.hdr-t { font-size: 16px; font-weight: 700; }
.hdr-bk { background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.hdr-bk:hover { background: var(--card); }
.hdr-act { display: flex; gap: 8px; }
.hdr-btn { background: var(--card); border: 1px solid var(--border); color: var(--text2); width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; text-decoration: none; transition: 0.2s; }
.hdr-btn:hover { background: var(--card-h); }

/* Balance Card */
.bal-card { background: linear-gradient(135deg, rgba(51,117,187,0.12), rgba(93,173,226,0.06)); border: 1px solid rgba(51,117,187,0.15); border-radius: 16px; padding: 24px 20px; text-align: center; margin-bottom: 20px; }
.bal-lbl { font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.bal-amt { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; }
.bal-chg { font-size: 13px; color: var(--green); font-family: 'JetBrains Mono', monospace; margin-top: 4px; }

/* Action Buttons */
.act-row { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.act-btn { display: flex; flex-direction: column; align-items: center; gap: 5px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 14px; padding: 14px 20px; min-width: 70px; cursor: pointer; color: var(--text); font-family: inherit; transition: 0.2s; }
.act-btn:hover { background: rgba(255,255,255,0.08); }
.act-btn .ic { font-size: 20px; }
.act-btn .lb { font-size: 11px; font-weight: 600; }

/* Chain Grid */
.chain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-bottom: 20px; }
.chain-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 8px 12px; text-align: center; cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chain-card:hover { background: var(--card-h); border-color: var(--border-h); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.25); }
.chain-card:active { transform: translateY(0); }
.cc-logo { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--bg); font-size: 20px; }
.cc-logo img { width: 100%; height: 100%; object-fit: cover; }
.cc-name { font-weight: 600; font-size: 12px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.cc-sym { font-size: 10px; color: var(--muted); font-weight: 500; }
.cc-bal { font-size: 10px; font-weight: 600; color: var(--green); font-family: 'JetBrains Mono', monospace; }
.cc-tatum { font-size: 8px; color: var(--primary-l); margin-top: -2px; }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin: 8px 0 12px; }
.tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px 18px; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; transition: 0.2s; }
.tab.active { color: var(--text); border-bottom-color: var(--primary); }

/* Token List */
.tok-list { padding-bottom: 20px; }
.tok-item { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-radius: 12px; cursor: pointer; transition: 0.15s; }
.tok-item:hover { background: rgba(255,255,255,0.03); }
.tok-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--card); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; font-size: 18px; }
.tok-ico img { width: 100%; height: 100%; object-fit: cover; }
.tok-inf { flex: 1; min-width: 0; }
.tok-nm { font-weight: 600; font-size: 14px; }
.tok-ch { font-size: 11px; color: var(--muted); }
.tok-bal { text-align: right; }
.tok-ba { font-weight: 600; font-size: 14px; font-family: 'JetBrains Mono', monospace; }
.tok-usd { font-size: 12px; color: var(--text2); font-family: 'JetBrains Mono', monospace; }

/* TX List */
.tx-item { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); }
.tx-ico { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; margin-right: 9px; }
.tx-ico.send { background: rgba(246,70,93,0.1); }
.tx-ico.receive { background: rgba(14,203,129,0.1); }
.tx-ico.swap { background: rgba(51,117,187,0.1); }
.tx-lf { display: flex; align-items: center; }
.tx-tp { font-weight: 500; font-size: 13px; text-transform: capitalize; }
.tx-dt { font-size: 10px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.tx-am { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 500; }
.tx-am.green { color: var(--green); }
.tx-am.red { color: var(--red); }

/* Forms */
.f-in { width: 100%; padding: 12px 14px; background: var(--input); border: 1px solid #2B3139; border-radius: 10px; color: var(--text); font-size: 14px; font-family: 'JetBrains Mono', monospace; outline: none; transition: 0.2s; }
.f-in:focus { border-color: var(--primary); }
.f-in::placeholder { color: var(--muted); }
select.f-in { appearance: none; cursor: pointer; font-family: 'Plus Jakarta Sans', sans-serif; }
textarea.f-in { font-family: 'Plus Jakarta Sans', sans-serif; resize: vertical; }

/* Buttons */
.btn-p { width: 100%; padding: 14px; background: linear-gradient(135deg, var(--primary), #2B63A0); border: none; border-radius: 10px; color: #fff; font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer; transition: 0.15s; }
.btn-p:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(51,117,187,0.25); }
.btn-p:disabled { opacity: 0.4; pointer-events: none; }
.btn-s { width: 100%; padding: 14px; background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer; transition: 0.15s; }
.btn-s:hover { background: rgba(255,255,255,0.1); }

/* Glass */
.glass { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }

/* Welcome */
.welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 40px 20px; animation: fadeIn 0.4s; }
.w-logo { width: 72px; height: 72px; border-radius: 18px; background: linear-gradient(135deg, var(--primary), var(--primary-l)); display: flex; align-items: center; justify-content: center; font-size: 36px; margin-bottom: 20px; box-shadow: 0 8px 32px rgba(51,117,187,0.2); overflow: hidden; }
.w-logo img { width: 48px; height: 48px; object-fit: contain; }
.w-title { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 6px; }
.w-sub { color: var(--text2); font-size: 14px; margin-bottom: 34px; }
.w-btns { width: 100%; max-width: 300px; display: flex; flex-direction: column; gap: 10px; }
.w-note { margin-top: 28px; background: rgba(240,185,11,0.06); border: 1px solid rgba(240,185,11,0.12); border-radius: 12px; padding: 14px 16px; font-size: 12px; color: rgba(240,185,11,0.75); line-height: 1.5; text-align: center; max-width: 300px; }
.w-tatum { margin-top: 12px; font-size: 11px; color: var(--primary-l); text-align: center; }

/* Mnemonic */
.mn-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 16px 0; }
.mn-word { background: rgba(51,117,187,0.08); border: 1px solid rgba(51,117,187,0.15); padding: 8px 10px; border-radius: 8px; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--primary-l); display: flex; align-items: center; gap: 6px; }
.mn-word .n { color: var(--muted); font-size: 10px; min-width: 16px; }
.mn-blur { filter: blur(6px); user-select: none; }

/* Swap */
.swap-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 12px; }
.swap-div { display: flex; justify-content: center; margin: -8px 0; position: relative; z-index: 2; }
.swap-div button { width: 36px; height: 36px; background: var(--bg); border: 2px solid var(--border); border-radius: 10px; color: var(--primary); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Bottom Nav */
.bnav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; background: var(--card); border-top: 1px solid var(--border); display: flex; padding: 8px 0 env(safe-area-inset-bottom, 8px); z-index: 100; }
.nav-i { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px; background: none; border: none; color: var(--muted); font-size: 10px; font-weight: 600; font-family: inherit; cursor: pointer; transition: 0.2s; }
.nav-i.on { color: var(--primary); }
.nav-i .ni { font-size: 20px; }

/* Notification */
.notif { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); padding: 10px 20px; border-radius: 10px; z-index: 9999; font-size: 13px; font-weight: 500; backdrop-filter: blur(12px); animation: fadeIn 0.3s; max-width: 360px; }
.notif.ok { background: rgba(14,203,129,0.12); border: 1px solid rgba(14,203,129,0.25); color: var(--green); }
.notif.er { background: rgba(246,70,93,0.12); border: 1px solid rgba(246,70,93,0.25); color: var(--red); }

/* Info */
.info-box { background: rgba(51,117,187,0.08); border: 1px solid rgba(51,117,187,0.15); border-radius: 10px; padding: 12px 16px; font-size: 12px; color: var(--primary-l); margin-bottom: 18px; line-height: 1.5; }

/* Spinner */
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 40px auto; }
.spinner-sm { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }

/* PIN Keypad */
.pin-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); background: transparent; transition: all 0.15s; }
.pin-dot.filled { background: var(--primary); border-color: var(--primary); transform: scale(1.1); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 280px; margin: 0 auto; }
.pin-key { width: 100%; aspect-ratio: 1.6; background: var(--card); border: 1px solid var(--border); border-radius: 14px; color: var(--text); font-size: 24px; font-weight: 700; font-family: 'JetBrains Mono', monospace; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: center; }
.pin-key:hover { background: var(--card-h); }
.pin-key:active { transform: scale(0.95); background: rgba(51,117,187,0.15); }
.pin-key[data-key=""] { background: transparent; border-color: transparent; cursor: default; }
.pin-key[data-key=""]:hover { background: transparent; }
.pin-del { font-size: 20px; color: var(--text2); }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }

/* Responsive */
@media (max-width: 430px) { #app { max-width: 100%; } .bnav { max-width: 100%; } }
@media (max-width: 360px) { .chain-grid { grid-template-columns: repeat(2, 1fr); } }