/* ================================================================================
   Motions · dashboard-v2.css — dashboard-only refinement layer (Hyperliquid quality)
   ================================================================================
   Loaded AFTER app.css on index.html only. Every rule scoped so it stacks on
   top of the base. Palette preserved (acid-lime accent + oxblood).

   Design principles:
   - Deeper black bg, no textures, no scanlines.
   - Sharp corners (≤6px), hairline dividers, zero drop-shadows.
   - Tabular numerals everywhere. Numbers do the talking.
   - Uppercase mini labels with tight letter-spacing (Bloomberg / Hyperliquid).
   - Semantic colour is scarce: lime = live/positive, red = negative, everything
     else is a shade of neutral. No decorative colour.
   - Active states use a 2px left / bottom accent bar, not filled backgrounds.
   - Motion is quiet: 160ms, one easing, no bounces.

   Safety: does NOT edit app.css. Delete this file + one <link> tag = full revert.
================================================================================ */

:root {
  --hl-ease: cubic-bezier(.4,0,.2,1);
  --hl-dur:  160ms;

  /* Deeper, cooler black — matches homepage v2 */
  --bg:        #060709;
  --bg-1:      #0a0c10;
  --bg-2:      #0f1116;
  --bg-3:      #14171e;
  --bg-hover:  rgba(255,255,255,0.03);
  --hairline:  rgba(255,255,255,0.06);
  --hairline-2: rgba(255,255,255,0.10);
  --hairline-3: rgba(255,255,255,0.16);

  --text:      #eef1f5;
  --text-mid:  #a8afba;
  --text-dim:  #6b7280;
  --text-tiny: #4a505b;

  --accent:      #6de0c9;
  --accent-2:    #8feddb;
  --accent-soft: rgba(109,224,201,0.10);
  --accent-line: rgba(109,224,201,0.32);
  --accent-glow: rgba(109,224,201,0.35);

  --pos:       #7de37a;      /* positive / bid */
  --neg:       #ff4d5a;      /* negative / ask */
  --warn:      #ffb547;

  --mono: 'Inter', -apple-system, BlinkMacSystemFont, ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* --- Base ---------------------------------------------------------------- */
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  font-feature-settings: "cv11" 1, "ss01" 1;   /* Inter refined variants */
}
/* Kill the retro scanline overlay from app.css */
body::before { display: none !important; }

/* --- Grid + Chrome ------------------------------------------------------- */
body {
  grid-template-columns: 216px 1fr;
  grid-template-rows: 52px 1fr 24px;
}

/* --- HEADER ---------------------------------------------------------------- */
header {
  background: rgba(6,7,9,0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  height: 26px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(109,224,201,0.18));
}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Status pill — compact, precise */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--text-mid);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-tiny);
  transition: background var(--hl-dur) var(--hl-ease);
}
.dot.live, .dot.on {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: dot-pulse 2s var(--hl-ease) infinite;
}
.dot.idle { background: var(--warn); }
.dot.err, .dot.killed { background: var(--neg); }
@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

.kill-btn {
  padding: 6px 14px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--neg);
  background: rgba(255,77,90,0.08);
  border: 1px solid rgba(255,77,90,0.28);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--hl-dur) var(--hl-ease);
}
.kill-btn:hover {
  background: rgba(255,77,90,0.16);
  border-color: rgba(255,77,90,0.5);
  color: #ff6b76;
}

/* --- SIDEBAR --------------------------------------------------------------- */
nav.side {
  background: var(--bg-1);
  border-right: 1px solid var(--hairline);
  padding: 12px 0 12px;
  display: flex;
  flex-direction: column;
}
.nav-section {
  padding: 14px 20px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tiny);
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 20px;
  margin: 1px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mid);
  cursor: pointer;
  transition: color var(--hl-dur) var(--hl-ease), background var(--hl-dur) var(--hl-ease);
  border-radius: 0;
  border: 0;
}
.nav-item:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, var(--accent-soft) 0%, transparent 60%);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.nav-icon {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-item.active .nav-icon { opacity: 1; color: var(--accent); }
.count {
  margin-left: auto;
  padding: 1px 7px;
  background: var(--bg-3);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-mid);
  min-width: 20px;
  text-align: center;
}

