/* Momo: dark trading terminal. Desktop = 3 columns (sidebar | content | trade panel), phone = 1 column + tab bar. */
:root {
  --bg: #060510; --s1: #12111a; --s2: #161522; --s3: #1e1d2c; --tint: rgba(203,208,235,.1); --line: #1f1e2b; --line2: #2a2938;
  --text: #f7f7f7; --mute: #9899a3; --dim: #5b5d68;
  --accent: #516af6; --accent2: #6f85ff; --accent-t: rgba(81,106,246,.16); --indigo: #221d4b;
  --up: #21c95e; --up-t: rgba(33,201,94,.16); --down: #ff622e; --down-t: rgba(255,98,46,.14); --warn: #ffc74f; --dev: #fd5dd3;
  --r: 14px; --font: "Inter", system-ui, -apple-system, sans-serif;
  --top-h: 64px; --tab-h: 62px; --tick-h: 30px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; overflow-x: hidden; }
body { overscroll-behavior-y: none; font-feature-settings: "tnum" 1, "cv11" 1; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: var(--text); background: var(--s2); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; width: 100%; outline: none; }
input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.up { color: var(--up); } .down { color: var(--down); } .mute { color: var(--mute); } .dim { color: var(--dim); } .accent { color: var(--accent2); }
.small { font-size: 12.5px; } .tiny { font-size: 11px; } .b { font-weight: 600; }
.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hide-d { } .hide-m { display: none !important; }

/* ---------- top bar ---------- */
#top { position: sticky; top: 0; z-index: 30; height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 16px 0; display: flex; align-items: center; gap: 14px; background: var(--bg); }
.brand { font-weight: 700; font-size: 26px; letter-spacing: -0.05em; display: flex; align-items: center; gap: 2px; }
.brand i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; margin-left: 2px; transform: translateY(6px); }
#search-box { flex: 1; max-width: 400px; margin: 0 auto; position: relative; }
#search-box .field { display: flex; align-items: center; gap: 8px; background: var(--s1); border: 1px solid var(--line2); border-radius: 12px; padding: 0 8px 0 12px; height: 44px; color: var(--mute); }
#search-box input { background: none; border: 0; padding: 0; height: 100%; }
.kbd { font-size: 11px; color: var(--mute); background: var(--s3); border-radius: 6px; padding: 3px 7px; }
#search-res { position: absolute; top: 50px; left: 0; right: 0; background: var(--s1); border: 1px solid var(--line2); border-radius: 14px; max-height: 70vh; overflow: auto; padding: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.top-cards { display: flex; gap: 8px; }
.tcard { background: var(--s1); border: 1px solid var(--line2); border-radius: 12px; padding: 6px 12px; line-height: 1.25; min-width: 104px; }
.tcard b { font-size: 15px; font-weight: 600; }
.tcard .tiny a { color: var(--accent2); }
.tcard.me { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; position: relative; color: var(--mute); flex: none; }
.icon-btn:hover { background: var(--s2); color: var(--text); }
#notif-dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ---------- shell ---------- */
#shell { padding: 0 12px calc(var(--tab-h) + var(--safe-b) + 16px); }
#left, #right { display: none; }
#view { min-width: 0; }
#tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(6,5,16,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
#tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--dim); font-size: 11px; font-weight: 600; }
#tabs a svg { width: 21px; height: 21px; }
#tabs a.on { color: var(--text); }
#ticker { display: none; }

@media (min-width: 1100px) {
  .hide-d { display: none !important; } .hide-m { display: revert !important; }
  #shell { display: grid; grid-template-columns: 290px minmax(0, 1fr) 320px; gap: 12px; padding: 0 12px; height: calc(100vh - var(--top-h) - var(--tick-h)); }
  #left, #right { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; scrollbar-width: none; padding-bottom: 12px; }
  #left::-webkit-scrollbar, #right::-webkit-scrollbar { display: none; }
  #view { overflow-y: auto; min-height: 0; padding-bottom: 16px; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
  #tabs { display: none; }
  #ticker { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: var(--tick-h); align-items: center; gap: 18px; padding: 0 14px; border-top: 1px solid var(--line); background: var(--bg); font-size: 12px; z-index: 30; }
  #ticker .tk { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
  #ticker .tk img { width: 16px; height: 16px; border-radius: 50%; }
  #ticker .right { margin-left: auto; display: flex; gap: 16px; color: var(--mute); }
}

