:root {
  --grey-000: #ffffff;
  --grey-300: #a3a4a7;
  --grey-500: #6a6b6e;
  --grey-600: #47484a;
  --grey-700: #2a2b2e;
  --grey-800: #1a1b1d;
  --grey-900: #121314;
  --grey-1000: #0c0d0f;
  --blue-300: #8b99ff;
  --blue-500: #4459ff;
  --lime: #baf24a;
  --red: #f07484;
  --red-badge: #e5484d;
  --bg: #121314;
  --tile: #1c1d20;
  --text: #ffffff;
  --muted: #8e8f93;
  --line: rgba(255, 255, 255, 0.08);
  --primary: var(--blue-300);
  --radius: 16px;
  --radius-sm: 12px;
  --pad: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: #000;
  color: var(--text);
  font-family: Geist, "Helvetica Neue", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.015em;
}
body { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
#app {
  max-width: 390px;
  margin: 0 auto;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
}
button, .btn {
  appearance: none; font-family: inherit; cursor: pointer;
  border: 0; background: none; color: inherit;
}
button:disabled { opacity: 1; cursor: not-allowed; }
input, select, textarea {
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  outline: none;
}
input:focus, textarea:focus { border-color: var(--blue-500); box-shadow: 0 0 0 1px var(--blue-500); }
label { display: block; font-size: 15px; font-weight: 500; margin: 18px 0 8px; }
a { color: var(--primary); text-decoration: none; }

/* top chrome — Account 1 + hamburger */
.mm-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 4px;
}
.acct-btn { display: flex; align-items: center; gap: 4px; font-size: 17px; font-weight: 600; }
.acct-btn .chev { opacity: .55; width: 12px; height: 12px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; position: relative; color: var(--text);
}
.icon-btn svg { width: 22px; height: 22px; }
.nbadge {
  position: absolute; top: 2px; right: 0;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--red-badge); color: #fff; border-radius: 99px;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--bg);
}

.addr-chip {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 2px 16px 12px;
  background: var(--tile);
  border-radius: 10px;
  padding: 6px 10px 6px 8px;
  font-size: 13px; color: var(--muted); font-weight: 500;
}
.nets { display: flex; }
.nets i {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--bg); margin-left: -6px;
  display: block;
}
.nets i:first-child { margin-left: 0; }

/* fund empty */
.fund-card {
  margin: 8px 16px 16px;
  background: var(--tile);
  border-radius: 20px;
  padding: 28px 20px 22px;
  text-align: center;
}
.fund-card h2 { font-size: 22px; font-weight: 650; letter-spacing: -0.03em; margin: 10px 0 6px; }
.fund-card p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.illus { width: 88px; height: 88px; margin: 0 auto; display: block; }

/* square action tiles */
.actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 16px 16px;
}
.act {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--tile);
  border-radius: 16px;
  padding: 16px 4px 12px;
  min-height: 84px;
}
.act i { width: 22px; height: 22px; display: grid; place-items: center; }
.act i svg { width: 22px; height: 22px; }
.act span { font-size: 13px; font-weight: 500; }