.nav-footer {
  margin-top: auto;
  padding: 14px 20px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-footer .user {
  font-size: 11.5px;
  color: var(--text-mid);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.nav-footer #logout {
  font-size: 11px;
  color: var(--text-dim);
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: color var(--hl-dur) var(--hl-ease);
}
.nav-footer #logout:hover { color: var(--neg); }

/* --- MAIN + SECTION shells ------------------------------------------------- */
main {
  background: var(--bg);
  overflow-y: auto;
  padding: 0;
}
.section {
  padding: 24px 28px 40px;
  min-height: 100%;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--hairline);
}
.section-head h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 4px;
}
.crumbs {
  font-size: 11.5px;
  color: var(--text-dim);
  letter-spacing: 0;
}

/* --- METRICS BAR (top overview) -------------------------------------------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
  background: var(--bg-1);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 0;
  margin-bottom: 20px;
  overflow: hidden;
}
.metric {
  padding: 14px 18px;
  border-right: 1px solid var(--hairline);
  background: transparent;
  border-radius: 0;
  position: relative;
}
.metric:last-child { border-right: 0; }
.metric-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.metric-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.metric-value.green { color: var(--accent); }
.metric-value.red   { color: var(--neg); }
.metric-sub {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

/* --- CHAIN TABS — nothing here, app.css owns them 100%. -------------------
   We only add per-chain accents for Robinhood + Solana (missing from the
   original per-chain map in app.css). No shape / colour / background / font
   overrides — those all live in app.css lines 759-802. */
.chain-tab[data-chain="robinhood"].active::before { background: var(--accent); }
.chain-tab[data-chain="robinhood"].active         { color: var(--accent); }
.chain-tab[data-chain="solana"].active::before    { background: #c2a5ff; }
.chain-tab[data-chain="solana"].active            { color: #c2a5ff; }

/* --- CHAIN WALLETS PANEL --------------------------------------------------- */
.chain-wallets {
  background: var(--bg-1);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}
.chain-wallets-toggle {
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: 0;
  color: var(--text-mid);
  font-family: var(--sans);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: background var(--hl-dur) var(--hl-ease);
}
.chain-wallets-toggle:hover { background: var(--bg-hover); }
.cw-label { font-weight: 600; color: var(--text); letter-spacing: 0; }
.cw-summary {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.cw-arrow { color: var(--text-dim); font-size: 10px; transition: transform var(--hl-dur) var(--hl-ease); }
.chain-wallets.open .cw-arrow { transform: rotate(180deg); }
.chain-wallets-list {
  border-top: 1px solid var(--hairline);
  padding: 4px 0;
  max-height: 340px;
  overflow-y: auto;
}
.cw-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  padding: 6px 16px;
  font-size: 11.5px;
  color: var(--text-mid);
  font-variant-numeric: tabular-nums;
  border-radius: 0;
}
.cw-row:hover { background: var(--bg-hover); }
.cw-empty { padding: 14px 16px; text-align: center; color: var(--text-dim); font-size: 11.5px; }

/* --- CHART SECTION --------------------------------------------------------- */
.chart-section {
  background: var(--bg-1);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}
.chart-controls {
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: transparent;
}
.chart-input-group {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 340px;
}
.chart-input, .chart-tf, .slot-dex, select, input[type="text"], input[type="number"] {
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 6px;
  transition: border-color var(--hl-dur) var(--hl-ease), background var(--hl-dur) var(--hl-ease);
  outline: 0;
}
.chart-input:focus, .chart-tf:focus, .slot-dex:focus,
select:focus, input[type="text"]:focus, input[type="number"]:focus {
  border-color: var(--accent-line);
  background: var(--bg-3);
}
.chart-input { flex: 1; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.chart-tf { min-width: 72px; }
.chart-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 8px;
  border-left: 1px solid var(--hairline);
  color: var(--text-mid);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.chart-price { font-weight: 600; color: var(--text); }
.chart-container {
  position: relative;
  padding: 0;
  min-height: 320px;
}
.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* Holders toggle button — floats on chart */
.holders-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  background: rgba(6,7,9,0.72);
  backdrop-filter: blur(10px);
  border: 1px solid var(--hairline-2);
  color: var(--text-mid);
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--hl-dur) var(--hl-ease);
}
.holders-toggle:hover { color: var(--text); border-color: var(--hairline-3); }
.holders-toggle svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 1.8; fill: none; }