/* ---------- panels ---------- */
.panel { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); }
.panel.pad { padding: 14px; }
.ptabs { display: flex; gap: 16px; padding: 12px 14px 0; border-bottom: 1px solid var(--line); }
.ptabs button { padding: 0 0 11px; color: var(--mute); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.ptabs button.on { color: var(--text); border-color: var(--text); }
.ptabs button .cnt { color: var(--dim); }
.h-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.section-t { font-weight: 600; font-size: 15px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 10px 0; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 13px; border-radius: 10px; background: var(--s1); border: 1px solid var(--line2); color: var(--mute); font-weight: 500; font-size: 13px; }
.chip.on { background: var(--s3); color: var(--text); border-color: var(--s3); }
.seg { display: inline-flex; background: var(--s2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { padding: 5px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--mute); }
.seg button.on { background: var(--s3); color: var(--text); }
.seg.full { display: flex; width: 100%; } .seg.full button { flex: 1; }

/* avatars */
.ava { width: 40px; height: 40px; border-radius: 50%; background: var(--s3); object-fit: cover; display: grid; place-items: center; font-weight: 700; overflow: hidden; flex: none; color: #fff; }
.ava.xs { width: 22px; height: 22px; font-size: 10px; } .ava.sm { width: 30px; height: 30px; font-size: 12px; } .ava.md { width: 36px; height: 36px; font-size: 14px; }
.ava.lg { width: 48px; height: 48px; font-size: 20px; } .ava.xl { width: 84px; height: 84px; font-size: 36px; }
.ava.sq { border-radius: 10px; }

/* lists */
.trow { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.trow:hover { background: rgba(255,255,255,.015); }
.tname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tsub { color: var(--mute); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tright { text-align: right; white-space: nowrap; }
.badge { display: inline-block; padding: 1px 6px; border-radius: 6px; font-size: 10.5px; font-weight: 600; background: var(--tint); color: var(--mute); vertical-align: 1px; margin-left: 4px; }
.badge.dev { background: rgba(253,93,211,.14); color: var(--dev); }
.badge.new { background: var(--accent-t); color: var(--accent2); }
.badge.live { background: var(--down-t); color: var(--down); }
.prog { height: 4px; background: var(--s3); border-radius: 4px; overflow: hidden; margin-top: 5px; width: 90px; }
.prog i { display: block; height: 100%; background: var(--accent); }

/* table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; color: var(--mute); font-size: 12.5px; padding: 10px 12px; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: rgba(255,255,255,.02); }
.tbl .r { text-align: right; }
.tbl-wrap { overflow-x: auto; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 15px; width: 100%; background: var(--s3); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.buy { background: var(--up); color: #03130a; } .btn.sell { background: var(--down); color: #1c0700; }
.btn.soft { background: var(--s2); border: 1px solid var(--line2); }
.btn.small { height: 34px; font-size: 13px; border-radius: 10px; width: auto; padding: 0 12px; }
.btn.ghost { background: transparent; border: 1px solid var(--line2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.985); }
.link { color: var(--accent2); }

/* stats */
.stat-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.stat { background: var(--s2); border-radius: 12px; padding: 8px 12px; flex: none; min-width: 92px; }
.stat .k { color: var(--mute); font-size: 11.5px; }
.stat .v { font-weight: 600; margin-top: 2px; font-size: 15px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.empty { text-align: center; color: var(--mute); padding: 36px 16px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 6px; font-weight: 600; }
.skel { background: linear-gradient(90deg, var(--s1), var(--s3), var(--s1)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* token page */
.tok-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; flex-wrap: wrap; }
.tok-head .ident { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tok-head .sym { font-size: 18px; font-weight: 600; }
.icon-chip { width: 26px; height: 26px; border-radius: 7px; background: var(--s3); display: grid; place-items: center; color: var(--mute); }
.icon-chip svg { width: 14px; height: 14px; }
.icon-chip:hover { color: var(--text); }
.tok-stats { display: flex; gap: 6px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.tok-stats .stat { padding: 6px 12px; text-align: center; }
.tok-stats .v { font-size: 17px; }
.chart-bar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--mute); font-size: 13px; flex-wrap: wrap; }
.chart-bar select { width: auto; padding: 4px 8px; background: var(--s2); border-radius: 8px; font-size: 13px; }
.chart-bar .tog b { color: var(--text); font-weight: 500; } .chart-bar .tog span { cursor: pointer; } .chart-bar .tog .on { color: var(--accent2); }
.legend { position: absolute; left: 14px; top: 8px; z-index: 3; font-size: 13px; pointer-events: none; }
.legend .t { color: var(--text); margin-right: 6px; }
#chart-wrap { position: relative; height: 420px; }
#chart { position: absolute; inset: 0; }
.chart-foot { display: flex; align-items: center; gap: 12px; padding: 8px 14px; color: var(--mute); font-size: 12.5px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.chart-foot button { color: var(--mute); padding: 3px 6px; border-radius: 6px; } .chart-foot button.on { color: var(--text); background: var(--s3); }
.chart-foot label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.chart-foot input[type=checkbox], .ptabs input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--accent); padding: 0; }
.addr { font-size: 12px; color: var(--mute); }

/* trade panel */
.tp { padding: 12px; }
.bs { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.bs button.side { height: 44px; border-radius: 12px; font-weight: 600; font-size: 15px; background: var(--s2); color: var(--mute); }
.bs button.side.on.buy { background: var(--up-t); color: var(--up); border: 1px solid rgba(33,201,94,.3); }
.bs button.side.on.sell { background: var(--down-t); color: var(--down); border: 1px solid rgba(255,98,46,.3); }
.amt-box { margin-top: 10px; background: var(--s2); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.amt-box input { background: none; border: 0; padding: 0; font-size: 30px; font-weight: 500; width: 55%; }
.amt-box input::placeholder { color: var(--dim); }
.amt-box .out { text-align: right; color: var(--mute); font-size: 13px; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 8px; }
.presets button { background: var(--s2); border-radius: 10px; padding: 9px 0; font-weight: 600; font-size: 13.5px; }
.presets button.on { outline: 1px solid var(--accent); }
.kv { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.kv span:first-child { color: var(--mute); }
.qbox { margin-top: 8px; }
.warn { background: rgba(255,199,79,.08); color: var(--warn); border-radius: 10px; padding: 9px 11px; font-size: 12.5px; }
.note { display: flex; align-items: center; gap: 6px; color: var(--mute); font-size: 12.5px; margin-top: 10px; }
.pos-card { padding: 14px; }
.about .chg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.about .chg button { background: var(--s2); border-radius: 10px; padding: 7px 0; text-align: center; font-size: 12px; color: var(--mute); }
.about .chg button.on { background: var(--s3); color: var(--text); }
.about .chg b { display: block; font-size: 12.5px; }
.bar2 { display: flex; gap: 4px; margin: 5px 0 12px; } .bar2 i { height: 4px; border-radius: 4px; display: block; }
.bar2 i.g { background: var(--up); } .bar2 i.r { background: var(--down); }
.links { display: flex; gap: 6px; flex-wrap: wrap; }
.links a { background: var(--s2); border: 1px solid var(--line2); border-radius: 10px; padding: 6px 10px; font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; }
.thesis-box textarea { background: transparent; border: 0; padding: 6px 0; min-height: 44px; }
.trade-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 25; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 12px; background: linear-gradient(transparent, var(--bg) 35%); }

/* sidebar */
.lb-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 12px; }
.lb-card { background: var(--s2); border-radius: 12px; padding: 8px; display: flex; gap: 8px; align-items: center; min-width: 0; }
.lb-card .ava { width: 34px; height: 34px; border-radius: 9px; }
.lb-row { display: grid; grid-template-columns: 22px 34px 1fr auto; gap: 10px; align-items: center; padding: 9px 14px; }
.lb-row:hover { background: rgba(255,255,255,.02); }
.rank { color: var(--mute); font-size: 13px; text-align: right; }
.medal { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #1a1205; }
.m1 { background: linear-gradient(135deg, #ffc861, #af770f); } .m2 { background: linear-gradient(135deg, #fff3dc, #5c5c5c); } .m3 { background: linear-gradient(135deg, #ffa35f, #a4571c); }
.my-rank { margin: 10px 12px; padding: 10px 12px; border-radius: 12px; background: var(--s2); display: flex; align-items: center; gap: 10px; }

/* feed */
.feed-item { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.feed-item .line { line-height: 1.45; }
.tokchip { display: inline-flex; align-items: center; gap: 5px; background: var(--s2); padding: 2px 8px 2px 3px; border-radius: 999px; font-weight: 600; font-size: 12.5px; vertical-align: middle; }
.post { padding: 12px 4px; border-bottom: 1px solid var(--line); }
.reacts { display: flex; gap: 6px; margin-top: 8px; }
.reacts button { background: var(--s2); border-radius: 999px; padding: 2px 9px; font-size: 12.5px; }

/* sheet + toast */
#sheet-wrap { position: fixed; inset: 0; z-index: 60; }
#sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.65); animation: fade .2s; }
#sheet { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; max-height: 92dvh; overflow-y: auto;
  background: var(--s1); border: 1px solid var(--line2); border-radius: 22px 22px 0 0; padding: 10px 16px calc(18px + var(--safe-b)); animation: up .28s cubic-bezier(.2,.9,.3,1); }
#sheet::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 4px; background: var(--s3); margin: 0 auto 12px; }
@media (min-width: 700px) { #sheet { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 20px; animation: fade .2s; } #sheet::before { display: none; } }
@keyframes up { from { transform: translate(-50%, 100%); } }
@keyframes fade { from { opacity: 0; } }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + var(--safe-b) + 76px); z-index: 70; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 13.5px; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: fade .2s; }
@media (min-width: 1100px) { #toast { bottom: 52px; } }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0; }
.pin-dots i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--dim); }
.pin-dots i.on { background: var(--accent); border-color: var(--accent); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { height: 54px; border-radius: 14px; background: var(--s2); font-size: 21px; font-weight: 600; }
.profile-top { text-align: center; padding-top: 12px; }
.profile-top .name { font-size: 22px; font-weight: 600; margin-top: 10px; }
.counts { display: flex; justify-content: center; gap: 22px; margin: 12px 0; }
.counts b { display: block; font-size: 16px; } .counts span { color: var(--mute); font-size: 12px; }
.wallet-card { background: radial-gradient(120% 140% at 0% 0%, rgba(81,106,246,.28), transparent 60%), var(--s1); border: 1px solid var(--line2); border-radius: 18px; padding: 18px; }
.big { font-size: 32px; font-weight: 600; letter-spacing: -0.03em; }
.share-canvas { width: 100%; border-radius: 14px; display: block; }
/* live updates */
@keyframes fu { from { background: rgba(33,201,94,.35); } to { background: transparent; } }
@keyframes fd { from { background: rgba(255,98,46,.35); } to { background: transparent; } }
.flash-up { animation: fu .9s ease-out; border-radius: 4px; } .flash-down { animation: fd .9s ease-out; border-radius: 4px; }
@keyframes slidein { from { opacity: 0; transform: translateY(-8px); background: rgba(81,106,246,.18); } to { opacity: 1; transform: none; } }
.trow.fresh { animation: slidein .6s ease-out; }
.livedot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--up); margin-right: 5px; box-shadow: 0 0 0 0 rgba(33,201,94,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(33,201,94,0); } 100% { box-shadow: 0 0 0 0 rgba(33,201,94,0); } }
.dim-row { opacity: .5; }
