/* BossTrade terminal theme — matches dashboard.py palette, refined layout */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;600;700;800&display=swap');

:root {
  --bg: #04040c;
  --bg2: #08081a;
  --bg3: #0d0d20;
  --accent: #5b6aff;
  --accent2: #00e5a0;
  --red: #ff3d5a;
  --yellow: #ffb700;
  --purple: #a78bfa;
  --text: #7070a0;
  --white: #d0d0f0;
  --border: #14142a;
  --mono: 'Space Mono', monospace;
  --sans: 'Syne', sans-serif;
  --buy-threshold: 56;
  --t0: #E24B4A;
  --t1: #D85A30;
  --t2: #EF9F27;
  --t3: #97C459;
  --t4: #1D9E75;
  --gold: #FFD700;
  --line: var(--border);
  --muted: var(--text);
}

.app-body.boss-terminal {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

.app-body.boss-terminal .app-layout {
  grid-template-columns: 220px minmax(0, 1fr);
}

.app-body.boss-terminal .sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
}

.app-body.boss-terminal .brand {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent2);
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 229, 160, 0.35);
  text-decoration: none;
}

.app-body.boss-terminal .sidebar-label {
  color: #333360;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
}

.app-body.boss-terminal .sidebar-link {
  font-family: var(--mono);
  font-size: 0.72rem;
  border-radius: 8px;
  color: var(--text);
}

.app-body.boss-terminal .sidebar-link.is-active {
  background: rgba(91, 106, 255, 0.12);
  border-color: var(--accent);
  color: var(--white);
}

.app-body.boss-terminal .app-main {
  background: var(--bg);
  padding: 0;
}

.app-body.boss-terminal .app-header {
  display: none;
}

.app-body.boss-terminal .app-content {
  padding: 0;
  max-width: none;
}

/* Terminal HUD */
.bt-hud {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0.35rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 50;
}

.bt-hud-brand {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent2);
  letter-spacing: 2px;
  padding-right: 0.75rem;
  border-right: 1px solid #1a1a30;
}

.bt-hud-stat .lbl {
  font-size: 0.48rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #333360;
  font-weight: 700;
}

.bt-hud-stat .val {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--white);
  font-weight: 700;
}

.bt-hud-stat .val.pos { color: var(--accent2); }
.bt-hud-stat .val.neg { color: var(--red); }

.bt-hud-sub {
  background: #06060f;
  border-bottom: 1px solid var(--border);
  padding: 0.35rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: #7070a0;
  line-height: 1.5;
}

.bt-hud-sub strong { color: #c4b5fd; font-weight: 700; }

.bt-hud-clock {
  min-width: 11.5rem;
  padding-right: 0.65rem;
  border-right: 1px solid #1a1a30;
}
.bt-hud-clock .lbl { color: #555580; }
.bt-hud-clock-date {
  font-size: 0.62rem !important;
  color: #8888cc !important;
  font-weight: 500 !important;
  line-height: 1.2;
}
.bt-hud-clock-time {
  font-size: 0.88rem !important;
  color: var(--accent2) !important;
  letter-spacing: 0.05em;
}

.bt-hud-stat .val.bt-ref-timer {
  min-width: 2.2rem;
  text-align: center;
}

.bt-card-ref {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--accent2);
  margin-left: auto;
  margin-right: 0.35rem;
}

.bt-pilot {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text);
}