.holders-panel {
  background: var(--bg-2);
  border-left: 1px solid var(--hairline-2);
}

/* --- BUTTONS --------------------------------------------------------------- */
.btn {
  padding: 7px 12px;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--hl-dur) var(--hl-ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover {
  background: var(--bg-3);
  border-color: var(--hairline-2);
}
.btn.primary {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
  font-weight: 600;
}
.btn.primary:hover {
  background: rgba(109,224,201,0.18);
  border-color: rgba(109,224,201,0.5);
}
.btn.danger {
  background: rgba(255,77,90,0.08);
  border-color: rgba(255,77,90,0.28);
  color: var(--neg);
}
.btn.danger:hover {
  background: rgba(255,77,90,0.16);
  border-color: rgba(255,77,90,0.5);
}

/* --- STRATEGY BOXES -------------------------------------------------------- */
.ws-banner {
  padding: 8px 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 6px;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 500;
  margin-bottom: 12px;
}
.strat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}
.strat-box {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  transition: border-color var(--hl-dur) var(--hl-ease);
}
.strat-box:hover { border-color: var(--hairline-2); }
.strat-box.running { border-color: var(--accent-line); }
.strat-box-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg-2);
}
.strat-box-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0;
}
.strat-box-status {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 2px 8px;
  border-radius: 4px;
}
.strat-box-status.off  { color: var(--text-dim); background: var(--bg-3); }
.strat-box-status.on   { color: var(--accent); background: var(--accent-soft); }
.strat-box-status.err  { color: var(--neg); background: rgba(255,77,90,0.10); }
.strat-box-body { padding: 12px 14px; }
.strat-box-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--hairline);
  background: var(--bg-2);
  display: flex;
  gap: 8px;
}

/* Live indicator (pulsing dot) */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  opacity: 0;
  transition: opacity var(--hl-dur) var(--hl-ease);
}
.strat-box.running .live-indicator { opacity: 1; }
.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  animation: dot-pulse 2s var(--hl-ease) infinite;
}

.ws-disabled-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(6,7,9,0.78);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  padding: 20px;
  color: var(--text-dim);
  font-size: 11.5px;
  border-radius: 8px;
}
.strat-box.disabled .ws-disabled-overlay { display: flex; }
.ws-disabled-icon {
  font-size: 22px;
  color: var(--text-tiny);
}

/* --- FIELDS + FORMS ------------------------------------------------------ */
.field {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--text-mid);
  letter-spacing: 0.02em;
}
.field input, .field select {
  width: 100%;
  margin-top: 4px;
}
.setting-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 14px 0 6px;
}
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 700;
  margin-left: 4px;
  cursor: help;
  position: relative;
}
.info-icon:hover .tooltip { opacity: 1; pointer-events: auto; transform: translateY(0); }
.tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--bg-3);
  border: 1px solid var(--hairline-2);
  color: var(--text);
  font-size: 11px;
  font-weight: 400;
  padding: 6px 10px;
  border-radius: 6px;
  min-width: 200px;
  opacity: 0;
  pointer-events: none;
  transition: all var(--hl-dur) var(--hl-ease);
  letter-spacing: 0;
  z-index: 50;
  text-transform: none;
}

/* Wallet share buttons */
.wallet-share-row {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}
.ws-btn {
  flex: 1;
  padding: 6px 8px;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  color: var(--text-mid);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--hl-dur) var(--hl-ease);
  font-variant-numeric: tabular-nums;
}
.ws-btn:hover { border-color: var(--hairline-2); color: var(--text); }
.ws-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

