:root {
  --bg: #F5F6F8; --card: #FFFFFF; --line: #E4E7EC; --line-soft: #EEF0F3;
  --ink: #0F172A; --ink-2: #1F2937; --ink-3: #3F4756; --muted: #5B6474;
  --accent: #3B5BDB; --accent-ink: #2B44A8; --accent-bg: #EEF1FD;
  --good: #0B6B42; --good-bg: #E6F4EC; --good-solid: #0B7A4B;
  --bad: #9A3A00; --bad-bg: #FDEEE3;
  --warn-bg: #FFF6DB; --warn-line: #F0D58A; --warn-ink: #5C3D00;
  --hide-bg: #F3F4F6; --hide-line: #C9CDD4;
  --massa: #E8590C; --massa-bg: #FFF0E6; --massa-ink: #9A3A00;
  --solana: #7C3AED; --solana-bg: #F1EAFE; --solana-ink: #5B21B6;
  --evm: #1E3A8A; --evm-bg: #E8EEFB; --evm-ink: #1E3A8A;
  --head: 'Space Grotesk', Inter, system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 Inter, system-ui, -apple-system, sans-serif; font-variant-numeric: tabular-nums; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
button { font: inherit; }
h1, h2, h3 { font-family: var(--head); margin: 0; }
h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 20px; font-weight: 600; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top, 0px); }
.topbar-in { max-width: 1280px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 12px 32px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--head); font-weight: 700; font-size: 18px; }
.topnav { display: flex; gap: 4px; flex: 1 1 auto; }
.topnav a { padding: 12px 16px; border-radius: 10px; color: var(--ink-3); font-weight: 500; text-decoration: none; }
.topnav a[aria-current="page"] { background: var(--accent-bg); color: var(--accent-ink); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.updated { font-size: 13px; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #1E293B; color: #fff; }
.btn.ghost { background: var(--card); border-color: var(--line); color: var(--ink-2); }
.btn.ghost:hover { background: #F8F9FB; }
.btn.danger { background: var(--card); border-color: #F2C4A8; color: var(--bad); }
.icon-btn { padding: 0; width: 44px; }
.icon-btn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.syncbar { max-width: 1280px; margin: 12px auto 0; padding: 0 24px; font-size: 13px; color: var(--ink-3); }
.syncbar > div { display: flex; align-items: center; gap: 10px; background: var(--accent-bg); color: var(--accent-ink); padding: 10px 14px; border-radius: 10px; }
.dot-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; flex: none; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- layout ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 24px 24px 64px; display: flex; flex-direction: column; gap: 24px; outline: none; }
.loading { padding: 80px 0; text-align: center; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px 24px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.big { font-family: var(--head); font-size: 52px; line-height: 1; font-weight: 700; letter-spacing: -0.02em; }
.big .cents { font-size: 26px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill .d { width: 7px; height: 7px; border-radius: 50%; }
.chg { padding: 3px 8px; border-radius: 7px; font-weight: 600; font-size: 14px; }
.chg.up { background: var(--good-bg); color: var(--good); }
.chg.down { background: var(--bad-bg); color: var(--bad); }
.chg.flat { background: #EEF0F3; color: var(--ink-3); }

.seg { display: inline-flex; gap: 4px; background: #F1F3F6; padding: 4px; border-radius: 12px; }
.seg button { min-height: 40px; padding: 0 14px; border: none; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.15); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #D5D9E0; background: var(--card); color: var(--ink-2); font-weight: 600; font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .n { opacity: .7; margin-left: 4px; }

/* ---------- chart ---------- */
.chart-empty { height: 160px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }

/* ---------- lists ---------- */
.wcard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-height: 72px; }
.wcard:hover { border-color: #CBD2DC; color: var(--ink); }
.wcard.empty { opacity: .65; }
.wicon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.wmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wsub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wval { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.wval b { font-size: 16px; }
.up-t { color: var(--good); font-size: 12px; font-weight: 600; }
.down-t { color: var(--bad); font-size: 12px; font-weight: 600; }

.chainbar { display: flex; height: 18px; border-radius: 6px; overflow: hidden; gap: 3px; margin: 4px 0 14px; }
.legend-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.legend-row .sw { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.legend-row .nm { flex: 1; font-weight: 600; }
.legend-row .nm span { color: var(--muted); font-weight: 500; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; padding: 10px 8px; }
.tbl td { padding: 12px 8px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.tbl .r { text-align: right; }
.tbl tr.off td { background: #F7F7F8; }
.tbl tr.off td.dim { opacity: .5; filter: grayscale(1); }
.tok { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ticon { width: 36px; height: 36px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; overflow: hidden; }
.ticon { position: relative; }
.ticon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.tok .t1 { font-weight: 600; display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tok .t2 { font-size: 12px; color: var(--muted); display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strike { text-decoration: line-through; }
.status { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.status.ok { background: var(--good-bg); color: var(--good); }
.status.scam, .status.off { background: #EEEFF1; color: var(--ink-3); }
.status.warn { background: var(--warn-bg); color: var(--warn-ink); }

.switch { position: relative; width: 52px; height: 30px; border-radius: 999px; border: none; cursor: pointer; padding: 0; background: #B8BEC8; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.switch[aria-checked="true"] { background: var(--good-solid); }
.switch[aria-checked="true"]::after { left: 25px; }
.switch:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.linkbtn { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 12px; padding: 4px 0; }

.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; font-size: 14px; text-decoration: none; }
.banner.hidden-tokens { background: #F6F6F7; border: 1px dashed var(--hide-line); color: var(--ink-3); }
.banner.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); }
.banner.info { background: var(--accent-bg); color: var(--accent-ink); }
.banner b { color: var(--ink); }
.banner .go { margin-left: auto; font-weight: 600; color: var(--accent); white-space: nowrap; }

/* activity / history */
.ev { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.ev:first-child { border-top: none; }
.badge { flex: none; width: 74px; text-align: center; padding: 4px 0; border-radius: 6px; font-size: 12px; font-weight: 600; }
.k-buy { background: var(--good-bg); color: var(--good); }
.k-sell { background: var(--bad-bg); color: var(--bad); }
.k-receive, .k-send { background: var(--accent-bg); color: var(--accent-ink); }
.k-swap { background: var(--solana-bg); color: var(--solana-ink); }
.k-stake, .k-unstake { background: var(--massa-bg); color: var(--massa-ink); }
.k-interact, .k-spam { background: #EEEFF1; color: var(--muted); }
.ev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ev-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.ev-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-amt { text-align: right; font-weight: 600; font-size: 14px; white-space: nowrap; }
.ev-amt small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.ev.spam { opacity: .55; }
.ev.spam .ev-title { text-decoration: line-through; }

.year-h { display: flex; align-items: center; gap: 12px; padding: 18px 0 6px; }
.year-h b { font-family: var(--head); font-size: 22px; }
.year-h i { flex: 1; height: 1px; background: var(--line); }
.year-h span { font-size: 13px; color: var(--muted); }
.hrow { display: grid; grid-template-columns: 84px 74px minmax(0, 1fr) auto; align-items: center; gap: 12px 16px; padding: 12px 0; border-top: 1px solid #F0F2F5; }
.hrow .when b { display: block; font-size: 14px; }
.hrow .when span { font-size: 12px; color: var(--muted); }
.hrow.spam { opacity: .55; }
.hrow.spam .ev-title { text-decoration: line-through; }
.origin { display: inline-block; margin-top: 4px; padding: 3px 8px; border-radius: 6px; background: var(--warn-bg); color: #7A5200; font-size: 12px; font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: #F6F7F9; border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi b { font-size: 24px; font-family: var(--head); font-weight: 600; }
.kpi small { font-size: 12px; color: var(--muted); }

.hold { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.hold.off { background: var(--hide-bg); border: 1px dashed var(--hide-line); color: var(--muted); }
.hold.off .ticon { filter: grayscale(1); opacity: .6; }
.hold .hm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hold .hm b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hold .hm span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hold .hv { font-weight: 700; font-size: 17px; white-space: nowrap; }

.wtabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.wtabs a { flex: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.wtabs a[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.wtabs .d { width: 8px; height: 8px; border-radius: 50%; }

.addr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.copy { min-height: 36px; min-width: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); }

.form { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.form label { font-weight: 600; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.form input { min-height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid #CBD2DC; font: 15px Inter, sans-serif; background: #fff; color: var(--ink); }
.form input:focus { outline: 3px solid #BFCBF5; border-color: var(--accent); }
.form .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.err { color: var(--bad); font-size: 14px; }
.manage-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.manage-row .wmain { min-width: 160px; }

.empty-note { padding: 24px; text-align: center; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; max-width: calc(100vw - 32px); }
.login { max-width: 380px; margin: 10vh auto; }

/* ---------- bottom nav (phone) ---------- */
.bottomnav { display: none; }
.show-phone { display: none; }
@media (max-width: 760px) {
  body { font-size: 15px; }
  .topbar-in { padding: 10px 16px; }
  .topnav, .updated, .hide-phone { display: none !important; }
  .brand { font-size: 17px; }
  .page { padding: 16px 16px calc(100px + var(--safe-b)); gap: 16px; }
  .syncbar { padding: 0 16px; margin-top: 10px; }
  .card { padding: 16px; border-radius: 16px; }
  .grid-2 { grid-template-columns: 1fr; gap: 16px; }
  .big { font-size: 42px; }
  .big .cents { font-size: 22px; }
  h1 { font-size: 26px; }
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); justify-content: space-around; padding: 6px 8px calc(8px + var(--safe-b)); }
  .bottomnav a { min-width: 72px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none; }
  .bottomnav a[aria-current="page"] { color: var(--accent-ink); }
  .hrow { grid-template-columns: 74px minmax(0, 1fr) auto; }
  .hrow .when { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; }
  .hrow .when b { display: inline; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 0 6px; font-size: 13px; white-space: nowrap; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi b { font-size: 20px; }
  .worth { align-items: flex-start !important; }
  .big.mid { font-size: 34px !important; }
  .tbl-tokens thead { display: none; }
  .tbl-tokens tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
  .tbl-tokens td { border: none; padding: 0; }
  .tbl-tokens td.c-tok { grid-column: 1; }
  .tbl-tokens td.c-switch { grid-column: 2; grid-row: 1; align-self: center; }
  .tbl-tokens td.c-val { grid-column: 1 / -1; text-align: left; font-size: 13px; color: var(--muted); }
  .tbl-tokens td.c-status { grid-column: 1 / -1; }
  .tbl-tokens td.c-hide { display: none; }
  .show-phone { display: inline; }
  .tbl-tokens tr.off { background: #F7F7F8; }
  .tbl-tokens tr.off td { background: transparent; }
}

/* ---------- interactive chart ---------- */
.ic { display: flex; flex-direction: column; gap: 10px; }
.ic-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ic-ranges button { min-height: 36px; padding: 0 12px; }
.ic-tools { display: flex; gap: 6px; }
.ic-btn { min-width: 40px; min-height: 40px; border: 1px solid var(--line, #E4E7EC); background: var(--card); color: var(--ink-2, #344054); border-radius: 10px; font-size: 18px; font-weight: 600; cursor: pointer; }
.ic-btn:hover { background: #F6F7F9; }
.ic-btn.ic-wide { font-size: 13px; padding: 0 12px; }
.ic-btn[aria-pressed="true"] { background: var(--ink, #0F172A); color: #fff; border-color: var(--ink, #0F172A); }
.ic-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13px; color: var(--muted); min-height: 24px; }
.ic-summary b { color: var(--ink); font-weight: 600; }
.ic-summary small { color: var(--muted); }
.ic-pa { font-size: 13px; font-weight: 600; margin-left: auto; }
.ic-plot { position: relative; user-select: none; -webkit-user-select: none; touch-action: pan-y; cursor: crosshair; outline: none; border-radius: 10px; }
.ic-plot:focus-visible { box-shadow: 0 0 0 3px rgba(59,91,219,.35); }
.ic-svg { display: block; width: 100%; }
.ic-ylabs span { position: absolute; left: 0; transform: translateY(-50%); font-size: 11px; color: var(--muted); background: linear-gradient(90deg, var(--card) 70%, transparent); padding-right: 10px; pointer-events: none; }
.ic-markers { position: absolute; inset: 0; pointer-events: none; }
.ic-mk { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; padding: 0; border-radius: 50%; border: 2.5px solid var(--c); background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.25); cursor: pointer; pointer-events: auto; overflow: visible; transition: transform .12s; }
.ic-mk:hover, .ic-mk:focus-visible { transform: scale(1.35); z-index: 3; outline: none; }
.ic-mk .ic-l { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--ink-2, #344054); border-radius: 50%; }
.ic-mk img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #fff; }
.ic-mk em { position: absolute; top: -9px; right: -11px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--c); color: #fff; font: 700 10px/16px Inter, sans-serif; font-style: normal; text-align: center; }
.ic-sel { position: absolute; top: 0; bottom: 0; background: rgba(59,91,219,.12); border-left: 1.5px solid #3B5BDB; border-right: 1.5px solid #3B5BDB; pointer-events: none; }
.ic-sel::after { content: attr(data-label); position: absolute; top: 6px; left: 50%; transform: translateX(-50%); background: #3B5BDB; color: #fff; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.ic-cross { position: absolute; top: 0; bottom: 0; width: 0; pointer-events: none; }
.ic-cross i { position: absolute; top: 0; bottom: 0; left: 0; border-left: 1px dashed #94A3B8; }
.ic-cross b { position: absolute; left: -5px; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: #fff; border: 2.5px solid #3B5BDB; }
.ic-tip { position: absolute; z-index: 5; max-width: 300px; min-width: 160px; background: var(--ink, #0F172A); color: #fff; border-radius: 10px; padding: 10px 12px; font-size: 12px; box-shadow: 0 8px 24px rgba(15,23,42,.25); pointer-events: none; }
.ic-tdate { color: #CBD5E1; font-size: 11px; }
.ic-tval { font-size: 18px; font-weight: 700; font-family: 'Space Grotesk', Inter, sans-serif; margin: 2px 0; }
.ic-tsub { color: #CBD5E1; }
.ic-trow { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: start; padding: 4px 0; }
.ic-trow + .ic-trow { border-top: 1px solid rgba(255,255,255,.1); }
.ic-trow b { display: block; font-weight: 600; }
.ic-trow small { color: #CBD5E1; }
.ic-dot { width: 10px; height: 10px; border-radius: 50%; border: 2.5px solid; margin-top: 3px; }
.ic-tusd { font-weight: 600; white-space: nowrap; }
.ic-more { color: #CBD5E1; font-size: 11px; padding-top: 4px; }
.ic-xlabs { position: relative; height: 18px; font-size: 11px; color: var(--muted); margin-top: -4px; }
.ic-xlabs span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.ic-nav { position: relative; height: 44px; border-radius: 8px; background: #F6F7F9; cursor: pointer; touch-action: none; user-select: none; overflow: hidden; }
.ic-navsvg { display: block; width: 100%; }
.ic-win { position: absolute; top: 0; bottom: 0; background: rgba(59,91,219,.14); border: 1.5px solid #3B5BDB; border-radius: 6px; cursor: grab; }
.ic-win:active { cursor: grabbing; }
.ic-win .h { position: absolute; top: 50%; width: 10px; height: 22px; margin-top: -11px; background: #fff; border: 1.5px solid #3B5BDB; border-radius: 4px; cursor: ew-resize; }
.ic-win .h.l { left: -6px; } .ic-win .h.r { right: -6px; }
.ic-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.ic-leg { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line, #E4E7EC); border-radius: 999px; background: var(--card); color: var(--ink-2, #344054); font-size: 13px; cursor: pointer; }
.ic-leg span { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid; background: #fff; }
.ic-leg em { font-style: normal; color: var(--muted); font-size: 12px; }
.ic-leg[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.ic-hint { font-size: 12px; color: var(--muted); margin: 0; }
.hrow.flash { animation: flash 2.2s ease-out; border-radius: 10px; }
@keyframes flash { 0%, 30% { background: #FFF4CC; box-shadow: 0 0 0 3px #FFE08A; } 100% { background: transparent; box-shadow: none; } }
@media (max-width: 760px) {
  .ic-bar { flex-direction: column; align-items: stretch; }
  .ic-tools { justify-content: flex-end; }
  .ic-hint { display: none; }
  .ic-pa { margin-left: 0; }
  .ic-tip { max-width: 240px; }
}
@media (hover: none) { .ic-hint::before { content: 'Tap an icon for details · pinch to zoom · '; } }
#ch-total .ic-summary .chg { display: none; }

/* ---------- overview: money strip + period panel ---------- */
.money-strip { padding-top: 18px; padding-bottom: 14px; }
.money-strip .ms-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.money-strip h2 { font-size: 18px; }
.money-strip .banner { padding: 8px 14px; }
.money-strip .chainbar { margin: 6px 0 8px; height: 14px; }
.ms-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; }
.ms-legend .legend-row { padding: 2px 0; }
.ms-legend .legend-row .nm { flex: none; }
.ms-nets { font-size: 13px; color: var(--muted); margin-left: auto; }
.ms-nets b { color: var(--ink-3); font-weight: 600; }
.chart-row { align-items: start; }
.period { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; transition: opacity .15s; }
.period.loading { opacity: .55; }
.period h2 { font-size: 18px; }
.pd-body { display: flex; flex-direction: column; gap: 12px; }
.pd-dates { font-size: 13px; color: var(--muted); margin-top: -6px; }
.pd-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pd-kpis div { background: #F6F7F9; border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.pd-kpis span { font-size: 12px; color: var(--muted); }
.pd-kpis b { font-size: 15px; }
.pd-kpis b.up-t, .pd-kpis b.down-t { font-size: 15px; }
.pd-list { display: flex; flex-direction: column; }
.pd-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.pd-row:first-child { border-top: none; }
.pd-main { display: flex; flex-direction: column; min-width: 0; }
.pd-main b { font-weight: 600; }
.pd-main span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-main span .up-t, .pd-main span .down-t { font-size: 12px; }
.pd-val { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.pd-val .muted { font-size: 12px; }
.pd-more { font-size: 13px; font-weight: 600; align-self: flex-start; }
.pd-note { font-size: 12px; color: var(--muted); margin: 0; }
@media (max-width: 760px) {
  .ms-legend { gap: 2px 18px; }
  .ms-nets { margin-left: 0; width: 100%; }
  .period { position: static; max-height: none; }
}
.big-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.big-row .cur { font-size: 15px; font-weight: 600; color: var(--muted); }
.big-row .cad { font-size: 17px; font-weight: 600; color: var(--ink-3); font-family: var(--head); }
.period.snap { box-shadow: 0 0 0 2px var(--accent-bg), 0 1px 3px rgba(15,23,42,.08); }

/* ---------- wallet importer ---------- */
.importer { max-width: 760px; }
.imp-tabs { margin-bottom: 16px; }
.imp-pane { margin-bottom: 14px; }
.imp-lab { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.imp-lab .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.imp-lab textarea { padding: 12px 14px; border-radius: 10px; border: 1px solid #CBD2DC; font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; color: var(--ink); }
.imp-lab textarea:focus { outline: 3px solid #BFCBF5; border-color: var(--accent); }
.imp-wallets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.imp-wbtn { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.imp-wbtn:hover { border-color: var(--accent); background: var(--accent-bg); }
.imp-wbtn img { width: 28px; height: 28px; border-radius: 6px; }
.imp-wbtn span { display: flex; flex-direction: column; }
.imp-wbtn small { color: var(--muted); font-size: 12px; }
.imp-wbtn.busy { opacity: .6; cursor: progress; }
.imp-list { display: flex; flex-direction: column; margin-bottom: 14px; }
.imp-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding-bottom: 6px; font-size: 14px; }
.imp-head .muted { font-size: 13px; }
.imp-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto minmax(120px, 200px); gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.imp-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
.imp-row.off { opacity: .6; }
.imp-addr { display: flex; flex-direction: column; min-width: 0; }
.imp-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-name { min-height: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid #CBD2DC; font: 14px Inter, sans-serif; width: 100%; }
.imp-actions { display: flex; gap: 10px; }
@media (max-width: 760px) {
  .imp-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .imp-row .imp-name { grid-column: 2 / -1; }
}
.imp-tips { margin: 0 0 12px; padding-left: 18px; font-size: 13px; color: var(--ink-3); display: flex; flex-direction: column; gap: 4px; }

/* ---------- Tools: LP scanner and dust collector ---------- */
.seg .seg-a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.seg .seg-a[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.15); }
.small { font-size: 13px; }
.tool-pick { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.tool-pick label, .lp-opts label, .dust-bar label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.tool-pick select, .tool-pick input, .lp-opts select, .dust-bar select { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid #CBD2DC; font: 15px Inter, sans-serif; background: var(--card); color: var(--ink); max-width: 100%; }
.tool-pick input { width: min(420px, 100%); }
.tool-pick label { flex: 1 1 240px; }
.lp-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.lp { border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.lp-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.lp-title { font-family: var(--head); font-weight: 700; font-size: 18px; }
.lp-val { font-family: var(--head); font-weight: 700; font-size: 22px; white-space: nowrap; }
.lp-back { margin: 10px 0; color: var(--ink-2); }
.lp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.lp-actions, .row-btns, .dust-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lp-opts { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.lp-opts label.chk, .chk { flex-direction: row; align-items: center; gap: 8px; min-height: 44px; }
.dust-bar { justify-content: flex-end; margin-top: 12px; }
.tbl.dust input[type="checkbox"], .chk input { width: 20px; height: 20px; }
.steps { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 6px; }
.step { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #F6F7F9; font-size: 14px; }
.step .st { width: 20px; flex: none; text-align: center; font-weight: 700; }
.step.done { background: var(--good-bg); }
.step.fail { background: var(--warn-bg); }
.step.sign, .step.pending { background: var(--accent-bg); }
.step .sm { color: var(--muted); }
.step-group { font-weight: 700; margin-top: 8px; font-size: 14px; }
.banner.ok { background: var(--good-bg); color: var(--good); }
@media (max-width: 640px) { .tool-pick .btn { width: 100%; } .lp-val { font-size: 18px; } }
@media (max-width: 1100px) { .topbar-in { gap: 12px 16px; } .topnav a { padding: 12px 10px; } .topbar .updated { display: none; } }
@media (max-width: 1000px) { .topbar .hide-phone { display: none; } }