.promo {
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  display: flex; gap: 12px; align-items: flex-start;
  position: relative;
}
.promo .ph {
  width: 56px; height: 56px; border-radius: 12px; flex-shrink: 0;
  background: #2a3144; display: grid; place-items: center; font-size: 22px;
}
.promo b { display: block; font-size: 15px; font-weight: 600; }
.promo span { display: block; font-size: 13px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.promo .x { position: absolute; top: 10px; right: 10px; color: var(--muted); width: 28px; height: 28px; }

/* tabs */
.tabs {
  display: flex; gap: 18px;
  padding: 4px 16px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tabs button {
  padding: 12px 0 10px;
  font-size: 16px; font-weight: 500;
  color: var(--muted);
  position: relative; white-space: nowrap;
}
.tabs button.on { color: var(--text); font-weight: 600; }
.tabs button.on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: #fff; border-radius: 2px;
}
.filter {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px; font-weight: 500;
}

/* token / network rows */
.list { padding: 0 4px 32px; }
.row-asset, .row-net {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
}
.av {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--tile);
  display: grid; place-items: center;
  overflow: visible; flex-shrink: 0;
  position: relative;
  font-size: 11px; font-weight: 700;
}
.av img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.av .badge-net {
  position: absolute; right: -2px; bottom: -2px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--bg);
}
.sq {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
  font-weight: 700; font-size: 14px; color: #fff;
}
.meta { flex: 1; min-width: 0; }
.name { font-size: 16px; font-weight: 600; }
.net { font-size: 13px; color: var(--muted); margin-top: 2px; }
.right { text-align: right; }
.amt { font-size: 16px; font-weight: 600; }
.usd { font-size: 13px; color: var(--muted); margin-top: 2px; }
.row-ico { display: flex; gap: 14px; color: var(--text); }
.row-ico button { width: 28px; height: 28px; display: grid; place-items: center; }

.search {
  width: calc(100% - 32px);
  margin: 8px 16px 12px;
  background: var(--tile);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 16px 12px 40px;
  font-size: 15px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%238e8f93' stroke-width='1.8'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M13 13l3.5 3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px 50%;
}

/* headers */
.back-hdr, .hdr {
  display: flex; align-items: center;
  height: 52px; padding: 0 8px;
  position: sticky; top: 0; background: var(--bg); z-index: 20;
}
.back-hdr h2, .hdr h2 { flex: 1; text-align: center; font-size: 17px; font-weight: 600; margin-right: 36px; }
.screen { padding: 4px 16px 32px; }
.screen h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.03em; margin: 8px 0; }
.lead { color: var(--muted); font-size: 14px; line-height: 1.45; margin-bottom: 12px; }

.primary, .white-btn {
  background: #fff; color: #111;
  font-weight: 600; font-size: 16px;
  border-radius: 999px; padding: 16px;
  width: 100%;
}
.primary:disabled, .white-btn:disabled, .btn-off {
  background: #3a3b3e; color: #111;
}
.ghost { color: var(--primary); font-weight: 600; font-size: 14px; padding: 10px; }
.danger { color: var(--red); font-weight: 600; }
.stack { display: grid; gap: 10px; margin-top: 16px; }
.sticky-foot {
  position: sticky; bottom: 0;
  background: linear-gradient(transparent, var(--bg) 30%);
  padding: 20px 0 8px;
}

/* settings / menu rows */
.setting, .menu-item {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  padding: 16px 0;
  font-size: 16px; font-weight: 500;
}
.setting .sub { font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 4px; line-height: 1.35; }
.setting .trail { margin-left: auto; color: var(--muted); font-weight: 400; display: flex; align-items: center; gap: 4px; }
.group-title { font-size: 14px; color: var(--muted); padding: 18px 0 6px; }
.hair { height: 1px; background: var(--line); margin: 8px 0; }
.pill-warn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #3a1f24; color: var(--red);
  border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 600; margin-top: 8px;
}

.toggle {
  width: 42px; height: 26px; border-radius: 99px;
  background: #3a3b3e; position: relative; flex-shrink: 0; margin-left: auto;
}
.toggle.on { background: var(--blue-300); }
.toggle i {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
}
.toggle.on i { left: 19px; }

.token-hero { text-align: center; padding: 12px 0 8px; }
.token-hero .av { width: 56px; height: 56px; margin: 0 auto 8px; }
.token-hero .av img { width: 56px; height: 56px; }
.avail { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 8px; }
.avail .max { color: var(--primary); font-weight: 600; }
.amt-wrap { position: relative; }
.amt-wrap .sym {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 600; font-size: 15px;
}