/* Direction/mode/speed/duration/pattern toggles */
.direction-toggle, .mode-toggle, .speed-toggle, .duration-toggle, .pattern-toggle,
.funding-tab {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 6px;
}
.direction-btn, .mode-btn, .speed-btn, .duration-btn, .pattern-btn {
  flex: 1;
  padding: 5px 8px;
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--hl-dur) var(--hl-ease);
}
.direction-btn:hover, .mode-btn:hover, .speed-btn:hover,
.duration-btn:hover, .pattern-btn:hover { color: var(--text); }
.direction-btn.active, .mode-btn.active, .speed-btn.active,
.duration-btn.active, .pattern-btn.active {
  background: var(--bg-3);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

/* --- TABLES / DATA GRID ---------------------------------------------------- */
.dtable, table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: var(--text);
}
.dtable th, table th {
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: left;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
}
.dtable td, table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--hairline);
  font-variant-numeric: tabular-nums;
  color: var(--text-mid);
}
.dtable tr:hover td, table tbody tr:hover td { background: var(--bg-hover); color: var(--text); }
.dtable td.green, td.buy, .buy { color: var(--accent); }
.dtable td.red,   td.sell, .sell { color: var(--neg); }

/* Chain tag pills used in tables */
.chain-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  background: var(--bg-3);
  color: var(--text-mid);
  border: 1px solid var(--hairline);
}
.chain-tag.base { color: #6db8ff; border-color: rgba(109,184,255,0.22); }
.chain-tag.bsc  { color: #f0b90b; border-color: rgba(240,185,11,0.22); }
.chain-tag.ethereum { color: #a5b4fc; border-color: rgba(165,180,252,0.22); }
.chain-tag.solana { color: #9945ff; border-color: rgba(153,69,255,0.22); }

/* DEX type badge */
.dex-type {
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.10em;
  background: var(--bg-3);
  color: var(--text-mid);
  border: 1px solid var(--hairline);
}
.dex-type.v2 { color: #a5b4fc; }
.dex-type.v3 { color: var(--accent); border-color: var(--accent-line); }
.dex-type.v4 { color: #6de0c9; border-color: rgba(109,224,201,0.22); }

/* --- LOG STREAM ------------------------------------------------------------ */
.log, #log-stream, .log-entry {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11.5px;
}
.log {
  background: var(--bg-1);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 0;
  max-height: 70vh;
  overflow-y: auto;
}
.log-entry {
  padding: 5px 12px;
  border-bottom: 1px solid var(--hairline);
  color: var(--text-mid);
  display: grid;
  grid-template-columns: 68px 40px 1fr;
  gap: 10px;
  letter-spacing: 0;
}
.log-entry:hover { background: var(--bg-hover); }
.log-entry .time { color: var(--text-dim); }
.log-entry .level { font-weight: 700; letter-spacing: 0.08em; }
.log-entry.info .level { color: #8ad2ff; }
.log-entry.warn .level { color: var(--warn); }
.log-entry.err .level  { color: var(--neg); }
.log-entry.ok .level   { color: var(--accent); }

/* --- PANELS (generic) ----------------------------------------------------- */
.panel {
  background: var(--bg-1);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}
.panel-title {
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg-2);
}
.panel-body { padding: 14px; }

/* --- QUICK TRADE PANEL ---------------------------------------------------- */
.quick-trade-panel {
  background: var(--bg-1);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
}
.quick-trade-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg-2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.quick-trade-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}
.quick-trade-body { padding: 14px; }
.qt-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.qt-buttons { display: flex; gap: 6px; }
.qt-buy, .qt-buy-all {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}
.qt-sell, .qt-sell-all {
  background: rgba(255,77,90,0.08);
  border-color: rgba(255,77,90,0.28);
  color: var(--neg);
}
.qt-amount, .qt-token {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* --- HOLDERS PANEL --------------------------------------------------------- */
.holders-panel { padding: 0; }
.holders-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.holders-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}
.holders-close {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.holders-close:hover { color: var(--text); }
.holders-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--hairline);
}
.holders-stat {
  padding: 10px 14px;
  border-right: 1px solid var(--hairline);
}
.holders-stat:last-child { border-right: 0; }
.holders-stat-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.holders-stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.holders-stat-value.ours { color: var(--accent); }
.holders-list { padding: 4px 0; max-height: 300px; overflow-y: auto; }
.holder-row {
  display: grid;
  grid-template-columns: 32px 1fr 60px;
  gap: 10px;
  padding: 6px 14px;
  font-size: 11.5px;
  color: var(--text-mid);
  font-variant-numeric: tabular-nums;
}
.holder-row:hover { background: var(--bg-hover); }
.holder-rank { color: var(--text-dim); }
.holder-addr { font-family: var(--mono); }
.holder-pct { text-align: right; color: var(--text); font-weight: 600; }
.holder-tag.ours { color: var(--accent); }

/* --- BADGES / STATUS ------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  border-radius: 4px;
  background: var(--bg-3);
  color: var(--text-mid);
  border: 1px solid var(--hairline);
}
.badge.on, .badge.live, .badge.running { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.badge.off, .badge.idle    { color: var(--text-dim); }
.badge.err, .badge.error   { color: var(--neg); border-color: rgba(255,77,90,0.28); background: rgba(255,77,90,0.08); }
.badge.warn, .badge.paused { color: var(--warn); border-color: rgba(255,181,71,0.28); }
.badge.pending { color: #8ad2ff; }

/* --- PROGRESS BAR --------------------------------------------------------- */
.progress-bar {
  height: 3px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 300ms var(--hl-ease);
}

/* --- MODAL --------------------------------------------------------------- */
.modal {
  background: rgba(6,7,9,0.78);
  backdrop-filter: blur(10px);
}
.modal-backdrop { background: transparent; }
.modal-body, .modal-content, .modal-head, .modal-foot {
  background: var(--bg-1);
}
.modal-head, .modal-foot { border-color: var(--hairline); }
.modal-body { border-color: var(--hairline); }
.close-x {
  background: transparent;
  color: var(--text-dim);
  border: 0;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.close-x:hover { color: var(--text); }

/* --- FOOTER --------------------------------------------------------------- */
footer {
  background: var(--bg-1);
  border-top: 1px solid var(--hairline);
  color: var(--text-dim);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
}

/* --- SCROLLBARS ---------------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--hairline-2) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--hairline-2);
  border-radius: 4px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--hairline-3); }

/* --- MISC UTILITIES -------------------------------------------------------- */
.hidden { display: none !important; }
.small { font-size: 11px; }
.addr, .sym {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

/* Success / error toned text */
.green, .success { color: var(--accent) !important; }
.red, .error, .danger { color: var(--neg) !important; }
.warn, .warning { color: var(--warn) !important; }
.info { color: #8ad2ff !important; }

/* Selection */
::selection { background: rgba(109,224,201,0.28); color: var(--text); }

/* --- Recent trades panel (history) ---------------------------------------- */
.recent-trades-panel {
  background: var(--bg-1);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
}
.rt-head, .rt-row-header {
  display: grid;
  grid-template-columns: 68px 44px 60px 100px 90px 1fr 60px 40px;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--hairline);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg-2);
}
.rt-rows { max-height: 60vh; overflow-y: auto; }
.rt-row {
  display: grid;
  grid-template-columns: 68px 44px 60px 100px 90px 1fr 60px 40px;
  gap: 10px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--hairline);
  font-size: 11.5px;
  color: var(--text-mid);
  font-variant-numeric: tabular-nums;
}
.rt-row:hover { background: var(--bg-hover); color: var(--text); }
.rt-time { color: var(--text-dim); }
.rt-kind.buy { color: var(--accent); }
.rt-kind.sell { color: var(--neg); }
.rt-wallet, .rt-tx { font-family: var(--mono); }
.rt-tx a { color: var(--text-mid); text-decoration: none; }
.rt-tx a:hover { color: var(--accent); }
.rt-star { color: var(--text-dim); cursor: pointer; }
.rt-star:hover { color: var(--warn); }

/* --- Small responsive tweaks --------------------------------------------- */
@media (max-width: 1080px) {
  body { grid-template-columns: 200px 1fr; }
  .section { padding: 20px 22px 36px; }
  .strat-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: 52px auto 1fr 24px;
  }
  nav.side { display: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

/* ================================================================================
   Polish pass — widget-level fixes
   ================================================================================ */

/* --- Sidebar: allow long labels + count to coexist ------------------------ */
.nav-item {
  min-width: 0;              /* let ellipsis kick in on long labels */
}
.nav-item > *:not(.nav-icon):not(.count) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-section { padding-left: 18px; padding-right: 18px; }

/* --- Section chrome: extra right padding, safe scroll -------------------- */
.section { padding-right: 32px; }

/* --- Metric bar: keep numbers readable on narrow viewports --------------- */
.metrics {
  overflow-x: auto;
  scrollbar-width: thin;
}
.metric {
  min-width: 130px;
}
.metric-value {
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metric-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Strategy box head: prevent title/status collision ------------------- */
.strat-box-head {
  min-width: 0;
  flex-wrap: nowrap;
}
.strat-box-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}
.live-indicator { flex-shrink: 0; }
.strat-box-status { flex-shrink: 0; }

/* --- Strategy body vertical rhythm --------------------------------------- */
.strat-box-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.strat-box-body .setting-label:first-child { margin-top: 0; }
.strat-box-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.strat-box-progress {
  height: 3px;
  background: var(--bg-3);
  overflow: hidden;
}
.strat-box-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 300ms var(--hl-ease);
}

/* --- Wallet-share buttons: fit 'Custom' cleanly -------------------------- */
.ws-btn {
  padding: 5px 4px;
  font-size: 10.5px;
  letter-spacing: 0;
  white-space: nowrap;
  min-width: 0;
}
.ws-custom-input {
  width: 60px !important;
  padding: 5px 8px;
  margin-left: 4px;
}

/* --- Pattern grid: proper 3-col grid of icon-stacked buttons ------------- */
.pattern-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0;
  background: transparent;
  border: 0;
}
.pattern-btn {
  position: relative;
  padding: 10px 6px 8px;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  color: var(--text-mid);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--hl-dur) var(--hl-ease);
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  min-width: 0;
  overflow: visible;
}
.pattern-btn:hover {
  border-color: var(--hairline-2);
  color: var(--text);
}
.pattern-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}
.pattern-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  opacity: 0.85;
}
.pattern-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
}
.pattern-btn.active .pattern-icon { opacity: 1; }
.pattern-btn .info-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  font-size: 8px;
}

