.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,#7c3aed));border-radius:50%}
.top-search { position: relative; flex: 0 0 220px; }
.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 rgba(104,38,153,.25); border-radius: var(--r-sm); padding: 4px 8px; margin-left: 16px; }
.quickbuy-label { font-size: 10px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; 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: 3px; }
.preset-btn {
  padding: 4px 8px; background: var(--surface); border: 1px solid rgba(104,38,153,.25); border-radius: 4px;
  font-size: 11px; font-weight: 700; color: var(--text-dim); transition: all .15s;
}
.preset-btn:hover { border-color: rgba(104,38,153,.45); color: var(--text); background: var(--surface); }
.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; }
.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: linear-gradient(135deg,#682699,#9B27FF); border: none; border-radius: var(--r-sm); color: #fff; font-size: 12px; font-weight: 700; padding: 6px 14px; transition: opacity .2s; white-space: nowrap; }
.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; }

/* ══ 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;
}
.stab {
  padding: 7px 15px; border-radius: var(--r-sm); border: none; background: none;
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.45); transition: all .15s;
}
.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: 5px 9px; border-radius: 4px; border: none; background: none; font-size: 12px; font-weight: 600; color: var(--text-faint); transition: all .15s; }
.tf-btn:hover { color: var(--text); background: var(--surface); }
.tf-btn.active { color: var(--text); 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: 8px 0;
  gap: 4px;
}
.sidebar-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
  background: none;
  border: none;
  cursor: pointer;
  transition: all .15s;
}
.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; }

/* Table header */
.tbl-head {
/* MUST match .token-row grid exactly */
  display: grid;
  grid-template-columns: minmax(200px,2.5fr) 80px 110px 90px 90px 110px 86px;
  padding: 6px 14px;
  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:last-child { 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(200px,2.5fr) 80px 110px 90px 90px 110px 86px;
  align-items: center;
  padding: 12px 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.05);
  border-left-color: var(--pink);
}
.token-row:hover .row-buy-btn { opacity: 1; }
.token-row.pinged { animation: rowPing .5s ease; }
@keyframes rowPing { 0%{background:var(--surface)} 100%{background:transparent} }

/* Pair info cell */
.row-pair { display: flex; align-items: center; gap: 11px; min-width: 0; }
.row-img {
  width: 42px; height: 42px; 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; }
.row-name { font-size:14px; font-weight:700; color:#f0f0f0; display:flex; align-items:center; gap:6px; }
.row-name-text { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:120px; }
.row-ticker { color:rgba(255,255,255,0.35); font-weight:500; font-size:11px; flex-shrink:0; }
.row-price-inline { font-family:var(--font-mono); font-size:12px; font-weight:600; color:rgba(255,255,255,0.55); flex-shrink:0; }
.row-sub { display:flex; align-items:center; gap:6px; margin-top:4px; flex-wrap:wrap; }
.row-age { font-size:10px; font-weight:700; color:rgba(255,255,255,0.3); font-family:var(--font-mono); background:rgba(255,255,255,0.05); padding:1px 5px; border-radius:3px; }
.row-dex-tag { font-size:10px; font-weight:700; color:rgba(255,255,255,0.3); background:rgba(255,255,255,0.05); padding:1px 5px; border-radius:3px; }
.row-socials { display:flex; align-items:center; gap:3px; }
.row-social { color:rgba(255,255,255,0.25); display:flex; transition:color .15s; }
.row-social:hover { color:rgba(255,255,255,0.6); }

/* Sparkline */
.row-spark { display:flex; align-items:center; justify-content:center; overflow:hidden; padding-right:6px; }
.row-spark canvas { display:block; max-width:100%; }

/* Numeric cells */
.row-mc, .row-liq, .row-vol, .row-txns { display:flex; flex-direction:column; justify-content:center; }
.row-val { font-family:var(--font-mono); font-size:13px; font-weight:700; color:#e8e8e8; }
.row-label { font-size:10px; color:rgba(255,255,255,0.28); font-weight:600; margin-bottom:2px; text-transform:uppercase; letter-spacing:.03em; }
.row-chg { font-size:12px; font-weight:700; margin-top:2px; }
.row-chg.up { color:#00e09a; }
.row-chg.dn { color:#ff5555; }
.row-chg.flat { color:rgba(255,255,255,0.3); }
.row-txns-split { display:flex; align-items:center; gap:4px; font-family:var(--font-mono); font-size:12px; font-weight:700; margin-top:2px; }
.row-txns-b { color:#00e09a; }
.row-txns-s { color:#ff5555; }

/* Action cell */
.row-action { display:flex; align-items:center; justify-content:flex-end; gap:5px; }
.row-buy-btn {
  background: linear-gradient(135deg,rgba(0,196,140,.3) 0%,rgba(0,196,140,.15) 100%);
  border: 1px solid rgba(0,196,140,.6); border-radius: 6px; color: #00e0a0;
  font-size: 11px; font-weight: 800; padding: 5px 11px; opacity: 0;
  transition: opacity .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:var(--green) !important; }

.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 ════════════════════════════════════════════════════ */
.pumptires-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); }
/* pump.tires 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; }

/* pump.tires 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; }

/* pump.tires 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(104,38,153,.25);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  color: var(--text-dim);
}
.mobile-icon-btn:hover {
  background: var(--surface);
  border-color: rgba(104,38,153,.45);
  color: var(--text);
}

/* ══ 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;
    gap: 5px;
    margin-left: auto;
  }

  /* 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;
  }
}
