:root {
  --bg: #0F0F11;
  --surface: #1C1C1F;
  --surface-2: #2C2C31;
  --line: #26262A;
  --text: #F5F5F7;
  --muted: #8E8E93;
  --accent: #7C5BE4;
  --accent-2: #9B7BFF;
  --up: #32D74B;
  --down: #FF453A;
  --amber: #FFB340;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--text); touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 8px; }

.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }

/* ---------- Gate (install / blocked screens) ---------- */
.gate {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: calc(var(--top) + 32px) 28px calc(var(--bottom) + 32px);
}
.gate-inner { width: 100%; max-width: 380px; }
.gate-logo { border-radius: 18px; margin-bottom: 24px; }
.gate h1 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; margin-bottom: 10px; }
.gate p { color: var(--muted); margin-bottom: 20px; }
.steps { counter-reset: s; margin: 8px 0 24px; }
.steps li {
  counter-increment: s; position: relative;
  padding: 14px 0 14px 44px; border-top: 1px solid var(--line);
}
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 12px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); color: var(--accent-2);
  display: grid; place-items: center; font-size: 15px; font-weight: 600;
}
.share-ico { display: inline-block; vertical-align: -3px; color: #0A84FF; }
.gate .note { font-size: 15px; }

/* ---------- Screens ---------- */
main { max-width: 520px; margin: 0 auto; }
.screen {
  padding: calc(var(--top) + 28px) 20px calc(var(--bottom) + 104px);
  /* Every tab fills the whole screen, so the bottom bar sits in the same place on every tab
     (on phones it moved up on short pages like Home and down on long ones like Settings). */
  min-height: 100vh;
  min-height: calc(100lvh + 1px);
}
.title { font-size: 34px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; margin-bottom: 18px; }
.section { font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin: 28px 0 6px; }

.balance { font-size: 44px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }


/* segmented control */
.seg {
  display: flex; gap: 2px; padding: 4px;
  background: var(--surface); border-radius: 999px;
}
.seg button {
  flex: 1; padding: 9px 0; border-radius: 999px;
  color: var(--text); font-size: 17px;
  transition: background .18s;
}
.seg button.on { background: var(--surface-2); font-weight: 600; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 54px; border-radius: 999px; font-size: 18px; font-weight: 600;
  transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.dark { background: var(--surface); color: var(--text); }
.btn.block { width: 100%; }
.btn.small { height: 44px; padding: 0 20px; font-size: 16px; }
.btn:disabled { opacity: .5; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }

/* token list */
.list li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.list li:first-child { border-top: 0; }
.list .meta { flex: 1; min-width: 0; }
.list .meta b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta small, .list .val small { font-size: 16px; color: var(--muted); }
.list .val { text-align: right; font-variant-numeric: tabular-nums; }
.list .val b { display: block; font-weight: 500; }
.list .val small.up { color: var(--up); }
.list .val small.down { color: var(--down); }
.list .val small.wait { color: var(--amber); }
.list button.item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.empty { color: var(--muted); padding: 14px 0; font-size: 15px; }

.avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-weight: 700; font-size: 18px; color: #111;
}

/* ---------- Sniper (trade tab) ---------- */

.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
  justify-content: center; padding: 14px; min-height: 64px; border-radius: 16px;
  background: var(--surface); border: 1.5px solid transparent;
  transition: border-color .15s, background .15s;
}
.chips button b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chips button small { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1em; }
.chips button.on { border-color: var(--accent-2); background: rgba(124, 91, 228, .14); }