/* Full-width OBU buttons (rich content: icon + label + sub) ---------------- */
.pattern-btn-full {
  padding: 10px 12px;
  align-items: flex-start;
  text-align: left;
  gap: 2px;
  min-height: 62px;
}
.obu-fullbtn-icon {
  font-size: 15px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 2px;
}
.obu-fullbtn-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0;
}
.obu-fullbtn-sub {
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0;
  line-height: 1.35;
}
.obu-fullbtn-sublabel {
  font-size: 10px;
  color: var(--text-dim);
}

/* --- Mode / aggression / speed / duration buttons: icon + label ---------- */
.mode-btn, .direction-btn, .speed-btn, .duration-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}
.mode-icon, .direction-icon, .speed-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  opacity: 0.75;
}
.mode-icon svg, .direction-icon svg, .speed-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
}
.mode-btn.active .mode-icon,
.direction-btn.active .direction-icon,
.speed-btn.active .speed-icon { opacity: 1; }

/* Info-icon inside toggle buttons: don't push button width */
.mode-btn .info-icon,
.pattern-btn .info-icon,
.ws-btn .info-icon,
.direction-btn .info-icon,
.duration-btn .info-icon,
.speed-btn .info-icon {
  margin-left: 2px;
}

/* --- Custom inputs (duration/speed/usage) -------------------------------- */
.custom-duration-input,
.custom-speed-row,
.obu-usage-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.custom-duration-input input,
.custom-speed-row input,
.obu-custom-usage {
  flex: 1;
  min-width: 0;
}
.input-suffix, .unit {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 4px;
}

