/* ONE — design system. Tokens first, everything reuses them. */

:root {
  --bg: #07061a;
  --bg2: #0d0b24;
  --panel: #12102b;
  --panel2: #181537;
  --line: #26224d;
  --line2: #352f6b;
  --text: #eceafa;
  --dim: #9e9ac7;
  --dim2: #6f6ba0;
  --acc: #7c6cff;
  --acc2: #a89bff;
  --lime: #a89bff;
  --lime-ink: #0b0920;
  --green: #9db4ff;
  --red: #ff5c7a;
  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 16px 44px rgba(3, 2, 14, .55);
  --font: 'Geist', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'JetBrains Mono', 'Consolas', monospace;
  --top-h: 60px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(900px 480px at 82% -12%, rgba(124, 108, 255, .18), transparent 62%),
    radial-gradient(700px 420px at -8% 8%, rgba(124, 108, 255, .10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* manual motion toggle only — never prefers-reduced-motion */
body.no-motion *, body.no-motion *::before, body.no-motion *::after {
  animation: none !important;
  transition: none !important;
}

.mono { font-family: var(--mono); }

a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--acc2); outline-offset: 2px; border-radius: 6px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--lime); color: var(--lime-ink); padding: 10px 16px; border-radius: 0 0 10px 0;
  font-weight: 600;
}
.skip:focus { left: 0; }

/* --- header ----------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 40;
  background: rgba(7, 6, 26, .94);
  border-bottom: 1px solid var(--line);
}

.top-in {
  max-width: 1560px; margin: 0 auto; padding: 0 18px;
  height: var(--top-h);
  display: flex; align-items: center; gap: 16px;
}

.brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand-img { height: 26px; width: auto; display: block; }

.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 13px; border-radius: 10px;
  color: var(--dim); font-weight: 500; font-size: 14.5px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: rgba(124, 108, 255, .10); }
.nav a.active { color: var(--text); background: rgba(124, 108, 255, .16); }

.fee-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid rgba(168, 155, 255, .28);
  background: rgba(168, 155, 255, .08);
  color: var(--lime); font-size: 12px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
}
.fee-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.soon-chips { display: inline-flex; align-items: center; gap: 6px; }

.chip {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line2); background: rgba(124, 108, 255, .07);
  color: var(--dim); font-size: 12px; font-weight: 600; white-space: nowrap;
  font-family: var(--mono);
}
.chip.dim-chip { color: var(--dim2); background: transparent; }
button.chip { cursor: pointer; transition: border-color .15s, color .15s; }
button.chip:hover { color: var(--text); border-color: var(--acc); }

.search {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 10px 0 12px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--panel); color: var(--dim2);
}
.search:focus-within { border-color: var(--acc); color: var(--dim); }
.search svg { width: 16px; height: 16px; flex: 0 0 auto; }
.search input {
  width: 210px; border: 0; outline: 0; background: transparent;
  color: var(--text); font: 500 13.5px var(--font);
}
.search input::placeholder { color: var(--dim2); }
.search kbd {
  font: 600 11px var(--mono); color: var(--dim2);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
}

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--dim);
  transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--acc); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn[aria-pressed="false"] { color: var(--dim2); }

/* --- buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer;
  font: 600 14.5px var(--font); letter-spacing: .01em; white-space: nowrap;
  transition: transform .12s, filter .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--lime); color: var(--lime-ink); }
.btn-primary:hover { filter: brightness(1.06); }

.btn-ghost { background: rgba(124, 108, 255, .10); border-color: var(--line2); color: var(--text); }
.btn-ghost:hover { border-color: var(--acc); }

.btn-acc { background: var(--acc); color: #fff; }
.btn-acc:hover { filter: brightness(1.08); }

.btn-connect { min-height: 38px; padding: 0 16px; border-radius: 11px; }

/* --- layout ----------------------------------------------------------- */
main { min-height: calc(100vh - var(--top-h)); padding-bottom: 40px; }

.page { max-width: 1560px; margin: 0 auto; padding: 22px 18px 0; }

.page-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; }
.page-head h1 {
  margin: 0; font-size: clamp(22px, 2.4vw, 30px); font-weight: 700;
  letter-spacing: -.035em; line-height: 1.15;
}

