:root {
  --bg: #111113;
  --bg-2: #18191b;
  --bg-3: #212225;
  --bg-4: #272a2d;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #71717a;
  --accent: #86efac;
  --accent-ink: #052e16;
  --up: #86efac;
  --down: #f87171;
  --nav: 248px;
  --rail: 320px;
  --radius: 12px;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: inherit; }

.shell {
  min-height: 100%;
  display: grid;
  grid-template-columns: var(--nav) 1fr;
}

.nav {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 12px 16px;
  background: #0e0f11;
  border-right: 1px solid var(--line);
}
.nav__brand { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; }
.wordmark, .topbar__mark {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 0; color: var(--text);
}
.wordmark img, .topbar__mark img {
  width: 36px; height: 36px;
  image-rendering: pixelated;
  background: #1a1c1e;
  border-radius: 8px;
}
.wordmark span { font-weight: 700; font-size: 20px; letter-spacing: -0.04em; }
.icon-btn.nav__close { display: none; }

.nav__account {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px;
}
.nav__account:hover { border-color: var(--line-2); }
.nav__key {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--bg-3); color: var(--accent);
  flex: none;
}
.nav__account-text { display: flex; flex-direction: column; min-width: 0; }
.nav__account-text strong { font-size: 13.5px; }
.nav__account-text small { color: var(--faint); font-size: 12px; }

.nav__group { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.nav__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left; text-decoration: none;
  background: transparent; border: 0; border-radius: 10px;
  padding: 9px 10px; color: var(--muted); font-weight: 550;
}
.nav__item:hover { background: var(--bg-2); color: var(--text); }
.nav__item.active { background: var(--bg-3); color: var(--text); }
.nav__item--quiet { color: var(--faint); font-weight: 500; font-size: 13px; }
.nav__icon { width: 18px; height: 18px; display: grid; place-items: center; flex: none; }
.nav__icon svg { width: 18px; height: 18px; }
.ext { margin-left: auto; color: var(--faint); font-size: 12px; }

.nav__cta {
  margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
}
.nav__cta:hover { filter: brightness(1.05); }
.nav__cta:active { translate: 0 1px; }
.nav__foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }

.workspace { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  background: rgba(17, 17, 19, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__mark { display: none; }
#menu-open { display: none; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-2);
  display: grid; place-items: center; color: var(--text);
}
.search {
  flex: 1; display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px;
  color: var(--faint);
}
.search:focus-within { border-color: var(--accent); }
.search input {
  flex: 1; background: none; border: 0; outline: none; color: var(--text); min-width: 0;
}
.search input::placeholder { color: var(--faint); }
.search kbd {
  font-family: var(--font); font-size: 12px; color: var(--faint);
  border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px;
}
.ghost {
  height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; font-weight: 600;
}
.ghost:hover { background: var(--bg-3); }

.stage { padding: 22px 22px 48px; }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  gap: 18px;
  align-items: start;
}
.heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; }
h1 { margin: 2px 0 4px; font-size: 32px; letter-spacing: -0.04em; line-height: 1.05; }
.lede { margin: 0; color: var(--muted); max-width: 46ch; }
h2 { margin: 0; font-size: 16px; letter-spacing: -0.02em; }

.join {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; white-space: nowrap;
}

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px;
}
.stat {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
}
.stat span { display: block; color: var(--faint); font-size: 11px; font-weight: 650; letter-spacing: 0.06em; }
.stat strong { display: block; margin-top: 4px; font-size: 20px; letter-spacing: -0.03em; }
.stat em { font-style: normal; color: var(--accent); font-weight: 600; font-size: 13px; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 12px; color: var(--muted); font-size: 13px;
}
.segmented {
  display: flex; padding: 3px; gap: 2px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px;
}
.segmented button {
  border: 0; background: transparent; color: var(--muted);
  height: 30px; padding: 0 12px; border-radius: 999px; font-weight: 600; font-size: 13px;
}
.segmented button.active { background: var(--accent); color: var(--accent-ink); }