.modes { display: grid; gap: 10px; }
.mode {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left;
  padding: 16px; border-radius: 16px; background: var(--surface); border: 1.5px solid transparent;
  transition: border-color .15s, background .15s;
}
.mode b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.mode small { display: block; color: var(--muted); font-size: 14px; line-height: 1.4; margin-top: 4px; }
.mode.on { border-color: var(--accent-2); background: rgba(124, 91, 228, .14); }
.radio {
  width: 20px; height: 20px; border-radius: 50%; flex: none; margin-top: 2px;
  border: 2px solid #55555c; display: grid; place-items: center;
}
.mode.on .radio { border-color: var(--accent-2); }
.mode.on .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-2); }
.tag {
  font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: .03em;
  color: var(--accent-2); background: rgba(155, 123, 255, .16); padding: 3px 8px; border-radius: 999px;
}

.card { background: var(--surface); border-radius: 18px; padding: 16px; margin-top: 12px; }
#custom { margin-top: 2px; }
.card .chips button { background: var(--bg); border-color: var(--line); }
.card .chips button.on { border-color: var(--accent-2); background: rgba(124, 91, 228, .14); }
.card-h {
  display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600;
  padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line);
}
.card-h svg { color: var(--accent-2); flex: none; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid .full { grid-column: 1 / -1; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > span:first-child { font-size: 13px; color: var(--muted); }
.inp {
  display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 12px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
}
.inp:focus-within { border-color: var(--accent); }
.inp input { flex: 1; min-width: 0; width: 100%; background: none; border: 0; outline: none; font-size: 16px; font-variant-numeric: tabular-nums; }
.inp input::placeholder { color: #55555c; }
.inp em { font-style: normal; color: var(--muted); font-size: 14px; }
.fld .seg { background: var(--bg); border: 1px solid var(--line); }
.fld .seg button { font-size: 15px; padding: 8px 0; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; text-align: left;
  padding: 14px; margin-top: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
}
.toggle-row b { display: block; font-weight: 600; font-size: 16px; }
.toggle-row small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 2px; }
.chev { transition: transform .2s; color: var(--muted); flex: none; }
[aria-expanded="true"] .chev { transform: rotate(180deg); }
.saved-note { text-align: center; color: var(--muted); font-size: 13px; margin-top: 10px; }

.filters { margin-top: 4px; }
.filters li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
}
.filters li:last-child { border-bottom: 0; }
.filters li span { font-size: 16px; }

/* iOS-style switch */
.switch {
  appearance: none; -webkit-appearance: none;
  width: 51px; height: 31px; border-radius: 999px;
  background: var(--surface-2); position: relative; cursor: pointer; flex: none;
  transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 27px; height: 27px; border-radius: 50%; background: #fff;
  transition: transform .2s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }

/* ---------- Settings ---------- */
.group { border-top: 1px solid var(--line); }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 6px 0; border-bottom: 1px solid var(--line);
}

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  padding: 8px 0 calc(var(--bottom) + 6px);
  background: rgba(15, 15, 17, .88);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--muted); font-size: 11px; padding: 2px 0;
}
.tabbar button.on { color: var(--accent-2); }

.backdrop {
  position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.55);
  opacity: 0; transition: opacity .25s;
}
.backdrop.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  max-width: 520px; margin: 0 auto;
  max-height: calc(100dvh - var(--top) - 40px); overflow-y: auto;
  background: var(--surface); border-radius: 18px 18px 0 0;
  padding: 10px 20px calc(var(--bottom) + 20px);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.sheet.open { transform: none; }
