/* ============================================================
   BINANCE OVERVIEW v2 — Premium overlay
   bn2-* classes only — zero conflict with existing styles
   ============================================================ */

/* ── Page background ──────────────────────────────────────── */
[data-view="binance"] { background: #07090f; }

/* ── Overlay base ─────────────────────────────────────────── */
.bn2-overlay { margin-top: 12px; }

/* ── Premium topbar ───────────────────────────────────────── */
.bn2-topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: linear-gradient(90deg, #0a0f1e 0%, #0c1428 50%, #0a0f1e 100%);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 6px;
  gap: 10px;
}
.bn2-tb-brand {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #b4c3f0;
  text-transform: uppercase;
  flex-shrink: 0;
}
.bn2-tb-brand span { color: #c9a84c; }
.bn2-tb-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}
.bn2-tb-acct {
  font-size: 12px;
  font-weight: 600;
  color: #d4deff;
}
.bn2-tb-mode {
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid;
}
.bn2-tb-right {
  font-size: 10px;
  color: rgba(180,195,240,0.45);
  flex-shrink: 0;
}

/* ── KPI row ──────────────────────────────────────────────── */
.bn2-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
@media (max-width: 900px) { .bn2-kpi-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .bn2-kpi-row { grid-template-columns: repeat(2, 1fr); } }

.bn2-kpi-card {
  background: rgba(12,20,40,0.82);
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom: 2px solid rgba(79,140,255,0.0);
  border-radius: 7px;
  padding: 10px 12px;
  transition: border-color 0.2s, border-bottom-color 0.35s;
  animation: bn2-kpi-reveal 0.4s ease-out both;
}
.bn2-kpi-card:hover { border-color: rgba(79,140,255,0.18); }
@keyframes bn2-kpi-reveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bn2-kpi-card:nth-child(1) { animation-delay: 0.04s; }
.bn2-kpi-card:nth-child(2) { animation-delay: 0.08s; }
.bn2-kpi-card:nth-child(3) { animation-delay: 0.12s; }
.bn2-kpi-card:nth-child(4) { animation-delay: 0.16s; }
.bn2-kpi-card:nth-child(5) { animation-delay: 0.20s; }

.bn2-kpi-card.gold  { border-bottom-color: rgba(201,168,76,0.55) !important; background: rgba(201,168,76,0.04); }
.bn2-kpi-card.pos   { border-bottom-color: rgba(134,239,172,0.45) !important; }
.bn2-kpi-card.neg   { border-bottom-color: rgba(252,165,165,0.45) !important; }
.bn2-kpi-card.warn  { border-bottom-color: rgba(252,165,165,0.65) !important; background: rgba(127,29,29,0.18); }
.bn2-kpi-card.amber { border-bottom-color: rgba(251,191,36,0.5) !important; }
.bn2-kpi-card.loading { opacity: 0.4; }

.bn2-kpi-lbl {
  font-size: 9px;
  color: rgba(180,195,240,0.42);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}
.bn2-kpi-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: #d4deff;
  line-height: 1;
}
.bn2-kpi-sub {
  font-size: 9px;
  color: rgba(180,195,240,0.32);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Runtime quick actions strip ─────────────────────────── */
.bn2-rt-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: rgba(12,20,40,0.7);
  border: 1px solid rgba(255,255,255,0.048);
  border-radius: 6px;
}
.bn2-rt-title {
  font-size: 9px;
  color: rgba(201,168,76,0.6);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  flex-shrink: 0;
  margin-right: 4px;
}
.bn2-rt-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.bn2-rt-btn {
  padding: 2px 9px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 4px;
  color: rgba(180,195,240,0.55);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}
.bn2-rt-btn:hover {
  background: rgba(79,140,255,0.09);
  border-color: rgba(79,140,255,0.28);
  color: #7fb3ff;
}

/* ── Charts grid ──────────────────────────────────────────── */
.bn2-charts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 1100px) { .bn2-charts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width:  640px)  { .bn2-charts-grid { grid-template-columns: 1fr; } }

.bn2-chart-card {
  background: rgba(12,20,40,0.82);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 7px;
  padding: 10px 12px;
}
.bn2-chart-title {
  font-size: 9px;
  color: rgba(201,168,76,0.65);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 8px;
}