.feed { display: flex; flex-direction: column; gap: 10px; }
.post {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px;
}
.post__top { display: flex; align-items: center; gap: 10px; }
.post__who { display: flex; flex-direction: column; min-width: 0; }
.post__who strong { font-size: 14px; }
.post__who small { color: var(--faint); }
.pill {
  margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 999px; background: var(--bg-4); color: var(--muted);
}
.pill.call { color: var(--accent-ink); background: var(--accent); }
.pill.trade { color: #dbeafe; background: #1e3a8a; }
.pill.note { color: #fde68a; background: #422006; }
.post p { margin: 10px 0; font-size: 15px; }
.token-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
}
.token-chip img, .avatar {
  width: 36px; height: 36px; image-rendering: pixelated; border-radius: 8px; background: #101113; flex: none;
}
.avatar.lg { width: 44px; height: 44px; }
.token-chip .meta { display: flex; flex-direction: column; min-width: 0; }
.token-chip .meta small, .muted { color: var(--faint); }
.token-chip .nums { margin-left: auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.up { color: var(--up); }
.down { color: var(--down); }
.fill {
  display: flex; gap: 14px; margin-top: 8px; color: var(--muted); font-size: 12.5px;
}
.fill b { color: var(--text); font-weight: 600; }

.rail { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 76px; }
.card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px;
}
.card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.card > p { margin: 0 0 10px; color: var(--faint); font-size: 13px; }
.rank {
  width: 100%; display: grid; grid-template-columns: 18px 36px 1fr auto; gap: 8px; align-items: center;
  background: none; border: 0; padding: 7px 2px; text-align: left; border-radius: 10px;
}
.rank:hover { background: var(--bg-3); }
.rank small { display: block; color: var(--faint); }
.rank b { font-size: 13px; }
.promo img.hero {
  width: 72px; height: 72px; image-rendering: pixelated; margin-bottom: 8px;
}
.promo h2 { margin-bottom: 6px; }
.promo p { color: var(--muted); }
.promo .join, .promo .ghost { width: 100%; justify-content: center; margin-top: 8px; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--faint); font-size: 11px; font-weight: 650; letter-spacing: 0.05em; }
tr:last-child td { border-bottom: 0; }
tr.click:hover td { background: rgba(255,255,255,0.03); }
.who { display: flex; align-items: center; gap: 10px; }
.who small { display: block; color: var(--faint); font-weight: 500; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.coin {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.coin__top, .coin__agent { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; text-align: left; padding: 0; }
.coin__top .chg { margin-left: auto; font-weight: 700; }
.coin__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.coin__stats span { display: block; color: var(--faint); font-size: 10px; letter-spacing: 0.05em; font-weight: 700; }
.coin__stats strong { font-size: 13px; }
.trade-link {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; border-radius: 999px; text-decoration: none; font-weight: 700;
  background: var(--bg-3); border: 1px solid var(--line);
}
.trade-link:hover { border-color: var(--accent); color: var(--accent); }

.activity { display: flex; flex-direction: column; }
.activity button {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center;
  width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 12px 2px;
}
.activity button small { display: block; color: var(--faint); }

.empty { padding: 28px; text-align: center; color: var(--muted); }

.support { max-width: 640px; }
.support h1 { margin-bottom: 8px; }
.faq { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.faq details {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.faq summary { cursor: pointer; font-weight: 650; }
.faq p { color: var(--muted); margin: 8px 0 0; }

.modal { border: 0; padding: 0; background: transparent; }
.modal::backdrop { background: rgba(0,0,0,.72); }
.modal__card {
  width: min(440px, calc(100vw - 28px));
  max-height: min(86vh, 720px); overflow: auto;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 18px; padding: 18px;
}
.modal__card h2 { font-size: 20px; letter-spacing: -0.03em; margin-bottom: 6px; }
.modal__card p { color: var(--muted); margin: 0 0 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.field span { font-size: 12px; color: var(--faint); font-weight: 650; }
.field input, .field select {
  height: 40px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg); padding: 0 12px; outline: none;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors button {
  width: 42px; height: 42px; padding: 4px; border-radius: 10px;
  border: 2px solid transparent; background: var(--bg);
}
.colors button img { width: 100%; height: 100%; image-rendering: pixelated; }
.colors button.active { border-color: var(--accent); }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.profile {
  display: flex; gap: 12px; align-items: center; margin-bottom: 12px;
}
.profile img { width: 64px; height: 64px; image-rendering: pixelated; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kv div { background: var(--bg); border-radius: 10px; padding: 10px; }
.kv span { display: block; color: var(--faint); font-size: 11px; }
.toast {
  position: fixed; bottom: 16px; left: 50%; translate: -50% 0;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; padding: 10px 14px; border-radius: 999px; z-index: 20;
  max-width: min(420px, calc(100vw - 24px)); text-align: center;
}
button.agent-hit {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 0; color: inherit;
  text-align: left; min-width: 0;
}
button.trade-link { width: 100%; color: inherit; cursor: pointer; }
tr.click { cursor: pointer; }
tr.is-new td { background: rgba(134, 239, 172, 0.08); }
.coin__id, .coin__agent span { display: flex; flex-direction: column; min-width: 0; }
.coin__id small, .coin__agent small { color: var(--faint); display: block; }
.kv .wide { grid-column: 1 / -1; }
.kv strong { display: block; margin-top: 4px; font-weight: 650; }
.kv .wide strong { font-weight: 550; line-height: 1.4; }
.form-error { color: var(--down); font-size: 13px; margin: 0 0 10px; }
.nav__account-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#login-top { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.tight { padding-top: 4px; padding-bottom: 4px; }
.num { font-variant-numeric: tabular-nums; }

.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 15; }
.scrim[hidden] { display: none; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .rail { position: static; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .nav {
    position: fixed; z-index: 16; transform: translateX(-105%);
    transition: transform .18s ease; width: min(86vw, 300px);
  }
  .nav.open { transform: none; }
  .icon-btn.nav__close, #menu-open, .topbar__mark { display: grid; }
  .topbar__mark { display: flex; }
  .stats { grid-template-columns: 1fr; }
  h1 { font-size: 26px; }
  .stage { padding: 16px 14px 40px; }
  .search kbd, #login-top { display: none; }
  .heading { flex-direction: column; align-items: flex-start; }
  .toolbar { flex-wrap: wrap; }
  .segmented { max-width: 100%; overflow: auto; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .nav { transition: none; }
}
