:root {
  --bg: #0e0f11;
  --panel: #16171a;
  --panel-2: #1c1e22;
  --line: #2a2c31;
  --line-soft: #222428;
  --text: #ecebe6;
  --muted: #8e9097;
  --faint: #5d6067;
  --long: #5cc08b;
  --long-bg: rgba(92, 192, 139, .13);
  --short: #e8735e;
  --short-bg: rgba(232, 115, 94, .13);
  --gold: #e7c35b;
  --gold-bg: rgba(231, 195, 91, .12);
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 20px 16px 60px; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.long { color: var(--long); }
.short { color: var(--short); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.pos { color: var(--long); }
.neg { color: var(--short); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.brand { font-size: 26px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; }
.brand span { color: var(--gold); }
.status { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; color: var(--muted); font-size: 12px; background: var(--panel); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot.ok { background: var(--long); box-shadow: 0 0 0 0 rgba(92,192,139,.6); animation: pulse 2s infinite; }
.dot.warn { background: var(--gold); }
.dot.bad { background: var(--short); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(92,192,139,.5);} 70% { box-shadow: 0 0 0 7px rgba(92,192,139,0);} 100% { box-shadow: 0 0 0 0 rgba(92,192,139,0);} }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px; }
.panel h2 { font-size: 15px; margin: 0; font-weight: 650; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--muted); }

/* buttons, chips */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { background: transparent; color: var(--muted); border: 0; padding: 5px 10px; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; flex: none; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--panel-2); color: var(--text); }
.btn { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px; font: inherit; font-size: 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--faint); }
.chip { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; }
.chip.genius { background: var(--gold-bg); color: var(--gold); border: 1px solid rgba(231,195,91,.35); }
.chip.bot { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.coinchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 4px 10px 4px 4px; font: inherit; font-size: 12px; cursor: pointer; }
.coinchip.on { color: var(--text); border-color: var(--text); }
.coinchip.all { padding: 4px 10px; }
.badge { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 9px; font-weight: 800; color: #0e0f11; flex: none; letter-spacing: -.03em; }
.badge.lg { width: 30px; height: 30px; font-size: 11px; border-radius: 8px; }
select, input[type=search] { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font: inherit; font-size: 12px; }

/* flow table */
.table-scroll { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }
td.r, th.r { text-align: right; }
.coincell { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.bar { position: relative; height: 8px; border-radius: 4px; background: var(--short); overflow: hidden; min-width: 110px; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--long); }
.bar.empty { background: var(--line); }
.sharecell { display: flex; align-items: center; gap: 10px; }
.sharecell b { font-family: var(--mono); font-size: 12px; min-width: 70px; }
.sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 22px 0 12px; }
.filters .coins { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filters .spacer { flex: 1; }
.count { font-size: 12px; color: var(--muted); }

/* event cards */
.feed { display: flex; flex-direction: column; gap: 10px; }
.ev { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; transition: border-color .15s, background .6s; }
.ev:hover { border-color: var(--line); }
.ev.fresh { background: #1e2019; border-color: rgba(231,195,91,.4); }
.ev-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ev-coin { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 750; letter-spacing: -.01em; }
.ev-time { font-size: 12px; color: var(--muted); font-family: var(--mono); white-space: nowrap; }
.ev-time .ago { color: var(--text); }
.ev-time .ago.new { color: var(--gold); }
.ev h3 { margin: 8px 0 10px; font-size: 17px; font-weight: 600; }
.ev h3 .side { font-weight: 750; }
.metrics { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline; }
.m { display: inline-flex; align-items: baseline; gap: 7px; }
.m .k { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.m .v { font-family: var(--mono); font-size: 14px; }
.m .v.big { font-size: 16px; font-weight: 600; }
.ev-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border-top: 1px solid var(--line-soft); margin-top: 12px; padding-top: 10px; font-size: 12px; color: var(--muted); }
.ev-foot .addr { color: var(--text); font-family: var(--mono); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.ev-foot .name { color: var(--text); }
.empty-state { text-align: center; color: var(--muted); padding: 40px 10px; border: 1px dashed var(--line); border-radius: var(--radius); }
.more { display: flex; justify-content: center; margin-top: 14px; }

/* trader page */
.back { color: var(--muted); text-decoration: none; font-size: 13px; }
.back:hover { color: var(--text); }
.hero { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hero .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.hero h1 { font-size: 40px; letter-spacing: -.03em; margin: 10px 0 8px; font-weight: 800; word-break: break-all; }
.hero .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hero .acct { text-align: right; }
.hero .acct .k { font-size: 12px; color: var(--muted); }
.hero .acct .v { font-size: 36px; font-weight: 800; letter-spacing: -.02em; font-family: var(--mono); }
.summary { border-top: 1px solid var(--line-soft); margin-top: 14px; padding-top: 14px; font-size: 15px; line-height: 1.5; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.tile .k { font-size: 12px; color: var(--muted); }
.tile .v { font-size: 26px; font-weight: 750; font-family: var(--mono); margin: 6px 0 4px; letter-spacing: -.02em; }
.grid2 { display: grid; grid-template-columns: 1.65fr 1fr; gap: 12px; margin-bottom: 12px; }
.grid2b { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.chart { position: relative; height: 230px; }
.chart svg { display: block; width: 100%; height: 100%; }
.chart .tip { position: absolute; pointer-events: none; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-size: 12px; font-family: var(--mono); white-space: nowrap; transform: translate(-50%, -110%); display: none; }
.nowbig { font-size: 38px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 10px; }
.kv { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-family: var(--mono); }
.list-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.list-row:last-child { border-bottom: 0; }
.list-row .t { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.list-row .r { text-align: right; font-family: var(--mono); }
.scroll-list { max-height: 520px; overflow-y: auto; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
.err { color: var(--short); padding: 20px 0; }

@media (max-width: 860px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .grid2, .grid2b { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .hero .acct { text-align: left; }
}
@media (max-width: 520px) {
  .ev h3 { font-size: 15px; }
  .metrics { gap: 4px 14px; }
  .tile .v { font-size: 20px; }
}