.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.sub-line { color: var(--dim2); font-size: 13px; margin: -8px 0 14px; word-break: break-all; }

/* --- cards ------------------------------------------------------------ */
.card {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  min-width: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
}

.col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.col-head {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 4px;
}
.col-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.col-count { font: 500 12px var(--mono); color: var(--dim2); }

/* --- skeleton --------------------------------------------------------- */
.sk { position: relative; overflow: hidden; background: rgba(124, 108, 255, .08); border-radius: 8px; }
.sk::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(168, 155, 255, .13) 50%, transparent 80%);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.sk-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sk-avatar { width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto; }
.sk-line { height: 12px; display: block; }
.sk-line.w60 { width: 60%; }
.sk-line.w40 { width: 40%; margin-bottom: 10px; }
.sk-bar { height: 6px; width: 100%; border-radius: 4px; }

/* card enter animation (new feed rows) */
.card.in { animation: rise .28s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* --- empty state ------------------------------------------------------ */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center;
  border: 1px dashed var(--line2); border-radius: var(--r);
  padding: 34px 20px; margin-bottom: 14px;
  color: var(--dim);
}
.empty strong { color: var(--text); font-size: 16px; letter-spacing: -.01em; }
.empty p { margin: 0; max-width: 520px; font-size: 13.5px; color: var(--dim); }
.empty-ic { color: var(--acc2); }

/* --- toast ------------------------------------------------------------ */
#toast-root {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  display: inline-flex; align-items: center;
  max-width: 340px; padding: 11px 15px; border-radius: 12px;
  background: var(--panel2); border: 1px solid var(--line2); color: var(--text);
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px);
  transition: opacity .22s, transform .22s;
}
.toast.show { opacity: 1; transform: none; }
.toast.ok { border-color: rgba(157, 180, 255, .45); }
.toast.warn { border-color: rgba(255, 92, 122, .5); }

/* --- modal ------------------------------------------------------------ */
.modal-back {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(3, 2, 14, .68);
  opacity: 0; transition: opacity .2s;
}
.modal-back.show { opacity: 1; }

.modal {
  width: 100%; max-width: 440px;
  background: var(--panel2); border: 1px solid var(--line2); border-radius: 16px;
  box-shadow: var(--shadow);
  transform: translateY(8px) scale(.98); transition: transform .2s;
}
.modal-back.show .modal { transform: none; }

.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 14px 0 18px;
}
.modal-head strong { font-size: 16px; letter-spacing: -.01em; }

.modal-body { padding: 10px 18px 16px; }
.modal-body p { margin: 0 0 8px; font-size: 14px; color: var(--dim); }
.modal-body .modal-dim { font-size: 12.5px; color: var(--dim2); }

.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 18px 16px; }

/* --- chain icons ------------------------------------------------------ */
.chain-ic, .chain-glyph { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.chain-ic svg { width: 100%; height: 100%; }
.chain-glyph {
  width: 100%; height: 100%; border-radius: 9px;
  font: 700 12px var(--mono); background: rgba(124, 108, 255, .14);
}

/* --- mobile ----------------------------------------------------------- */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(7, 6, 26, .97);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; min-height: 56px; color: var(--dim2); font-size: 11.5px; font-weight: 600;
}
.tabbar a svg { width: 20px; height: 20px; }
.tabbar a.active { color: var(--acc2); }

@media (max-width: 1100px) {
  .search { display: none; }
  .soon-chips { display: none; }
}
.top-right .search-mobile { display: none; }
@media (max-width: 1100px) {
  .top-right .search-mobile { display: inline-flex; }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .fee-chip { display: none; }
  .tabbar { display: grid; }
  main { padding-bottom: 76px; }
  #toast-root { bottom: 76px; right: 12px; left: 12px; align-items: stretch; }
  .toast { max-width: none; }
  .grid3 { grid-template-columns: 1fr; }
  .page { padding: 14px 12px 0; }
  .top-in { padding: 0 12px; gap: 10px; }
}

@media (max-width: 390px) {
  .brand-img { height: 22px; }
  .btn-connect { padding: 0 12px; font-size: 13.5px; }
}

