.topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 14px; border-bottom: 1px solid var(--border);
  background: rgba(10,10,10,0.88); position: fixed; top: 0; left: 0; right: 0; z-index: 200;
}
.logo { display: flex; align-items: center; gap: 9px; color: var(--text); white-space: nowrap; text-decoration: none; }
.logo img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; flex-shrink: 0; border: 1px solid rgba(255,255,255,.1); }
.logo-text { font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 700; letter-spacing: -0.5px; background: linear-gradient(135deg, #e0e0e0 0%, #888888 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
/* Remove number input spinners */
input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
input[type=number]{-moz-appearance:textfield}
/* Token icon fallback */
.row-img-fb{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800;color:#fff;background:linear-gradient(135deg,var(--pink),var(--purple,#AAFF00));border-radius:50%}
.top-search { position: relative; flex: 0 0 275px; }
.top-search input {
  width: 100%; box-sizing: border-box; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); font-size: 12px; padding: 6px 10px 6px 30px; outline: none; transition: border-color .2s;
}
.top-search input:focus { border-color: var(--border2); }
.top-search input::placeholder { color: var(--text-faint); }
.top-search-ico { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }

/* Quick Buy */
.quickbuy-wrap { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0 10px; margin-left: 16px; height: 32px; cursor: pointer; transition: border-color .15s; }
.quickbuy-wrap:hover { border-color: var(--border2); }
.quickbuy-label { font-size: 11px; color: var(--text-dim); font-weight: 600; white-space: nowrap; }
.quickbuy-input { width: 60px; background: none; border: none; color: var(--text); font-family: var(--font-mono); font-size: 13px; font-weight: 600; outline: none; }
.quickbuy-input::placeholder { color: var(--text-faint); }
.quickbuy-suffix { font-size: 10px; color: var(--text-faint); font-weight: 600; }
.preset-btns { display: flex; gap: 5px; }
.preset-btn {
  padding: 0 12px; height: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  font-size: 11px; font-weight: 700; color: var(--text-dim); transition: all .15s;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.preset-btn:hover { border-color: var(--border2); color: var(--text); background: var(--surface2); }
.preset-btn.active { border-color: rgba(0,196,140,.6); color: #00c48c; background: rgba(0,196,140,.08); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 7px; padding-right: 4px; flex-shrink: 0; min-width: 0; }
/* Gold icons throughout topbar-right */
.topbar-right button svg, .topbar-right a svg { stroke: #f0b429; }
.topbar-right button svg[fill]:not([fill='none']) { fill: #f0b429; stroke: none; }
.pls-pill { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); background: var(--surface); border: 1px solid var(--surface); border-radius: var(--r-sm); padding: 4px 9px; white-space: nowrap; }
.chain-pill { display: flex; align-items: center; gap: 5px; background: var(--surface); border: 1px solid var(--surface); border-radius: var(--r-sm); padding: 4px 9px; font-size: 11px; font-weight: 600; color: var(--text-dim); }
.chain-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); flex-shrink:0; }
.wallet-btn { background: #AAFF00; border: none; border-radius: var(--r-sm); color: #000; font-size: 12px; font-weight: 700; padding: 6px 14px; transition: opacity .2s; white-space: nowrap; flex-shrink: 0; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.wallet-btn:hover { opacity: .85; }
.wallet-btn.connected { background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); font-family: var(--font-mono); font-size: 11px; font-weight: 500; max-width: 140px; }

/* ══ SUB TABS ══════════════════════════════════════════════════════════ */
.subtabs {
  height: var(--subtabs-h); display: flex; align-items: center; gap: 2px;
  padding: 0 14px; border-bottom: 1px solid var(--border);
  background: rgba(10,10,10,0.86); position: fixed; top: var(--topbar-h); left: 0; right: 0; z-index: 199;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}
.subtabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}
.stab {
  padding: 6px 13px; border-radius: var(--r-sm); border: none; background: none;
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.45); transition: all .15s;
  height: 30px; display: flex; align-items: center; white-space: nowrap; flex-shrink: 0;
  outline: none; -webkit-tap-highlight-color: transparent;
}
.stab:hover { color: #d0d0d0; background: var(--surface); }
.stab.active { color: #e0e0e0; background: var(--surface2); }
.stab-sep { width: 1px; height: 16px; background: var(--border); margin: 0 4px; }
.tf-btns { display: flex; gap: 2px; }
.tf-btn { padding: 0 9px; border-radius: 4px; border: none; background: none; font-size: 12px; font-weight: 600; color: rgba(240,180,41,0.55); transition: all .15s; height: 30px; display: flex; align-items: center; }
.tf-btn:hover { color: var(--gold); background: var(--surface); }
.tf-btn.active { color: var(--gold); background: var(--surface2); }
.subtabs-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.filter-btn { display: flex; align-items: center; gap: 5px; padding: 5px 11px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 11px; font-weight: 600; color: var(--text-dim); transition: all .15s; }
.filter-btn:hover { border-color: var(--border2); color: var(--text); }

/* ══ LAYOUT ════════════════════════════════════════════════════════════ */
.main-wrap {
  position: fixed;
  top: calc(var(--topbar-h) + var(--subtabs-h));
  left: var(--sidebar-w); right: 0;
  bottom: calc(var(--statusbar-h) + var(--ticker-h));
  display: flex;
  overflow: hidden;
  transition: left .25s ease;
}

/* ══ LEFT SIDEBAR ══════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: calc(var(--topbar-h) + var(--subtabs-h));
  left: 0; bottom: calc(var(--statusbar-h) + var(--ticker-h));
  width: var(--sidebar-w);
  background: rgba(10,10,10,0.90);
  border-right: 1px solid rgba(255,255,255,0.07);
  z-index: 198;
  display: flex;
  flex-direction: row;
}
.sidebar-rail {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 2px;
}
.sidebar-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
}
/* Gold icons for special sidebar tools */
#siScanner svg, #siWalletTracker svg, #siPgmaps svg {
  stroke: #f0b429;
}
.sidebar-icon {
  width: 52px; height: 38px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
  background: none;
  border: none;
  cursor: pointer;
  transition: all .15s;
  flex-direction: column;
  gap: 3px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .02em;
}
.sidebar-icon:hover { background: var(--surface); color: var(--text-dim); }
.sidebar-icon.active { background: var(--surface2); color: var(--pink); }
.sidebar-panel {
  position: absolute;
  left: var(--sidebar-w);
  top: 0; bottom: 0;
  width: var(--sidebar-panel-w);
  background: rgba(10,10,10,0.90);
  border-right: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(calc(-100% - var(--sidebar-w)));
  opacity: 0;
  pointer-events: none;
  transition: transform .25s ease, opacity .2s ease;
}
.sidebar-panel.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: all;
}
.sidebar-panel-header {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 7px;
  flex-shrink: 0;
}
.sidebar-panel-title { font-size: 12px; font-weight: 700; color: var(--text); }
.sidebar-panel-title a { color: var(--text); text-decoration: none; }
.sidebar-panel-title a:hover { color: var(--pink); }
.sidebar-panel-close {
  margin-left: auto;
  background: none; border: none;
  color: var(--text-faint); cursor: pointer;
  display: flex; align-items: center;
  font-size: 14px; padding: 2px 4px; border-radius: 4px;
  transition: color .15s;
}
.sidebar-panel-close:hover { color: var(--text); }
.sidebar-panel-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.scan-row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.scan-row span:first-child { color: var(--text-faint); }
.scan-row span:last-child { font-family: var(--font-mono); color: var(--text-dim); }

/* ══ DISCOVERY VIEW ════════════════════════════════════════════════════ */
#discoveryView { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ═══ TOKEN LIST TABLE — 8-column grid ════════════════════════════════════
   TOKEN | PRICE | CHART | CHANGES | MCAP | LIQ | VOL | ACTION
   Fixed px for first 4 cols, 1fr each for numeric so they fill the width.
   No dead zones. ======================================================= */

/* Table header — MUST match .token-row grid exactly */
.tbl-head {
  display: grid;
  grid-template-columns: minmax(175px,1fr) 120px 175px 110px 76px 108px 102px 108px 42px 78px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; background: var(--bg);
}
.tbl-head span { font-size: 10px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; transition: color .15s; }
.tbl-head span:hover { color: var(--text-dim); }
.tbl-head span:nth-child(n+5) { justify-content: flex-end; }

/* Token rows */
.token-list { flex: 1; overflow-y: auto; }
.token-list::-webkit-scrollbar { width: 3px; }
.token-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

.token-row {
  display: grid;
  grid-template-columns: minmax(175px,1fr) 120px 175px 110px 76px 108px 102px 108px 42px 78px;
  align-items: center;
  padding: 9px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background .1s;
  border-left: 3px solid transparent;
}
.token-row:hover {
  background: rgba(255,255,255,0.032);
  border-left-color: var(--pink);
}
.token-row:hover .row-buy-btn { opacity: 1; border-color: rgba(0,196,140,.8); color: #00e8a8; }
.token-row.pinged { animation: rowPing .5s ease; }
@keyframes rowPing { 0%{background:rgba(0,196,140,.08)} 100%{background:transparent} }

/* ── Col 1: TOKEN — logo + name + pills ─────────────────────────────── */
.row-pair { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; }
.row-img {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg,#1e1e2e,#2a2a3e);
  flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
}
.row-img img { width:100%; height:100%; object-fit:cover; }
.row-img-dex { position:absolute; bottom:-1px; right:-1px; width:14px; height:14px; border-radius:50%; border:1.5px solid #0a0a0a; }
.row-meta { min-width:0; flex:1; overflow:hidden; }
/* Line 1: symbol + badges + copy */
.row-name { font-size:14px; font-weight:700; color:#f0f0f0; display:flex; align-items:center; gap:5px; flex-wrap:nowrap; overflow:hidden; white-space:nowrap; }
.row-name-text { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100px; }
/* Line 2: age + dex pills */
.row-sub { display:flex; align-items:center; gap:5px; margin-top:3px; flex-wrap:nowrap; overflow:hidden; }
.row-age { font-size:10px; font-weight:600; color:rgba(255,255,255,0.3); font-family:var(--font-mono); background:rgba(255,255,255,0.06); padding:1px 5px; border-radius:3px; flex-shrink:0; }
.row-dex-tag { font-size:10px; font-weight:600; color:rgba(255,255,255,0.25); background:rgba(255,255,255,0.06); padding:1px 5px; border-radius:3px; flex-shrink:0; }
.row-ticker { color:rgba(255,255,255,0.25); font-weight:500; font-size:10px; flex-shrink:0; }
/* legacy inline socials (hidden — socials now in dedicated column) */
.row-socials { display:none; }
.row-social  { display:none; }

/* ── Col 2: PRICE — price + change% ───────────────────────────── */
.row-price-col { display:flex; flex-direction:column; justify-content:center; gap:2px; }
.row-price-inline { font-family:var(--font-mono); font-size:13px; font-weight:700; color:#f0f0f0; white-space:nowrap; }

/* ── Col 3: CHART — sparkline + B/S bar ────────────────────────── */
.row-spark { display:flex; flex-direction:column; align-items:stretch; justify-content:center; gap:3px; overflow:hidden; padding:0 4px; }
.row-spark canvas { display:block; width:100%; height:36px; }
.row-bs-bar { display:flex; height:3px; border-radius:2px; overflow:hidden; background:rgba(255,255,255,.06); }
.row-bs-buy  { background:#00c48c; flex-shrink:0; }
.row-bs-sell { background:#ff4545; flex-shrink:0; }

/* ── Col 4: CHANGES — 5m / 1h / 6h stacked ──────────────────────── */
.row-changes { display:flex; flex-direction:column; justify-content:center; gap:3px; padding:0 4px; }
.row-tf-inline { display:flex; align-items:center; gap:6px; }
.row-tf-lbl { font-size:10px; font-weight:600; color:rgba(255,255,255,.22); text-transform:uppercase; letter-spacing:.04em; flex-shrink:0; width:18px; }
.row-changes .row-chg { font-size:12px; font-weight:700; margin:0; }

/* ── Col 5: SOCIALS ───────────────────────────────────────── */
.row-socials-col { display:flex; align-items:center; justify-content:center; gap:6px; }
.row-social-lg { color:rgba(255,255,255,.28); display:flex; transition:color .15s, transform .15s; }
.row-social-lg:hover { color:rgba(255,255,255,.75); transform:scale(1.15); }

/* ── Cols 6-8: MCAP / LIQ / VOL — fixed width, right-aligned ──────── */
.row-mc, .row-liq, .row-vol { display:flex; align-items:center; justify-content:flex-end; padding-right:6px; }
.row-val { font-family:var(--font-mono); font-size:13px; font-weight:700; color:#d4d4d4; white-space:nowrap; }

/* shared change colors */
.row-chg { font-size:12px; font-weight:700; margin-top:1px; }
.row-chg.up   { color:#00e09a; }
.row-chg.dn   { color:#ff5555; }
.row-chg.flat { color:rgba(255,255,255,0.3); }
.row-txns-b { color:#00e09a; }
.row-txns-s { color:#ff5555; }

/* ── Col 8: WATCHLIST ────────────────────────────────────────── */
.row-watchlist { display:flex; align-items:center; justify-content:center; }
.row-star-btn {
  color: rgba(255,255,255,.18);
  transition: color .15s, transform .15s;
  flex-shrink: 0; padding: 4px;
  border-radius: 4px;
}
.row-star-btn:hover { color: #f5c518; transform: scale(1.2); }
.row-star-btn.starred { color: #f5c518; }

/* ── Col 9: BUY ─────────────────────────────────────────────────── */
.row-action { display:flex; align-items:center; justify-content:flex-end; }
.row-buy-btn {
  background: rgba(0,196,140,.12);
  border: 1px solid rgba(0,196,140,.35); border-radius: 5px; color: #00c48c;
  font-size: 11px; font-weight: 800; padding: 5px 14px; opacity: 0.7;
  transition: opacity .15s, border-color .15s, color .15s, transform .1s;
  white-space:nowrap; letter-spacing:.02em; flex-shrink:0;
}
.row-buy-btn:hover { transform: scale(1.04); }
.qbuy-flash { opacity:1 !important; background:rgba(0,196,140,.3) !important; }

.list-loading { padding: 60px 40px; text-align:center; color:rgba(255,255,255,0.25); font-size:13px; }

/* legacy B/S classes kept for compatibility */
.row-buysell { display:none; }
.row-txns    { display:none; }

.list-loading { padding: 60px 40px; text-align:center; color:rgba(255,255,255,0.25); font-size:13px; }

/* Table header */
/* tbl-head defined above */

/* ══ DEX SCREENER TAB ══════════════════════════════════════════════════ */
.ds-featured { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; padding:12px 14px; border-bottom:1px solid var(--border); flex-shrink:0; }
.ds-card {
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:12px;
  cursor:pointer; transition:all .15s;
}
.ds-card:hover { border-color:var(--border2); background:var(--surface2); }
.ds-card-head { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.ds-card-img { width:32px; height:32px; border-radius:50%; background:var(--surface2); flex-shrink:0; overflow:hidden; display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:800; color:var(--text-faint); }
.ds-card-img img { width:100%; height:100%; object-fit:cover; }
.ds-card-name { font-size:13px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ds-card-sym { font-size:11px; color:var(--text-faint); }
.ds-card-price { font-family:var(--font-mono); font-size:14px; font-weight:700; }
.ds-card-stats { display:flex; gap:8px; margin-top:6px; }
.ds-card-stat { font-size:11px; color:var(--text-faint); }
.ds-card-stat strong { color:var(--text-dim); }

/* ══ PUMP.TIRES TAB ════════════════════════════════════════════════════ */
.bowpump-view { flex:1; display:grid; grid-template-columns:1fr 1fr 1fr; gap:0; overflow:hidden; min-height:0; height:100%; }
.pt-col { display:flex; flex-direction:column; overflow:hidden; min-height:0; }
.pt-col:not(:last-child) { border-right:1px solid var(--border); }
.pt-col-header { padding:10px 14px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:8px; flex-shrink:0; }
.pt-col-title { font-size:12px; font-weight:700; color:var(--text); text-transform:uppercase; letter-spacing:.05em; }
.pt-live-dot { width:7px; height:7px; border-radius:50%; background:var(--green); box-shadow:0 0 6px var(--green); animation:pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.pt-count { font-size:11px; color:var(--text-faint); }
.pt-list { flex:1; overflow-y:auto; }
.pt-list::-webkit-scrollbar { width:3px; }
.pt-list::-webkit-scrollbar-thumb { background:rgba(255,255,255,.08); }
/* bowPUMP.fun tab bar */
.pt-tab-btn { background:none; border:none; border-bottom:2px solid transparent; padding:9px 14px; font-family:inherit; font-size:11px; font-weight:600; color:var(--text-faint); cursor:pointer; display:flex; align-items:center; white-space:nowrap; transition:all .15s; margin-bottom:-1px; }
.pt-tab-btn:hover { color:var(--text); }
.pt-tab-btn.active { color:var(--text); border-bottom-color:var(--pink); }
.pt-panel { display:none; flex:1; flex-direction:column; overflow:hidden; min-height:0; }
.pt-panel.active { display:flex; }
.pt-panel-label { font-size:10px; color:var(--text-faint); padding:6px 14px; border-bottom:1px solid var(--border); flex-shrink:0; font-weight:500; }

/* bowPUMP.fun launch card */
.pt-card {
  display:flex; align-items:flex-start; gap:12px; padding:12px 14px;
  border-bottom:1px solid rgba(255,255,255,.04); cursor:pointer; transition:background .12s;
  border-left:3px solid transparent;
}
.pt-card:hover { background:rgba(255,255,255,.04); border-left-color:var(--pink); }
.pt-card-img { width:44px; height:44px; border-radius:50%; background:var(--surface2); flex-shrink:0; overflow:hidden; position:relative; border:1px solid rgba(255,255,255,.08); }
.pt-card-img img { width:100%; height:100%; object-fit:cover; }
.pt-card-info { flex:1; min-width:0; }
.pt-card-name { font-size:14px; font-weight:700; color:#f0f0f0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pt-card-sub { display:flex; align-items:center; gap:8px; margin-top:3px; font-size:11px; color:rgba(255,255,255,.35); }
.pt-card-right { text-align:right; flex-shrink:0; }
.pt-card-mc { font-family:var(--font-mono); font-size:14px; font-weight:700; color:#e8e8e8; }
.pt-card-chg { font-size:12px; font-weight:700; margin-top:3px; }

/* bowPUMP.fun activity (trade feed) */
.pt-trade {
  display:flex; align-items:center; gap:10px; padding:8px 14px;
  border-bottom:1px solid rgba(255,255,255,.03);
}
.pt-trade-type { width:34px; height:34px; border-radius:var(--r-sm); display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:800; flex-shrink:0; }
.pt-trade-type.buy { background:rgba(0,196,140,.12); color:var(--green); }
.pt-trade-type.sell { background:rgba(255,77,77,.1); color:var(--red); }
.pt-trade-info { flex:1; min-width:0; }
.pt-trade-name { font-size:12px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pt-trade-wallet { font-size:10px; color:var(--text-faint); font-family:var(--font-mono); margin-top:2px; }
.pt-trade-right { text-align:right; flex-shrink:0; }
.pt-trade-usd { font-family:var(--font-mono); font-size:13px; font-weight:700; }
.pt-trade-time { font-size:10px; color:var(--text-faint); margin-top:2px; }

/* ══ TOKEN VIEW ════════════════════════════════════════════════════════ */
#tokenView { flex:1; display:none; flex-direction:column; overflow:hidden; -webkit-overflow-scrolling: touch; }

/* Token view header */
.tv-header {
  display:flex; align-items:center; gap:12px; padding:8px 14px;
  border-bottom:1px solid var(--border); flex-shrink:0; min-height:58px; background:var(--bg);
}
.tv-back { display:flex; align-items:center; gap:5px; background:var(--surface); border:1px solid var(--border); border-radius:var(--r-sm); padding:5px 11px; font-size:12px; font-weight:600; color:var(--text-dim); transition:all .15s; }
.tv-back:hover { background:var(--surface2); color:var(--text); }
.tv-token-img { width:36px; height:36px; border-radius:50%; background:var(--surface2); flex-shrink:0; overflow:hidden; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:800; color:var(--text-faint); }
.tv-token-img img { width:100%; height:100%; object-fit:cover; }
.tv-token-info { flex:1; min-width:0; }
.tv-token-name { font-size:15px; font-weight:800; letter-spacing:-.3px; display:flex; align-items:center; gap:7px; }
.tv-token-sym { color:var(--text-dim); font-weight:500; font-size:13px; }
.tv-token-price-row { display:flex; align-items:center; gap:7px; margin-top:2px; }
.tv-price { font-family:var(--font-mono); font-size:19px; font-weight:700; }
.tv-chg { font-size:11px; font-weight:700; padding:2px 7px; border-radius:4px; }
.tv-chg.up { background:rgba(0,196,140,.12); color:var(--green); }
.tv-chg.dn { background:rgba(255,77,77,.12); color:var(--red); }
.tv-stats { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.tv-stat { }
.tv-stat-lbl { font-size:10px; color:var(--text-faint); text-transform:uppercase; letter-spacing:.05em; }
.tv-stat-val { font-family:var(--font-mono); font-size:12px; color:var(--text); font-weight:500; margin-top:1px; }
.tv-links { display:flex; align-items:center; gap:5px; flex-shrink:0; }
.tv-link { display:flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:var(--r-sm); background:var(--surface); border:1px solid var(--border); color:var(--text-faint); transition:all .15s; }
.tv-link:hover { background:var(--surface2); color:var(--text); }
.tv-dex-badge { display:flex; align-items:center; gap:5px; background:var(--surface); border:1px solid var(--border); border-radius:var(--r-sm); padding:4px 8px; font-size:11px; font-weight:600; color:var(--text-dim); flex-shrink:0; }

/* Pair switcher dropdown */
.pair-switcher { position:relative; display:inline-flex; align-items:center; flex-shrink:0; }
.pair-switcher-btn {
  display:flex; align-items:center; gap:4px;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r-sm);
  padding:3px 8px; font-size:11px; font-weight:600; color:var(--text-dim);
  cursor:pointer; transition:all .15s; white-space:nowrap; font-family:inherit;
}
.pair-switcher-btn:hover { background:var(--surface2); border-color:var(--border2); color:var(--text); }
.pair-switcher-btn svg { flex-shrink:0; transition:transform .15s; }
.pair-switcher-btn.open svg { transform:rotate(180deg); }
.pair-switcher-menu {
  position:absolute; top:calc(100% + 5px); left:0; z-index:9999;
  background:rgba(15,15,15,0.97); border:1px solid var(--border2);
  border-radius:var(--r); min-width:240px; max-height:280px; overflow-y:auto;
  box-shadow:0 8px 32px rgba(0,0,0,.6); backdrop-filter:blur(12px);
  display:none;
}
.pair-switcher-menu.open { display:block; }
.pair-switcher-item {
  display:flex; align-items:center; justify-content:space-between;
  padding:8px 12px; cursor:pointer; transition:background .1s; gap:10px;
  border-bottom:1px solid var(--border);
}
.pair-switcher-item:last-child { border-bottom:none; }
.pair-switcher-item:hover { background:var(--surface2); }
.pair-switcher-item.active { background:var(--surface); }
.pair-switcher-item-left { display:flex; flex-direction:column; gap:2px; min-width:0; }
.pair-switcher-item-pair { font-size:12px; font-weight:700; color:var(--text); }
.pair-switcher-item.active .pair-switcher-item-pair { color:var(--pink); }
.pair-switcher-item-dex { font-size:10px; color:var(--text-faint); }
.pair-switcher-item-liq { font-family:var(--font-mono); font-size:11px; font-weight:600; color:var(--text-dim); white-space:nowrap; flex-shrink:0; }

/* Token view body: chart + trade side by side */
.tv-body { flex:1; display:flex; min-height:0; overflow:hidden; }
.tv-chart-col { flex:1; display:flex; flex-direction:column; overflow:hidden; border-right:1px solid var(--border); min-height:0; }
.tv-chart-area { flex:1; display:flex; flex-direction:column; overflow:hidden; min-height:0; }
.tv-chart-toolbar { display:flex; align-items:center; gap:3px; padding:6px 12px; border-bottom:1px solid var(--border); flex-shrink:0; }

/* ══ MOBILE ICON BAR ══════════════════════════════════════════════════ */
#mobileIconBar { display: none; }
.mobile-icon-btn {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  color: var(--text-dim);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.mobile-icon-btn:hover, .mobile-icon-btn:focus, .mobile-icon-btn:focus-visible {
  background: var(--surface2);
  border-color: rgba(255,255,255,.15);
  color: var(--text);
  outline: none;
}

/* ══ MOBILE STYLES ════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* On mobile: hide desktop-only elements */
  .topbar-right, .quickbuy-wrap, .preset-btns, .top-search,
  .logo-text, #walletBtnDesktop {
    display: none;
  }
  
  #mobileIconBar {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    flex: 1;
    gap: 0;
    padding: 0 4px;
  }
  #mobileIconBar .mobile-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  #mobileIconBar .wallet-btn {
    font-size: 10px;
    padding: 5px 10px;
    flex-shrink: 0;
  }

  /* Logo image styled as same square button on mobile */
  .logo img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.08);
  }
  
  .wallet-btn {
    padding: 5px 10px;
    font-size: 11px;
  }
  .wallet-btn.connected {
    background: var(--surface);
    border: 1px solid rgba(0,196,140,.4);
    color: var(--green);
  }
}

/* ── Pair switcher menu — mobile fix ───────────────────────────────────────── */
@media (max-width: 767px) {
  .pair-switcher-menu.open {
    position: fixed;
    top: auto;
    left: 10px;
    right: 10px;
    /* Position just below the token header bar (~tvHeader height) */
    top: calc(var(--topbar-h) + 68px);
    min-width: unset;
    width: auto;
    max-height: 260px;
    z-index: 9999;
  }
}

/* ══ FEAR & GREED WIDGET ═══════════════════════════════════════════════ */
/* Fear & Greed Widget — proportionally sized for sidebar */
.fg-widget {
  padding: 8px 6px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.fg-title {
  font-size: 9px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  text-align: center;
}
.fg-score {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}
.fg-label {
  font-size: 10px;
  text-align: center;
  margin-bottom: 6px;
  color: var(--text-dim);
}
.fg-votes {
  display: flex;
  gap: 3px;
}
.fg-btn {
  flex: 1;
  padding: 6px 4px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-faint);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.15s;
}
.fg-btn:hover {
  background: var(--surface2);
  color: var(--text-dim);
}
.fg-bear {
  border-color: rgba(255,69,69,0.3);
}
.fg-bear:hover {
  border-color: rgba(255,69,69,0.5);
  color: #ff6b6b;
}
.fg-bull {
  border-color: rgba(0,196,140,0.3);
}
.fg-bull:hover {
  border-color: rgba(0,196,140,0.5);
  color: #00c48c;
}
.fg-count {
  font-size: 9px;
  color: var(--text-faint);
  text-align: center;
  margin-top: 3px;
}

/* ══ CHAT PANEL ════════════════════════════════════════════════════════ */
.chat-panel {
  width: 280px;
  height: 100%;
  background: #0a0a0a;
  border-left: 1px solid #222222;
  display: flex;
  flex-direction: column;
}
.chat-panel.hidden {
  display: none;
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #1e1e1e;
}
.chat-header span {
  font-size: 13px;
  font-weight: 700;
  color: #eee;
}
.chat-header button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 16px;
  line-height: 1;
}
.chat-header button:hover {
  color: rgba(255, 255, 255, 0.6);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.chat-msg {
  margin-bottom: 8px;
  font-size: 12px;
}
.chat-msg .chat-author {
  color: #7766cc;
  font-weight: 600;
}
.chat-msg .chat-text {
  color: #ccccee;
}
.chat-msg .chat-time {
  color: #444466;
  font-size: 10px;
  margin-left: 4px;
}
.chat-input-row {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-top: 1px solid #1e1e1e;
}
.chat-input-row input {
  flex: 1;
  background: #111111;
  border: 1px solid #333333;
  border-radius: 4px;
  color: #eee;
  padding: 6px;
  font-size: 12px;
  outline: none;
}
.chat-input-row button {
  background: #5522bb;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.chat-input-row button:hover {
  background: #6633cc;
}
.chat-toggle-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.chat-toggle-btn:hover {
  color: var(--text);
  border-color: var(--border2);
}

/* ══ USER PROFILE PANEL ════════════════════════════════════════════════ */
.profile-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 320px;
  background: #0a0a0a;
  border-left: 1px solid #222222;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s;
}
.profile-panel.open {
  transform: translateX(0);
}
.profile-panel.hidden {
  display: none;
}
.profile-header {
  padding: 16px;
  border-bottom: 1px solid #1e1e1e;
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #222222;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7766cc;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.profile-info {
  flex: 1;
  min-width: 0;
}
.profile-username {
  font-weight: 600;
  color: #eee;
  font-size: 14px;
}
.profile-address {
  font-size: 11px;
  color: #555588;
  font-family: monospace;
}
.profile-joined {
  font-size: 10px;
  color: #444466;
  margin-top: 2px;
}
.profile-tabs {
  display: flex;
  border-bottom: 1px solid #1e1e1e;
}
.ptab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  color: rgba(255,255,255,.3);
  cursor: pointer;
  font-size: 12px;
  border-bottom: 2px solid transparent;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.ptab:focus { outline: none; }
.ptab:focus-visible { outline: none; }
.ptab.active {
  color: #c0c0c0;
  border-bottom-color: rgba(255,255,255,.25);
}
#profile-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.profile-token-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 12px;
}
.profile-token-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ══ USER SEARCH ═══════════════════════════════════════════════════════ */
.user-search-wrapper {
  position: relative;
}
.user-search-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.user-search-btn:hover {
  color: var(--text);
  border-color: var(--border2);
}
.user-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #161616;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  min-width: 280px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  z-index: 10000;
}
.user-search-input-wrap {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.user-search-input-wrap input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
  font-family: inherit;
}
.user-search-input-wrap input:focus {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
}
.user-search-hint {
  padding: 8px 12px 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.user-search-results {
  max-height: 300px;
  overflow-y: auto;
}
.user-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.user-search-result:hover {
  background: rgba(255, 255, 255, 0.05);
}
.user-search-result:last-child {
  border-bottom: none;
}
.user-search-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}


/* ══════════════════════════════════════════════════════════
   MOBILE OPTIMISATION  (max-width: 768px only)
   Desktop layout is completely untouched above this line.
   ══════════════════════════════════════════════════════════ */

/* Desktop-only elements — hidden on mobile */
.mobile-tab-selector { display: none; }
.mobile-tab-menu     { display: none; }
.mobile-sort-bar     { display: none; }
#mobileTabBackdrop   { display: none; }
.mobile-rocket-btn   { display: none; }

@media (max-width: 768px) {

  /* ── 1. HIDE desktop tab bar, show dropdown ─────────── */
  body .subtabs { display: none !important; }

  .mobile-tab-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    background: #111111;
    border-bottom: 1px solid #1e1e1e;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #e0e0ee;
    -webkit-tap-highlight-color: transparent;
  }

  /* Bottom sheet */
  .mobile-tab-menu {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #111111;
    border-top: 1px solid #1e1e1e;
    border-radius: 18px 18px 0 0;
    z-index: 1000;
    padding: 0 0 36px;
    box-shadow: 0 -12px 48px rgba(0,0,0,.75);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    transform: translateY(100%);
  }
  .mobile-tab-menu.open {
    display: block;
    transform: translateY(0);
  }
  .mob-tab-handle {
    width: 44px; height: 4px;
    background: rgba(255,255,255,.2);
    border-radius: 2px;
    margin: 12px auto 6px;
  }
  /* Tab menu buttons — remove iOS default styling */
  .mobile-tab-menu button {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    padding: 15px 20px;
    background: #111111;
    border: none;
    border-bottom: 1px solid #1e1e1e;
    color: #e0e0ee;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-tab-menu button:last-child { border-bottom: none; }
  .mobile-tab-menu button:active { background: #1e1e1e; }

  #mobileTabBackdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 999;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }
  #mobileTabBackdrop.visible { display: block !important; }

  /* ── 2. TOKEN ROWS → clean cards ───────────────────── */
  body .tbl-head { display: none !important; }

  .token-list {
    padding: 6px 8px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  /* Card */
  .token-row {
    display: flex !important;
    align-items: center !important;
    padding: 10px 12px !important;
    background: #111111 !important;
    border: 1px solid #1e1e1e !important;
    border-radius: 10px !important;
    margin: 0 !important;
    gap: 10px !important;
    cursor: pointer !important;
    min-height: 52px !important;
  }

  /* Logo + info */
  .token-row .row-pair {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 !important;
    min-width: 0 !important;
  }
  .token-row .row-img {
    width: 36px !important;
    height: 36px !important;
    flex-shrink: 0 !important;
    border-radius: 50% !important;
    overflow: hidden !important;
  }
  .token-row .row-img img {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
  }
  .token-row .row-img-fb {
    width: 36px !important;
    height: 36px !important;
    background: #1e1e1e !important;
    border-radius: 50% !important;
    /* NO display:flex here — inline style=display:none controls visibility */
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #9977cc !important;
    flex-shrink: 0 !important;
  }
  .token-row .row-meta {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  .token-row .row-name {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    overflow: hidden !important;
  }
  .token-row .row-name-text {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #e0e0ee !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 90px !important;
  }
  .token-row .row-sub {
    font-size: 10px !important;
    color: #555577 !important;
    margin-top: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .token-row .copy-ca-btn { display: none !important; }
  .token-row .badge-whale-slot { display: none !important; }

  /* Price col */
  .token-row .row-price-col {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 2px !important;
    flex-shrink: 0 !important;
  }
  .token-row .row-price-inline {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #e0e0ee !important;
    white-space: nowrap !important;
  }
  .token-row .row-chg { font-size: 11px !important; font-weight: 600 !important; }
  .token-row .row-chg.up { color: #22c55e !important; }
  .token-row .row-chg.dn { color: #ef4444 !important; }

  /* Buy button */
  .token-row .row-action {
    display: flex !important;
    flex-shrink: 0 !important;
  }
  .token-row .row-buy-btn {
    padding: 7px 14px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    min-width: 48px !important;
    min-height: 36px !important;
    background: #111111 !important;
    border: 1px solid #22c55e !important;
    color: #22c55e !important;
    border-radius: 6px !important;
    cursor: pointer !important;
  }

  /* HIDE desktop columns */
  .token-row .row-spark,
  .token-row .row-changes,
  .token-row .row-socials-col,
  .token-row .row-mc,
  .token-row .row-liq,
  .token-row .row-vol,
  .token-row .row-watchlist { display: none !important; }

  /* ── 3. SORT BAR — rectangular with slight radius, not pills ── */
  .mobile-sort-bar {
    display: flex !important;
    gap: 6px;
    padding: 8px 10px;
    overflow-x: auto;
    border-bottom: 1px solid #1e1e1e;
    scrollbar-width: none;
    background: #0d0d0d;
    flex-shrink: 0;
  }
  .mobile-sort-bar::-webkit-scrollbar { display: none; }
  .msort-btn {
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
    padding: 6px 14px;
    background: #111111;
    border: 1px solid #1e1e1e;
    border-radius: 6px;
    color: #888899;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
  }
  .msort-btn.active {
    background: #1a0d33;
    border-color: #6633cc;
    color: #cc99ff;
  }

  /* ── 4. CHAT — only shows when active on token page, never on discovery ── */
  /* Hidden by default — .hidden class controls visibility, nothing else */
  #chat-panel.hidden, .chat-panel.hidden {
    display: none !important;
  }
  /* When actively shown (hidden class removed by setMobileTab) */
  #chat-panel:not(.hidden), .chat-panel:not(.hidden) {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    /* top is set dynamically by setMobileTab() to account for tvHeader */
    bottom: 58px !important;    /* above mobile footer */
    width: 100% !important;
    height: auto !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-top: 1px solid #1e1e1e !important;
    z-index: 180 !important;
    background: #0a0a0a !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .chat-panel.hidden { display: none !important; }
  .chat-drag-handle { display: none !important; }

  /* ── 5. ROCKET ICON (mobile header) ─────────────────── */
  .mobile-rocket-btn { display: flex !important; }

}

/* Launch view: stack on mobile */
/* ── Launch tab: mobile tabs ─────────────────────────────────────────── */
.launch-mobile-tabs { display: none; gap: 4px; padding: 6px 10px; background: rgba(10,10,10,0.86); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.launch-mob-tab {
  padding: 6px 14px; background: none; border: none; border-radius: var(--r-sm);
  color: rgba(255,255,255,.45); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all .15s;
  -webkit-tap-highlight-color: transparent; outline: none;
}
.launch-mob-tab:focus, .launch-mob-tab:focus-visible { outline: none; }
.launch-mob-tab.active { color: #e0e0e0; background: var(--surface2); }

@media (max-width: 768px) {
  #launchView:not([style*="display: none"]):not([style*="display:none"]) {
    display: flex !important;
    flex-direction: column !important;
  }
  .launch-mobile-tabs {
    display: flex !important;
    flex-shrink: 0;
    background: #0d0d0d;
    border-bottom: 1px solid #1e1e1e;
  }
  #launchGrid {
    grid-template-columns: 1fr !important;
    flex: 1 !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  /* Hide both columns by default; show via launch-tab-active class */
  #launchFormColumn,
  .launch-launched-col {
    display: none !important;
  }
  #launchFormColumn.launch-tab-active {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow-y: auto !important;
    border-right: none !important;
    padding: 16px 16px calc(16px + 58px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .launch-launched-col.launch-tab-active {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important;
  }
}

/* ── bowPUMP: Live Feed + inner tabs on mobile ─────────────────────── */
.pt-inner-tabs { display: none; gap: 4px; padding: 6px 10px; background: rgba(10,10,10,0.86); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.pt-inner-tab {
  padding: 6px 14px; background: none; border: none; border-radius: var(--r-sm);
  color: rgba(255,255,255,.45); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all .15s;
  -webkit-tap-highlight-color: transparent; outline: none;
}
.pt-inner-tab:focus, .pt-inner-tab:focus-visible { outline: none; }
.pt-inner-tab.active { color: #e0e0e0; background: var(--surface2); }

/* Desktop: 4-col grid (default) */
.pt-desktop-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  height: 100%;
  gap: 0;
}
.pt-col-live { border-right: 1px solid var(--border); }
.pt-col-new  { border-right: 1px solid var(--border); }
.pt-col-bonding { border-right: 1px solid var(--border); }

@media (max-width: 768px) {
  /* Show inner tab bar */
  .pt-inner-tabs {
    display: flex !important;
    flex-shrink: 0;
    background: #0d0d0d;
    border-bottom: 1px solid #1e1e1e;
  }
  /* ptView becomes flex-column */
  #ptView:not([style*="display: none"]):not([style*="display:none"]) {
    display: flex !important;
    flex-direction: column !important;
  }
  /* Desktop layout switches to flex-column */
  .pt-desktop-layout {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  /* Live Feed: top ~40% */
  /* Live feed: hidden by default on mobile — shown only when Live tab active */
  .pt-col-live {
    flex: 1 !important;
    border-right: none !important;
    border-bottom: none !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: none !important;
  }
  .pt-col-live.pt-tab-active {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
  }
  /* Tab content columns: below, fill remaining space */
  .pt-col-new,
  .pt-col-bonding,
  .pt-col-graduated {
    flex: 3 !important;
    border-right: none !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  /* Hide column header labels on mobile (tabs replace them) */
  .pt-col-tab-hdr { display: none !important; }
  /* Hide inactive tab columns on mobile */
  .pt-col-new:not(.pt-tab-active),
  .pt-col-bonding:not(.pt-tab-active),
  .pt-col-graduated:not(.pt-tab-active) {
    display: none !important;
  }
  /* Ensure active tab fills available space */
  .pt-col-new.pt-tab-active,
  .pt-col-bonding.pt-tab-active,
  .pt-col-graduated.pt-tab-active {
    display: flex !important;
    flex-direction: column !important;
  }
  /* pt-list fills tab content area */
  .pt-col-new .pt-list,
  .pt-col-bonding .pt-list,
  .pt-col-graduated .pt-list {
    max-height: none !important;
    height: 100% !important;
  }
}

/* Mobile nav tabs — top quick nav */
.mobile-nav-tabs { display: none; }
@media (max-width: 768px) {
  .mobile-nav-tabs {
    display: flex !important;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid #1e1e1e;
    background: #0a0a0a;
    flex-shrink: 0;
  }
  .mobile-nav-tabs::-webkit-scrollbar { display: none; }
  .mob-nav-tab {
    flex-shrink: 0;
    padding: 6px 12px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 6px;
    color: rgba(255,255,255,.5);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
  }
  .mob-nav-tab:focus { outline: none; }
  .mob-nav-tab:focus-visible { outline: none; }
  .mob-nav-tab.active {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.2);
    color: #fff;
  }
}

/* Mobile token rows: market cap + social links */
@media (max-width: 768px) {

  /* Price col: price on top, mcap below */
  .token-row .row-price-col {
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 1px !important;
  }

  /* Show market cap on mobile — small text under price */
  .token-row .row-mc {
    display: block !important;
    font-size: 10px !important;
    color: #666688 !important;
    white-space: nowrap !important;
    text-align: right !important;
    flex-shrink: 0 !important;
  }
  .token-row .row-mc .row-val {
    font-size: 10px !important;
    color: #666688 !important;
  }

  /* Show social icons on mobile — inline after dex label */
  .token-row .row-socials-col {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex-shrink: 0 !important;
    margin-left: 4px !important;
  }
  /* Inline the socials col next to the sub row using flex order tricks */
  .token-row .row-pair .row-meta .row-sub {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    overflow: hidden !important;
  }
}

/* Mobile-only inline extras in token rows */
.row-mob-socials { display: none; }
.row-mob-mc      { display: none; }
.row-mob-h6      { display: none; }

@media (max-width: 768px) {
  /* Social icons inline next to dex label */
  .row-mob-socials {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin-left: 2px !important;
  }
  .row-mob-socials a { display: inline-flex; align-items: center; }
  .row-mob-socials svg { width: 12px !important; height: 12px !important; }

  /* Market cap below price */
  .row-mob-mc {
    display: block !important;
    font-size: 10px !important;
    color: #555577 !important;
    white-space: nowrap !important;
    text-align: right !important;
    line-height: 1.2 !important;
  }

  /* Hide the original desktop socials/mc columns — already hidden but belt+braces */
  .token-row .row-socials-col { display: none !important; }
  .token-row .row-mc          { display: none !important; }

  /* 6h change below market cap in mobile price col */
  .row-mob-h6 {
    display: block !important;
    font-size: 9px !important;
    color: rgba(255,255,255,.35) !important;
    white-space: nowrap !important;
    text-align: right !important;
    line-height: 1.2 !important;
    margin-top: 1px !important;
  }
}

/* ── Mobile: tab containers + form inputs + token stats ── */
@media (max-width: 768px) {
  /* Show mobile tab bars */
  .launch-mobile-tabs { display: flex !important; }
  .pt-inner-tabs { display: flex !important; }

  /* Launch form: monospace, smaller, white */
  #ptPanel-launch input, #ptPanel-launch textarea,
  #launchFormColumn input, #launchFormColumn textarea {
    font-size: 11px !important;
    font-family: var(--font-mono) !important;
    color: #fff !important;
  }

  /* Token page: wrap header so stats show below on mobile */
  .tv-header { flex-wrap: wrap; min-height: auto; align-items: flex-start; }
  .tv-links { order: 9; }
  .tv-stats {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px 16px !important;
    width: 100% !important;
    padding: 4px 0 2px !important;
    order: 10 !important;
  }
  .tv-stat { display: flex !important; flex-direction: column; }
  /* Only show Vol + Mkt Cap on mobile, hide the rest */
  .tv-stat:nth-child(n+3) { display: none !important; }
  .tv-6h-chg { display: inline !important; }
}

/* ── Launch form: monospace inputs, lighter backgrounds, gold asterisks ── */
#ptPanel-launch input[type="text"],
#ptPanel-launch input[type="url"],
#ptPanel-launch input[type="number"],
#ptPanel-launch textarea,
#launchFormColumn input[type="text"],
#launchFormColumn input[type="url"],
#launchFormColumn input[type="number"],
#launchFormColumn textarea {
  font-family: var(--font-mono) !important;
  background: rgba(255,255,255,.06) !important;
  color: #fff !important;
}