/* --- OBU usage sub-panel ------------------------------------------------- */
.organic-buyup-section { margin-top: 8px; }
.obu-usage-toggle {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  flex: 1;
}
.obu-usage-btn {
  flex: 1;
  padding: 5px 6px;
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--hl-dur) var(--hl-ease);
}
.obu-usage-btn:hover { color: var(--text); }
.obu-usage-btn.active {
  background: var(--bg-3);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

/* --- Wallet PnL toggle (below strat-box-foot) ---------------------------- */
.wallet-pnl-section {
  border-top: 1px solid var(--hairline);
  background: var(--bg-2);
}
.wallet-pnl-toggle {
  width: 100%;
  padding: 8px 14px;
  background: transparent;
  border: 0;
  color: var(--text-mid);
  font-family: var(--sans);
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: background var(--hl-dur) var(--hl-ease);
}
.wallet-pnl-toggle:hover { background: var(--bg-hover); }
.wallet-pnl-label { font-weight: 600; color: var(--text); letter-spacing: 0; }
.wallet-pnl-summary {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.wallet-pnl-arrow { color: var(--text-dim); font-size: 10px; transition: transform var(--hl-dur) var(--hl-ease); }
.wallet-pnl-section.open .wallet-pnl-arrow { transform: rotate(180deg); }
.wallet-pnl-list {
  border-top: 1px solid var(--hairline);
  padding: 4px 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-1);
}
.wallet-pnl-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 5px 14px;
  font-size: 11.5px;
  color: var(--text-mid);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.wallet-pnl-row:hover { background: var(--bg-hover); }
.wallet-pnl-empty { padding: 12px 14px; text-align: center; color: var(--text-dim); font-size: 11.5px; }

/* --- Quick-trade section inside strat-box -------------------------------- */
.quick-trade-section {
  padding: 10px 14px;
  border-top: 1px solid var(--hairline);
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quick-trade-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.qt-wallet-picker-row { position: relative; }
.qt-wallet-picker {
  width: 100%;
  justify-content: space-between;
  font-size: 11.5px;
}
.qt-wp-label { color: var(--text); }
.qt-wp-arrow { color: var(--text-dim); font-size: 10px; margin-left: auto; }
.qt-wallet-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-2);
  border: 1px solid var(--hairline-2);
  border-radius: 6px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 20;
  padding: 3px;
}
.qt-wallet-item {
  padding: 6px 10px;
  font-size: 11.5px;
  color: var(--text-mid);
  border-radius: 4px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.qt-wallet-item:hover { background: var(--bg-hover); color: var(--text); }
.qt-wallet-item.selected { background: var(--accent-soft); color: var(--accent); }
.qt-wallet-addr { font-family: var(--mono); }
.qt-wallet-bals { font-size: 10.5px; color: var(--text-dim); }
.qt-wallet-loading, .qt-wallet-error, .qt-wallet-empty {
  padding: 10px 12px;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}
.qt-wallet-error { color: var(--neg); }

.quick-trade-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
}
.qt-amount {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  padding: 6px 10px;
  font-size: 12px;
}
.quick-trade-row-bulk {
  grid-template-columns: 1fr 1fr;
}

