:root {
  --bg: #ffffff; --card: #ffffff; --line: #e5e7eb; --soft: #f1f3f5; --text: #15181e; --muted: #6b7280;
  --accent: #1f6feb; --accent-soft: #e8f0fe; --up: #16a34a; --down: #dc2626; --warn: #ea8a0c;
  --radius: 14px; --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}
[data-theme="dark"] {
  --bg: #0d1117; --card: #151b23; --line: #262d36; --soft: #1c232c; --text: #e6e9ee; --muted: #8b949e;
  --accent: #4c8dff; --accent-soft: #19273d; --shadow: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.up { color: var(--up); } .down { color: var(--down); }
.gold { color: #c99400; font-weight: 700; }   /* the official token up more than 5% */
[data-theme="dark"] .gold { color: #f5c542; }
/* a row whose token traded in the latest block */
@keyframes tickUp { from { background: rgba(38,166,154,.22); } to { background: transparent; } }
@keyframes tickDown { from { background: rgba(239,83,80,.22); } to { background: transparent; } }
tr.tick-up > td { animation: tickUp 1.6s ease-out; } tr.tick-down > td { animation: tickDown 1.6s ease-out; }
.hidden { display: none !important; }
/* Lightweight Charts' TradingView attribution: kept (their licence notice asks for it), but small and quiet */
a#tv-attr-logo { transform: scale(.55); transform-origin: left bottom; opacity: .5; }
a#tv-attr-logo:hover { opacity: .9; }

/* header */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: 1480px; margin: 0 auto; display: flex; align-items: center; gap: 22px; padding: 12px 20px; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--accent); }
.nav a { color: var(--muted); font-weight: 600; margin-right: 18px; }
.nav a.on, .nav a:hover { color: var(--text); }
.search { flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.search input { width: 100%; padding: 9px 12px 9px 34px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); outline: none; }
.search input:focus { border-color: var(--accent); }
.search svg { position: absolute; left: 10px; top: 10px; color: var(--muted); }
.search .results { position: absolute; top: 42px; left: 0; right: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); max-height: 420px; overflow: auto; padding: 6px; }
.algo-chip { font-size: 12px; color: var(--muted); white-space: nowrap; }
.iconbtn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  display: grid; place-items: center; }
.btn { border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 700; background: var(--soft); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; padding: 13px; font-size: 15px; }
.pop { position: absolute; right: 20px; top: 60px; z-index: 40; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.14); padding: 14px; min-width: 260px; }
.pop h4 { margin: 0 0 10px; font-size: 13px; }
.seg { display: inline-flex; background: var(--soft); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.seg.sm button, .chart-head .seg button { padding: 4px 9px; font-size: 12px; }
.chart-head { flex-wrap: wrap; }
.frange input { width: 86px; }
/* ☰ menu and footer */
.pop.menu { width: 290px; padding: 8px; }
.pop.menu h5 { margin: 8px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mi { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.mi:hover { background: var(--soft); } .mi span { font-size: 12.5px; }
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 22px 0 30px; font-size: 13px; }
.foot .in { max-width: 1620px; margin: 0 auto; padding: 0 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; } .foot nav a { color: var(--muted); text-decoration: none; }
.foot nav a:hover { color: var(--text); } .foot .muted { margin-left: auto; }
.about { max-width: 820px; margin: 0 auto; line-height: 1.6; } .about section { padding: 18px 24px; margin-bottom: 18px; }
.about h2 { margin-top: 0; }
/* Explore home banner */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; align-items: center; padding: 16px 20px; margin-bottom: 18px; }
.hstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hstats small { display: block; color: var(--muted); font-size: 12px; } .hstats b { font-size: 20px; }
.hbars { width: 100%; height: 86px; } .hbars rect { fill: #2563eb; opacity: .75; } .hbars rect:hover { opacity: 1; }
@media (max-width: 1000px) { .hero { grid-template-columns: 1fr; } .hstats { grid-template-columns: repeat(2, 1fr); } }
/* Edit token info */
.ti { max-width: 760px; }
.tif { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; } .tif > span { font-weight: 600; font-size: 14px; }
.tif input, .tif textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; }
.ticon { display: flex; gap: 14px; align-items: flex-start; } .ticon img { border-radius: 14px; background: var(--soft); object-fit: cover; }
.ticon input[type=file] { margin-bottom: 8px; } .ticon #iconUrl { width: 100%; box-sizing: border-box; }
.tilinks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.tilinks .tif { margin: 6px 0; } @media (max-width: 700px) { .tilinks { grid-template-columns: 1fr; } }
.tisave { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
/* asset page: your P&L and recent swaps */
#pnl { margin-bottom: 14px; }
.myswap { align-items: center; } .myswap > span { display: inline-flex; align-items: center; gap: 6px; }
.myswap .vlogo, .myswap .vbadge { width: 22px; height: 22px; border-radius: 6px; font-size: 8px; }
.frange { gap: 10px; }

/* layout */
.wrap { max-width: 1480px; margin: 0 auto; padding: 22px 20px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.notice { background: var(--accent-soft); color: var(--accent); border-radius: 12px; padding: 10px 14px; font-weight: 600;
  font-size: 13px; margin-bottom: 18px; }

/* discovery strip */
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.strip .card { padding: 14px 16px; }
.strip h3 { margin: 0 0 8px; font-size: 15px; display: flex; gap: 6px; align-items: center; }
.strip h3 small { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 11px; }
.strip .row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.strip .row .chg { margin-left: auto; }

/* screenshot-matched overrides */
.brand { font-style: italic; font-size: 30px; font-weight: 900; letter-spacing: -.04em; color: #1f6feb; display: inline-flex; align-items: center; }
/* the EasyAlgo logo (public/brand); the light-text version shows in dark mode */
.brand-logo { height: 38px; width: auto; display: block; }
.brand-logo.dark, [data-theme="dark"] .brand-logo.light { display: none; }
[data-theme="dark"] .brand-logo.dark { display: block; }
@media (max-width: 700px) { .brand-logo { height: 30px; } }
.nav a { font-size: 17px; }
.search input { background: var(--soft); border-color: transparent; border-radius: 10px; padding: 11px 12px 11px 38px; }
/* flat look: white page, cards drawn by their 1px border only; the stats banner stays hidden until it has numbers */
.card { box-shadow: none; }
.hero:empty { display: none; }
.search svg { top: 13px; left: 13px; }
.iconbtn { background: var(--soft); border: 0; width: 42px; height: 42px; }
.iconbtn.dark { background: #e3e6ea; }
[data-theme="dark"] .iconbtn.dark { background: #2a323d; color: var(--text); }
[data-theme="dark"] .vlogo { background: #fff; }
.btn.primary { border-radius: 12px; padding: 11px 18px; }
.strip .card { padding: 18px 18px 14px; }
.strip h3 { font-size: 17px; margin-bottom: 12px; }
.strip h3 .info { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; background: #9aa0a8; color: #fff;
  font: 700 11px/18px Georgia, serif; text-align: center; cursor: help; }
.strip .row { padding: 6px 0; font-size: 15px; }
.badge { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: #22c55e; color: #fff;
  font-size: 10px; font-weight: 900; margin-left: 4px; vertical-align: -2px; }
.tabbar { display: inline-flex; background: var(--soft); border-radius: 12px; padding: 4px; gap: 2px; }
.tabbar button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 600; color: var(--muted); font-size: 15px; }
.tabbar button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.tbl.market th { background: var(--soft); padding: 13px 8px; font-size: 13px; text-align: center; }
.tbl.market th.l { text-align: left; }
.tbl.market td { padding: 12px 8px; height: 64px; font-size: 15px; text-align: center; border-bottom: 1px solid var(--line); }
.tbl.market td.l { text-align: left; }
.tbl.market td.r { text-align: right; }
.tbl.market .asset b { font-size: 15px; }
.tbl.market .name small { font-size: 13px; letter-spacing: .01em; }
.logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: var(--soft); }
.logo.sm { width: 22px; height: 22px; } .logo.lg { width: 48px; height: 48px; }
.colpick { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; }
.colpick .chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.colpick .chips button { border: 0; border-radius: 9px; padding: 7px 12px; background: var(--soft); font-weight: 600; }
.colpick .chips button.on { background: var(--accent); color: #fff; }
.portfolio-total { font-size: 46px; font-weight: 800; text-align: center; letter-spacing: -.02em; }
.hold { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.hold .amt { margin-left: auto; text-align: right; }
.hold .amt small { display: block; color: var(--muted); }
.swap-grid { display: grid; grid-template-columns: minmax(0, 1fr) 470px; gap: 18px; max-width: 1340px; margin: 0 auto; align-items: start; }
@media (max-width: 1000px) { .swap-grid { grid-template-columns: 1fr; } }

.launchmark { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 5px; background: #ffedd5;
  font-size: 11px; margin-left: 4px; vertical-align: -3px; }
.pill.launch { background: #ffedd5; color: #c2410c; }
/* the site's own token (EASYALGO): Official badge, header chip, pinned Explore row, asset-page card, swap chip */
.pill.official { background: var(--accent-soft); color: var(--accent); }
.pill.sm { font-size: 10px; padding: 1px 6px; margin-left: 4px; vertical-align: 1px; }
a.off-chip { display: inline-flex; align-items: center; gap: 5px; color: var(--text); padding: 4px 8px; border-radius: 8px; background: var(--accent-soft); }
a.off-chip:hover { outline: 1px solid var(--accent); }
a.off-chip .vlogo, a.off-chip .vbadge, a.off-chip img { width: 18px; height: 18px; }
@media (max-width: 1100px) { a.off-chip { display: none; } }
.tbl.market tr.pinned > td { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.tbl.market .pin { font-size: 15px; cursor: help; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.quick .chip { border: 0; cursor: pointer; font-weight: 700; }
.quick .chip.official { background: var(--accent-soft); color: var(--accent); }
.pager select { border: 0; background: var(--soft); border-radius: 10px; padding: 8px 10px; font-weight: 600; }
.pager { align-items: center; }
.pager .pg { min-width: 40px; }

/* asset page (screenshot-matched) */
.asset-grid { grid-template-columns: 360px minmax(0, 1fr) 440px; }
.cardhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cardhead h4 { margin: 0; font-size: 18px; display: flex; gap: 8px; align-items: center; }
.btn.sm { padding: 6px 12px; font-size: 13px; background: #e3e6ea; }
.btn.sm.primary { background: var(--accent); color: #fff; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 4px; }
.pill.gray { background: var(--soft); color: var(--text); }
.kvrow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.big { font-size: 19px; }
.bar { height: 4px; border-radius: 4px; background: #f5b301; margin-top: 8px; display: flex; overflow: hidden; }
.bar i { display: block; background: var(--accent); }
.pairrow { display: flex; align-items: center; gap: 6px; padding: 7px 6px; margin: 0 -6px; font-size: 15px; border-radius: 10px; color: inherit; }
.pairrow:hover { background: var(--soft); }
.minichart { position: relative; }
.tip { position: absolute; top: 4px; z-index: 5; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.12); min-width: 170px; font-size: 14px; pointer-events: none; }
.chart-foot { display: flex; align-items: center; gap: 8px; padding: 8px 14px 12px; border-top: 1px solid var(--line); }
.ranges button { border: 0; background: none; padding: 4px 7px; color: var(--muted); font-weight: 600; }
.ranges button.on { color: var(--accent); border-bottom: 2px solid var(--accent); }
.vtabs { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 14px; background: var(--soft); border-radius: 14px; padding: 5px; }
.vtabs button { border: 0; background: none; padding: 9px 14px; border-radius: 10px; font-weight: 600; color: var(--muted); font-size: 15px; }
.vtabs button.on { background: var(--card); color: var(--text); box-shadow: 0 0 0 2px var(--accent); }
.swaprow { display: grid; grid-template-columns: 34px 64px 150px minmax(0, 1fr) 110px 40px; align-items: center; gap: 10px; padding: 9px 6px;
  border-bottom: 1px solid var(--line); }
.swaprow:hover { background: var(--soft); }
/* one line always: the two chips share the width and long names/amounts shrink with an ellipsis instead of wrapping */
.swaprow .flow { display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: nowrap; min-width: 0; color: var(--muted); }
.swaprow .flow .chip { min-width: 0; flex: 0 1 auto; overflow: hidden; }
.swaprow .flow .chip b { min-width: 0; overflow: hidden; text-overflow: ellipsis; max-width: 9em; }
.swaprow .flow .chip > :not(b) { flex-shrink: 0; }
@media (max-width: 1200px) { .swaprow .flow .chip small { display: none; } }
.swaprow .when { text-align: right; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 10px; padding: 5px 10px; color: var(--text);
  font-size: 15px; white-space: nowrap; }
.chip small { color: var(--muted); font-size: 12px; }
.vlogo { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.vbadge { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #fff; font: 800 10px/1 system-ui; }
.iconbtn.sm { width: 34px; height: 34px; text-decoration: none; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
h5 { margin: 6px 0 8px; font-size: 14px; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.desc { white-space: pre-wrap; line-height: 1.6; margin: 4px 0; }
.note { padding: 12px 4px; border-top: 1px solid var(--line); }
.composer { background: var(--soft); border-radius: 14px; padding: 12px; margin: 4px 0 12px; display: grid; gap: 8px; }
.composer textarea { width: 100%; min-height: 90px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: 10px;
  font: inherit; background: var(--card); color: var(--text); outline: none; }
.composer textarea:focus { border-color: var(--accent); }
.note.reply { margin-left: 28px; border-left: 3px solid var(--line); padding-left: 12px; }
.noteimg { max-width: 320px; max-height: 240px; border-radius: 10px; margin-top: 8px; display: block; }
.noteimg.blur { filter: blur(18px); }
.drawer-bg { position: fixed; inset: 0; background: rgba(10,14,20,.35); z-index: 70; }
.drawer { position: absolute; left: 0; top: 0; bottom: 0; width: min(470px, 96vw); background: var(--card); overflow: auto; padding: 18px 14px;
  box-shadow: 10px 0 40px rgba(0,0,0,.2); }
.drawer h3 { margin: 16px 0 8px; }
.drawer-x { position: absolute; right: 14px; top: 10px; border: 0; background: none; font-size: 24px; color: var(--muted); }
@media (max-width: 1500px) { .asset-grid { grid-template-columns: 330px minmax(0, 1fr); } .swaprow { grid-template-columns: 34px 60px 120px minmax(0, 1fr) 90px 40px; } }

/* avatars */
.av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 11px;
  color: #fff; flex: none; letter-spacing: -.02em; }
.av.sm { width: 22px; height: 22px; font-size: 9px; }
.av.lg { width: 44px; height: 44px; font-size: 15px; }
.name b { font-weight: 700; } .name small { display: block; color: var(--muted); font-size: 12px; }

/* tabs + toolbar */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.flag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: #fdecec; color: var(--down);
  margin-left: 4px; vertical-align: 1px; }
[data-theme="dark"] .flag { background: #3a1d1d; }

/* market table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; background: var(--soft);
  cursor: pointer; user-select: none; white-space: nowrap; }
.tbl th:first-child { border-top-left-radius: 10px; } .tbl th:last-child { border-top-right-radius: 10px; }
.tbl th.l, .tbl td.l { text-align: left; }
.tbl th.sorted::after { content: " ▾"; } .tbl th.sorted.asc::after { content: " ▴"; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tbl tbody tr { cursor: pointer; } .tbl tbody tr:hover { background: var(--soft); }
.tbl .asset { display: flex; align-items: center; gap: 10px; }
.rank { display: inline-block; min-width: 30px; text-align: center; padding: 2px 6px; border-radius: 7px; background: var(--soft);
  font-size: 12px; font-weight: 700; color: var(--muted); }
.star { border: 0; background: none; color: #c4c8cf; font-size: 17px; padding: 0 4px; }
.star.on { color: #f5b301; }
.pager { display: flex; justify-content: center; gap: 8px; padding: 14px; }

/* asset page */
.asset-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.panel { padding: 16px; }
.price-big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.price-big.long { font-size: 20px; }   /* tiny prices with subscript zeros: keep them inside the card */
.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.stat3 div { background: var(--soft); border-radius: 10px; padding: 8px; text-align: center; }
.stat3 small { display: block; color: var(--muted); font-size: 11px; }
.box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.box small { color: var(--muted); font-size: 11px; display: block; }
.chart-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
/* the chart is drawn exactly this size (asset.js reads it), taller on big screens; nothing of it may spill over the
   range buttons below */
#chart { height: clamp(340px, 56vh, 620px); position: relative; overflow: hidden; }
.chart-foot { position: relative; z-index: 2; background: var(--card); border-radius: 0 0 16px 16px; }
.reset-view { border: 0; background: none; color: var(--muted); font-size: 16px; padding: 2px 8px; border-radius: 8px; cursor: pointer; }
.reset-view:hover { background: var(--soft); color: var(--text); }
.empty-chart { height: 440px; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; }
.tabs { display: flex; gap: 6px; padding: 10px 14px 0; }
.tabs button { border: 0; background: var(--soft); border-radius: 9px; padding: 7px 12px; font-weight: 600; color: var(--muted); }
.tabs button.on { background: var(--accent-soft); color: var(--accent); }
.side { font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 6px; }
.side.buy { background: #e7f6ec; color: var(--up); } .side.sell { background: #fdecec; color: var(--down); }
[data-theme="dark"] .side.buy { background: #12301d; } [data-theme="dark"] .side.sell { background: #3a1d1d; }
.safety { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pill { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #e7f6ec; color: var(--up); }
.pill.bad { background: #fdecec; color: var(--down); }

/* swap box */
.swap { padding: 16px; }
.swap h3 { margin: 0 0 10px; font-size: 16px; }
.swap .leg { background: var(--soft); border-radius: 12px; padding: 12px; }
.swap .leg label { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.swap .leg .pct { margin-left: auto; display: flex; gap: 4px; }
.swap .leg .pct button { border: 0; background: var(--card); border-radius: 6px; font-size: 11px; font-weight: 700; padding: 3px 7px; }
.swap .line { display: flex; align-items: center; gap: 10px; }
.swap .amt { flex: 1; min-width: 0; border: 0; background: transparent; font: 600 22px/1.2 var(--mono); outline: none; }
.swap .usd { font-size: 12px; color: var(--muted); margin-top: 2px; }
.swap .tok { display: flex; align-items: center; gap: 6px; border: 0; background: var(--card); border-radius: 10px;
  padding: 7px 10px; font-weight: 700; box-shadow: var(--shadow); }
.swap .bal { font-size: 12px; color: var(--muted); margin-top: 6px; }
.swap .flip { display: grid; place-items: center; margin: -6px auto; position: relative; z-index: 1; width: 34px; height: 34px;
  border-radius: 10px; border: 3px solid var(--card); background: var(--soft); }
.swap .route { font-size: 12px; margin-top: 10px; }
.swap .route .kv { padding: 4px 0; font-size: 12px; }
.swap .msg { font-size: 12px; margin-top: 8px; min-height: 16px; }
.swap .msg.err { color: var(--down); } .swap .msg.ok { color: var(--up); }
.swap .cta { margin-top: 12px; }

/* modals */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 14, 20, .45); z-index: 60; display: grid; place-items: center; }
.modal { width: min(440px, 94vw); max-height: 80vh; display: flex; flex-direction: column; background: var(--card);
  border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.modal header { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 800; }
.modal header button { margin-left: auto; border: 0; background: none; font-size: 20px; color: var(--muted); }
.modal .body { padding: 12px 16px; overflow: auto; }
.modal input.q { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--soft);
  outline: none; margin-bottom: 8px; }
.pick { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px; border-radius: 10px;
  text-align: left; }
.pick:hover { background: var(--soft); }
.pick .r { margin-left: auto; text-align: right; font-size: 12px; color: var(--muted); }
.wallet-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); margin-bottom: 8px; font-weight: 700; }
.wallet-opt:hover { border-color: var(--accent); }
.wallet-opt .av { position: relative; overflow: hidden; border-radius: 12px; }
.wallet-opt .wlogo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }

@media (max-width: 1280px) { .asset-grid { grid-template-columns: 300px minmax(0, 1fr); } .asset-grid > .right { grid-column: 1 / -1; } }
@media (max-width: 1100px) { .strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  /* one column sized to the screen (not to its widest content), header wraps instead of running off the edge */
  .asset-grid { grid-template-columns: minmax(0, 1fr); } .asset-grid > * { min-width: 0; } .strip { grid-template-columns: 1fr; }
  .search { display: none; } .tbl .hide-sm { display: none; }
  .topbar .in { flex-wrap: wrap; gap: 10px 14px; padding: 10px 14px; } .algo-chip { display: none; }
  .topbar .nav { order: 3; width: 100%; display: flex; gap: 18px; }
  .wrap { padding: 14px 12px 50px; } .panel { padding: 14px; }
  .chart-head { gap: 6px; } .chart-head .seg button { padding: 3px 7px; }
  .stat3 { gap: 6px; } #period { display: inline-flex; flex-wrap: wrap; }
  .card { overflow-x: auto; }
}
[data-theme="dark"] .btn.sm { background: #2a323d; color: var(--text); }
[data-theme="dark"] .btn.sm.primary { background: var(--accent); color: #fff; }
