.overlay { position:fixed; inset:0; background:rgba(0,0,0,.75); backdrop-filter:blur(4px); z-index:9999; display:flex; align-items:center; justify-content:center; }
@media (max-width: 768px) { #profileOverlay { align-items: flex-end; } #profileOverlay .profile-modal { border-radius: 16px 16px 0 0; } }
.overlay.hidden { display:none; }
.modal { background:#111; border:1px solid var(--border2); border-radius:14px; padding:24px; width:360px; }
.modal-title { font-size:17px; font-weight:800; margin-bottom:5px; }
.modal-sub { font-size:12px; color:var(--text-dim); margin-bottom:18px; }
.modal-btn { width:100%; padding:11px; border:1px solid var(--border); border-radius:var(--r-sm); background:var(--surface); color:var(--text); font-family:inherit; font-size:13px; font-weight:600; cursor:pointer; text-align:left; display:flex; align-items:center; gap:9px; transition:all .15s; margin-bottom:7px; }
.modal-btn:hover { background:var(--surface2); border-color:var(--border2); }
.wallet-option-btn { width:100%; display:flex; align-items:center; gap:14px; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1); border-radius:12px; padding:14px 16px; cursor:pointer; margin-bottom:10px; transition:background .2s; text-align:left; }
.wallet-option-btn:hover { background:rgba(255,255,255,0.09); }
.wallet-option-wc { background:rgba(99,102,241,0.08); border-color:rgba(99,102,241,0.25); }
.wallet-option-wc:hover { background:rgba(99,102,241,0.16); }
.wallet-option-icon { width:28px; height:28px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.wallet-option-text { display:flex; flex-direction:column; gap:2px; }
.wallet-option-name { font-size:14px; font-weight:600; color:var(--text); }
.wallet-option-sub { font-size:12px; color:var(--text-faint); }
.modal-close { float:right; background:none; border:none; color:var(--text-faint); font-size:16px; cursor:pointer; }

/* ══ PRICE ANIMATIONS ══════════════════════════════════════════════════ */
@keyframes priceUp { 0% { color: var(--green); } 100% { color: inherit; } }
@keyframes priceDn { 0% { color: var(--red); } 100% { color: inherit; } }
@keyframes tradeSlideIn { from { opacity:0; transform:translateY(-8px); background:rgba(255,255,255,0.06); } to { opacity:1; transform:translateY(0); background:transparent; } }
@keyframes spin { from { transform:rotate(0deg); } to { transform:rotate(360deg); } }
.price-up { animation: priceUp 1.5s ease forwards; }
.price-dn { animation: priceDn 1.5s ease forwards; }

/* ══ SEARCH AUTOCOMPLETE ═══════════════════════════════════════════════ */
.search-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--r);
  box-shadow: 0 8px 24px rgba(0,0,0,.5); z-index: 9999; max-height: 320px; overflow-y: auto;
}
@media (max-width: 767px) {
  .top-search { max-width: none; flex: 1; }
  .search-dropdown {
    /* Anchor below the search input, expand right up to screen edge minus safe margin */
    position: fixed;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: 420px;
    top: calc(var(--topbar-h) + 4px);
  }
}
.search-result-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px;
  cursor: pointer; transition: background .12s; border-bottom: 1px solid var(--border);
}
.search-result-item:hover { background: var(--surface); }
.search-result-item:last-child { border-bottom: none; }
.sr-img { width: 28px; height: 28px; border-radius: 50%; background: var(--surface2); flex-shrink:0; overflow:hidden; display:flex; align-items:center; justify-content:center; font-size:9px; font-weight:800; color:var(--text-faint); }
.sr-img img { width:100%; height:100%; object-fit:cover; }
.sr-name { font-size: 13px; font-weight: 700; }
.sr-sym { font-size: 11px; color: var(--text-faint); margin-top: 1px; }
.sr-price { margin-left: auto; font-family: var(--font-mono); font-size: 12px; flex-shrink: 0; padding-left: 8px; }