/* --- terminal --------------------------------------------------------- */
.top-in { max-width: none; }
.page.term { max-width: none; padding: 10px 12px 0; }
.term-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.term-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.term-controls .chain-chips, .term-controls .term-toolbar { margin: 0; }
.term-controls .term-toolbar { padding: 4px 8px; }
.term-controls .tb-note { display: none; }
.chain-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chip-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--dim);
  font: 600 13px var(--font); white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.chip-btn:hover { color: var(--text); border-color: var(--acc); }
.chip-btn.on { color: var(--text); border-color: var(--acc); background: rgba(124, 108, 255, .16); }
.chip-btn.off { color: var(--dim2); opacity: .6; cursor: not-allowed; }

.term-status {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 10px 14px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel);
  font-size: 13px; color: var(--dim);
}
.ts-main { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.ts-main b { font-family: var(--mono); }
.ts-feeds { display: inline-flex; flex-wrap: wrap; gap: 6px 12px; margin-left: auto; }
.ts-chip { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--mono); color: var(--dim2); white-space: nowrap; }
.ts-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim2); flex: 0 0 auto; }
.ts-dot.ok { background: var(--green); box-shadow: 0 0 6px rgba(157, 180, 255, .55); }
.ts-dot.poll { background: var(--acc2); }
.ts-dot.warn { background: #ffb454; }
.ts-dot.bad { background: var(--red); }

.term-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 14px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel);
}
.pay-label { font-size: 13px; color: var(--dim2); font-weight: 600; }
.pay-sel {
  height: 34px; padding: 0 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  font: 600 13px var(--font);
}
.tb-sep { width: 1px; height: 22px; background: var(--line); }
.tb-lab { font-size: 13px; color: var(--dim2); font-weight: 600; }
.tb-note { font-size: 12px; color: var(--dim2); }
.preset-wrap { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qb-head {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(168, 155, 255, .32); background: rgba(168, 155, 255, .08);
  color: var(--lime); font: 600 12.5px var(--mono); white-space: nowrap;
}
.qb-head:hover { filter: brightness(1.12); }

.term-tabs { display: none; }

.col-head .col-spacer { flex: 1 1 auto; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 9px; }
.filter-wrap { position: relative; }
.filter-pop {
  position: absolute; right: 0; top: 38px; z-index: 30;
  width: 240px; padding: 12px;
  background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 9px;
}
.filter-pop[hidden] { display: none; }
.filter-pop label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--dim); }
.filter-pop .f-check { flex-direction: row; align-items: center; gap: 8px; font-size: 12.5px; }
.filter-pop .f-check input { width: 15px; height: 15px; accent-color: var(--acc); }
.f-clear { align-self: flex-start; cursor: pointer; }

.inp {
  height: 34px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font: 500 13px var(--font); outline: 0; width: 100%;
}
.inp:focus { border-color: var(--acc); }