.bt-sw { position: relative; width: 42px; height: 22px; display: inline-block; }
.bt-sw input { opacity: 0; width: 0; height: 0; }
.bt-sl {
  position: absolute; inset: 0; background: #1a1a3a; border-radius: 11px; cursor: pointer;
  transition: 0.3s;
}
.bt-sl:before {
  content: ""; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px;
  background: #333360; border-radius: 50%; transition: 0.3s;
}
.bt-sw input:checked + .bt-sl { background: var(--accent); }
.bt-sw input:checked + .bt-sl:before { transform: translateX(20px); background: #fff; }

.bt-terminal-body {
  padding: 1rem 1.25rem 2rem;
  overflow-y: auto;
  max-height: calc(100vh - 52px);
}

.bt-capital-slots {
  margin: 0 1.25rem 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #080812;
  border: 1px solid #1a1a30;
  border-radius: 10px;
  font-family: var(--mono);
}
.bt-capital-slots-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: #8888cc;
  margin-bottom: 0.55rem;
}
.bt-capital-slots-hdr .bt-capital-next { color: #00e5a0; font-weight: 700; }
.bt-capital-manual-tag { font-size: 0.58rem; color: #555580; font-weight: 400; }
.bt-capital-help {
  font-size: 0.62rem;
  color: #555580;
  margin: 0 0 0.5rem;
  line-height: 1.35;
}
.bt-btn-fund { border-color: rgba(0, 229, 160, 0.5) !important; color: #00e5a0 !important; }
.bt-bank-ext { margin-top: 0.25rem; padding-top: 0.25rem; border-top: 1px dashed #252545; }
.bt-slot-xfer { display: flex; gap: 0.25rem; margin-top: 0.35rem; flex-wrap: wrap; }
.bt-bank-to-slots { flex-wrap: wrap; }
.bt-capital-slots-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}
@media (max-width: 900px) {
  .bt-capital-slots-grid { grid-template-columns: repeat(2, 1fr); }
}
.bt-capital-slot {
  background: #0d0d1a;
  border: 1px solid #252545;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  min-height: 4.5rem;
}
.bt-capital-slot .lbl {
  font-size: 0.62rem;
  font-weight: 800;
  color: #5b6aff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bt-capital-slot .amt { font-size: 0.95rem; font-weight: 700; color: #e8e8ff; margin-top: 0.2rem; }
.bt-capital-slot .pair { font-size: 0.7rem; color: #00e5a0; font-weight: 700; }
.bt-capital-slot .sub { font-size: 0.58rem; color: #555580; margin-top: 0.15rem; }
.bt-capital-slot.is-idle { border-color: rgba(0, 229, 160, 0.25); }
.bt-capital-slot.is-open { border-color: rgba(255, 215, 0, 0.45); background: #12101a; }
.bt-capital-slot.is-open .lbl { color: #EF9F27; }
.bt-bank-slot {
  border-color: rgba(167, 139, 250, 0.45);
  background: linear-gradient(145deg, #0f0c18, #0a0a14);
}
.bt-bank-slot .lbl { color: #a78bfa; }
.bt-bank-actions { display: flex; gap: 0.35rem; margin-top: 0.4rem; flex-wrap: wrap; }
.bt-btn-sm { font-size: 0.58rem !important; padding: 0.2rem 0.45rem !important; }
.bt-btn-sync {
  border-color: rgba(91, 106, 255, 0.65) !important;
  color: #a5b4fc !important;
  font-weight: 700;
}
.bt-capital-loading { font-size: 0.68rem; color: #555580; grid-column: 1 / -1; }

.bt-top-slots-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  padding: 0.55rem 0.75rem;
  background: #0a0a18;
  border: 1px solid #1a1a30;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.68rem;
}

.bt-top-slot-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: #0d0d1a;
  border: 1px solid #252545;
}

.bt-top-slot-chip .rank {
  font-weight: 800;
  color: #00e5a0;
}

.bt-top-slot-chip.in-trade { border-color: rgba(0, 229, 160, 0.45); }
.bt-top-slot-chip .pnl.pos { color: #00e5a0; }
.bt-top-slot-chip .pnl.neg { color: #ff3d5a; }

.bt-watchlist-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.bt-watchlist-lbl {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent2);
  font-weight: 700;
}
.bt-watchlist-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1;
  min-width: 200px;
}
.bt-wl-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: #8888aa;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  border: 1px solid #252545;
  cursor: pointer;
}
.bt-wl-chip.on {
  color: var(--text);
  border-color: rgba(0, 229, 160, 0.45);
  background: rgba(0, 229, 160, 0.06);
}
.bt-wl-bt { color: #00e5a0; font-size: 0.58rem; }
.bt-watchlist-alloc {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: #00e5a0;
  white-space: nowrap;
}

.bt-pairs-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

/* Watchlist size: 2 cryptos → equal columns, side by side */
.bt-pairs-grid.cols-1 {
  grid-template-columns: 1fr;
  max-width: 720px;
}
.bt-pairs-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.bt-pairs-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.bt-pairs-grid.cols-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.bt-pairs-grid.cols-4 .bt-pair-card .bt-chart-host {
  min-height: 220px;
}

.bt-pairs-empty {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #555580;
  padding: 2rem;
  grid-column: 1 / -1;
}

@media (max-width: 960px) {
  .bt-pairs-grid.cols-2,
  .bt-pairs-grid.cols-3,
  .bt-pairs-grid.cols-4 {
    grid-template-columns: 1fr;
  }
}

.bt-pair-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  border-left: 3px solid var(--border);
  transition: border-left-color 0.4s ease, box-shadow 0.35s ease;
}

.bt-pair-card.bt-top-slot {
  box-shadow: 0 0 0 1px rgba(0, 229, 160, 0.35), 0 4px 24px rgba(0, 229, 160, 0.08);
}

.bt-rank-badge {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 800;
  color: #04040c;
  background: linear-gradient(135deg, #00e5a0, #5a9fff);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.bt-live-pnl {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.85rem 0;
  color: #8888cc;
}

.bt-live-pnl.pos { color: #00e5a0; }
.bt-live-pnl.neg { color: #ff3d5a; }

.bt-trade-plan {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: #7070a0;
  padding: 0.35rem 0.85rem 0;
  line-height: 1.45;
}

.bt-trade-plan.manual-ok { color: #c4a035; }
.bt-trade-plan.in-trade { color: #00e5a0; }

.bt-btn-buy:disabled,
.bt-btn-sell:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.bt-pair-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid #12122a;
}

.bt-pair-name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--white);
}

.bt-pair-price {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--white);
}

.bt-sig {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.bt-sig-buy { background: rgba(255, 215, 0, 0.15); color: var(--gold); }
.bt-sig-watch { background: rgba(239, 159, 39, 0.15); color: var(--t2); }
.bt-sig-avoid { background: rgba(226, 75, 74, 0.2); color: #ff9a9a; }

.bt-ready {
  font-size: 0.58rem;
  font-family: var(--mono);
  padding: 0.12rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.25rem;
}
.bt-ready-yes { background: rgba(0, 229, 160, 0.15); color: var(--accent2); }
.bt-ready-no { background: rgba(85, 85, 128, 0.2); color: #8888cc; }

.bt-chart-boss-wrap {
  border-bottom: 1px solid #12122a;
}

.bt-chart-host {
  width: 100%;
  height: 200px;
  background: #06060f;
  box-sizing: border-box;
  padding-right: 2px;
}

.bt-metrics-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  padding: 0.4rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  border-top: 1px solid #12122a;
  background: #070712;
}

.bt-metrics-compact .k { color: #555580; margin-right: 0.2rem; }
.bt-metrics-compact .v { color: #c4b5fd; font-weight: 600; }

.bt-pct-hint.ready { color: var(--accent2); }

.bt-manual-panel {
  padding: 0.55rem 0.75rem 0.65rem;
  background: linear-gradient(180deg, #0a0a1a 0%, #070712 100%);
  border-top: 1px solid rgba(255, 215, 0, 0.25);
  border-bottom: 1px solid #12122a;
}

.bt-manual-panel.highlight {
  box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.45);
}

.bt-manual-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.bt-manual-title {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.bt-manual-mode {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: #555580;
}

.bt-manual-signal {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: #c4b5fd;
  margin-bottom: 0.35rem;
  line-height: 1.45;
}

.bt-manual-preview {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.35rem 0.5rem;
  border-radius: 5px;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.bt-manual-preview.pass { background: rgba(0, 229, 160, 0.1); color: var(--accent2); }
.bt-manual-preview.warn { background: rgba(239, 159, 39, 0.12); color: var(--t2); }
.bt-manual-preview.fail { background: rgba(255, 61, 90, 0.1); color: var(--red); }

.bt-manual-size { margin-bottom: 0.45rem; }

.bt-manual-lbl {
  display: block;
  font-family: var(--mono);
  font-size: 0.58rem;
  color: #555580;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.bt-pct-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.bt-pct-btn {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  border: 1px solid #2a2a4a;
  background: #0a0a18;
  color: #8888cc;
  cursor: pointer;
}

.bt-pct-btn:hover { border-color: var(--gold); color: var(--gold); }
.bt-pct-btn.active {
  background: rgba(255, 215, 0, 0.15);
  border-color: var(--gold);
  color: var(--gold);
}

.bt-manual-usd-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bt-manual-usd-row input {
  width: 88px;
  background: #0a0a18;
  border: 1px solid #2a2a4a;
  border-radius: 5px;
  color: var(--white);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.45rem;
}

.bt-pct-hint {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: #555580;
}

.bt-manual-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.bt-auto-trade {
  margin-left: 0.35rem;
}

/* Segmented AUTO/MANUAL + LIVE/PAPER */
.bt-hud-modes {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  flex-shrink: 0;
}

.bt-seg {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: #06060f;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  padding: 2px;
}

.bt-seg-lbl {
  font-family: var(--mono);
  font-size: 0.48rem;
  color: #555580;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 0.35rem 0 0.45rem;
}

.bt-seg-btn {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #8888cc;
  cursor: pointer;
}

.bt-seg-btn:hover { color: var(--white); }

.bt-seg-btn.active {
  background: rgba(0, 229, 160, 0.18);
  color: var(--accent2);
}

#btn-mode-manual.active {
  background: rgba(255, 215, 0, 0.15);
  color: var(--gold);
}

.bt-seg-exec .bt-seg-btn.active {
  background: rgba(91, 106, 255, 0.2);
  color: #a5b4fc;
}

.bt-hud-compact {
  padding: 0.28rem 0.85rem;
  gap: 0.65rem;
}

.bt-hud-sub-compact {
  padding: 0.25rem 0.85rem;
  font-size: 0.58rem;
  max-height: 2.4em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-reconcile-banner {
  margin: 0 0.85rem 0.5rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.62rem;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.bt-reconcile-banner a { color: #a78bfa; }

.bt-buy-signal-banner {
  margin: 0 0.85rem 0.5rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.65rem;
  color: #fde68a;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.bt-sig-buy-signal {
  color: #FFD700 !important;
  font-weight: 800;
  animation: bt-signal-pulse 1.2s ease-in-out infinite;
}

.bt-ready-signal {
  color: #FFD700 !important;
  border-color: rgba(255, 215, 0, 0.5) !important;
}

.bt-card-signal-flash {
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.55);
}

.bt-card-exit-win {
  box-shadow: 0 0 0 2px rgba(0, 229, 160, 0.55);
}

.bt-card-exit-loss {
  box-shadow: 0 0 0 2px rgba(255, 82, 82, 0.55);
}

.bt-chart-signal-legend {
  font-size: 0.62rem;
  line-height: 1.35;
  margin: 0.2rem 0 0.35rem;
  padding: 0 0.15rem;
  min-height: 0.85rem;
}

.bt-btn-signal-ready {
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}

@keyframes bt-signal-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.bt-hud-hide-sm {
  display: none;
}

@media (min-width: 1200px) {
  .bt-hud-hide-sm { display: block; }
}

.bt-capital-slots-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.45rem 0.85rem;
  background: #070712;
  border: none;
  border-bottom: 1px solid var(--border);
  color: #8888cc;
  font-family: var(--mono);
  font-size: 0.65rem;
  cursor: pointer;
  text-align: left;
}

.bt-capital-slots-toggle:hover { color: var(--accent2); }

.bt-capital-chevron {
  color: #555580;
  font-size: 0.7rem;
}

.bt-capital-collapsed .bt-capital-slots-body {
  display: none;
}

.bt-terminal-charts-first {
  padding-top: 0.35rem;
}

.bt-watchlist-below {
  margin-top: 0.65rem;
  margin-bottom: 0.75rem;
}

.bt-auto-badge {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.bt-auto-badge.on { background: rgba(0, 229, 160, 0.15); color: var(--accent2); }
.bt-auto-badge.off { background: rgba(239, 159, 39, 0.15); color: var(--t2); }

.bt-boss-inline {
  background: #08081a;
  border-top: 1px solid #12122a;
}

.bt-boss-toggle {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.85rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--purple);
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.03em;
}

.bt-boss-toggle:hover {
  color: var(--accent2);
  background: rgba(91, 106, 255, 0.06);
}

.bt-boss-panel {
  display: flex;
  flex-direction: column;
  max-height: 220px;
  background: #06060f;
}

.bt-boss-panel.open {
  border-bottom: 1px solid #1a1a30;
}

.bt-boss-msgs {
  flex: 1;
  min-height: 100px;
  max-height: 160px;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  line-height: 1.45;
}

.bt-boss-msg {
  margin-bottom: 0.5rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.bt-boss-msg.user {
  color: var(--accent2);
}

.bt-boss-msg.ai {
  color: #b8b8d8;
}

.bt-boss-form {
  display: flex;
  gap: 0.4rem;
  padding: 0.45rem 0.6rem 0.55rem;
  border-top: 1px solid #12122a;
}

.bt-boss-input {
  flex: 1;
  min-width: 0;
  background: #0a0a18;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 0.4rem 0.5rem;
}

.bt-boss-send {
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.bt-boss-send:disabled {
  opacity: 0.5;
  cursor: wait;
}

.bt-boss-send:hover:not(:disabled) {
  filter: brightness(1.1);
}

.bt-gauge-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0.85rem 0.65rem;
}

.bt-gauge-wrap { width: 168px; height: 92px; flex-shrink: 0; }

.bt-dca-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 0.5rem;
  background: #08081a;
  gap: 0.15rem;
  transition: border-color 0.3s;
}

.bt-dca-gauge-label {
  font-family: var(--mono);
  font-size: 0.48rem;
  color: #555580;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bt-dca-gauge-status {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
  color: #c4b5fd;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  word-break: break-word;
}

.bt-dca-gauge-price {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 800;
  color: #FFD700;
}

.bt-dca-gauge-so {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: #555580;
}

.bt-dca-gauge-avg {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: #9090b0;
}

.bt-metrics {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.68rem;
}

.bt-metrics .row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}

.bt-metrics .k { color: #555580; }
.bt-metrics .v { color: #c4b5fd; font-weight: 600; }

.bt-gate-line {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: #555580;
  padding: 0 0.85rem 0.55rem;
  border-top: 1px solid #0a0a18;
  padding-top: 0.35rem;
}

.bt-btn {
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.62rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border);
}
.bt-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Live trade log dock */
.bt-trade-log {
  margin-top: 1.25rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 160px;
  display: flex;
  flex-direction: column;
}
.bt-trade-log-hdr {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #333360;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.bt-trade-log-body {
  overflow-y: auto;
  padding: 0.35rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  line-height: 1.45;
}
.bt-log-line { padding: 0.15rem 0; color: var(--text); border-bottom: 1px solid #0a0a18; }
.bt-log-buy { color: var(--gold); }
.bt-log-sell { color: var(--red); }
.bt-log-warn { color: var(--yellow); }
.bt-log-sys { color: #8888cc; }

.bt-btn-kill { background: var(--red); color: #fff; border-color: var(--red); }
.bt-btn-kill:hover { opacity: 0.85; }
.bt-card-actions { display: flex; gap: 0.5rem; padding: 0.5rem 0.75rem 0.75rem; }
.bt-btn-buy { color: var(--accent2); border-color: #00e5a044; }
.bt-btn-sell { color: var(--red); border-color: #ff3d5a44; }

.bt-modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  z-index: 1000; align-items: center; justify-content: center;
}
.bt-modal-overlay.open { display: flex; }
.bt-modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.5rem; max-width: 420px; width: 90%; font-family: var(--mono);
}
.bt-modal h3 { margin: 0 0 0.5rem; color: var(--accent2); }
.bt-modal-pair { color: var(--white); font-size: 0.85rem; margin-bottom: 1rem; }
.bt-modal label { display: block; font-size: 0.7rem; color: var(--text); margin: 0.75rem 0 0.35rem; }
.bt-modal input {
  width: 100%; padding: 0.5rem; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; color: var(--white); box-sizing: border-box;
}
.bt-modal-actions { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }
.bt-preview-status { font-size: 0.72rem; padding: 0.5rem; border-radius: 6px; margin: 0.5rem 0; }
.bt-preview-status.pass { background: #00e5a018; color: var(--accent2); border: 1px solid #00e5a044; }
.bt-preview-status.fail { background: #ff3d5a12; color: var(--red); border: 1px solid #ff3d5a44; }

.pos-equity { height: 120px; margin: 1rem 0; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; position: relative; }
.pos-equity svg { width: 100%; height: 100%; }
.pos-toolbar { display: flex; gap: 0.75rem; margin-bottom: 1rem; align-items: center; }
.pos-toolbar a, .pos-toolbar button {
  font-family: var(--mono); font-size: 0.7rem; padding: 0.4rem 0.8rem;
  border-radius: 6px; border: 1px solid var(--border); background: var(--bg3); color: var(--accent2);
  text-decoration: none; cursor: pointer;
}