.grip { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-2); margin: 0 auto 10px; }
.close {
  position: absolute; top: 18px; right: 18px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-2); color: var(--muted);
  display: grid; place-items: center;
}
.token-head { display: flex; align-items: center; gap: 14px; margin: 12px 0 8px; }
.token-head .sym { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; z-index: 30;
  bottom: calc(var(--bottom) + 92px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--surface-2); color: var(--text);
  padding: 12px 18px; border-radius: 14px; font-size: 15px;
  max-width: calc(100% - 40px); text-align: center;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (max-width: 360px) {
  .grid.three { grid-template-columns: 1fr 1fr; }
  .balance { font-size: 38px; }
}

/* ---------- Login ---------- */
.key-input {
  width: 100%; height: 56px; padding: 0 16px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  font-size: 18px; letter-spacing: .04em; outline: none; text-transform: uppercase;
}
.key-input:focus { border-color: var(--accent); }
.key-input::placeholder { color: #55555c; text-transform: none; }
.err { color: var(--down) !important; font-size: 15px; margin: -4px 0 12px !important; }
.link { color: var(--accent-2); }
.mono-key { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 15px; }

/* ---------- Wallet ---------- */
.key-input.plain { text-transform: none; letter-spacing: 0; }
.key-input.area { height: auto; padding: 14px 16px; resize: none; font-size: 16px; line-height: 1.4; word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace; }
.choices { display: grid; gap: 12px; margin: 8px 0 20px; }
.choice {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
}
.choice:active { transform: scale(.99); }
.choice b { display: block; font-weight: 600; }
.choice small { color: var(--muted); font-size: 15px; }
.choice-ico {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: var(--surface-2); color: var(--accent-2); display: grid; place-items: center;
}
.gate .label { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin: 4px 0 8px; }
.addr-box {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; word-break: break-all;
  color: var(--text) !important;
}
.addr-box { background: var(--surface); border-radius: 12px; padding: 12px 14px; }
.keybox {
  position: relative; display: block; width: 100%; text-align: left; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.45; word-break: break-all;
}
.keybox em { display: none; }
.keybox.hidden-key span { filter: blur(6px); user-select: none; }
.keybox.hidden-key em {
  display: grid; place-items: center; position: absolute; inset: 0;
  font-style: normal; font-weight: 600; color: var(--text);
}
.check { display: flex; align-items: center; gap: 10px; margin: 18px 0; font-size: 16px; color: var(--muted); }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.bal-err { color: var(--amber); font-size: 14px; margin-top: 8px; }
.row.as-row { width: 100%; text-align: left; }
.row.danger { color: var(--down); }

/* deposit sheet */
.dep { text-align: center; margin-top: -6px; }
.dep-title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.dep-sub { color: var(--muted); font-size: 15px; margin: 4px 24px 0; line-height: 1.4; }
.qr {
  /* Fixed square size (no aspect-ratio) so iPhones can't add extra space above the code */
  --qr: min(232px, 68vw);
  position: relative;
  width: var(--qr); height: var(--qr); margin: 14px auto 18px;
  padding: 14px; background: #fff; border-radius: 26px;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
  line-height: 0; font-size: 0;
}
.qr svg { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); display: block; }
.dep-addr {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--surface-2); border-radius: 14px; padding: 12px 16px; margin-bottom: 14px;
}
.dep-label { color: var(--muted); font-size: 13px; }
.dep-short { font-size: 18px; font-weight: 600; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.dep .btn { gap: 8px; }
.dep-warn {
  display: flex; gap: 8px; align-items: flex-start; text-align: left;
  color: var(--muted); font-size: 13px; line-height: 1.4; margin: 16px 4px 4px;
}
.dep-warn svg { flex: none; margin-top: 1px; }
#wsheet .btn { gap: 8px; }
.gate .btn { gap: 8px; }

/* ---------- Loading ---------- */
.spinner {
  display: inline-block; width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--surface-2); border-top-color: var(--accent-2);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gate.is-loading .gate-inner { display: flex; flex-direction: column; align-items: center; }
.gate.is-loading .gate-logo { width: 96px; height: 96px; border-radius: 24px; margin-bottom: 36px; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.94); opacity: .8; } }
.skeleton {
  color: transparent !important; border-radius: 10px;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* pull to refresh */
.screen.snap { transition: transform .25s; }

/* ---------- Trades ---------- */
.pnl-card {
  background: var(--surface); border-radius: 20px; padding: 18px; margin-bottom: 16px;
}
.pnl-label { color: var(--muted); font-size: 14px; }
.pnl-total { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.pnl-usd { color: var(--muted); font-size: 16px; min-height: 1.2em; font-variant-numeric: tabular-nums; }
.pnl-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.pnl-stats b { display: block; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pnl-stats small { color: var(--muted); font-size: 13px; }
.trades { margin-top: 12px; }
.trades a.item { display: flex; align-items: center; gap: 12px; width: 100%; }
.trades .meta small { font-size: 14px; }
.trades .val b.up, .trades .val small.up { color: var(--up); }
.trades .val b.down, .trades .val small.down { color: var(--down); }
.avatar.tok { background: var(--surface-2); color: var(--text); font-size: 17px; }
.empty-state { flex-direction: column; text-align: center; padding: 40px 20px !important; gap: 6px !important; border: 0 !important; }
.empty-state b { font-weight: 600; font-size: 17px; }
.empty-state small { color: var(--muted); font-size: 14px; line-height: 1.4; max-width: 280px; }
.empty-ico { width: 56px; height: 56px; border-radius: 50%; background: var(--surface); color: var(--accent-2); display: grid; place-items: center; margin-bottom: 6px; }

/* ---------- Home: Phantom-style balance ---------- */
.bal-chg { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--muted); }
.bal-chg .up { color: var(--up); }
.bal-chg .down { color: var(--down); }
.chg-pill { font-size: 14px; font-weight: 600; padding: 3px 8px; border-radius: 8px; background: var(--surface); }
.chg-pill.up { color: var(--up); background: rgba(50,215,75,.13); }
.chg-pill.down { color: var(--down); background: rgba(255,69,58,.13); }
.bal-chg .skeleton { min-width: 64px; }

.token-row {
  display: flex; align-items: center; gap: 12px; margin-top: 22px;
  padding: 14px; background: var(--surface); border-radius: 16px;
}
.sol-logo { width: 44px; height: 44px; border-radius: 50%; background: #000; display: grid; place-items: center; flex: none; }
.sol-logo img { width: 22px; height: 22px; display: block; }
.tr-meta { flex: 1; min-width: 0; }
.tr-meta b, .tr-val b { display: block; font-weight: 600; font-size: 17px; }
.tr-meta small, .tr-val small { display: block; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tr-val { text-align: right; font-variant-numeric: tabular-nums; }
.tr-val small.up { color: var(--up); }
.tr-val small.down { color: var(--down); }


/* ---------- Home market boxes ---------- */

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.tile { background: var(--surface); border-radius: 16px; padding: 12px; min-width: 0; display: flex; flex-direction: column; }
.tile-h { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 8px; white-space: nowrap; }
.tile-h::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; }
.tile:nth-child(1) .tile-h::before { background: var(--up); }
.tile:nth-child(2) .tile-h::before { background: #4DA3FF; }
.tile:nth-child(3) .tile-h::before { background: #FF5C82; }
.tile-v { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; border-radius: 6px; white-space: nowrap; }
.tile-v.up { color: var(--up); }
.tile-v.down { color: var(--down); }
.tile-s { color: var(--muted); font-size: 12px; line-height: 1.3; margin: 2px 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.split { margin-top: auto; margin-bottom: 10px; height: 6px; border-radius: 99px; background: var(--down); overflow: hidden; }
.split i { display: block; height: 100%; background: var(--up); transition: width .4s; }
.bars { margin-top: auto; height: 26px; display: flex; align-items: flex-end; gap: 4px; }
.bars i { flex: 1; border-radius: 3px; background: #4DA3FF; opacity: .85; transition: height .4s; }
.bars i:last-child { opacity: 1; }
.spark { margin-top: auto; width: 100%; height: 28px; }
.spark.up { color: var(--up); }
.spark.down { color: var(--down); }
.sk-row { padding: 10px 0; }
.sk-row .skeleton { display: block; height: 18px; border-radius: 6px; }
.flash { animation: flash .8s ease-out; }
@keyframes flash { 0% { background: rgba(155,123,255,.22); } 100% { background: transparent; } }
@media (max-width: 370px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .tiles .tile:last-child { grid-column: 1 / -1; }
}

/* ---------- Center SNIPRO button (opens the sniper) ---------- */
.tabbar .fab {
  position: relative; justify-self: center; align-self: start;
  width: 66px; height: 66px; margin-top: -30px; padding: 0; gap: 0;
  display: grid; place-items: center; border-radius: 50%;
  animation: fab-float 3.2s ease-in-out infinite;
}
.fab-ring {
  position: absolute; inset: -3px; border-radius: 50%;
  background: conic-gradient(from 0deg, #9B7BFF, #5B3FC4, #C9B8FF, #7C5BE4, #9B7BFF);
  animation: fab-spin 3s linear infinite;
  filter: drop-shadow(0 0 10px rgba(155,123,255,.65));
}
.fab-core {
  position: relative; width: 60px; height: 60px; border-radius: 50%; overflow: hidden;
  background: #0b0b10; display: grid; place-items: center;
  box-shadow: 0 0 0 3px var(--bg), 0 10px 26px rgba(124,91,228,.45);
  animation: fab-glow 2.4s ease-in-out infinite;
}
.fab-core img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); }
.tabbar .fab:active .fab-core { transform: scale(.94); }
@keyframes fab-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes fab-spin { to { transform: rotate(360deg); } }
@keyframes fab-glow { 0%, 100% { box-shadow: 0 0 0 3px var(--bg), 0 8px 22px rgba(124,91,228,.35); } 50% { box-shadow: 0 0 0 3px var(--bg), 0 10px 34px rgba(155,123,255,.75); } }

.tabbar .fab.on .fab-core { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent-2), 0 10px 34px rgba(155,123,255,.75); }

/* ---------- Sniper page ---------- */
.sn-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.back { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; color: var(--text); }
.sn-live {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600;
  color: var(--muted); background: var(--surface); padding: 6px 12px; border-radius: 999px;
}
.sn-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.sn-live.on { color: var(--up); background: rgba(50,215,75,.12); }
.sn-live.on i { background: var(--up); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(50,215,75,.6); } 50% { box-shadow: 0 0 0 5px rgba(50,215,75,0); } }
.sn-hero { text-align: center; margin: -10px 0 0; }
.sn-hero .title { margin: 10px 0 4px; font-size: 30px; }
.sn-hero p { font-size: 14.5px; line-height: 1.45; max-width: 330px; margin: 0 auto; }
.sn-logo { position: relative; width: 78px; height: 78px; margin: 0 auto; display: grid; place-items: center; animation: fab-float 3.2s ease-in-out infinite; }
.sn-logo .fab-ring { inset: 1px; }
.sn-logo .fab-core { width: 70px; height: 70px; }
#screen-sniper .modes { margin-top: 2px; }
#screen-sniper #start-snipe { margin-top: 20px; }
#screen-sniper { padding-bottom: calc(var(--bottom) + 130px); }

/* ---------- Agents ---------- */
.ag-head { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 10px; }
.ag-head .section { margin: 0; }
.ag-count { font-size: 13px; font-weight: 600; color: var(--muted); }
.ag-count.on { color: var(--up); }
.agents { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.agent {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid transparent; border-radius: 18px; padding: 12px 10px 14px;
  transition: border-color .4s, box-shadow .4s;
}
.agent.awake { border-color: color-mix(in srgb, var(--c) 45%, transparent); box-shadow: 0 0 22px -10px var(--c); }
.ag-ring { position: relative; width: 56px; height: 56px; flex: none; }
.ring-svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-svg .rt { fill: none; stroke: var(--surface-2); stroke-width: 4; }
.ring-svg .rp { fill: none; stroke: var(--c); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.ag-face { position: absolute; inset: 10px; width: 36px; height: 36px; overflow: visible; }
.ag-face .eyes, .ag-face .eyes-shut, .ag-face .ag-body { transform-box: fill-box; transform-origin: center; }
.ag-txt { min-width: 0; display: flex; flex-direction: column; }
.ag-txt b { font-size: 16px; font-weight: 700; line-height: 1.2; }
.ag-txt small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-st { font-size: 12.5px; font-weight: 600; margin-top: 4px; color: var(--muted); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.ag-bar { position: absolute; left: 12px; right: 12px; bottom: 6px; height: 3px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ag-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--c); }

/* cartoon details */
.ag-face .shine { fill: #fff; opacity: .5; }
.ag-face .cheek { fill: #FF7A9A; opacity: .55; }
.ag-face .glint { fill: #fff; stroke: none; }
.ag-face .ag-body, .ag-face .eyes, .ag-face .dots, .ag-face .dots circle, .ag-face .feat { transform-box: fill-box; transform-origin: center; }
.ag-face .dots { opacity: 0; }

/* asleep: 0%, eyes shut, slow breathing, floating z's */
.agent.asleep .ag-face { animation: ag-breathe 3.6s ease-in-out infinite; animation-delay: var(--d); filter: saturate(.8) brightness(.92); }
.zz { position: absolute; top: -4px; right: -2px; width: 20px; height: 24px; pointer-events: none; }
.zz i {
  position: absolute; left: 0; bottom: 0; font-style: normal; font-weight: 800; color: var(--c);
  opacity: 0; animation: ag-z 3s ease-in-out infinite;
}
.zz i:nth-child(1) { font-size: 9px; animation-delay: calc(var(--d) + 0s); }
.zz i:nth-child(2) { font-size: 11px; animation-delay: calc(var(--d) + 1s); }
.zz i:nth-child(3) { font-size: 13px; animation-delay: calc(var(--d) + 2s); }
@keyframes ag-breathe { 0%, 100% { transform: scale(1) translateY(0); } 50% { transform: scale(1.06) translateY(1px); } }
@keyframes ag-z { 0% { opacity: 0; transform: translate(0, 4px) rotate(-8deg); } 25% { opacity: .9; } 100% { opacity: 0; transform: translate(12px, -16px) rotate(12deg); } }

/* awake: ring spins, characters move (gear spins, others rock or float),
   eyes blink and take turns with a bouncing "..." thinking animation */
.agent.awake .ring-svg { animation: ag-spin 1.8s linear infinite; }
.agent.awake.mv-spin .ag-body { animation: ag-gear 5s linear infinite; }
.agent.awake.mv-spin .ag-face { animation: ag-hop 2.2s ease-in-out infinite; animation-delay: var(--d); }
.agent.awake.mv-rock .ag-face { animation: ag-rock 2.4s ease-in-out infinite; animation-delay: var(--d); }
.agent.awake.mv-float .ag-face { animation: ag-float 2.8s ease-in-out infinite; animation-delay: var(--d); }
.agent.awake .eyes { animation: ag-eyes 6s ease-in-out infinite; animation-delay: var(--d); }
.agent.awake .dots { animation: ag-dots 6s ease-in-out infinite; animation-delay: var(--d); }
.agent.awake .dots circle { animation: ag-bounce .9s ease-in-out infinite; }
.agent.awake .dots circle:nth-child(2) { animation-delay: .15s; }
.agent.awake .dots circle:nth-child(3) { animation-delay: .3s; }
.agent.awake .ag-st { color: var(--c); }
.ag-st .ld i { font-style: normal; display: inline-block; animation: ag-ld 1.2s ease-in-out infinite; }
.ag-st .ld i:nth-child(2) { animation-delay: .2s; }
.ag-st .ld i:nth-child(3) { animation-delay: .4s; }
.agent.awake .ag-bar i { width: 35%; animation: ag-slide 1.6s ease-in-out infinite; }
@keyframes ag-spin { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
@keyframes ag-gear { to { transform: rotate(360deg); } }
@keyframes ag-hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes ag-rock { 0%, 100% { transform: rotate(-9deg) translateY(0); } 50% { transform: rotate(9deg) translateY(-2px); } }
@keyframes ag-float { 0%, 100% { transform: translate(-1.5px, 0) rotate(-4deg); } 50% { transform: translate(1.5px, -2.5px) rotate(4deg); } }
/* eyes show ~55% of the time with a blink, then "..." for ~35% */
@keyframes ag-eyes {
  0%, 16%, 20%, 52% { opacity: 1; transform: scaleY(1); }
  18% { opacity: 1; transform: scaleY(.08); }
  56%, 92% { opacity: 0; transform: scaleY(1); }
  96%, 100% { opacity: 1; }
}
@keyframes ag-dots { 0%, 52% { opacity: 0; } 56%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes ag-bounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-2.2px); } }
@keyframes ag-ld { 0%, 100% { opacity: .2; } 40% { opacity: 1; } }
@keyframes ag-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(300%); } }
@media (max-width: 360px) { .agents { grid-template-columns: 1fr; } }
#start-snipe.stop { background: var(--surface-2); color: var(--down); }
.snipe-btn { gap: 8px; color: var(--accent-2); }

/* ---------- Wallets ---------- */
.in-use {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--up); background: rgba(50,215,75,.13); padding: 4px 10px; border-radius: 999px;
}
.in-use i { width: 6px; height: 6px; border-radius: 50%; background: var(--up); animation: pulse 1.6s ease-in-out infinite; }
.in-use.sm { font-size: 10px; padding: 3px 8px; }
.wl-hero { background: var(--surface); border: 1.5px solid var(--accent-2); border-radius: 18px; padding: 16px; }
.wl-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.wl-label { font-size: 12px; color: var(--muted); margin: 14px 0 6px; }
.wl-field { display: flex; align-items: center; gap: 10px; background: var(--bg); border-radius: 12px; padding: 10px 10px 10px 12px; min-width: 0; }
.wl-field .mono, .wl-field .pk-blur { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; text-align: left; line-height: 1.4; }
.wl-hint { font-size: 12px; color: var(--muted); margin-top: 10px; }
.mini { flex: none; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 9px; background: var(--surface-2); color: var(--text); }
.mini.wide { flex: 1; padding: 10px; font-size: 14px; }
.mini.danger { color: var(--down); }
.pk-blur { display: block; overflow: hidden; min-width: 0; padding: 0; background: none; }
.pk-blur span { display: block; filter: blur(5px); transition: filter .2s; user-select: none; }
.pk-blur.shown span { filter: none; user-select: text; }
.wl-field .pk-blur span { white-space: normal; word-break: break-all; }
.wl-actions { margin-top: 14px; }
.wl-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.wl-card { background: var(--surface); border: 1.5px solid transparent; border-radius: 16px; padding: 12px; min-width: 0; }
.wl-card.using { border-color: rgba(50,215,75,.6); }
.wl-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.wl-card-top b { font-size: 16px; }
.wl-bal { margin-left: auto; font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.wl-row { display: flex; align-items: center; gap: 10px; background: var(--bg); border-radius: 10px; padding: 8px 8px 8px 12px; margin-top: 6px; font-size: 13px; min-width: 0; }
.wl-row .k { color: var(--muted); font-size: 12px; width: 52px; flex: none; }
.wl-row .mono, .wl-row .pk-blur { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; text-align: left; }
.wl-row .pk-blur span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-btns { display: flex; gap: 8px; margin-top: 10px; }
#wsheet .btn.dark { background: var(--surface-2); }
.tile .bars, .tile .spark { height: 26px; }
.agent.asleep .ag-txt { justify-content: center; }
