.muted { color: var(--muted); }
.num, .chip b, .stat b, .eq b { font-variant-numeric: tabular-nums; }
.up { color: var(--success) !important; }
.down { color: var(--danger) !important; }

.page { max-width: 1280px; margin: 0 auto; padding: calc(var(--bar-h) + 4px) 8px 32px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- head ---------- */
.head { display: flex; flex-direction: column; gap: 20px; padding: 16px 8px 4px; }
.head__id { display: flex; align-items: center; gap: 16px; }
.head__mark .mark { width: 72px; height: 72px; color: var(--accent); display: block; }
.head h1 { font-size: 36px; line-height: 40px; font-weight: 600; letter-spacing: -.025em; }
.sub { color: var(--muted); font-size: 18px; line-height: 26px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--default); color: var(--muted); font-size: 13px; white-space: nowrap; }
.chip b { color: var(--foreground); font-weight: 500; }
.chip--live { background: rgba(4, 133, 247, .15); color: var(--accent); font-weight: 500; }
.chip--live i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; }
#mode.real { background: rgba(23, 201, 100, .15); color: var(--success); }

.head__wallet { display: flex; flex-direction: column; gap: 6px; }
.head__credit { align-self: flex-start; flex: none; display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 16px 6px 6px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03); transition: border-color .15s, background .15s; }
.head__credit:hover { border-color: rgba(4, 133, 247, .5); background: rgba(4, 133, 247, .08); }
.head__credit img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.head__credit-t { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; }
.head__credit-t span { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.head__credit-t b { color: var(--foreground); font-size: 15px; font-weight: 600; }
.eq { display: flex; align-items: baseline; gap: 10px; }
.eq b { font-size: 36px; line-height: 40px; font-weight: 600; letter-spacing: -.025em; }
.eq .unit { color: var(--muted); font-size: 18px; }
.eq-sub { color: var(--muted); font-size: 14px; }
.eq-sub b { color: var(--foreground); font-weight: 500; }
.eq-row { display: flex; align-items: center; gap: 16px; margin-top: 6px; }
.eq-row .btn svg { font-size: 16px; }
.egg { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.egg__bar { width: 110px; height: 6px; border-radius: 999px; background: var(--default); overflow: hidden; }
.egg__bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .6s; }

/* ---------- the fly's own token ---------- */
.own { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 16px; padding: 14px 16px; border-radius: 24px;
  background: linear-gradient(135deg, rgba(4, 133, 247, .22), rgba(4, 133, 247, .06)); border: 1px solid rgba(4, 133, 247, .35); }
.own__img { width: 56px; height: 56px; border-radius: 50%; flex: none; }
.own__txt { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.own__t { font-size: 20px; line-height: 26px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.own__tag { height: 22px; font-size: 12px; }
.own__s { color: var(--muted); font-size: 14px; line-height: 20px; }
.own__s b { color: var(--foreground); font-weight: 500; }
.own__ca { align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; color: var(--muted); background: var(--default); border: 0; border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.own__ca:hover { color: var(--foreground); }
.own__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.own__btn { background: var(--default); color: var(--foreground); }

/* ---------- grid of cards ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.card { background: var(--surface); border-radius: 24px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.card__h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 16px; font-weight: 500; }
.card__h .muted { font-size: 13px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.market { height: 400px; }
.tok { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tok img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--default); }
.tok__id { min-width: 0; margin-right: auto; }
.tok__tick { font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.01em; }
.tok__name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.stat { display: flex; flex-direction: column; align-items: flex-end; background: var(--surface-2); border-radius: 16px; padding: 6px 12px; }
.stat span { color: var(--muted); font-size: 12px; line-height: 16px; }
.stat b { font-size: 15px; line-height: 20px; font-weight: 500; }
.chart { position: relative; flex: 1; min-height: 0; background: var(--surface-2); border-radius: 20px; overflow: hidden; }
.chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.chip--float { position: absolute; top: 12px; left: 12px; background: rgba(39, 39, 42, .85); }
.chip--float:empty { display: none; }
.senses { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sense i { width: 8px; height: 8px; border-radius: 50%; }
.sugar i { background: var(--success); } .bitter i { background: var(--danger); } .loom i { background: #9353d3; } .wind i { background: #06b7db; }
.spike i { background: #3ea0ff; box-shadow: 0 0 8px #3ea0ff; } .inhib i { background: #f5a524; }
.spacer { flex: 1; }

.flycard { padding: 0; overflow: hidden; height: 400px; }
.art { position: relative; flex: 1; min-height: 0; background: radial-gradient(rgba(4, 133, 247, .25), transparent 66%); }
.art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.act { padding: 0 16px 16px; }
.act__t { font-size: 16px; font-weight: 500; line-height: 22px; }
.act__s { font-size: 13px; line-height: 18px; }
.toast { position: absolute; top: 14px; left: 50%; transform: translate(-50%, -6px); opacity: 0; pointer-events: none; transition: all .25s ease;
  background: var(--surface-2); border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 500; white-space: nowrap;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35); display: flex; align-items: center; gap: 8px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast img { width: 22px; height: 22px; border-radius: 6px; }

.brain { height: 330px; }
.brain__views { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
.view { position: relative; background: var(--surface-2); border-radius: 20px; overflow: hidden; min-height: 150px; }
.view canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.view__l { position: absolute; left: 12px; top: 10px; color: var(--muted); font-size: 12px; }

.decisions { height: 330px; }
.positions { display: flex; flex-wrap: wrap; gap: 6px; }
.positions:empty { display: none; }
.list { list-style: none; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: var(--surface-2); border-radius: 20px; padding: 4px;
  scrollbar-width: thin; scrollbar-color: #3a3a3f transparent; }
.list::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
.list::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb { background: #3a3a3f; border-radius: 3px; }
.item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 16px; animation: rise .3s cubic-bezier(.25, 1, .5, 1); }
.item__ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 15px;
  background: var(--default); color: var(--muted); }
.item--buy .item__ic { background: rgba(23, 201, 100, .15); color: var(--success); }
.item--sell .item__ic { background: rgba(4, 133, 247, .15); color: var(--accent); }
.item--honeypot .item__ic { background: rgba(243, 18, 96, .15); color: var(--danger); }
.item--egg .item__ic { background: rgba(245, 165, 36, .15); color: var(--warning); }
.item--learn .item__ic { background: rgba(147, 83, 211, .18); color: #c9a3f5; }
.item--avoid .item__ic { background: rgba(243, 18, 96, .15); color: var(--danger); }
.item--escape .item__ic, .item--groom .item__ic { background: rgba(147, 83, 211, .15); color: #b37feb; }
.item__m { min-width: 0; flex: 1; }
.item__t { font-size: 15px; font-weight: 500; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__s { color: var(--muted); font-size: 13px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__r { font-size: 14px; font-weight: 500; text-align: right; white-space: nowrap; }

@media (max-width: 899px) {
  .brain { height: auto; }
  .view { height: 170px; }
  .decisions { height: 420px; }
}
@media (min-width: 900px) {
  .head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .head__credit { align-self: center; margin: 0 auto; }
  .head__wallet { align-items: flex-end; }
  .brain__views { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .trades { grid-column: 1 / -1; }
}

/* ---------- trades table ---------- */
.trades__h { align-items: center; flex-wrap: wrap; }
.trades__sum { margin-left: auto; }
.tabs { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.tab { height: 30px; padding: 0 14px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 500; }
.tab b { margin-left: 4px; font-weight: 500; color: inherit; opacity: .8; }
.tab.active { background: var(--default-hover); color: var(--foreground); }
.table-wrap { overflow: auto; max-height: 420px; border-radius: 20px; background: var(--surface-2); scrollbar-width: thin; scrollbar-color: #3a3a3f transparent; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; min-width: 760px; }
.table th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-weight: 400; font-size: 13px; text-align: right;
  padding: 12px 16px 8px; white-space: nowrap; }
.table th:first-child, .table td:first-child { text-align: left; }
.table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.table th.sortable:hover { color: var(--foreground); }
.table th.sorted { color: var(--accent); }
.table td { padding: 10px 16px; text-align: right; border-top: 1px solid #2e2e32; white-space: nowrap; }
.table tr:hover td { background: rgba(255, 255, 255, .02); }
.tcell { display: flex; align-items: center; gap: 10px; }
.tcell img, .tcell .ph { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--default); flex-shrink: 0; }
.tcell b { font-weight: 500; }
.tcell a { color: var(--foreground); }
.tcell a:hover { color: var(--accent); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 500; }
.pill.up { background: rgba(23, 201, 100, .12); } .pill.down { background: rgba(243, 18, 96, .12); }
.table-empty { padding: 28px; text-align: center; color: var(--muted); }