.term-grid { align-items: start; gap: 10px; }
.term-grid .col { border: 1px solid var(--line); background: #111020; border-radius: 14px; padding: 0 6px 6px; gap: 0; }
.term-grid .col-head { padding: 7px 5px; }
.term .term-status { margin: 8px 0 0; padding: 6px 10px; background: transparent; }
.col-list {
  display: flex; flex-direction: column; gap: 7px; min-width: 0;
  height: calc(100dvh - var(--top-h) - 130px);
  min-height: 220px;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 2px 6px 8px 2px;
  scrollbar-width: thin;
  scrollbar-color: #39334e transparent;
}
.col-list .empty { margin-bottom: 0; padding: 26px 14px; }

.coin-card {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 8px; min-width: 0; min-height: 86px;
  display: grid; grid-template-columns: 44px minmax(0, 1fr) max-content; align-items: start; gap: 8px;
}
.cc-main, .cc-market { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cc-market { align-items: flex-end; }
.coin-card.in { animation: none; }
.coin-card.link { cursor: pointer; transition: border-color .15s, transform .12s; }
.coin-card.link:hover { border-color: var(--acc); transform: translateY(-1px); }

.cc-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cc-avatar {
  position: relative; width: 44px; height: 44px; flex: 0 0 auto;
  border-radius: 11px; overflow: hidden; background: rgba(124, 108, 255, .14);
  display: inline-flex; align-items: center; justify-content: center;
}
.cc-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-letter { font: 700 15px var(--mono); color: var(--acc2); }
.cc-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.cc-line { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.cc-name {
  font-weight: 600; font-size: 14px; letter-spacing: -.01em;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cc-sym { font: 500 12px var(--font); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-sub { display: flex; align-items: center; font-size: 12px; color: var(--dim2); white-space: nowrap; overflow: hidden; }
.cc-age { color: var(--lime); }
.cc-sub .cc-socials { margin-left: 5px; gap: 3px; }
.cc-sub .cc-socials a { width: 18px; height: 18px; border-radius: 4px; }
.cc-sub .cc-socials svg { width: 10px; height: 10px; }
.cc-chain::before, .cc-hold:not(:empty)::before { content: '·'; margin: 0 6px; color: var(--line2); }
.cc-chg { font: 600 12px var(--mono); flex: 0 0 auto; }
.cc-chg.up { color: var(--green); }
.cc-chg.down { color: var(--red); }
.cc-chg.flat { color: var(--dim2); }

.cc-mid { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.cc-socials { display: inline-flex; align-items: center; gap: 6px; }
.cc-socials a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid var(--line); color: var(--dim2);
}
.cc-socials a:hover { color: var(--text); border-color: var(--acc); }
.cc-socials svg { width: 13px; height: 13px; }
.cc-price { font: 500 12.5px var(--mono); color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cc-stats { display: flex; flex-wrap: wrap; justify-content: flex-end; max-width: 160px; gap: 2px 7px; }
.cc-stats .st:first-child { width: 100%; justify-content: flex-end; }
.cc-stats .st:first-child b { font-size: 14px; }
.cc-change.up { color: var(--green); }
.cc-change.down { color: var(--red); }
.cc-stats .st { display: inline-flex; align-items: baseline; gap: 5px; }
.cc-stats .st i { font-style: normal; font: 500 12px var(--mono); color: var(--dim2); }
.cc-stats .st b { font: 600 12.5px var(--mono); color: var(--text); }

.cc-curve { display: flex; flex-direction: column; gap: 5px; }
.cc-curve[hidden] { display: none; }
.cc-bar { height: 5px; border-radius: 4px; background: rgba(124, 108, 255, .16); overflow: hidden; }
.cc-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--acc), var(--acc2)); transition: width .3s; }
.cc-pct { font: 500 11.5px var(--mono); color: var(--dim2); }

.cc-buy { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qb {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 26px; padding: 0 7px; border-radius: 7px; cursor: pointer;
  border: 1px solid rgba(168, 155, 255, .32); background: rgba(168, 155, 255, .08);
  color: var(--lime); font: 600 12.5px var(--mono); white-space: nowrap;
  transition: filter .15s, border-color .15s;
}
.qb:hover { filter: brightness(1.12); border-color: rgba(168, 155, 255, .6); }
.qb:nth-child(2) { color: var(--acc2); background: #201835; border-color: #453664; }
.qb svg { width: 12px; height: 12px; }
.cc-buy .dim-chip {
  box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0;
  height: auto; min-height: 28px; padding: 4px 6px;
  white-space: normal; line-height: 1.2; text-align: center;
  overflow-wrap: anywhere;
}

/* ONE terminal density: full-height board, compact data ribbon, brand-purple trade chips. */
.page.term { padding: 8px 10px 0; }
.page.coin { max-width: none; padding-inline: 14px; }
.term-controls { margin-bottom: 8px; gap: 8px; }
.term-controls .chain-chips { gap: 5px; }
.term-controls .chip-btn { height: 32px; padding: 0 11px; font-size: 12px; }
.term-toolbar { gap: 7px; }
.term-status {
  min-height: 54px; margin: 0 0 8px; padding: 6px 12px;
  flex-direction: row; align-items: center; gap: 12px;
  border-radius: 12px; background: linear-gradient(100deg, #151126, #100e1c);
}
.ts-stat {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-width: 112px; padding-right: 12px; border-right: 1px solid var(--line);
}
.ts-label { color: var(--dim2); font: 600 9px var(--mono); letter-spacing: .1em; }
.ts-stat > b { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font: 700 15px var(--mono); white-space: nowrap; }
.ts-stat small { color: var(--dim2); font: 500 10px var(--font); }
.ts-feeds { min-width: 0; flex: 1 1 auto; justify-content: flex-end; gap: 5px 10px; }
.ts-chip { font-size: 10px; }
.term-grid { gap: 8px; }
.term-grid .col { min-height: 0; height: calc(100dvh - var(--top-h) - 137px); border-radius: 13px; padding: 0 5px 5px; }
.term-grid .col-head { min-height: 37px; padding: 4px 5px; }
.term-grid .col-head h2 { font-size: 13px; }
.col-list { height: calc(100% - 37px); min-height: 0; gap: 6px; padding: 2px 3px 6px; }
.coin-card {
  box-sizing: border-box; flex: 0 0 auto;
  min-height: 96px; padding: 7px; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 150px); gap: 7px;
  border-radius: 12px; background: #17151f; border-color: rgba(168,155,255,.1);
}
.cc-avatar { width: 48px; height: 48px; border-radius: 10px; }
.cc-main, .cc-market { gap: 3px; min-width: 0; }
.cc-market { min-width: 0; max-width: 100%; width: 100%; align-items: stretch; overflow: visible; }
.cc-name { font-size: 13px; }
.cc-sym { font-size: 11px; }
.cc-sub { font-size: 10px; }
.cc-stats { max-width: 130px; gap: 1px 5px; }
.cc-stats .st i { font-size: 9px; }
.cc-stats .st b { font-size: 11px; }
.cc-stats .st:first-child b { font-size: 13px; }
.cc-buy { gap: 4px; width: 100%; min-width: 0; flex-wrap: nowrap; }
.qb, .qb:nth-child(2) {
  flex: 1 1 0; min-width: 0; min-height: 26px; padding: 0 4px; color: var(--acc2);
  background: rgba(124,108,255,.12); border-color: rgba(124,108,255,.35);
  font-size: 10px;
}
.qb:hover { border-color: var(--acc2); }
.qb-head { color: var(--acc2); background: rgba(124,108,255,.1); border-color: rgba(124,108,255,.3); }
.cc-bar { height: 4px; }
.cc-pct { font-size: 10px; }

@media (max-width: 1100px) and (min-width: 901px) {
  .ts-feeds { justify-content: flex-start; }
  .term-grid .col { height: calc(100dvh - var(--top-h) - 178px); }
  .coin-card { grid-template-columns: 38px minmax(0,1fr); }
  .cc-avatar { width: 38px; height: 38px; }
  .cc-market { grid-column: 2; flex-direction: column; align-items: stretch; justify-content: flex-start; }
}

@media (max-width: 900px) {
  .term-status { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .ts-stat { min-width: 0; padding-right: 5px; }
  .ts-label { font-size: 8px; }
  .ts-stat > b { font-size: 12px; }
  .ts-feeds { grid-column: 1 / -1; justify-content: flex-start; }
  .term-grid .col { height: auto; }
  .coin-card { min-height: 96px; }
  .cc-stats { max-width: 130px; }
  .col-list { height: auto; }
  .cc-buy .qb { min-height: 36px; }
  .cc-stats { max-width: 130px; }
  .term-grid .col { display: none; }
  .term-grid .col.on { display: flex; }
  .col-list { max-height: none; overflow: visible; padding: 0; }
  .term-tabs {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin: 0 0 12px;
  }
  .term-tabs::-webkit-scrollbar { display: none; }
  .tt {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    min-height: 44px; padding: 4px 6px; border-radius: 12px; cursor: pointer;
    border: 1px solid var(--line); background: var(--panel); color: var(--dim);
    font: 600 12px var(--font); text-align: center;
  }
  .tt.on { color: var(--text); border-color: var(--acc); background: rgba(124, 108, 255, .16); }
  .tt-n { font: 600 12px var(--mono); color: var(--dim2); }
  .filter-pop { position: fixed; left: 12px; right: 12px; top: auto; bottom: 70px; width: auto; z-index: 60; }
  .ts-feeds { margin-left: 0; }
}

/* --- coin page --------------------------------------------------------- */
.coin-top { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 14px; flex-wrap: wrap; }
.coin-top .back { flex: 0 0 auto; }

.ci-avatar {
  position: relative; width: 46px; height: 46px; flex: 0 0 auto;
  border-radius: 12px; overflow: hidden; background: rgba(124, 108, 255, .14);
  display: inline-flex; align-items: center; justify-content: center;
}
.ci-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ci-letter { font: 700 17px var(--mono); color: var(--acc2); }

.ci-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ci-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ci-name h1 {
  margin: 0; font-size: clamp(18px, 1.8vw, 24px); font-weight: 700; letter-spacing: -.035em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.ci-sym { font: 600 13px var(--mono); color: var(--dim); white-space: nowrap; }
.ci-sub { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim2); flex-wrap: wrap; }
.ci-addr { cursor: pointer; border-bottom: 1px dashed var(--line2); white-space: nowrap; }
.ci-addr:hover { color: var(--text); border-color: var(--acc); }

.ci-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-left: auto; }
.ci-stats .stat { display: inline-flex; flex-direction: column; gap: 2px; min-width: 0; }
.ci-stats .stat i { font-style: normal; font: 500 10.5px var(--mono); color: var(--dim2); letter-spacing: .02em; white-space: nowrap; }
.ci-stats .stat b { font: 600 13.5px var(--mono); color: var(--text); white-space: nowrap; }
.ci-stats .up { color: var(--green); }
.ci-stats .down { color: var(--red); }

.coin-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 260px 330px;
  gap: 14px; align-items: start;
}

/* chart */
.chart-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tf-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tf {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 30px; padding: 0 9px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel2); color: var(--dim);
  font: 600 12px var(--mono); white-space: nowrap;
}
.tf:hover { color: var(--text); border-color: var(--acc); }
.tf.on { color: var(--lime); border-color: rgba(168, 155, 255, .4); background: rgba(168, 155, 255, .08); }
.live-chip { cursor: pointer; }
.chart-ohlc { margin-left: auto; font: 500 12px var(--mono); color: var(--dim2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.chart-wrap { position: relative; height: 360px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(7, 6, 26, .5); overflow: hidden; }
.chart-wrap canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.chart-note {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  max-width: min(78%, 420px); padding: 12px 18px; border: 1px solid rgba(168,155,255,.14);
  border-radius: 12px; background: rgba(12,10,24,.86); text-align: center;
  font-size: 13px; line-height: 1.5; color: var(--dim2); pointer-events: none;
}
.chart-wrap.has-data .chart-note { display: none; }

/* tabs under the chart */
.coin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 10px; }
.ctab {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--dim);
  font: 600 12.5px var(--font); white-space: nowrap;
}
.ctab:hover { color: var(--text); border-color: var(--acc); }
.ctab.on { color: var(--text); border-color: var(--acc); background: rgba(124, 108, 255, .16); }
.ctab.soon { color: var(--dim2); opacity: .65; cursor: not-allowed; }
.about { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 16px; }
.about span { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-size: 12.5px; }
.about i { font-style: normal; color: var(--dim2); flex: 0 0 auto; }
.about b { font-weight: 500; color: var(--text); word-break: break-all; min-width: 0; }
.tab-body .empty { padding: 22px 14px; margin-bottom: 0; }

/* trades */
.trades-panel { display: flex; flex-direction: column; min-width: 0; max-height: 720px; }
.tp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tp-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.tp-live { display: inline-flex; align-items: center; gap: 6px; font: 600 11.5px var(--mono); color: var(--dim2); }
.tp-live[hidden] { display: none; }
.trades-cols, .tr { display: grid; grid-template-columns: 46px 1fr 1fr 1fr 56px 40px; gap: 6px; align-items: center; }
.trades-cols { font: 500 10.5px var(--mono); color: var(--dim2); padding: 0 4px 6px; border-bottom: 1px solid var(--line); }
.trades-list { overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; min-height: 220px; }
.tr { font: 500 12px var(--mono); padding: 6px 4px; border-bottom: 1px solid rgba(38, 34, 77, .5); min-width: 0; }
.tr span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tr-side { font-weight: 600; text-transform: uppercase; font-size: 10.5px; }
.tr.buy .tr-side { color: var(--green); }
.tr.sell .tr-side { color: var(--red); }
.tr-when { text-align: right; color: var(--dim2); }

/* trade panel */
.trade-panel { display: flex; flex-direction: column; gap: 10px; }
.side-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.side-tabs [data-side] {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel2); color: var(--dim);
  font: 600 14px var(--font);
}
.side-tabs [data-side]:hover { color: var(--text); border-color: var(--acc); }
.side-tabs [data-side].on[data-side="buy"] { background: rgba(157, 180, 255, .14); border-color: rgba(157, 180, 255, .45); color: var(--green); }
.side-tabs [data-side].on[data-side="sell"] { background: rgba(255, 92, 122, .12); border-color: rgba(255, 92, 122, .45); color: var(--red); }

.mode-row { display: flex; gap: 6px; }
.mode {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center;
  height: 32px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--dim);
  font: 600 12.5px var(--font); white-space: nowrap;
}
.mode.on { color: var(--text); border-color: var(--acc); background: rgba(124, 108, 255, .14); }
.mode.soon { color: var(--dim2); opacity: .6; cursor: not-allowed; }

.pay-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--dim2); font-weight: 600; }
.pay-row .pay-sel { max-width: 62%; }