/* lock */
.lock {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: 72px 24px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.wordmark {
  font-weight: 700;
  font-size: 56px;
  line-height: 0.86;
  letter-spacing: -0.07em;
  margin: 8px 0 48px;
}
.lock input {
  text-align: left;
  background: var(--bg);
  border-radius: 14px;
}
.lock .stack { margin-top: 14px; }
.lock .forgot { margin-top: 18px; color: var(--blue-300); font-weight: 600; font-size: 16px; }
.lock-art {
  position: absolute; left: 0; right: 0; bottom: 0; height: 140px;
  pointer-events: none;
}

.err { color: var(--red); font-size: 13px; margin-top: 10px; }
.ok { color: var(--lime); }
.warn {
  font-size: 13px; color: #e8b84a; line-height: 1.45;
  background: #e8b84a14; border-radius: 10px; padding: 10px 12px;
}
.card {
  background: var(--tile);
  border-radius: var(--radius);
  padding: 14px;
}
.addr { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; color: var(--muted); }
.center { text-align: center; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.words { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.word {
  background: var(--tile); border-radius: 8px; padding: 8px 6px;
  font-size: 12px; font-family: ui-monospace, Menlo, monospace;
}
.word b { color: var(--muted); margin-right: 4px; }
.word-in {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 8px 10px 28px;
  font-size: 14px;
  font-family: Geist, system-ui, sans-serif;
  position: relative;
}
.srp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 8px 0 14px;
}
.srp-cell { position: relative; }
.srp-cell b {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--muted); font-weight: 500; pointer-events: none;
}
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: 16px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.qr { display: block; margin: 16px auto; width: 196px; height: 196px; background: #fff; border-radius: 12px; padding: 8px; }
.ident { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.ident svg { width: 100%; height: 100%; display: block; }
.hist { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.badge { width: 36px; height: 36px; border-radius: 50%; background: var(--tile); display: grid; place-items: center; }
.swap-leg { background: var(--tile); border-radius: 16px; padding: 12px 14px; }
.swap-leg .amt { font-size: 28px; font-weight: 700; border: 0; background: transparent; padding: 6px 0; }
.mark { width: 72px; height: 72px; margin: 28px auto 16px; display: block; }
.empty { text-align: center; color: var(--muted); padding: 36px 24px; font-size: 14px; line-height: 1.45; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 8px; }
.note { font-size: 13px; color: var(--muted); line-height: 1.45; }
.kicker { font-size: 12px; color: var(--muted); font-weight: 600; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.chip { font-size: 12px; border: 1px solid var(--line); border-radius: 99px; padding: 7px 11px; color: var(--muted); }
.gas-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.gas { background: var(--tile); border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px; text-align: center; }
.gas.on { border-color: var(--primary); }
.device-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.device { background: var(--tile); border-radius: 12px; padding: 18px 12px; text-align: center; }
.steps { display: flex; gap: 6px; justify-content: center; margin: 8px 0 16px; }
.steps i { width: 6px; height: 6px; border-radius: 50%; background: var(--grey-700); }
.steps i.on { background: var(--primary); width: 16px; border-radius: 6px; }
.hold { user-select: none; background: var(--tile); border-radius: 12px; padding: 28px 16px; text-align: center; }
.hold .blur { filter: blur(8px); font-family: ui-monospace, Menlo, monospace; font-size: 13px; line-height: 1.7; }
.hold.revealed .blur { filter: none; }
.radio { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 0; border-bottom: 1px solid var(--line); }
.dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); }
.radio.on .dot { border-color: var(--primary); box-shadow: inset 0 0 0 4px var(--primary); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.review dt { color: var(--muted); font-size: 12px; margin-top: 10px; }
.review dd { font-size: 14px; font-weight: 500; margin-top: 4px; }
.nft-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px; }
.nft { background: var(--tile); border-radius: 12px; overflow: hidden; }
.nft img, .nft .ph { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--grey-700); }
.notif { display: flex; gap: 12px; padding: 14px 16px; position: relative; }
.notif.unread { background: #16181c; }
.ndot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-500); margin-top: 16px; flex-shrink: 0; }
.notif .when { color: var(--muted); font-size: 12px; float: right; }

.ov { position: absolute; inset: 0; background: #030304b8; }
.sheet {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(390px, 100%); max-height: 86vh;
  background: var(--tile); border-radius: 16px 16px 0 0;
  padding: 8px 0 calc(16px + env(safe-area-inset-bottom)); overflow: auto;
}
.sheet .grab { width: 36px; height: 4px; border-radius: 4px; background: var(--grey-600); margin: 8px auto 12px; }
.sheet h3 { font-size: 16px; padding: 0 16px 8px; }
.pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; text-align: left; }
.pick.on { background: var(--line); }
.drawer {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: min(390px, 100%); height: 100%;
  background: var(--bg);
  padding: 0 16px 24px; overflow: auto;
}
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--grey-700); font-size: 13px; font-weight: 600;
  padding: 10px 16px; border-radius: 999px; z-index: 80;
}
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--primary); animation: spin .7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero { text-align: center; padding: 8px 16px 4px; }
.hero .fiat { font-size: 36px; font-weight: 700; letter-spacing: -0.04em; }
.chg { font-size: 13px; font-weight: 600; margin-top: 6px; color: var(--muted); }
.chg.up { color: var(--lime); }
.chg.down { color: var(--red); }
.market { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }

/* ——— motion ——— */
button, .act, .setting, .menu-item, .row-asset, .row-net, .pick, .toggle, .toggle i,
.white-btn, .primary, .tabs button::after, .gas, .chip, .addr-chip, .fund-card {
  transition: transform .18s cubic-bezier(.2,.8,.2,1), background .18s, color .18s, border-color .18s, opacity .18s, box-shadow .18s;
}
.toggle i { transition: left .2s cubic-bezier(.2,.8,.2,1); }
.tabs button::after { transition: transform .22s cubic-bezier(.2,.8,.2,1), opacity .22s; }
button:active, .act:active, .row-asset:active, .setting:active { transform: scale(0.97); }
.act:hover { background: #222327; }
.white-btn:hover, .primary:hover { filter: brightness(1.05); }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
#app.enter { animation: screenIn .32s cubic-bezier(.2,.75,.2,1); }
.fund-card { animation: screenIn .4s cubic-bezier(.2,.75,.2,1); }
#sheet {
  position: fixed; inset: 0; z-index: 50;
  visibility: hidden; pointer-events: none;
}
#sheet.on { visibility: visible; pointer-events: auto; }
.ov { opacity: 0; transition: opacity .22s ease; }
#sheet.on .ov { opacity: 1; }
.sheet {
  transform: translateX(-50%) translateY(108%);
  transition: transform .36s cubic-bezier(.2,.82,.2,1);
}
#sheet.on .sheet { transform: translateX(-50%) translateY(0); }
.drawer {
  animation: drawerIn .3s cubic-bezier(.2,.8,.2,1);
}
@keyframes drawerIn {
  from { opacity: 0; transform: translateX(-50%) translateX(36px); }
  to { opacity: 1; transform: translateX(-50%); }
}
#toast {
  opacity: 0; transform: translateX(-50%) translateY(8px);
  transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hold .blur { transition: filter .25s ease; }
.steps i { transition: width .2s, background .2s; }

html[data-theme="light"] {
  --bg: #f4f4f5;
  --tile: #ffffff;
  --text: #131416;
  --muted: #66676a;
  --line: rgba(0,0,0,0.08);
  --grey-700: #e4e4e6;
}
html[data-theme="light"] body { background: #ececee; }
html[data-theme="light"] .white-btn { background: #131416; color: #fff; }
html[data-theme="light"] .btn-off { background: #d5d6d8; color: #131416; }
html[data-theme="light"] .nbadge { border-color: var(--bg); }
html[data-theme="light"] .av .badge-net { border-color: var(--bg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
