@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jbm-400.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jbm-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jbm-800.woff2") format("woff2"); font-weight: 800 900; font-display: swap; }

/* Terminal theme: black panels, amber accent, one monospace face, square corners. */
:root {
  --bg: #050505;
  --card: #0a0a0a;
  --line: #262626;
  --text: #ededed;
  --muted: #8a8a8a;
  --accent: #ffb000;
  --long: #39d98a;
  --short: #ff5c5c;
  --radius: 0;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px env(safe-area-inset-bottom);
  min-height: 100dvh;
}

a { color: inherit; }

.top, main, .foot { width: 100%; max-width: 760px; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 6px; }

.search { display: flex; gap: 8px; margin: 10px 0 4px; }
.search input {
  flex: 1; min-width: 0; background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 0; padding: 10px 16px; font: inherit; font-size: 15px;
}
.search input:focus { outline: none; border-color: var(--accent); }
.search button {
  background: var(--accent); color: #050505; border: 0; border-radius: 0; padding: 10px 18px;
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
}

.popular { color: var(--muted); font-size: 13px; margin: 6px 4px 0; }
.popular a { color: var(--text); font-weight: 600; text-decoration: none; margin-right: 6px; }
.popular a:hover { color: var(--accent); }
.kicker { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

.intro h1 { font-size: 28px; margin: 18px 0 6px; }
.sub { color: var(--muted); margin: 0 0 6px; line-height: 1.45; }
.updated { color: var(--muted); font-size: 13px; margin: 0 0 14px; font-variant-numeric: tabular-nums; }

.nfa {
  font-size: 13px; line-height: 1.45; color: var(--muted); border: 1px solid var(--line); border-radius: 0;
  padding: 8px 12px; margin: 0 0 14px;
}
.disclaimer { border-top: 1px solid var(--line); padding-top: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  display: flex; align-items: baseline; gap: 8px; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 0; background: var(--card); text-decoration: none; font-weight: 700; font-size: 14px;
}
.chip .score { font-variant-numeric: tabular-nums; font-weight: 800; }
.chip.on { border-color: var(--accent); }

.range { display: inline-flex; border: 1px solid var(--line); border-radius: 0; overflow: hidden; margin-bottom: 12px; }
.range button {
  background: none; border: 0; color: var(--muted); padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer;
}
.range button.on { background: var(--line); color: var(--text); }

.coin {
  background: var(--card); border: 1px solid var(--line); border-radius: 0;
  padding: 16px; margin-bottom: 14px; scroll-margin-top: 12px;
}
.coin-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.coin-head h2 { margin: 0; font-size: 22px; }
.price { color: var(--muted); font-variant-numeric: tabular-nums; }
.crowd { margin: 12px 0 4px; }
.crowd-label { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.crowd-label b { font-size: 15px; }
.gauge { width: 100%; height: 14px; display: block; }
.gauge-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 2px; }

.tablewrap { overflow-x: auto; margin: 12px -4px 0; scrollbar-color: var(--line) transparent; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; min-width: 520px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--line); }
td { text-align: right; padding: 8px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
tr:last-child td { border-bottom: 0; }
.venue { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.binance { background: #f0b90b; }
.dot.bybit { background: #ff8a1f; }
.dot.okx { background: #c8c8d4; }
.dot.hyperliquid { background: #50e3c2; }
.bar { width: 64px; height: 8px; vertical-align: middle; margin-left: 6px; }
.up { color: var(--long); }
.down { color: var(--short); }
.na { color: var(--muted); }
.apr { color: var(--muted); font-size: 12px; margin-left: 4px; }

.chart { width: 100%; height: 150px; display: block; margin-top: 12px; }
.chart-cap { color: var(--muted); font-size: 12px; margin-top: 2px; }

.notes { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 20px 0; }
.notes h2 { color: var(--text); font-size: 17px; }
.notes b { color: var(--text); }
/* Collapsible notes (How to read this, FAQ, Disclaimer) */
details.notes { background: var(--card); border: 1px solid var(--line); border-radius: 0; padding: 0 18px; margin: 14px 0; }
details.notes summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
details.notes summary::-webkit-details-marker { display: none; }
details.notes summary h2 { margin: 0; font-size: 17px; }
details.notes summary::after { content: "+"; color: var(--muted); font-size: 22px; line-height: 1; }
details.notes[open] summary::after { content: "−"; }
details.notes[open] { padding-bottom: 6px; }
details.notes summary + p { margin-top: 0; }

.foot { color: var(--muted); font-size: 12px; text-align: center; padding: 20px 0 28px; }

.wide { width: 100%; }
.live {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 0;
  padding: 7px 12px; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--long); box-shadow: 0 0 8px var(--long); }
.live.stale i { background: #f0b90b; box-shadow: none; }

.hero2 { padding: 28px 0 8px; }
.kicker.green { color: var(--long); }
.hero2 h1 { font-size: 46px; line-height: 1.05; margin: 8px 0 10px; letter-spacing: -0.02em; }
.hero2 .sub { max-width: 720px; }
.hero2 .updated { display: inline; margin: 0; }
.btn-outline {
  border: 1px solid var(--line); border-radius: 0; padding: 10px 16px; text-decoration: none; font-weight: 600; white-space: nowrap;
}
.btn-outline:hover { border-color: var(--text); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 0; padding: 18px; min-width: 0; }
.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 0; overflow: hidden; }
.tabs button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; padding: 7px 11px; cursor: pointer; }
.tabs button.on { background: var(--line); color: var(--text); }
.split { display: grid; grid-template-columns: 1fr 1fr; margin: 14px 0 6px; }
.split > div + div { border-left: 1px solid var(--line); padding-left: 22px; }
.label { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; }
.big { margin: 2px 0; font-size: 44px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.spark { width: 46%; height: 56px; }

@media (max-width: 820px) {
  .hero2 h1 { font-size: 34px; }
  .big { font-size: 34px; }
  .split > div + div { padding-left: 14px; }
}

/* Markets screener */
.mtools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 4px 0 12px; }
.mtools input {
  flex: 0 1 280px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 0;
  padding: 10px 14px; font: inherit; font-size: 15px;
}
.mtools input:focus { outline: none; border-color: var(--accent); }
.mtools .updated { margin: 0; }
.mtable { padding: 6px 10px; }
.mtable table { min-width: 680px; }
.mtable th button {
  background: none; border: 0; color: inherit; font: inherit; font-weight: 600; font-size: 12px; cursor: pointer; padding: 4px 0;
  white-space: nowrap;
}
.mtable th.sorted button { color: var(--text); }
.mtable td { padding: 9px 4px; }
.coinlink { font-weight: 700; text-decoration: none; }
.coinlink:hover { color: var(--accent); }
.venues-cell { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; }
.more { cursor: pointer; background: none; color: var(--text); font: inherit; }

/* Search modal (Hyperliquid style) */
form.search input[readonly] { cursor: pointer; }
html.modal-open, html.modal-open body { overflow: hidden; }
.smodal {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.8); display: flex; justify-content: center;
  align-items: flex-start; padding-top: 8vh; overscroll-behavior: contain;
}
.smodal[hidden] { display: none; }
.spanel {
  width: min(820px, calc(100% - 32px)); max-height: 80vh; display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--line); border-radius: 0; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); overflow: hidden;
}
.stop { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.stop input {
  flex: 1; min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 0;
  padding: 11px 14px; font: inherit; font-size: 16px;
}
.stop input:focus { outline: none; border-color: var(--accent); }
.sclose { background: none; border: 0; color: var(--muted); font: inherit; font-size: 15px; padding: 0 8px; cursor: pointer; }
.sclose:hover { color: var(--text); }
.stabs { display: flex; gap: 4px; padding: 10px 12px 6px; overflow-x: auto; scrollbar-width: none; }
.stabs button {
  background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; font-weight: 700; padding: 6px 12px;
  border-radius: 0; cursor: pointer; white-space: nowrap;
}
.stabs button.on { background: var(--line); color: var(--text); }
.shead, .srow {
  display: grid; grid-template-columns: minmax(110px, 1.4fr) 1fr 0.8fr 1fr 1fr 0.9fr; gap: 8px; align-items: center;
  padding: 0 14px;
}
.shead { padding-top: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.shead button {
  background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; text-align: right;
  padding: 2px 0; cursor: pointer; white-space: nowrap;
}
.shead button.h-coin { text-align: left; }
.shead button.sorted { color: var(--text); }
.slist { overflow-y: auto; flex: 1; overscroll-behavior: contain; scrollbar-color: var(--line) transparent; padding: 4px 0; }
.srow { padding-top: 9px; padding-bottom: 9px; text-decoration: none; font-variant-numeric: tabular-nums; font-size: 14px; }
.srow span { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow .sc { text-align: left; display: flex; align-items: baseline; gap: 8px; }
.srow .sc i { font-style: normal; color: var(--muted); font-size: 11px; letter-spacing: 0.04em; }
.srow:hover, .srow.on { background: var(--line); }
.sfoot { margin: 0; padding: 8px 14px 12px; color: var(--muted); font-size: 12px; }
.sfoot:empty { display: none; }

@media (max-width: 700px) {
  .smodal { padding: 0; align-items: stretch; background: var(--card); }
  .spanel { width: 100%; max-height: none; height: var(--vh, 100dvh); border: 0; border-radius: 0; }
  .shead, .srow { grid-template-columns: minmax(96px, 1.3fr) 1fr 0.8fr 0.9fr; }
  .h-oi, .h-funding, .srow .so, .srow .sf { display: none; }
  .srow .sc i { display: none; }
  .srow { padding-top: 12px; padding-bottom: 12px; }
}
.stop, .stabs, .shead, .sfoot { flex: none; }
.liq { margin: 10px 2px 0; font-size: 13px; color: var(--muted); }
.liq b { font-weight: 700; }

/* Trade links */
.tradewrap { margin-top: 12px; }
.trade { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.trade-label { color: var(--muted); font-size: 13px; font-weight: 700; margin-right: 2px; }
.tradebtn {
  border-radius: 0; padding: 7px 12px; font-size: 13px; font-weight: 700; text-decoration: none; border: 1px solid transparent;
}
.tradebtn.binance { background: #f0b90b; color: #111; }
.tradebtn.bybit { background: #1b1b24; color: #ff9f2e; border-color: #ff9f2e; }
.tradebtn.okx { background: #f2f2f7; color: #111; }
.tradebtn.hyperliquid { background: #0d2b27; color: #50e3c2; border-color: #50e3c2; }
.tradebtn:hover { filter: brightness(1.1); }
.trade-note { margin: 6px 0 0; color: var(--muted); font-size: 11px; }

/* Home terminal layout */
body.term { padding: 0 0 env(safe-area-inset-bottom); align-items: stretch; font-size: 13px; }
.tbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: #0c0c0c; }
.tbrand { color: var(--accent); font-weight: 800; font-size: 15px; letter-spacing: 0.04em; text-decoration: none; }
.tnav { display: flex; flex-wrap: wrap; gap: 18px; flex: 1; }
.tnav a { color: var(--muted); text-decoration: none; }
.tnav a::before { content: "["; color: #4a4a4a; }
.tnav a::after { content: "]"; color: #4a4a4a; }
.tnav a:hover, .tnav a.on { color: var(--text); }
.tsearch { margin: 0; align-items: center; gap: 8px; border: 1px solid #333; padding: 0 10px; min-width: 240px; }
.tsearch span { color: var(--accent); }
.tsearch input { background: transparent; border: 0; border-radius: 0; padding: 7px 0; font-size: 13px; }
.tsearch:focus-within { border-color: var(--accent); }
body:not(.term) .tbar { align-self: stretch; margin: 0 -16px 12px; }
body.term .live, .tbar .live { border: 0; padding: 0; color: var(--long); font-size: 13px; }
body.term .live.stale, .tbar .live.stale { color: #f0b90b; }

.tape { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tick { display: flex; gap: 10px; padding: 8px 20px; border-right: 1px solid #1c1c1c; white-space: nowrap; text-decoration: none; font-variant-numeric: tabular-nums; }
.tick b { color: var(--text); }
a.tick:hover { background: #111; }
.acc { color: var(--accent); }

.tmain { width: 100%; max-width: 1280px; margin: 0 auto; padding: 14px 20px 28px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-content: start; }
.tfull { grid-column: 1 / -1; }
.tline { grid-column: 1 / -1; margin: 0; font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; }
.tline > span { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.tpanel { border: 1px solid var(--line); background: var(--card); min-width: 0; }
.thead { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--accent); font-weight: 700; }
.tdim { color: #6b6b6b; font-weight: 400; }
.mtabs { display: inline-flex; gap: 2px; }
.mtabs button { background: none; border: 0; color: #6b6b6b; font: inherit; font-size: 12px; padding: 0 6px; cursor: pointer; min-height: 24px; }
.mtabs button:hover { color: var(--text); }
.mtabs button.on { color: #050505; background: var(--accent); font-weight: 700; }
.tpad { margin: 0; padding: 10px 12px; }
.tpanel .tablewrap { margin: 0; }

.matrix { min-width: 960px; font-size: 13px; }
.matrix th { color: #6b6b6b; font-weight: 400; font-size: 12px; padding: 8px 12px; }
.matrix td { padding: 9px 12px; border-bottom: 1px solid #1a1a1a; }
.matrix tbody tr { cursor: pointer; }
.matrix tbody tr:hover td { background: #111; }
.matrix tbody tr:hover td.heat { filter: brightness(1.1); }
.matrix .sym a { color: var(--text); font-weight: 800; text-decoration: none; }
.matrix .sym { position: sticky; left: 0; background: var(--card); }
.matrix .sub { margin-left: 6px; font-size: 11px; }
.heat { color: #050505; font-weight: 700; }
.heat.h4 { background: #39d98a; }
.heat.h3 { background: #7fe0a8; }
.heat.h2 { background: #b6e8c6; }
.heat.h1 { background: #d9d9d9; }
.heat.h0 { background: #bdbdbd; }
.heat.s1 { background: #ffb3b3; }
.heat.s2 { background: #ff5c5c; }
.tspark { width: 96px; height: 24px; vertical-align: middle; }
.crowd b { font-weight: 800; margin-right: 8px; }
.blocks { letter-spacing: -1px; }
.hot { color: var(--short); }
.warm { color: var(--accent); }
.cool { color: #7cc4ff; }
.cold { color: #38bdf8; }

.trow { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-top: 1px solid #141414; text-decoration: none; font-variant-numeric: tabular-nums; }
.tlist .trow:first-child { border-top: 0; }
.trow b { color: var(--text); flex: 1; }
a.trow:hover { background: #111; }
#signals .trow { justify-content: flex-start; }
.trow .up, .trow .down { font-weight: 700; }

body.term .nfa { margin: 0; }
body.term details.notes { margin: 0; background: var(--card); }
body.term details.notes summary h2 { font-size: 13px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; }
.tfoot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 12px 20px; border-top: 1px solid var(--line); color: #6b6b6b; font-size: 12px; }
.tfoot a { color: var(--accent); text-decoration: none; }

@media (max-width: 900px) {
  .tmain { grid-template-columns: minmax(0, 1fr); padding: 12px 12px 24px; gap: 12px; }
  .tbar { padding: 10px 12px; gap: 8px 14px; }
  .tsearch { order: 5; flex: 1 1 100%; min-width: 0; }
  .tnav { order: 4; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 14px; white-space: nowrap; }
  .tbar .live { margin-left: auto; }
  .tick { padding: 8px 12px; }
  .matrix .opt { display: none; }
  .matrix { min-width: 0; }
  .matrix td, .matrix th { padding: 9px 6px; }
  .blocks { display: none; }
}


/* Crowd scoreboard (/crowd) and paper bot ledger (/bot) */
.bigstat { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; margin: 16px 0; }
.bigstat .big { font-size: clamp(56px, 14vw, 92px); font-weight: 800; line-height: .9; color: var(--accent); font-variant-numeric: tabular-nums; }
.bigstat p { margin: 0; line-height: 1.5; max-width: 60ch; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 12px 0; }
.tiles .panel { display: grid; gap: 8px; align-content: start; }
.tiles .v { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tiles .v small { font-size: 14px; color: var(--muted); font-weight: 400; }
.wbar { height: 6px; background: var(--line); position: relative; }
.wbar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.wbar u { position: absolute; top: -3px; bottom: -3px; left: 50%; width: 1px; background: var(--muted); }
.pos-long, .green { color: var(--long); }
.pos-short, .red { color: var(--short); }
.verdict { display: inline-block; font-size: 11px; padding: 1px 7px; border: 1px solid currentColor; }
.ledger table { min-width: 560px; }
.openpos { border: 1px solid var(--long); padding: 16px; display: grid; gap: 8px; margin: 12px 0; }
.openpos.lose { border-color: var(--short); }
.openpos .row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.openpos .pnl { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .bigstat { grid-template-columns: 1fr; gap: 10px; } }
.openpos .coin { font-size: 22px; }