/* ── Kill switch card ─────────────────────────────────────── */
.bn2-ks-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(12,20,40,0.82);
  transition: border-color 0.3s, background 0.3s;
  flex-wrap: wrap;
}
.bn2-ks-inner.bn2-ks-active {
  border-color: rgba(252,165,165,0.35) !important;
  background: rgba(127,29,29,0.18) !important;
  animation: bn2-ks-pulse 2s ease-in-out infinite;
}
@keyframes bn2-ks-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50%       { box-shadow: 0 0 14px 3px rgba(239,68,68,0.18); }
}
.bn2-ks-inner.bn2-ks-ok { border-color: rgba(134,239,172,0.15) !important; }

.bn2-ks-left  { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 160px; }
.bn2-ks-title { font-size: 11px; font-weight: 700; color: #d4deff; }
.bn2-ks-sub   { font-size: 10px; color: rgba(180,195,240,0.5); margin-top: 2px; }

.bn2-ks-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bn2-ks-dot.green {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,0.6);
  animation: bn2-dot-pulse 2.5s ease-in-out infinite;
}
.bn2-ks-dot.red {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239,68,68,0.7);
  animation: bn2-dot-pulse 1.2s ease-in-out infinite;
}
@keyframes bn2-dot-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.42; }
}

.bn2-ks-mid  { display: flex; gap: 12px; }
.bn2-ks-stat { font-size: 11px; color: rgba(180,195,240,0.55); }
.bn2-ks-stat b { color: #d4deff; }

.bn2-ks-right { margin-left: auto; }
.bn2-btn-reset {
  padding: 4px 12px;
  background: rgba(252,165,165,0.09);
  border: 1px solid rgba(252,165,165,0.32);
  border-radius: 5px;
  color: #fca5a5;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}
.bn2-btn-reset:hover:not(:disabled) { background: rgba(252,165,165,0.18); }
.bn2-btn-reset:disabled { opacity: 0.5; cursor: wait; }
.bn2-ks-clear { font-size: 10px; color: rgba(134,239,172,0.5); }

/* ── Live pulse dot (injected into #bn-sync-status) ───────── */
.bn2-pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  background: #64748b;
}
.bn2-pulse-dot.green { background: #22c55e; animation: bn2-dot-pulse 2.5s ease-in-out infinite; }
.bn2-pulse-dot.amber { background: #fbbf24; animation: bn2-dot-pulse 2s ease-in-out infinite; }
.bn2-pulse-dot.red   { background: #ef4444; animation: bn2-dot-pulse 1.2s ease-in-out infinite; }

/* ── Positions table ──────────────────────────────────────── */
.bn2-pos-wrap {
  margin-top: 10px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.055);
  background: rgba(12,20,40,0.82);
}
.bn2-pos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.bn2-pos-table thead tr {
  background: rgba(201,168,76,0.07);
  border-bottom: 1px solid rgba(201,168,76,0.15);
}
.bn2-pos-table th {
  padding: 6px 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(201,168,76,0.65);
  text-align: left;
  white-space: nowrap;
}
.bn2-pos-table td {
  padding: 7px 10px;
  color: rgba(180,195,240,0.75);
  border-bottom: 1px solid rgba(255,255,255,0.035);
  white-space: nowrap;
}
.bn2-pos-table tbody tr:last-child td { border-bottom: none; }
.bn2-pos-row:hover td { background: rgba(255,255,255,0.02); }
.bn2-pos-row-pos { border-left: 2px solid rgba(134,239,172,0.4); }
.bn2-pos-row-neg { border-left: 2px solid rgba(252,165,165,0.4); }
.bn2-pos-sym  { font-weight: 700; color: #d4deff !important; }
.bn2-pos-bep  { color: rgba(180,195,240,0.5) !important; font-style: italic; }
.bn2-pos-sltp { font-size: 10px; }
.bn2-pos-empty, .bn2-pos-loading {
  padding: 14px 16px;
  font-size: 11px;
  color: rgba(180,195,240,0.35);
}

/* ── Tab icons ────────────────────────────────────────────── */
.bn2-tab-icon {
  display: inline-block;
  margin-right: 4px;
  vertical-align: middle;
  opacity: 0.72;
  transition: opacity 0.14s;
}
.pf-tab-active .bn2-tab-icon { opacity: 1; }

/* ── Proposal filter bar ──────────────────────────────────── */
.bn2-prop-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(12,20,40,0.7);
  border: 1px solid rgba(255,255,255,0.048);
  border-radius: 6px;
  margin-bottom: 8px;
}
.bn2-prop-filter input,
.bn2-prop-filter select {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 4px;
  color: rgba(180,195,240,0.75);
  font-size: 11px;
  padding: 3px 8px;
  outline: none;
}
.bn2-prop-filter input::placeholder { color: rgba(180,195,240,0.3); }
.bn2-prop-filter select option { background: #0a0f1e; }

/* ── Empty state card ─────────────────────────────────────── */
.bn2-empty-state {
  padding: 24px 16px;
  text-align: center;
  background: rgba(12,20,40,0.6);
  border: 1px solid rgba(255,255,255,0.048);
  border-radius: 7px;
  font-size: 12px;
  color: rgba(180,195,240,0.35);
  margin-top: 10px;
}

/* ── Performance analysis grid ────────────────────────────── */
.bn2-perf-analysis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}
@media (max-width: 900px) { .bn2-perf-analysis { grid-template-columns: repeat(2, 1fr); } }
.bn2-perf-row {
  background: rgba(12,20,40,0.82);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bn2-perf-lbl {
  font-size: 9px;
  color: rgba(180,195,240,0.42);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.bn2-perf-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: #d4deff;
}
.bn2-perf-val.pos { color: #86efac; }
.bn2-perf-val.neg { color: #fca5a5; }

/* ── Security status banner ───────────────────────────────── */
.bn2-status-banner {
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
  border: 1px solid;
}
.bn2-status-banner.ok {
  background: rgba(34,197,94,0.07);
  border-color: rgba(34,197,94,0.25);
  color: #86efac;
}
.bn2-status-banner.halt {
  background: rgba(127,29,29,0.25);
  border-color: rgba(239,68,68,0.35);
  color: #fca5a5;
  animation: bn2-ks-pulse 2s ease-in-out infinite;
}

/* ── Security checklist items ─────────────────────────────── */
.bn2-sec-list-item {
  padding: 6px 0;
  color: rgba(180,195,240,0.7);
  font-size: 11px;
  border-bottom: 1px solid rgba(255,255,255,0.035);
  list-style: none;
}
.bn2-sec-list-item:last-child { border-bottom: none; }

/* ── Mode pill buttons (runtime tab) ──────────────────────── */
.bn2-mode-pill-btn {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(180,195,240,0.5);
  cursor: pointer;
  transition: all 0.14s;
}
.bn2-mode-pill-btn:hover,
.bn2-mode-pill-btn.active {
  background: rgba(79,140,255,0.12);
  border-color: rgba(79,140,255,0.35);
  color: #7fb3ff;
}

/* ── Scrollable table wrapper ─────────────────────────────── */
.bn2-tbl-scroll {
  max-height: 420px;
  overflow-y: auto;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.055);
  margin-top: 8px;
  /* gold scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(201,168,76,0.35) rgba(12,20,40,0.5);
}
.bn2-tbl-scroll::-webkit-scrollbar { width: 5px; }
.bn2-tbl-scroll::-webkit-scrollbar-track { background: rgba(12,20,40,0.5); }
.bn2-tbl-scroll::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.35); border-radius: 3px; }
.bn2-tbl-scroll::-webkit-scrollbar-thumb:hover { background: rgba(201,168,76,0.6); }

/* ── Consistent data table styling ───────────────────────── */
.bn2-data-tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.bn2-data-tbl th {
  padding: 6px 11px;
  font-size: 0.60rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(201,168,76,0.65);
  text-align: left;
  white-space: nowrap;
  background: #0c1020;
  border-bottom: 1px solid rgba(201,168,76,0.12);
}
.bn2-data-tbl td {
  padding: 7px 11px;
  font-size: 0.72rem;
  color: rgba(180,195,240,0.75);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  white-space: nowrap;
}
.bn2-data-tbl tbody tr:hover td { background: rgba(201,168,76,0.035); }

/* ── Truth banner (Sprint B FIX 1) ───────────────────────── */
.bn2-truth-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 0;
  padding: 7px 14px;
  margin: 5px 0 4px;
  border-left: 3px solid #22c55e;
  border-radius: 4px;
  background: rgba(12, 20, 40, 0.72);
  font-size: 11px;
  line-height: 1.7;
}
.bn2-truth-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-right: 16px;
  white-space: nowrap;
  color: #22c55e;
}

/* ── Sync status badge (Sprint B FIX 3) ──────────────────── */
.bn2-sync-status {
  font-size: 10px;
  margin-left: 8px;
  font-weight: 600;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

/* ── Mismatch badge (Sprint D FIX 2) ─────────────────────── */
.bn2-mismatch-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 8px;
  border-radius: 3px;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.4);
  color: #fca5a5;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Accounting row (Sprint D FIX 1) ─────────────────────── */
.bn2-accounting-row {
  display: flex;
  gap: 8px;
  margin: 3px 0 5px;
}
.bn2-acct-card {
  flex: 1;
  min-width: 0;
  background: rgba(12,20,40,0.65);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 5px;
  padding: 7px 12px;
}
.bn2-acct-lbl {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(201,168,76,0.65);
  margin-bottom: 3px;
}
.bn2-acct-val {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.bn2-acct-sub {
  font-size: 9.5px;
  color: rgba(180,195,240,0.45);
  margin-top: 2px;
}

/* ── Gate rejection log (Sprint D FIX 3) ─────────────────── */
.bn2-gate-log {
  margin-top: 10px;
  background: rgba(12,20,40,0.6);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 5px;
  padding: 10px 14px;
}
.bn2-gate-log-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(201,168,76,0.65);
  margin-bottom: 7px;
}
.bn2-gate-list {
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,168,76,0.25) transparent;
}
.bn2-gate-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 11px;
}
.bn2-gate-row:last-child { border-bottom: none; }
.bn2-gate-icon { color: #ef4444; flex-shrink: 0; }
.bn2-gate-sym  { color: rgba(180,195,240,0.85); font-weight: 600; min-width: 90px; flex-shrink: 0; }
.bn2-gate-name { color: #fbbf24; flex: 1; font-family: monospace; font-size: 10.5px; }
.bn2-gate-age  { color: rgba(180,195,240,0.4); font-size: 9.5px; flex-shrink: 0; }
.bn2-data-tbl tbody tr:last-child td { border-bottom: none; }

/* ── Proposal Explain Box ────────────────────────────────────────────────── */
.bn2-proposal-explain {
  padding: 12px 14px;
  border-radius: 6px;
  border-left: 4px solid #64748b;
  background: rgba(255,255,255,0.04);
  margin-bottom: 12px;
  direction: rtl;
  text-align: right;
  font-family: 'Segoe UI', Tahoma, sans-serif;
}
.bn2-proposal-explain.border-amber  { border-left-color: #f59e0b; }
.bn2-proposal-explain.border-green  { border-left-color: #22c55e; }
.bn2-proposal-explain.border-red    { border-left-color: #ef4444; }
.bn2-proposal-explain.border-blue   { border-left-color: #3b82f6; }
.bn2-proposal-explain.border-gray   { border-left-color: #64748b; }
.bn2-explain-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #e2e8f0;
}
.bn2-explain-body {
  font-size: 12px;
  color: rgba(226,232,240,0.75);
  margin-bottom: 3px;
}
.bn2-explain-sub {
  font-size: 10.5px;
  color: rgba(180,195,240,0.45);
  direction: ltr;
  text-align: left;
  font-family: monospace;
  margin-top: 4px;
}

/* ── Action Buttons Row ──────────────────────────────────────────────────── */
.bn2-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 4px;
  justify-content: flex-end;
  direction: rtl;
}
.bn2-action-btn {
  padding: 10px 20px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  direction: rtl;
}
.bn2-action-btn:hover { opacity: 0.85; }
.bn2-action-btn.force-exec {
  background: #c9a84c;
  color: #000;
  font-weight: 700;
  border-color: #c9a84c;
}
.bn2-action-btn.hold-btn {
  background: transparent;
  color: #94a3b8;
  border-color: #94a3b8;
}
.bn2-action-btn.resume-btn {
  background: transparent;
  color: #60a5fa;
  border-color: #60a5fa;
}
.bn2-action-btn.reactivate-btn {
  background: transparent;
  color: #f59e0b;
  border-color: #f59e0b;
}
.bn2-action-btn.info-only {
  background: transparent;
  color: #4ade80;
  border-color: #4ade8044;
  cursor: default;
  font-size: 12px;
  font-weight: 400;
}
.bn2-btn-loading {
  opacity: 0.6;
  pointer-events: none;
}
.bn2-btn-loading::after {
  content: ' ⏳';
}
.bn2-feedback {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  margin-top: 6px;
  direction: rtl;
  text-align: right;
  animation: bn2FadeOut 3s forwards;
}
.bn2-feedback.ok  { color: #4ade80; background: rgba(74,222,128,0.08); }
.bn2-feedback.err { color: #fca5a5; background: rgba(252,165,165,0.08); }
@keyframes bn2FadeOut {
  0%   { opacity: 1; }
  60%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Trade Side Panel ────────────────────────────────────────────────────── */
.bn2-trade-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9998;
  display: none;
}
.bn2-trade-panel {
  position: fixed;
  top: 0; right: 0;
  width: 380px;
  max-width: 95vw;
  height: 100vh;
  background: #0f1620;
  border-left: 2px solid rgba(201,168,76,0.3);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  box-shadow: -8px 0 32px rgba(0,0,0,0.5);
}

/* ── Order type pills ────────────────────────────────────────────────────── */
.bn2-order-type-pills {
  display: flex;
  gap: 8px;
}
.bn2-pill {
  flex: 1;
  padding: 8px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(226,232,240,0.5);
  cursor: pointer;
  direction: ltr;
}
.bn2-pill input { display: none; }
.bn2-pill.active {
  border-color: #c9a84c;
  color: #c9a84c;
  background: rgba(201,168,76,0.1);
}

/* ── Percentage quick buttons ────────────────────────────────────────────── */
.bn2-pct-btns {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.bn2-pct-btn {
  flex: 1;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  background: transparent;
  border: 1px solid rgba(201,168,76,0.4);
  color: #c9a84c;
  border-radius: 4px;
  cursor: pointer;
  transition: background .12s;
}
.bn2-pct-btn:hover { background: rgba(201,168,76,0.12); }

/* ── Confirmation box ────────────────────────────────────────────────────── */
.bn2-confirm-box {
  padding: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 6px;
  font-size: 13px;
}

/* ── Balance action buttons ──────────────────────────────────────────────── */
.bn2-bal-act-btn {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid;
  cursor: pointer;
  font-family: 'Segoe UI', sans-serif;
  font-weight: 600;
  transition: opacity .12s;
}
.bn2-bal-act-btn:hover { opacity: 0.8; }
.bn2-bal-act-btn.buy  { background: rgba(34,197,94,0.1); border-color: #22c55e44; color: #22c55e; }
.bn2-bal-act-btn.sell { background: rgba(239,68,68,0.1); border-color: #ef444444; color: #ef4444; }
.bn2-bal-act-btn.dust { background: rgba(201,168,76,0.1); border-color: #c9a84c44; color: #c9a84c; }

/* ── Sprint 4: Execution Profile Card ─────────────────────────────────────── */
.bn2-profile-section-header {
  font-size: 9px;
  color: rgba(201,168,76,0.65);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  margin-bottom: 8px;
}
.bn2-profile-loading {
  color: rgba(201,168,76,0.5);
  font-size: 11px;
  padding: 10px 0;
}
.bn2-profile-card {
  background: #0a0f1e;
  border-left: 6px solid #c9a84c;
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.bn2-profile-name {
  font-size: 15px;
  font-weight: 700;
  color: #c9a84c;
  margin-bottom: 4px;
  letter-spacing: .02em;
}
.bn2-profile-dot { font-size: 10px; margin-right: 6px; }
.bn2-profile-dot.stable { color: #86efac; }
.bn2-profile-dot.canary { color: #f59e0b; }
.bn2-profile-display {
  font-size: 11px;
  color: rgba(180,195,240,0.7);
  margin-bottom: 10px;
}
.bn2-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 12px;
  margin-bottom: 10px;
}
.bn2-ps-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.bn2-ps-lbl {
  font-size: 9px;
  color: rgba(148,163,184,0.6);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.bn2-ps-val {
  font-size: 11px;
  color: #c9a84c;
  font-weight: 600;
}
.bn2-profile-strats {
  font-size: 10px;
  color: rgba(148,163,184,0.65);
  margin-bottom: 3px;
}
.bn2-profile-strat-list { color: rgba(165,200,255,0.8); }
.bn2-profile-universe {
  font-size: 10px;
  color: rgba(148,163,184,0.55);
  margin-bottom: 12px;
}
.bn2-profile-actions { margin-top: 4px; }
.bn2-switch-btn {
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.4);
  color: #c9a84c;
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.bn2-switch-btn:hover { background: rgba(201,168,76,0.22); }

/* ── Status badges ──────────────────────────────────────────────────────────── */
.bn2-stable-badge {
  display: inline-block;
  background: rgba(134,239,172,0.12);
  color: #86efac;
  border: 1px solid rgba(134,239,172,0.3);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 600;
}
.bn2-canary-badge {
  display: inline-block;
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 600;
}

/* ── Emergency strip ────────────────────────────────────────────────────────── */
.bn2-emergency-strip {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.bn2-em-btn {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-size: 10px;
  border-radius: 4px;
  border: 1px solid;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity .12s;
}
.bn2-em-btn:hover { opacity: 0.8; }
.bn2-em-btn:disabled { opacity: 0.45; cursor: default; }
.bn2-em-btn.amber {
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.4);
  color: #f59e0b;
}
.bn2-em-btn.gray {
  background: rgba(148,163,184,0.08);
  border-color: rgba(148,163,184,0.3);
  color: #94a3b8;
}
.bn2-em-btn.blue {
  background: rgba(79,140,255,0.12);
  border-color: rgba(79,140,255,0.4);
  color: #a5c8ff;
}

/* ── Profile switcher modal ─────────────────────────────────────────────────── */
.bn2-profile-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10500;
}
.bn2-profile-modal {
  background: #0d1324;
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 8px;
  padding: 20px;
  width: min(520px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
  color: rgba(180,195,240,0.85);
}
.bn2-profile-modal-title {
  font-size: 11px;
  font-weight: 700;
  color: #c9a84c;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 14px;
}
.bn2-profile-diff-header {
  font-size: 12px;
  color: rgba(180,195,240,0.6);
  margin-bottom: 12px;
  font-style: italic;
}
.bn2-profile-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.bn2-profile-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 5px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .15s;
}
.bn2-profile-item:hover { border-color: rgba(201,168,76,0.45); }
.bn2-pl-header { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.bn2-pl-code { font-size: 12px; font-weight: 700; color: #c9a84c; }
.bn2-pl-name { font-size: 11px; color: rgba(180,195,240,0.65); }
.bn2-pl-desc { font-size: 10px; color: rgba(148,163,184,0.5); margin-top: 3px; }

/* ── Diff table ─────────────────────────────────────────────────────────────── */
.bn2-diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-bottom: 14px;
}
.bn2-diff-table th {
  text-align: left;
  font-size: 9px;
  color: rgba(148,163,184,0.5);
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.bn2-diff-table td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: rgba(180,195,240,0.7);
}
.bn2-diff-lbl { color: rgba(148,163,184,0.7); font-size: 10px; }
.bn2-diff-from { color: rgba(148,163,184,0.5); text-decoration: line-through; }
.bn2-diff-changed td { background: rgba(255,255,255,0.02); }
.bn2-diff-down { color: #fca5a5; }
.bn2-diff-up   { color: #86efac; }

/* ── Canary + open position warnings ───────────────────────────────────────── */
.bn2-canary-warning {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 5px;
  padding: 10px 12px;
  font-size: 11px;
  color: #fbbf24;
  margin-bottom: 12px;
}
.bn2-open-pos-warning {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 11px;
  color: #fca5a5;
  margin-bottom: 10px;
}
.bn2-profile-modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

/* ── Toast notifications ────────────────────────────────────────────────────── */
.bn2-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0d1324;
  border: 1px solid rgba(201,168,76,0.4);
  color: rgba(180,195,240,0.9);
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'Segoe UI', sans-serif;
  z-index: 11000;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  max-width: 480px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.bn2-toast.bn2-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.bn2-toast.bn2-toast-success { border-color: rgba(134,239,172,0.45); color: #86efac; }
.bn2-toast.bn2-toast-error   { border-color: rgba(252,165,165,0.45); color: #fca5a5; }