/* --- Warning / disabled banner (ws-banner) ------------------------------- */
.ws-banner {
  font-size: 11.5px;
  padding: 8px 12px;
}
.ws-disabled-msg { line-height: 1.4; }

/* --- Chart controls: prevent overflow ------------------------------------ */
.chart-controls {
  min-width: 0;
}
.chart-input-group {
  min-width: 0;
  flex-wrap: wrap;
}
.chart-input {
  min-width: 200px;
}
.chart-info {
  min-width: 0;
  flex-shrink: 1;
}
.chart-token-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

/* --- Holders panel: fix border/edge alignment ---------------------------- */
.holders-panel {
  border-radius: 0 8px 8px 0;
  overflow: hidden;
}

/* --- Chain wallets list rows --------------------------------------------- */
.cw-row {
  grid-template-columns: 1fr 90px 60px;
}
.w-addr, .cw-row .w-addr { font-family: var(--mono); }

/* --- Recent trades table: fit long content ------------------------------- */
.rt-head, .rt-row-header, .rt-row {
  grid-template-columns: 64px 40px 56px 100px 90px minmax(80px, 1fr) 60px 32px;
}
.rt-wallet, .rt-tx {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* --- Log entry: better wrapping ------------------------------------------ */
.log-entry {
  grid-template-columns: 64px 40px minmax(0, 1fr);
}
.log-entry .msg {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* --- Setting label spacing: first label after field shouldn't margin-top-14 */
.field + .setting-label { margin-top: 12px; }

/* --- Recent trades panel: fix header background stripe ----------------- */
.rt-head { background: var(--bg-2); position: sticky; top: 0; z-index: 2; }

/* --- Field labels above inputs (align) ---------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* --- Safety net: any first-child in strat body ------------------------- */
.strat-box-body > *:first-child { margin-top: 0; }

/* --- Better slot-dex + slot-token spacing -------------------------------- */
.slot-token, .slot-dex { margin-top: 4px; }

/* (removed duplicate .chain-tabs polish rule — the block at line ~330 owns
   chain-tab styling now; layering two blocks was easier to break than fix.) */
