:root {
  --bg: #0b0d0c;
  --panel: #121514;
  --panel-2: #181c1a;
  --line: #242a27;
  --text: #ece9df;
  --muted: #8a918c;
  --paper: #f2e7c2;
  --green: #3ee08f;
  --red: #ff5f5f;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
input { font: inherit; color: inherit; }
h3 { margin: 0 0 10px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
h3 .sub { text-transform: none; letter-spacing: 0; font-weight: 400; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.muted { color: var(--muted); }
.accent { color: var(--paper); }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; gap: 28px;
  padding: 10px 18px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(11, 13, 12, .92); backdrop-filter: blur(8px); z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .06em; color: var(--paper); }
.brand svg { width: 22px; height: 22px; }
.stat { display: flex; flex-direction: column; line-height: 1.2; }
.stat .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat .val { font-size: 16px; font-weight: 600; }
.top nav { margin-left: auto; display: flex; gap: 4px; }
.link { padding: 6px 10px; border-radius: 8px; color: var(--muted); }
.link:hover { color: var(--text); background: var(--panel-2); }
#auth { display: flex; align-items: center; gap: 8px; }
.btn { padding: 8px 14px; border-radius: 8px; background: var(--paper); color: #17170f; font-weight: 700; }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: var(--panel-2); color: var(--text); font-weight: 500; border: 1px solid var(--line); }
.wallet { font-family: var(--mono); padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }

/* ---------- layout ---------- */
.grid {
  display: grid; grid-template-columns: 290px minmax(0, 1fr) 350px; gap: 12px;
  padding: 12px; max-width: 1700px; margin: 0 auto; align-items: start;
}
#mid, #right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; }

/* ---------- token list ---------- */
#left { position: sticky; top: 68px; max-height: calc(100vh - 80px); display: flex; flex-direction: column; }
#search, .row input {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; outline: none;
}
#search:focus, .row input:focus { border-color: var(--paper); }
.tabs { display: flex; gap: 4px; margin: 10px 0; }
.tabs button { flex: 1; padding: 6px; border-radius: 7px; color: var(--muted); background: var(--panel-2); }
.tabs button.on { color: var(--text); outline: 1px solid var(--line); background: #1f2421; }
.list { overflow-y: auto; margin: 0 -6px; }
.tok { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 6px; border-radius: 8px; text-align: left; }
.tok:hover, .tok.on { background: var(--panel-2); }
.tok .meta { min-width: 0; flex: 1; }
.tok .sym { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tok .small { font-size: 12px; color: var(--muted); }
.tok .right { text-align: right; font-size: 12px; }
.icon { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-2); object-fit: cover; flex: none; }
.icon.lg { width: 44px; height: 44px; }
.icon.sm { width: 18px; height: 18px; }

/* ---------- token header, chart ---------- */
.thead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.thead .name { font-size: 18px; font-weight: 700; }
.thead .ca { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.thead .ca:hover { color: var(--text); }
.thead .price { font-size: 20px; font-weight: 600; margin-left: auto; text-align: right; }
.facts { display: flex; gap: 22px; margin-top: 12px; flex-wrap: wrap; }
.facts div { display: flex; flex-direction: column; }
.facts .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.warn { margin-top: 12px; padding: 8px 10px; border-radius: 8px; background: rgba(255, 95, 95, .1); color: var(--red); }
.chart { padding: 0; overflow: hidden; }
.chart iframe { display: block; width: 100%; height: 440px; border: 0; background: var(--panel); }

/* ---------- trade panel ---------- */
.tabs.big button { padding: 9px; font-weight: 700; }
.tabs.big button.on.buy { background: rgba(62, 224, 143, .14); color: var(--green); outline-color: rgba(62, 224, 143, .4); }
.tabs.big button.on.sell { background: rgba(255, 95, 95, .12); color: var(--red); outline-color: rgba(255, 95, 95, .4); }
.row { position: relative; }
.row input { font-size: 18px; padding-right: 54px; font-family: var(--mono); }
.row .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.chips { display: flex; gap: 6px; margin: 8px 0; }
.chips button { flex: 1; padding: 7px; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--line); font-family: var(--mono); }
.chips button:hover:not(:disabled) { border-color: var(--muted); }
.chips.wide button { padding: 12px; font-weight: 700; color: var(--red); }
.hint { font-size: 12px; color: var(--muted); min-height: 18px; }
.cta { width: 100%; padding: 12px; border-radius: 8px; font-weight: 800; margin-top: 8px; }
.cta.buy { background: var(--green); color: #06170e; }
.preview { font-size: 12px; color: var(--muted); margin-top: 8px; min-height: 18px; font-family: var(--mono); }

/* ---------- portfolio ---------- */
.pf-top { display: flex; justify-content: space-between; align-items: baseline; }
.pf-top .eq { font-size: 24px; font-weight: 700; }
.pf-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 4px; }
.pf-facts div { background: var(--panel-2); border-radius: 8px; padding: 8px; }
.pf-facts .lbl { font-size: 11px; color: var(--muted); display: block; }
.posrow { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.posrow .meta { flex: 1; min-width: 0; }
.posrow button.x { padding: 4px 8px; border-radius: 6px; color: var(--red); border: 1px solid rgba(255, 95, 95, .35); font-size: 12px; }
.posrow button.x:hover { background: rgba(255, 95, 95, .12); }

/* ---------- leaderboard, feed ---------- */
.lb { display: grid; grid-template-columns: 22px 1fr auto auto; gap: 8px; align-items: center; padding: 5px 0; width: 100%; text-align: left; }
.lb:hover .w { color: var(--paper); }
.lb .n { color: var(--muted); font-size: 12px; }
.lb .w { font-family: var(--mono); font-size: 13px; }
.lb .prize { font-size: 12px; color: var(--paper); font-family: var(--mono); }
.lb.me .w { color: var(--paper); font-weight: 700; }
.tag { font-size: 10px; padding: 1px 5px; border-radius: 4px; background: var(--panel-2); color: var(--muted); margin-left: 6px; font-family: inherit; }
.fd { display: flex; gap: 8px; align-items: center; padding: 4px 0; font-size: 13px; }
.fd .t { margin-left: auto; color: var(--muted); font-size: 12px; }

/* ---------- modal, toast ---------- */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 22px; width: min(820px, 94vw); max-height: 86vh; }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog .close { position: absolute; right: 12px; top: 8px; font-size: 22px; color: var(--muted); }
dialog h2 { margin: 0 0 4px; font-size: 18px; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px; }
td { padding: 6px 8px; border-top: 1px solid var(--line); }
td.r, th.r { text-align: right; }
.round-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 12px; }
.round-card .hd { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--panel-2); color: var(--muted); }
.pill.ok { color: var(--green); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 20; pointer-events: none; }
#toast div { background: #1d2220; border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); }
#toast div.err { border-color: rgba(255, 95, 95, .5); color: var(--red); }

/* ---------- rules page ---------- */
.doc { max-width: 780px; margin: 0 auto; padding: 28px 18px 80px; }
.doc h1 { font-size: 30px; margin: 10px 0 6px; color: var(--paper); }
.doc h2 { font-size: 18px; margin: 34px 0 10px; }
.doc p, .doc li { color: #cfcdc4; }
.doc li { margin: 6px 0; }
.doc .rule { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 14px 16px; margin: 12px 0; }
.doc .rule h3 { color: var(--text); font-size: 15px; text-transform: none; letter-spacing: 0; margin-bottom: 6px; }
.doc .rule .eg { font-size: 13px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 10px; margin: 8px 0 0; }
.doc table td, .doc table th { padding: 7px 10px; }

@media (max-width: 1100px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  #left { position: static; max-height: 320px; }
  .top { gap: 14px; flex-wrap: wrap; }
  .chart iframe { height: 340px; }
}

/* ---------- pulse board ---------- */
body[data-view="pulse"] .grid { display: none; }
body[data-view="trade"] #pulse { display: none; }
.link.on { color: var(--text); background: var(--panel-2); }
#meChip { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
#meChip:hover { border-color: var(--muted); }
#pulse { padding: 12px; max-width: 1900px; margin: 0 auto; }
.pulse-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.pulse-bar h2 { margin: 0 8px 0 4px; font-size: 20px; }
.quick { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; color: var(--muted); }
.quick svg { width: 13px; height: 13px; color: var(--paper); flex: none; }
.quick input { width: 58px; background: none; border: 0; outline: none; font-family: var(--mono); color: var(--text); }
#pulseSearch { flex: 1; min-width: 200px; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; outline: none; }
#pulseSearch:focus { border-color: var(--paper); }
.pulse-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.plist { height: calc(100vh - 190px); min-height: 360px; overflow-y: auto; }
@media (max-width: 1100px) {
  .pulse-cols { grid-template-columns: minmax(0, 1fr); }
  .plist { height: 420px; }
}

/* ---------- trade view (chart-first layout) ---------- */
.grid { grid-template-columns: minmax(0, 1fr) 350px; max-width: 1900px; }
.searchbox { position: relative; flex: 1; max-width: 380px; min-width: 180px; }
#search { width: 100%; }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 420px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 12px 40px rgba(0, 0, 0, .6); z-index: 10; }
.tok .meta, .tok .right { display: flex; flex-direction: column; }
.top nav { margin-left: 0; }

.thead { flex-wrap: nowrap; }
.thead .id { min-width: 0; }
.thead .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thead .name .muted { font-weight: 400; font-size: 14px; }
.thead .ca { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.thead .big { font-size: 24px; font-weight: 700; color: var(--paper); margin: 0 10px; }
.thead .facts { margin: 0 0 0 auto; gap: 22px; flex-wrap: nowrap; }
.thead .facts div { white-space: nowrap; }

.seg { display: flex; gap: 2px; }
.seg button { padding: 5px 10px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.seg button:hover { color: var(--text); }
.seg button.on { color: var(--text); background: var(--panel-2); }
.chart { padding: 0; }
.chart-bar { display: flex; align-items: center; gap: 14px; padding: 6px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chart-bar .legend { margin-left: auto; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.dot { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-style: normal; font-size: 10px; font-weight: 700; color: #06170e; }
.dot.buy { background: var(--green); }
.dot.sell { background: var(--red); margin-left: 8px; }
#chart { position: relative; height: clamp(340px, calc(100vh - 400px), 680px); }
.chart-note { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); z-index: 3; pointer-events: none; }

#bottom { padding: 8px 14px 12px; }
#bottom .seg { border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 4px; }
#bottom table { margin-top: 0; }
#board, #feed, #positions { max-height: 260px; overflow-y: auto; }
.tokcell { display: inline-flex; align-items: center; gap: 8px; }
button.x { padding: 4px 9px; border-radius: 6px; color: var(--red); border: 1px solid rgba(255, 95, 95, .35); font-size: 12px; }
button.x:hover { background: rgba(255, 95, 95, .12); }

.cells { display: grid; gap: 6px; }
.cells.three { grid-template-columns: repeat(3, 1fr); }
.cells.four { grid-template-columns: repeat(4, 1fr); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cells div { background: var(--panel-2); border-radius: 8px; padding: 7px 8px; display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.cells .lbl, .thead .facts .lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-family: system-ui, sans-serif; }
.cells.four div { text-align: center; font-size: 12px; }

@media (max-width: 1100px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .thead { flex-wrap: wrap; }
  .thead .facts { margin-left: 0; flex-wrap: wrap; }
  .searchbox { order: 5; max-width: none; flex-basis: 100%; }
  #chart { height: 360px; }
}

/* Fallback for tokens without a usable image: first letter of the ticker. */
.icon.letter { display: inline-grid; place-items: center; font-weight: 700; color: var(--muted); font-size: 13px; background: #1c211e; border: 1px solid var(--line); }
.icon.lg.letter { font-size: 20px; }
.icon.sm.letter { font-size: 10px; }

/* ---------- pulse cards ---------- */
.pcol { background: #0f1211; }
.pcol h3 { padding: 13px 16px; font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 700; }
.pc { display: grid; grid-template-columns: 74px minmax(0, 1fr) 132px; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pc:hover { background: #151918; }

.pc-art { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.pc-art .slot { display: block; width: 74px; height: 74px; }
.icon.art { width: 74px; height: 74px; border-radius: 6px; border: 1px solid var(--line); display: block; }
.icon.art.letter { display: grid; font-size: 28px; }
.pc-art .curve { display: block; width: 100%; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.pc-art .curve b { display: block; height: 100%; background: var(--green); }
.pc-ca { font-size: 11px; color: var(--muted); }

.pc-mid { display: flex; flex-direction: column; gap: 9px; min-width: 0; padding-top: 1px; }
.pc-title { display: flex; align-items: baseline; gap: 7px; min-width: 0; white-space: nowrap; }
.pc-title b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 60%; }
.pc-title span { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.pc-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.pc-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.pc-meta .age { color: var(--green); font-weight: 600; }
.pc-meta svg, .chip svg { width: 13px; height: 13px; flex: none; }
.pc-link { display: inline-flex; color: var(--muted); }
.pc-link:hover { color: var(--text); }
.pc-chips { display: flex; gap: 6px; flex-wrap: wrap; min-height: 24px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); font-size: 12px; font-family: var(--mono); }

.pc-side { display: flex; flex-direction: column; gap: 6px; align-items: stretch; text-align: right; }
.pc-nums { display: flex; justify-content: flex-end; align-items: baseline; gap: 10px; font-size: 14px; white-space: nowrap; }
.pc-nums i, .pc-tx i { font-style: normal; font-size: 11px; color: var(--muted); margin-right: 4px; font-family: system-ui, sans-serif; }
.pc-nums b { font-size: 16px; }
.tier-lo { color: #5db7ff; }
.tier-mid { color: var(--paper); }
.tier-hi { color: var(--green); }
.pc-tx { display: flex; justify-content: flex-end; align-items: center; font-size: 12px; color: var(--text); }
.pc-tx u { display: inline-block; width: 30px; height: 3px; border-radius: 2px; background: var(--red); margin-left: 8px; overflow: hidden; text-decoration: none; }
.pc-tx u b { display: block; height: 100%; background: var(--green); }
.qb { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border-radius: 99px; background: #1b201e; border: 1px solid var(--line); font-family: var(--mono); font-size: 13px; font-weight: 600; white-space: nowrap; }
.qb svg { width: 13px; height: 13px; color: var(--paper); flex: none; }
.qb:hover:not(:disabled) { border-color: var(--green); color: var(--green); background: rgba(62, 224, 143, .08); }
.qb:disabled { font-family: inherit; font-size: 12px; font-weight: 400; color: var(--muted); }

@media (max-width: 1500px) {
  .pc { grid-template-columns: 62px minmax(0, 1fr) 118px; gap: 12px; padding: 12px; }
  .pc-art .slot, .icon.art { width: 62px; height: 62px; }
}
.pcol { padding: 0; overflow: hidden; }
.pcol h3 { margin: 0; border-bottom: 1px solid var(--line); color: var(--text); }

/* Volume is context, market cap is the headline: keep them visibly different. */
.pc-nums span:first-child { color: #9aa19c; font-size: 13px; }
.tier-mid { color: #ffc64a; }

/* ---------- trade view: flat panels, one clear block per job ---------- */
#mid .panel, #right .panel { background: #0f1211; }
#tokenHead { padding: 12px 18px; }
.thead { gap: 16px; }
.thead .icon.lg { width: 48px; height: 48px; border-radius: 8px; border: 1px solid var(--line); }
.thead .name { font-size: 18px; }
.thead .ca { margin-top: 2px; }
.thead .big { font-size: 28px; margin: 0 6px 0 14px; }
.thead .facts { gap: 30px; }
.thead .facts div { gap: 3px; font-size: 14px; }

.chart-bar { padding: 8px 12px; }
#bottom { padding: 4px 18px 14px; }
#bottom .seg { gap: 22px; padding: 0; margin-bottom: 6px; }
#bottom .seg button { padding: 11px 0; border-radius: 0; font-size: 14px; }
#bottom .seg button.on { background: none; box-shadow: inset 0 -2px 0 var(--paper); }
#bottom th { padding: 8px; }
#bottom td { padding: 10px 8px; }

.trade { padding: 16px; }
.tabs.big { background: var(--panel-2); border-radius: 99px; padding: 3px; gap: 0; margin: 0 0 14px; }
.tabs.big button, .tabs.big button.on { border-radius: 99px; background: none; outline: none; padding: 8px; }
.tabs.big button.on.buy { background: var(--green); color: #06170e; }
.tabs.big button.on.sell { background: var(--red); color: #1f0707; }
.row input { height: 46px; border-radius: 10px; background: var(--panel); }
.chips { gap: 8px; margin: 10px 0; }
.chips button { border-radius: 99px; background: none; border: 1px solid rgba(62, 224, 143, .4); color: var(--green); padding: 7px; }
.chips button:hover:not(:disabled) { border-color: var(--green); background: rgba(62, 224, 143, .08); }
.chips.wide button { border-color: rgba(255, 95, 95, .4); color: var(--red); padding: 10px; font-weight: 600; }
.chips.wide button:hover:not(:disabled) { border-color: var(--red); background: rgba(255, 95, 95, .08); }
.hint { line-height: 1.5; }
.cta { height: 46px; padding: 0; border-radius: 99px; font-size: 15px; margin-top: 12px; }

/* Bought / Sold / Holding / PnL: one row split by hairlines, no boxes. */
.cells.four { gap: 0; margin-top: 16px; padding-top: 14px; }
.cells.four div { background: none; border-radius: 0; padding: 0 6px; gap: 5px; border-left: 1px solid var(--line); font-size: 13px; }
.cells.four div:first-child { border-left: 0; }

/* Token info and round summary: outlined tiles, value on top, label under it. */
.cells.three { gap: 8px; }
.cells.three div { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 10px 6px; align-items: center; text-align: center; gap: 4px; flex-direction: column-reverse; font-size: 14px; }
.cells.three div > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#right h3 { margin-bottom: 12px; }
.pf-top .eq { font-size: 26px; }
.thead .big.tier-lo { color: #5db7ff; }
.thead .big.tier-mid { color: #ffc64a; }
.thead .big.tier-hi { color: var(--green); }

/* ---------- scrollbars: thin and dark, like the rest of the page ---------- */
:root { color-scheme: dark; }
* { scrollbar-width: thin; scrollbar-color: #2b322e transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2b322e; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #3a433e; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- pulse column head and filters ---------- */
.pcol { position: relative; }
.pcol-head { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 0; border-bottom: 1px solid var(--line); }
.pcol-head h3 { border-bottom: 0; }
.pcol-head .count { font-size: 12px; color: var(--muted); font-family: var(--mono); margin-left: -6px; }
.filt { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border-radius: 8px; color: var(--muted); }
.filt:hover, .filt.on { color: var(--text); background: var(--panel-2); }
.filt.on { color: var(--paper); }
.filt svg { width: 16px; height: 16px; }
.filt i { font-style: normal; font-size: 12px; font-family: var(--mono); }
.filter-pop { position: absolute; top: 46px; right: 8px; left: 8px; z-index: 4; background: #161a18; border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: 0 16px 50px rgba(0, 0, 0, .65); }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 12px 0; }
.filter-pop label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.filter-pop label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.field { position: relative; display: block; }
.field input { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 34px 7px 9px; outline: none; font-family: var(--mono); }
.field input:focus { border-color: var(--paper); }
.field i { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 11px; color: var(--muted); }
.filter-foot { display: flex; justify-content: space-between; align-items: center; }

/* ---------- small controls ---------- */
.mini { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.mini:hover:not(:disabled), .mini.on { color: var(--text); border-color: var(--muted); }
.mini.on { color: var(--paper); border-color: var(--paper); }
.mini svg, .eye svg, .btn svg { width: 13px; height: 13px; }
.btn { display: inline-flex; align-items: center; gap: 7px; }
h3 .mini { float: right; margin-top: -4px; }
.seg.small button { padding: 3px 9px; font-size: 12px; }
.eye { display: inline-flex; padding: 4px; border-radius: 6px; color: var(--muted); opacity: .55; }
.eye:hover, .eye.on { opacity: 1; color: var(--paper); }
#toast div.clickable { pointer-events: auto; cursor: pointer; border-color: var(--paper); }
dialog #toast { z-index: 30; }

/* ---------- trade panel additions ---------- */
.preset-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.preset-row .mini:first-of-type { margin-left: auto; }
.chips input { flex: 1; min-width: 0; width: 100%; text-align: center; padding: 7px 4px; border-radius: 99px; background: var(--panel); border: 1px dashed var(--muted); font-family: var(--mono); outline: none; }
.chips input:focus { border-color: var(--paper); border-style: solid; }
.row .mini.inside { position: absolute; right: 52px; top: 50%; transform: translateY(-50%); }
.row input { padding-right: 112px; font-size: 16px; }
.share-token { margin-top: 12px; width: 100%; justify-content: center; padding: 7px; }

/* ---------- chart legend ---------- */
.chart-bar .legend { gap: 5px; }
.dot.sell { margin-left: 0; }
.dot.ring { background: rgba(62, 224, 143, .55); width: 9px; height: 9px; margin-left: 10px; }
.dot.dev { background: #ffc64a; border-radius: 3px; margin-left: 10px; }
.dash { display: inline-block; width: 18px; border-top: 1px dashed var(--muted); margin-left: 10px; }
#playersToggle.on { color: var(--green); }

/* ---------- tabs under the chart ---------- */
#positions, #tokenTrades, #board, #feed, #watching { max-height: 300px; overflow-y: auto; }
#bottom #rangeTabs { border: 0; margin: 6px 0 4px; gap: 2px; }
#bottom #rangeTabs button { padding: 4px 10px; border-radius: 6px; font-size: 12px; }
#bottom #rangeTabs button.on { background: var(--panel-2); box-shadow: none; }
.lb { grid-template-columns: 22px 1fr auto auto auto; }
.lb .w { text-align: left; }
.lb .w:hover { color: var(--paper); }
tr.mine td { background: rgba(242, 231, 194, .05); }
.tag.dev { background: rgba(255, 198, 74, .16); color: #ffc64a; }
#watchTab.live::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-left: 6px; vertical-align: middle; }
.watch-head { display: flex; align-items: center; gap: 12px; padding: 8px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.watch-head .mini { margin-left: auto; }
#tokenTrades a:hover { color: var(--paper); }

/* ---------- profile, round summary, share ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-right: 30px; }
.profile-head h2 { margin: 0; font-size: 22px; }
dialog h3 { margin-bottom: 4px; }
dialog td button:hover { color: var(--paper); }
.summary { text-align: center; padding: 6px 0 4px; }
.summary .hero { font-size: 72px; font-weight: 800; line-height: 1.1; margin: 8px 0 2px; }
.summary .sub { font-size: 16px; }
.summary p { color: #cfcdc4; max-width: 520px; margin: 12px auto 0; }
.summary-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.token-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 20px; }
.token-tiles > div { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.token-tiles .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.share-canvas { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); margin-top: 12px; display: block; }

/* ================= calm pass =================
   Fewer boxes, one typeface, colour only where it carries meaning. */

/* Numbers keep equal-width digits but use the same typeface as the text. */
:root { --code: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; --mono: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.mono, .chips button, .qb, .chip, .wallet, #meChip { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.thead .ca, .pc-ca { font-family: var(--code); }
body { font-size: 14px; }

/* The right column is one panel with sections, not a stack of boxes. */
#right { gap: 0; background: #0f1211; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
#right .panel { border: 0; border-radius: 0; background: none; border-top: 1px solid var(--line); padding: 18px; }
#right .panel:first-child { border-top: 0; }
#right h3 { font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 600; margin-bottom: 12px; }
#right h3 .mini { border: 0; padding: 0; color: var(--muted); }
#right h3 .mini:hover { color: var(--text); }

/* Buy / sell panel */
.preset-row { margin-bottom: 10px; gap: 14px; }
.preset-row .seg { gap: 0; }
.preset-row .textlink:first-of-type { margin-left: auto; }
.textlink { color: var(--muted); font-size: 12px; padding: 0; }
.textlink:hover { color: var(--text); }
.chips { gap: 6px; margin: 0 0 10px; }
.chips button, .chips.wide button { border-radius: 8px; border: 1px solid transparent; background: var(--panel-2); color: var(--text); padding: 9px 4px; font-weight: 600; font-size: 14px; }
.chips button:hover:not(:disabled) { border-color: var(--green); background: var(--panel-2); color: var(--green); }
.chips.wide button:hover:not(:disabled) { border-color: var(--red); background: var(--panel-2); color: var(--red); }
.chips input { border-radius: 8px; }
.row input { border-radius: 8px; height: 44px; font-size: 14px; background: none; }
.row .mini.inside { border: 0; color: var(--muted); right: 46px; }
.hint { margin-top: 8px; }
.hint b { color: var(--text); font-weight: 600; }
.cta { border-radius: 8px; height: 44px; margin-top: 12px; }
.tabs.big { border-radius: 8px; margin-bottom: 14px; }
.tabs.big button, .tabs.big button.on { border-radius: 6px; }

/* Your position in this token: four quiet figures. */
.cells.four { border-top: 0; margin-top: 18px; padding-top: 0; }
.cells.four div { border-left: 0; padding: 0; text-align: left; align-items: flex-start; font-size: 14px; }
.cells .lbl, .thead .facts .lbl { text-transform: none; letter-spacing: 0; font-size: 12px; }
.share-token { display: block; width: auto; margin: 12px 0 0; padding: 0; text-align: left; }

/* Token info: label on the left, value on the right. */
.kvs { display: grid; gap: 9px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Your round */
.pf-top .eq { font-size: 24px; }
.pf-line { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* Token header and chart */
#mid .panel { border-color: #1c211e; }
.thead .facts { gap: 26px; }
.thead .facts div { font-size: 14px; }
.chart-bar { border-bottom-color: #1c211e; }
.chart-bar .seg.right { margin-left: auto; }
.seg button { font-size: 13px; }

/* Tabs under the chart */
#bottom .seg { border-bottom: 1px solid #1c211e; }
th { text-transform: none; letter-spacing: 0; font-size: 12px; }
td { border-top-color: #1c211e; }
button.x { border: 0; padding: 4px 0; color: var(--muted); }
button.x:hover { background: none; color: var(--red); }

/* Header */
.stat .lbl { text-transform: none; letter-spacing: 0; font-size: 12px; }
h3 { text-transform: none; letter-spacing: 0; font-size: 13px; }

/* Outlined tiles used in windows (profile): lighter. */
.cells.three div { border-color: #1c211e; }

/* Nickname form on your own profile */
.nick-form { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.nick-form label { color: var(--muted); font-size: 13px; }
.nick-form input { flex: 1; min-width: 160px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: none; }
.nick-form input:focus { border-color: var(--paper); }
.lb .w, .fd button { font-family: inherit; }
.dash { margin-left: 0; border-top-style: dotted; }
.dash.buyline { border-top: 2px solid #5db7ff; }
.dash.sellline { border-top: 2px dashed #ff9f43; }

/* The chart sits on pure black so the candles carry all the contrast. */
#mid .panel.chart { background: #000; }
.chart-bar { border-bottom-color: #151817; }

/* Header: brand and navigation on the left, the account pinned to the right edge. */
.top nav { margin-right: auto; }

/* ---------- leaderboard screen ---------- */
body[data-view="board"] .grid, body[data-view="board"] #pulse { display: none; }
body:not([data-view="board"]) #boardPage { display: none; }
#boardPage { max-width: 1240px; margin: 0 auto; padding: 26px 18px 60px; }
.lp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.lp-head h1 { margin: 0 0 4px; font-size: 30px; }
.lp-head .seg { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.lp-head .seg button { padding: 7px 16px; border-radius: 7px; font-size: 14px; }
.lp-head .seg button.on { background: var(--paper); color: #17170f; font-weight: 600; }
.lp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
#lpSide { background: #0f1211; padding: 18px; position: sticky; top: 76px; }
#lpSide h3 { color: var(--text); margin-bottom: 14px; }
#lpSide p { font-size: 13px; margin: 16px 0 0; line-height: 1.55; }
#lpSide a { text-decoration: underline; }

.lp-me { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: #0f1211; margin-bottom: 18px; }
.lp-me > div { display: flex; flex-direction: column; gap: 2px; }
.lp-me .lbl { font-size: 12px; color: var(--muted); }
.lp-me b { font-size: 20px; font-variant-numeric: tabular-nums; }
.lp-me .grow { flex: 1; min-width: 200px; color: #cfcdc4; }
.lp-me .grow b { font-size: inherit; }

.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; margin-bottom: 18px; }
.pod { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: #0f1211; text-align: center; }
.pod.empty { visibility: hidden; }
.pod.p1 { padding-top: 30px; padding-bottom: 30px; border-color: rgba(255, 198, 74, .55); background: linear-gradient(180deg, rgba(255, 198, 74, .09), #0f1211 60%); }
.pod.me { box-shadow: 0 0 0 1px var(--paper) inset; }
.medal { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 17px; color: #14110a; background: #b9c0c6; }
.pod.p1 .medal { background: #ffc64a; width: 46px; height: 46px; font-size: 20px; }
.pod.p3 .medal { background: #c98a5a; }
.lp-name { font-weight: 700; font-size: 16px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-name:hover { color: var(--paper); }
.pod-main { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pod.p1 .pod-main { font-size: 38px; }
.pod-lines { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
.pod .eye { position: absolute; top: 10px; right: 10px; }

.lp-table { margin: 0; background: #0f1211; border: 1px solid var(--line); border-radius: 12px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.lp-table th { padding: 12px 14px; }
.lp-table td { padding: 12px 14px; font-size: 14px; }
.lp-table .lp-name { font-size: 14px; font-weight: 600; }
.lp-table tr:hover td { background: rgba(255, 255, 255, .02); }
@media (max-width: 1000px) {
  .lp-grid { grid-template-columns: minmax(0, 1fr); }
  #lpSide { position: static; }
  .podium { grid-template-columns: minmax(0, 1fr); }
  .pod.p1 { order: -1; }
}

/* ---------- favourites bar ---------- */
#favBar { display: flex; gap: 6px; padding: 6px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; background: #0d0f0e; scrollbar-width: none; }
#favBar::-webkit-scrollbar { display: none; }
.fav { display: inline-flex; align-items: center; gap: 7px; padding: 5px 6px 5px 8px; border-radius: 8px; border: 1px solid transparent; font-size: 13px; white-space: nowrap; cursor: pointer; font-variant-numeric: tabular-nums; }
.fav:hover, .fav.on { background: var(--panel-2); border-color: var(--line); }
.fav .unfav { color: var(--muted); padding: 0 4px; font-size: 15px; line-height: 1; visibility: hidden; }
.fav:hover .unfav { visibility: visible; }
.fav .unfav:hover { color: var(--red); }

/* ---------- star and hide on cards ---------- */
.pc-title { align-items: center; }
.pc-actions { margin-left: auto; display: inline-flex; gap: 2px; flex: none; }
.star, .hide { display: inline-flex; padding: 3px; border-radius: 6px; color: var(--muted); opacity: 0; }
.star svg, .hide svg { width: 15px; height: 15px; }
.star svg path { fill: none; }
.pc:hover .star, .pc:hover .hide, .star.on, .thead .star { opacity: 1; }
.star:hover, .star.on { color: #ffc64a; }
.star.on svg path { fill: currentColor; }
.hide:hover { color: var(--red); }
.thead .star { vertical-align: middle; margin-left: 4px; }
.pulse-bar #hiddenBtn { margin-left: auto; }
.hidden-head { display: flex; justify-content: flex-end; margin-top: 12px; }
.hidden-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.hidden-row .mini { margin-left: auto; }
.hidden-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- holder mark, badges, invites ---------- */
.holder { color: var(--paper); margin-left: 5px; font-size: .85em; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge { padding: 4px 10px; border-radius: 99px; border: 1px dashed var(--line); color: #5d635f; font-size: 12px; cursor: help; }
.badge.on { border: 1px solid rgba(242, 231, 194, .45); color: var(--paper); background: rgba(242, 231, 194, .07); }
.invite { display: flex; gap: 8px; margin-top: 10px; }
.invite input { flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-family: var(--code); font-size: 12px; color: var(--muted); outline: none; }
.lp-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- header extras ---------- */
.icon-btn { display: inline-flex; padding: 7px; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.off { opacity: .5; }

/* ---------- welcome ---------- */
.welcome { text-align: center; padding: 10px 6px 4px; }
.welcome-kicker { color: var(--paper); font-weight: 800; letter-spacing: .08em; font-size: 13px; text-transform: uppercase; }
.welcome h1 { font-size: 40px; line-height: 1.12; margin: 10px 0 12px; }
.welcome p { color: #cfcdc4; max-width: 560px; margin: 0 auto; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 24px 0 18px; text-align: left; }
.steps > div { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.steps b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--paper); color: #17170f; }
.steps h4 { margin: 12px 0 6px; font-size: 15px; }
.steps span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.welcome-live { color: var(--muted); }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } .welcome h1 { font-size: 30px; } }

/* ---------- positions bar ---------- */
#sellBar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: rgba(13, 15, 14, .96); border-top: 1px solid var(--line); overflow-x: auto; backdrop-filter: blur(8px); }
body.has-sellbar { padding-bottom: 54px; }
body.has-sellbar .plist { height: calc(100vh - 244px); }
body.has-sellbar #toast { bottom: 70px; }
.sb-title { color: var(--muted); font-size: 12px; margin-right: 4px; flex: none; }
.sb-pos { display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 9px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; white-space: nowrap; cursor: pointer; font-variant-numeric: tabular-nums; flex: none; }
.sb-pos:hover { border-color: var(--muted); }
.sb-pos button { padding: 4px 9px; border-radius: 6px; background: var(--panel-2); font-size: 12px; font-weight: 600; }
.sb-pos button:hover { background: rgba(255, 95, 95, .16); color: var(--red); }

/* Shown while prices are streaming straight from the chain. */
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--green); margin-left: auto; }
.live-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: live-pulse 1.4s ease-in-out infinite; }
.live-badge + .seg.right { margin-left: 0; }
@keyframes live-pulse { 50% { opacity: .25; } }

.beta-tag { font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 2px 6px; border-radius: 5px; background: rgba(242, 231, 194, .14); color: var(--paper); }

/* ================= phones ================= */
#pcolTabs { display: none; }

@media (max-width: 720px) {
  /* Header: two tidy rows and a scrolling menu instead of one long wrapping line. */
  .top { position: static; display: grid; grid-template-columns: 1fr auto auto; gap: 8px 10px; padding: 10px 12px; align-items: center; }
  .brand { grid-column: 1; font-size: 15px; min-width: 0; }
  #meChip { grid-column: 2; grid-row: 1; padding: 6px 8px; font-size: 12px; }
  #auth { grid-column: 3; grid-row: 1; gap: 4px; }
  #auth .link { display: none; }                       /* log out lives in the menu row on a phone */
  #auth .btn { padding: 7px 10px; font-size: 13px; }
  .wallet { padding: 6px 8px; font-size: 12px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .stat { grid-row: 2; flex-direction: row; align-items: baseline; gap: 6px; }
  .stat .val { font-size: 14px; }
  .top > .stat:nth-of-type(1) { grid-column: 1; }
  .top > .stat:nth-of-type(2) { grid-column: 2 / 4; justify-self: end; }
  #soundBtn { display: none; }
  .top nav { grid-column: 1 / -1; grid-row: 3; margin: 0 -12px; padding: 0 12px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav .link { white-space: nowrap; flex: none; }
  .searchbox { grid-column: 1 / -1; grid-row: 4; order: 0; max-width: none; }
  #search { padding: 8px 10px; }

  /* Pulse: one column at a time, scrolling with the page. */
  #pulse { padding: 10px; }
  .pulse-bar { margin-bottom: 8px; }
  #pcolTabs { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin-bottom: 10px; }
  #pcolTabs button { flex: 1; padding: 8px 4px; border-radius: 7px; }
  #pcolTabs button.on { background: var(--paper); color: #17170f; font-weight: 600; }
  .pcol { display: none; }
  body[data-pcol="fresh"] .pcol[data-col="fresh"], body[data-pcol="stretch"] .pcol[data-col="stretch"], body[data-pcol="migrated"] .pcol[data-col="migrated"] { display: block; }
  .plist, body.has-sellbar .plist { height: auto; min-height: 0; overflow: visible; }
  .pc { grid-template-columns: 56px minmax(0, 1fr) 96px; gap: 10px; padding: 12px 10px; }
  .pc-art .slot, .icon.art { width: 56px; height: 56px; }
  .pc-title b { font-size: 15px; }
  .pc-title span:not(.pc-actions) { display: none; }
  .pc-nums { flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; }
  .pc-nums b { font-size: 14px; }
  .qb { height: 32px; font-size: 12px; }
  .star, .hide { opacity: 1; }                          /* no hover on a touch screen */

  /* Token screen */
  .grid { padding: 10px; gap: 10px; }
  #tokenHead { padding: 12px; }
  .thead { gap: 10px 12px; }
  .thead .big { font-size: 22px; margin: 0 0 0 auto; }
  .thead .facts { width: 100%; gap: 14px 18px; }
  .thead .ca { max-width: 150px; }
  #chart { height: 320px; }
  .chart-bar { gap: 6px; padding: 6px 8px; }
  .chart-bar .seg { overflow-x: auto; scrollbar-width: none; }
  .seg button { padding: 5px 8px; }
  #bottom { padding: 4px 10px 12px; overflow: hidden; }
  #bottom .seg { gap: 16px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  #bottom .seg button { flex: none; }
  #positions, #tokenTrades, #board, #feed, #watching { overflow-x: auto; }
  #right .panel { padding: 14px; }

  /* Leaderboard */
  #boardPage { padding: 16px 10px 80px; }
  .lp-head h1 { font-size: 24px; }
  .lp-head .seg { width: 100%; }
  .lp-head .seg button { flex: 1; padding: 7px 4px; font-size: 13px; }
  .lp-me { gap: 12px 20px; padding: 12px; }
  .podium { gap: 10px; }
  .pod, .pod.p1 { padding: 16px 12px; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; text-align: left; gap: 6px 12px; }
  .pod-main, .pod.p1 .pod-main { font-size: 22px; margin-left: auto; }
  .pod-lines { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; width: 100%; }
  .pod .eye { position: static; }
  .medal, .pod.p1 .medal { width: 32px; height: 32px; font-size: 15px; }
  #lpBody { overflow-x: auto; }
  .lp-table th, .lp-table td { padding: 10px 8px; white-space: nowrap; }

  /* Windows and bars */
  dialog { padding: 16px; width: 96vw; max-height: 90vh; }
  #modalBody { overflow-x: auto; }
  .welcome h1 { font-size: 28px; }
  .summary .hero { font-size: 52px; }
  .cells.three { grid-template-columns: repeat(2, 1fr); }
  .nick-form label { width: 100%; }
  #toast { left: 10px; right: 10px; transform: none; align-items: center; }
  #favBar { padding: 6px 10px; }
  .doc { padding: 18px 14px 60px; }
  .doc h1 { font-size: 24px; }
}
@media (max-width: 720px) {
  .brand span { white-space: nowrap; }
  .brand { gap: 6px; letter-spacing: .03em; }
  .brand svg { width: 18px; height: 18px; flex: none; }
  .stat .lbl { white-space: nowrap; }
  .pc-ca { font-size: 10px; white-space: nowrap; }
  #meChip span { display: none; }
}
@media (max-width: 720px) {
  .brand { font-size: 14px; }
  .beta-tag { font-size: 9px; padding: 2px 4px; }
}

.guest-note { font-size: 13px; color: #cfcdc4; background: rgba(242, 231, 194, .07); border: 1px solid rgba(242, 231, 194, .25); border-radius: 8px; padding: 9px 11px; margin-bottom: 14px; line-height: 1.5; }
.guest-note .textlink, .hint .textlink, .lp-me .textlink { color: var(--paper); text-decoration: underline; font-size: inherit; }

/* Medium widths (small laptops, split screens): the header keeps its words on one line each and wraps as a whole. */
.brand span, .stat .lbl, .stat .val, .top nav .link, #auth .btn { white-space: nowrap; }
@media (min-width: 721px) and (max-width: 1200px) {
  .top { flex-wrap: wrap; gap: 10px 18px; }
  .searchbox { order: 5; flex-basis: 100%; max-width: none; }
}