.amt-row { position: relative; display: flex; align-items: center; }
.amt-row .amt { height: 48px; padding: 0 66px 0 12px; font: 600 17px var(--mono); }
.amt-cur { position: absolute; right: 12px; font: 600 12.5px var(--mono); color: var(--dim2); pointer-events: none; }

.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.qk {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 8px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel2); color: var(--dim);
  font: 600 12px var(--mono); white-space: nowrap;
}
.qk:hover { color: var(--text); border-color: var(--acc); }

.slip-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.slip-lab { font-size: 11px; color: var(--dim2); font-weight: 600; letter-spacing: .03em; }
.slip-chips { display: inline-flex; gap: 5px; }
.sl {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 9px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--dim);
  font: 600 12px var(--mono); white-space: nowrap;
}
.sl:hover { color: var(--text); border-color: var(--acc); }
.sl.on { color: var(--lime); border-color: rgba(168, 155, 255, .4); background: rgba(168, 155, 255, .08); }

.quote { border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(7, 6, 26, .45); padding: 10px 12px; min-height: 52px; }
.quote .q-head { font: 600 12.5px var(--font); color: var(--text); margin-bottom: 6px; }
.quote .q-head.dim { color: var(--dim2); font-weight: 500; }
.quote .q-rows { display: flex; flex-direction: column; gap: 4px; }
.quote .q-rows span { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12px; }
.quote .q-rows i { font-style: normal; color: var(--dim2); white-space: nowrap; }
.quote .q-rows b { font: 600 12.5px var(--mono); color: var(--text); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.quote .q-err { font-size: 12px; color: var(--dim2); line-height: 1.45; }
.quote .dim-chip { height: 30px; }

.trade-panel .act { width: 100%; }
.panel-note { margin: 0; font-size: 11.5px; color: var(--dim2); line-height: 1.45; }

/* responsive coin page */
@media (max-width: 1360px) {
  .coin-grid { grid-template-columns: minmax(0, 1fr) minmax(220px, 260px) minmax(270px, 320px); gap: 10px; }
  .trades-panel { grid-column: auto; max-height: 720px; }
}
@media (max-width: 1100px) {
  .ci-stats { margin-left: 0; flex-basis: 100%; }
}
@media (max-width: 900px) {
  .coin-grid { grid-template-columns: minmax(0, 1fr); }
  .trade-panel { order: -1; }
  .chart-wrap { height: 300px; }
  .trades-panel { max-height: none; }
  .trades-list { min-height: 160px; }
  .trades-cols, .tr { grid-template-columns: 44px 1fr 1fr 1fr 40px; }
  .tr-who, .trades-cols span:nth-child(5) { display: none; }
  .ci-stats { gap: 6px 14px; }
}