/* ══ TV SOCIAL LINKS ═══════════════════════════════════════════════════ */
.tv-social-link { color: var(--text-faint); display: inline-flex; align-items: center; padding: 3px; border-radius: 4px; transition: color .15s; }
.tv-social-link:hover { color: var(--text); background: var(--surface); }
.tv-socials-row { display: flex; align-items: center; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.tv-description { font-size: 11px; color: var(--text-faint); margin-top: 4px; max-width: 400px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.tv-description.expanded { white-space: normal; text-overflow: unset; }

/* ══ MOBILE RESPONSIVE ═════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .tbl-head span:nth-child(4),
  .tbl-head span:nth-child(5),
  .token-row > *:nth-child(4),
  .token-row > *:nth-child(5) { display: none; }
  .tbl-head { grid-template-columns: 2fr 90px 110px 100px 80px; }
  .token-row { grid-template-columns: 2fr 90px 110px 100px 80px; }
}

/* ══ MOBILE ════════════════════════════════════════════════════════════ */
/* ── MOBILE FOOTER ──────────────────────────────────────────────────── */
.mobile-footer { display: none; }
.mf-sheet-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  background: #131313; border: none; color: rgba(255,255,255,.45); font-size: 10px; font-weight: 600;
  cursor: pointer; padding: 18px 8px; width: 100%; text-transform: uppercase; letter-spacing: .06em;
  transition: background .15s, color .15s; -webkit-tap-highlight-color: transparent;
}
.mf-sheet-btn:active { background: rgba(255,255,255,.07); color: #fff; }
.mf-sheet-btn svg { opacity: .7; transition: opacity .15s; }
.mf-sheet-btn:active svg { opacity: 1; }
@media (max-width: 768px) {
  .mobile-footer {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    background: rgba(10,10,10,0.88); border-top: 1px solid rgba(255,255,255,.08);
    height: 58px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mf-bar { display: flex; width: 100%; align-items: stretch; }
  .mf-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; background: none; border: none; color: rgba(255,255,255,.35);
    font-size: 9px; font-weight: 600; cursor: pointer; padding: 6px 2px;
    transition: color .15s; -webkit-tap-highlight-color: transparent;
    letter-spacing: .02em; text-transform: uppercase;
  }
  .mf-btn svg { flex-shrink: 0; transition: stroke .15s; }
  .mf-btn:active { background: rgba(255,255,255,.04); }
  .mf-btn.active { color: #fff; }
  .mf-btn.active svg { stroke: #fff; }
  /* Buy button active = green, Sell = red */
  #mfBuy.active { color: #00D97E; }
  #mfBuy.active svg { stroke: #00D97E; }
  #mfSell.active { color: #FF4545; }
  #mfSell.active svg { stroke: #FF4545; }
  #mfOrdersBtn.active { color: #682699; }
  #mfOrdersBtn.active svg { stroke: #682699; }
}

@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  :root { --topbar-h: 52px; --subtabs-h: 40px; --statusbar-h: 28px; --ticker-h: 30px; --sidebar-w: 0px; }
  .sidebar { display: none; }

  /* Topbar: logo + search + wallet only */
  .topbar { gap: 7px; padding: 0 10px; }
  .quickbuy-wrap, .preset-btns, .pls-pill, .chain-pill { display: none; }
  .top-search { max-width: none; flex: 1; }
  .wallet-btn { padding: 5px 10px; font-size: 11px; }
  .logo { font-size: 13px; }
  .logo svg { width: 22px; height: 22px; }

  /* Sub tabs: scrollable row */
  .subtabs { padding: 0 8px; gap: 0; overflow-x: auto; }
  .subtabs::-webkit-scrollbar { display: none; }
  .stab { padding: 6px 10px; font-size: 11px; white-space: nowrap; flex-shrink: 0; }
  .stab-sep { display: none; }
  .tf-btns { display: none; }
  .subtabs-right { display: none; }

  /* Discovery table: mobile card layout — name | MC+chg | buy */
  .tbl-head { display: none; }
  .token-row { grid-template-columns: 1fr 90px 60px; padding: 8px 10px; gap: 6px; align-items: center; }
  .row-spark, .row-liq, .row-txns, .row-vol { display: none; }
  .row-mc { display: flex; }
  /* Hide socials + copy + whale from row sub-line — too cramped on mobile */
  .row-socials { display: none; }
  .row-sub .copy-ca-btn { display: none; }
  .badge-whale-slot { display: none; }
  /* Search hidden on mobile — replaced by drop-down search bar */
  .top-search { display: none; }
  .top-search input { font-size: 14px; padding: 8px 10px 8px 32px; }
  /* Search results: bigger tap targets, readable text */
  .search-result-item { padding: 10px 14px; gap: 12px; }
  .sr-img { width: 36px; height: 36px; }
  .sr-name { font-size: 14px; }
  .sr-sym { font-size: 12px; }
  .sr-price { font-size: 13px; }
  .row-buy-btn { opacity: 1; padding: 6px 12px; font-size: 11px; min-height: 36px; min-width: 48px; }
  /* Larger tap targets, prevent iOS zoom on input focus */
  .stab { min-height: 36px; }
  input, textarea, select { font-size: 16px !important; }
  /* Smooth scrolling containers */
  .token-list, .subtabs, .pt-list, .tv-trade-panel { -webkit-overflow-scrolling: touch; }
  /* Topbar background for mobile browser */
  .topbar { background: #0a0a0a; }
  /* main-wrap: sit below topbar, above footer — no gaps */
  .main-wrap {
    left: 0 !important; width: 100% !important; overflow: hidden; position: fixed;
    top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
    height: calc(100dvh - var(--topbar-h) - env(safe-area-inset-top, 0px) - 58px - env(safe-area-inset-bottom, 0px));
    padding-bottom: 0;
  }
  /* Hide subtabs on mobile — footer handles discovery navigation */
  .subtabs { display: none !important; }
  /* Status bar hidden on mobile — footer takes that role */
  .statusbar { display: none !important; }
  /* Hide kb-btn */
  .kb-btn { display: none; }

  /* DS tab — fully scrollable on mobile */
  .ds-featured { grid-template-columns: 1fr 1fr; padding: 10px; gap: 8px; }
  .ds-card { padding: 10px; }
  #dsView { display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  #dsFeatured { flex-shrink: 0; }
  #dsList { flex: 1; overflow-y: visible; }

  /* pump.tires: stack columns */
  .pumptires-view { grid-template-columns: 1fr; grid-template-rows: auto auto auto; overflow: visible; height: auto; }
  .pt-col { overflow-y: visible !important; height: auto !important; max-height: none !important; }
  .pt-col:not(:last-child) { border-right: none; border-bottom: 1px solid var(--border); }
  #ptLaunches, #ptBonding, #ptTrades { height: auto !important; max-height: none !important; overflow: visible !important; }

  /* Discovery view is THE scroll container on mobile */
  #discoveryView { overflow-y: auto !important; overflow-x: hidden; -webkit-overflow-scrolling: touch; height: 100%; }
  .token-list { overflow-y: visible !important; height: auto !important; }
  #tableView { overflow-y: visible !important; height: auto !important; flex: none; }
  #dsView { overflow-y: visible !important; height: auto !important; }
  #ptView { overflow-y: visible !important; height: auto !important; }
  .pt-col:last-child { border-right: none; }

  /* Token view: stack chart + trade + trades, whole view scrolls */
  #tokenView { overflow-y: auto !important; -webkit-overflow-scrolling: touch; height: 100%; }
  .tv-body { flex-direction: column; overflow: visible; height: auto; }
  /* Chart col becomes a plain block on mobile */
  .tv-chart-col { flex: none; border-right: none; min-height: 0; order: 1; }
  /* Bigger chart on mobile */
  .tv-chart-area { min-height: 340px; height: 340px; }
  .tv-trade-panel { width: 100%; box-sizing: border-box; overflow-y: visible; padding: 8px; height: auto; max-height: none; order: 2; gap: 6px; }
  /* Trades strip moves BELOW the buy box on mobile */
  #chartTradesStrip { order: 3; border-top: 1px solid var(--border); }
  .tv-trades { height: 130px; }
  .tp-section { flex: 0 0 auto; min-width: 0; padding: 10px; }
  #liveTradesFeed { max-height: 220px; }
  #tokenInfoBox { display: none !important; }

  /* TV header on mobile — compact single line */
  .tv-header { flex-wrap: nowrap; gap: 6px; min-height: auto; padding: 7px 10px; align-items: center; overflow: hidden; }
  .tv-stats { display: none; }
  .tv-links { display: none; }
  .tv-dex-badge { display: none; }
  .tv-token-info { min-width: 0; flex: 1; }
  .tv-name { font-size: 13px; }
  .tv-sub { font-size: 10px; }
  .tv-price-wrap { flex-shrink: 0; text-align: right; }
  .tv-price { font-size: 16px; }
  .tv-change { font-size: 11px; }
  /* Hide desktop back button on mobile — footer handles Back */
  .tv-back { display: none !important; }
  /* Trades strip: hide column header row on mobile — rows are self-explanatory */
  #chartTradesStrip > div:first-child { display: none !important; }
  #chartTradesList { max-height: 200px; }
  /* Hide legacy sidebar trades feed on mobile — chartTradesStrip is canonical */
  #liveTradesFeed { display: none !important; }
  /* Make TF buttons slightly larger tap targets */
  .tf-btn { min-height: 28px; padding: 3px 8px; }
  /* Trade panel quick amounts: bigger tap targets */
  .quick-amt-btn { min-height: 40px; font-size: 13px; }
  /* Slippage/gas rows: tighter */
  .slip-row, .gas-row { gap: 5px; }
  .slip-btn, .gas-btn { min-height: 32px; font-size: 11px; padding: 4px 8px; }

  /* Status bar: compact */
  .sb-item:nth-child(3), .sb-item:nth-child(4) { display: none; }
  .sb-item { padding: 0 8px; font-size: 10px; }

  /* Ensure nothing overflows horizontally */
  body { overflow-x: hidden; }
  .main-wrap { overflow-x: hidden; }
}

/* (duplicate 768px rules merged into block above) */

@media (max-width: 480px) {
  .alert-bell-btn { display: none; }
  .wallet-btn { font-size: 11px; padding: 5px 8px; }
  .ds-featured { grid-template-columns: 1fr !important; }
  /* Even smaller header */
  .tv-price { font-size: 15px; }
  .tv-token-logo { width: 28px !important; height: 28px !important; }
}

@media (max-width: 420px) {
  .tv-trade-panel { flex-direction: column; }
  .tv-back { padding: 4px 6px; }
}

/* ══ MISC ══════════════════════════════════════════════════════════════ */
.copy-btn { background:none; border:none; color:var(--text-faint); padding:0 2px; transition:color .15s; }
.copy-btn:hover { color:var(--text-dim); }
.addr-mono { font-family:var(--font-mono); font-size:11px; color:var(--text-faint); cursor:pointer; transition:color .15s; }
.addr-mono:hover { color:var(--text-dim); }

/* ══ NEW FEATURES ═══════════════════════════════════════════════════════ */
/* Star/Watchlist */
.row-star-btn { background:none; border:none; cursor:pointer; padding:0 3px; font-size:17px; color:var(--text-faint); line-height:1; transition:color .15s; flex-shrink:0; }
.row-star-btn.starred { color:var(--yellow); }
.row-star-btn:hover { color:var(--yellow); }

/* Copy CA button */
.copy-ca-btn { background:none; border:none; cursor:pointer; padding:0 2px; color:var(--text-faint); line-height:1; transition:color .15s; font-size:12px; display:inline-flex; align-items:center; }
.copy-ca-btn:hover { color:var(--text-dim); }
.copy-ca-btn.flash-green { color:var(--green) !important; }

/* Badges */
.badge { font-size:9px; font-weight:800; padding:2px 5px; border-radius:3px; text-transform:uppercase; flex-shrink:0; display:inline-flex; align-items:center; gap:3px; vertical-align:middle; line-height:1; }
.badge-hot { background:rgba(255,100,0,0.15); color:#FF6400; border:1px solid rgba(255,100,0,0.3); }
.badge-new { background:rgba(77,158,255,0.12); color:#4D9EFF; border:1px solid rgba(77,158,255,0.25); }
.badge-pump { background:rgba(0,196,140,0.12); color:var(--green); border:1px solid rgba(0,196,140,0.25); }
.badge-whale { background:rgba(77,158,255,0.1); color:var(--blue); border:1px solid rgba(77,158,255,0.2); font-size:9px; padding:1px 4px; border-radius:3px; flex-shrink:0; }

/* Sort indicators */
.sort-ind { color:var(--pink); font-size:9px; margin-left:2px; }

/* Price animations */
@keyframes priceUp { 0%{color:var(--green);text-shadow:0 0 8px var(--green)} 100%{color:inherit;text-shadow:none} }
@keyframes priceDn { 0%{color:var(--red);text-shadow:0 0 8px var(--red)} 100%{color:inherit;text-shadow:none} }
.price-up-flash { animation: priceUp 1s ease forwards !important; }
.price-dn-flash { animation: priceDn 1s ease forwards !important; }

/* Alert bell button */
.alert-bell-btn { position:relative; background:var(--surface); border:1px solid var(--surface); border-radius:var(--r-sm); padding:5px 8px; color:var(--text-dim); cursor:pointer; transition:all .15s; display:flex; align-items:center; font-size:14px; }
.alert-bell-btn:hover { border-color:rgba(104,38,153,.45); color:var(--text); background:var(--surface); }
.alert-badge { position:absolute; top:-5px; right:-5px; background:var(--red); color:#fff; font-size:8px; font-weight:800; border-radius:50%; width:14px; height:14px; display:flex; align-items:center; justify-content:center; }

/* Keyboard shortcut button */
.kb-btn { background:var(--surface); border:1px solid var(--surface); border-radius:var(--r-sm); padding:5px 8px; color:var(--text-dim); cursor:pointer; transition:all .15s; font-size:13px; font-weight:700; }
.kb-btn:hover { border-color:rgba(104,38,153,.45); color:var(--text); background:var(--surface); }

/* Shortcuts overlay */
.shortcuts-overlay { position:fixed; inset:0; background:rgba(0,0,0,.75); backdrop-filter:blur(4px); z-index:9999; display:flex; align-items:center; justify-content:center; }
.shortcuts-overlay.hidden { display:none; }
.shortcuts-panel { background:#111; border:1px solid var(--border2); border-radius:14px; padding:20px; width:340px; }
.shortcuts-panel-title { font-size:15px; font-weight:800; margin-bottom:14px; display:flex; justify-content:space-between; align-items:center; }
.shortcut-row { display:flex; justify-content:space-between; align-items:center; padding:6px 0; border-bottom:1px solid var(--border); font-size:12px; }
.shortcut-row:last-child { border-bottom:none; }
.shortcut-key { font-family:var(--font-mono); background:var(--surface2); border:1px solid var(--border2); border-radius:4px; padding:2px 7px; font-size:11px; font-weight:700; color:var(--text); }
.shortcut-desc { color:var(--text-dim); }

/* Alert panel */
.alert-panel { position:fixed; top:calc(var(--topbar-h) + 8px); right:14px; z-index:9999; background:#111; border:1px solid var(--border2); border-radius:10px; padding:14px; width:290px; max-height:400px; overflow-y:auto; }
.alert-panel.hidden { display:none; }
.alert-panel-title { font-size:12px; font-weight:700; margin-bottom:10px; display:flex; justify-content:space-between; align-items:center; }
.alert-form { display:flex; flex-direction:column; gap:6px; margin-bottom:10px; padding-bottom:10px; border-bottom:1px solid var(--border); }
.alert-form-row { display:flex; gap:6px; }
.alert-form select, .alert-form input[type="number"] { flex:1; background:var(--surface); border:1px solid var(--border); border-radius:var(--r-sm); color:var(--text); font-family:inherit; font-size:12px; padding:5px 8px; outline:none; }
.alert-form button { background:var(--pink); border:none; border-radius:var(--r-sm); color:#fff; font-size:11px; font-weight:700; padding:6px 10px; cursor:pointer; align-self:flex-start; }
.alert-item { display:flex; justify-content:space-between; align-items:center; font-size:11px; padding:5px 0; border-bottom:1px solid rgba(255,255,255,.04); gap:6px; }
.alert-item:last-child { border-bottom:none; }
.alert-item-del { background:none; border:none; color:var(--text-faint); cursor:pointer; font-size:13px; padding:0 2px; flex-shrink:0; }
.alert-item-del:hover { color:var(--red); }
.alert-no-token { font-size:11px; color:var(--text-faint); text-align:center; padding:8px 0; }

/* Bonding curve progress */
.pt-curve-bar { height:3px; border-radius:2px; background:rgba(255,255,255,0.08); margin-top:6px; overflow:hidden; }
.pt-curve-fill { height:100%; border-radius:2px; background:var(--green); transition:width .5s ease; }
.pt-curve-label { font-size:9px; color:var(--text-faint); margin-top:2px; text-align:right; }

/* Portfolio view */
.portfolio-view { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.portfolio-header { padding:14px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:24px; flex-shrink:0; }
.portfolio-stat-lbl { font-size:10px; color:var(--text-faint); text-transform:uppercase; letter-spacing:.05em; margin-bottom:3px; }
.portfolio-stat-val { font-family:var(--font-mono); font-size:22px; font-weight:800; color:var(--text); }
.portfolio-list { flex:1; overflow-y:auto; }
.portfolio-list::-webkit-scrollbar { width:3px; }
.portfolio-list::-webkit-scrollbar-thumb { background:rgba(255,255,255,.08); }
.portfolio-row { display:flex; align-items:center; gap:10px; padding:9px 14px; border-bottom:1px solid rgba(255,255,255,.025); cursor:pointer; transition:background .12s; }
.portfolio-row:hover { background:var(--surface); }
.portfolio-row-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:11px; font-weight:800; color:var(--text-faint); }
.portfolio-row-img img { width:100%; height:100%; object-fit:cover; }
.portfolio-row-meta { flex:1; min-width:0; }
.portfolio-row-name { font-size:13px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.portfolio-row-sym { font-size:11px; color:var(--text-faint); margin-top:2px; font-family:var(--font-mono); }
.portfolio-row-right { text-align:right; flex-shrink:0; }
.portfolio-row-val { font-family:var(--font-mono); font-size:13px; font-weight:700; }
.portfolio-row-bal { font-size:11px; color:var(--text-faint); margin-top:2px; }
.portfolio-row-pnl { font-size:11px; font-weight:600; margin-top:2px; }
.portfolio-row-pnl.up { color:var(--green); }
.portfolio-row-pnl.dn { color:var(--red); }
.rt-row { display:grid; grid-template-columns:36px 1fr 90px 90px; gap:0; padding:6px 14px; border-bottom:1px solid rgba(255,255,255,.04); align-items:center; }
.rt-row:hover { background:rgba(255,255,255,.03); cursor:pointer; }
.rt-type-buy { font-size:10px; font-weight:700; color:var(--green); }
.rt-type-sell { font-size:10px; font-weight:700; color:var(--red); }
.rt-status { display:inline-flex; align-items:center; gap:3px; font-size:9px; font-weight:600; letter-spacing:.3px; padding:1px 4px; border-radius:3px; margin-top:2px; }
.rt-status-confirmed { color:#00D97E; background:rgba(0,217,126,.1); }
.rt-status-reverted { color:#FF4545; background:rgba(255,69,69,.1); }
.rt-token { font-size:12px; font-weight:600; color:var(--text); }
.rt-sym { font-size:10px; color:var(--text-faint); margin-top:1px; }
.rt-amt { font-size:11px; color:var(--text); text-align:right; }
.rt-pnl { font-size:11px; font-weight:600; text-align:right; }
.rt-pnl.up { color:var(--green); }
.rt-pnl.dn { color:var(--red); }
.rt-pnl.flat { color:var(--text-faint); }
.portfolio-empty { padding:40px; text-align:center; color:var(--text-faint); font-size:12px; }

/* Watchlist */
.watchlist-empty { padding:40px; text-align:center; color:var(--text-faint); font-size:14px; line-height:1.6; }

/* ══ PROFILE ICON BTN (topbar) ══════════════════════════════════════════ */
.profile-icon-btn { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); cursor: pointer; padding: 0; border-radius: 8px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.profile-icon-btn:hover { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.12); }
.profile-icon-avatar { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #fff; }

/* ══ PROFILE MODAL ═══════════════════════════════════════════════════════ */
.profile-modal { max-width: 380px; width: 100%; padding: 0; overflow-y: auto; overflow-x: hidden; border-radius: 16px; max-height: 90dvh; }
@media (max-width: 768px) { .profile-modal { max-height: 85dvh; border-radius: 16px 16px 0 0; } }
.profile-banner { height: 90px; position: relative; background: linear-gradient(135deg, #0d2818 0%, #0a1628 50%, #1a0d28 100%); border-radius: 12px 12px 0 0; overflow: hidden; }
.profile-banner:hover #profileBannerHint { opacity: 1 !important; }
.profile-avatar:hover #profileAvatarImg { opacity: 0.7; }
.profile-avatar:hover::after { content:''; position:absolute;inset:0;background:rgba(0,0,0,0.4);border-radius:50%;display:flex;align-items:center;justify-content:center; }
.profile-avatar-row { display: flex; align-items: flex-end; gap: 12px; padding: 0 16px; margin-top: -28px; position: relative; }
.profile-avatar { width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; color: #fff; border: 3px solid var(--bg); flex-shrink: 0; position: relative; }
.profile-online-dot { width: 10px; height: 10px; background: var(--green); border-radius: 50%; border: 2px solid var(--bg); }
.profile-status { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--green); font-weight: 600; margin-bottom: 4px; }
.profile-edit-btn { margin-left: auto; display: flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border2); background: var(--surface); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; margin-bottom: 4px; transition: all .15s; }
.profile-edit-btn:hover { background: var(--surface2); }
.profile-username { font-size: 16px; font-weight: 700; color: var(--text); padding: 10px 16px 2px; }
.profile-wallet-addr { font-size: 11px; color: var(--text-faint); padding: 0 16px 8px; font-family: var(--font-mono); }
.profile-bio-wrap { padding: 0 16px 10px; }
.profile-bio-text { font-size: 13px; color: var(--text-dim); line-height: 1.5; min-height: 20px; }
.profile-bio-text.empty { color: var(--text-faint); font-style: italic; }
.profile-edit-form { padding: 8px 16px 4px; display: flex; flex-direction: column; gap: 8px; }
.profile-edit-form.hidden { display: none !important; }
.profile-input { background: var(--surface); border: 1px solid var(--border2); border-radius: 8px; padding: 9px 12px; color: var(--text); font-size: 13px; font-family: inherit; outline: none; width: 100%; box-sizing: border-box; transition: border-color .15s; }
.profile-input:focus { border-color: var(--pink); }
.profile-bio-input { resize: none; line-height: 1.5; }
.profile-save-btn { flex: 1; background: var(--pink); border: none; border-radius: 8px; padding: 9px; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; transition: opacity .15s; }
.profile-save-btn:hover { opacity: .85; }
.profile-cancel-btn { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px; color: var(--text-faint); font-size: 13px; font-weight: 600; cursor: pointer; }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; background: var(--border); margin: 10px 0 0; border-top: 1px solid var(--border); }
.profile-stat { padding: 12px 8px; text-align: center; background: var(--bg); }
.profile-stat-val { font-size: 15px; font-weight: 700; font-family: var(--font-mono); color: var(--text); }
.profile-stat-lbl { font-size: 10px; color: var(--text-faint); margin-top: 2px; text-transform: uppercase; letter-spacing: .05em; }
.profile-section-title { font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .08em; padding: 10px 16px 6px; }
.profile-linked { padding: 0 16px; }
.profile-link-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; font-size: 13px; color: var(--text-dim); cursor: default; }
.profile-ref-row { display: flex; align-items: center; gap: 8px; padding: 0 16px 16px; }
.profile-ref-link { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-ref-copy { padding: 5px 12px; border-radius: 6px; border: 1px solid var(--border2); background: var(--surface); color: var(--text); font-size: 11px; font-weight: 600; cursor: pointer; flex-shrink: 0; transition: all .15s; }
.profile-ref-copy:hover { background: var(--surface2); }

/* ── Leaderboard ─────────────────────────────────────────────────────────── */
.lb-sort-btn { background: none; border: 1px solid rgba(255,255,255,.1); border-radius: 4px; color: rgba(255,255,255,.4); font-size: 11px; padding: 3px 8px; cursor: pointer; transition: all .15s; }
.lb-sort-btn:hover { border-color: rgba(255,255,255,.25); color: rgba(255,255,255,.7); }
.lb-sort-btn.active { border-color: var(--pink); color: var(--pink); }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; margin-bottom: 6px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.05); transition: background .15s; }
.lb-row:hover { background: rgba(255,255,255,.06); }
.lb-rank { width: 28px; text-align: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.lb-rank-1 { color: #fbbf24; }
.lb-rank-2 { color: #94a3b8; }
.lb-rank-3 { color: #b45309; }
.lb-rank-n { color: rgba(255,255,255,.3); font-size: 12px; }
.lb-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lb-name { flex: 1; min-width: 0; }
.lb-name .lb-username { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-name .lb-addr { font-size: 10px; color: rgba(255,255,255,.3); margin-top: 1px; font-family: monospace; }
.lb-stat { text-align: right; flex-shrink: 0; }
.lb-stat .lb-val { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.85); }
.lb-stat .lb-sub { font-size: 10px; color: rgba(255,255,255,.3); margin-top: 1px; }
.lb-empty { text-align: center; padding: 40px; color: rgba(255,255,255,.3); font-size: 13px; line-height: 1.7; }

/* ── Trades / Holders bottom panel ────────────────────────────────────────── */
#thPanel {
  height: 280px;
  flex-shrink: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid var(--border);
}
.th-tab {
  display: flex; align-items: center; gap: 5px;
  padding: 8px 14px 7px;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: rgba(255,255,255,.35); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.th-tab:hover { color: rgba(255,255,255,.7); }
.th-tab.active { color: #fff; border-bottom-color: #682699; }
.th-tab svg { flex-shrink: 0; }
.th-table {
  width: 100%; border-collapse: collapse;
  font-size: 11px; font-family: var(--font-mono);
}
.th-table thead th {
  position: sticky; top: 0; z-index: 1;
  padding: 5px 10px; text-align: left;
  font-size: 9px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: rgba(255,255,255,.25);
  background: var(--bg); border-bottom: 1px solid rgba(255,255,255,.06);
}
.th-table thead th:nth-child(3),
.th-table thead th:nth-child(4),
.th-table thead th:nth-child(5),
.th-table thead th:nth-child(4) ~ th { text-align: right; }
.th-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .1s;
}
.th-table tbody tr:hover { background: rgba(255,255,255,.04); }
.th-table td {
  padding: 5px 10px; color: rgba(255,255,255,.75);
  white-space: nowrap;
}
.th-table td:nth-child(3),
.th-table td:nth-child(4),
.th-table td:nth-child(5),
.th-table td:nth-child(6),
.th-table td:nth-child(7) { text-align: right; }
.th-side-buy  { color: #00C48C; font-weight: 700; }
.th-side-sell { color: #FF4545; font-weight: 700; }
.th-maker { color: rgba(255,255,255,.5); font-size: 10px; }
.th-txn-link { color: rgba(255,255,255,.3); text-decoration: none; transition: color .15s; display: inline-flex; align-items: center; }
.th-txn-link:hover { color: rgba(255,255,255,.8); }
.th-empty { text-align: center !important; padding: 24px !important; color: rgba(255,255,255,.2); font-family: var(--font-sans); font-size: 12px; }
.th-pager-btn {
  padding: 4px 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 4px; color: rgba(255,255,255,.5); font-size: 11px; cursor: pointer; transition: background .15s;
}
.th-pager-btn:hover { background: rgba(255,255,255,.1); }
.th-pager-btn:disabled { opacity: .3; cursor: default; }
/* Bar for holder percentage */
.th-pct-bar { display: inline-block; height: 8px; border-radius: 2px; background: var(--surface); margin-right: 5px; vertical-align: middle; }
@media (max-width: 768px) {
  #thPanel { height: auto; flex: none; display: flex; flex-direction: column; overflow: hidden; }
  .th-table thead th:nth-child(4),
  .th-table td:nth-child(4),
  .th-table thead th:nth-child(5),
  .th-table td:nth-child(5) { display: none; }
}

/* ── Holders filter tabs + type badges ─────────────────────────────────────── */
.th-holder-filter-btn {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px; font-size: 10px; font-weight: 700;
  border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.4); cursor: pointer; transition: all .15s;
  letter-spacing: .04em;
}
.th-holder-filter-btn:hover { background: rgba(255,255,255,.09); color: rgba(255,255,255,.75); }
.th-holder-filter-btn.active { background: var(--surface); border-color: rgba(104,38,153,.25); color: #682699; }
.th-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1px 5px; border-radius: 4px; font-size: 9px; font-weight: 800;
  letter-spacing: .05em; vertical-align: middle; line-height: 1.4;
}
.th-badge-lp       { background: rgba(0,196,140,.15);  color: #00C48C; border: 1px solid rgba(0,196,140,.3); }
.th-badge-burnt    { background: rgba(255,100,50,.15);  color: #FF8057; border: 1px solid rgba(255,100,50,.3); }
.th-badge-contract { background: rgba(140,100,255,.15); color: #9B7FFF; border: 1px solid rgba(140,100,255,.3); }

/* ── Trades/Holders panel — mobile optimisation ────────────────────────────── */
@media (max-width: 767px) {
  /* Give panel more height on mobile */
  /* thPanel hidden by default on mobile — shown full-screen via TRADES footer tab */
  #thPanel { min-height: 0; max-height: none; display: none; }

  /* Tab bar — compact */
  #thPanel .th-tab { padding: 7px 14px; font-size: 11px; }

  /* Hide table headers — implied by layout */
  #thTradesTable thead, #thHoldersTable thead { display: none; }

  /* Trades: show SIDE | USD | AGE | TXN only — hide MAKER, PLS, COINS columns */
  #thTradesTable td:nth-child(1) { display: none; } /* MAKER */
  #thTradesTable td:nth-child(4) { display: none; } /* PLS */
  #thTradesTable td:nth-child(5) { display: none; } /* COINS */

  /* Compact row height */
  .th-table td { padding: 6px 8px; font-size: 11px; }
  .th-side-buy, .th-side-sell { font-size: 11px; }

  /* Holders: hide rank # — save space */
  #thHoldersTable td:nth-child(1) { display: none; }
  /* Compact bar width */
  .th-pct-bar { max-width: 40px; }

  /* Filter bar — smaller buttons */
  .th-holder-filter-btn { padding: 2px 7px; font-size: 9px; }
}
