/* Professional light finance card — backtest results */
.bbg-terminal-card {
  background: #ffffff;
  border: 1px solid #000000;
  border-radius: 4px;
  padding: 0;
  color: #0f172a;
  font-family: "JetBrains Mono", "Roboto Mono", "SF Mono", Consolas, monospace;
  box-shadow: none;
  max-width: 100%;
  margin: 15px auto;
  overflow: hidden;
}

.bbg-main-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  .bbg-main-grid { grid-template-columns: 1fr; }
}

.bbg-capital-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bbg-badge-label {
  font-size: 11px;
  color: #64748b;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.bbg-flow-value {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  word-break: break-word;
  color: #0f172a;
}

.bbg-arrow { color: #94a3b8; margin: 0 8px; font-weight: 400; }
.bbg-muted { color: #64748b; }
.bbg-accent-gold { color: #0f172a; font-weight: 800; }
.bbg-bright-white { color: #0f172a; font-weight: 800; }

.bbg-pnl-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bbg-pnl-tag {
  background: #ecfdf5;
  color: #059669;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid #a7f3d0;
}

.bbg-pnl-banner.is-loss .bbg-pnl-tag {
  background: #fef2f2;
  color: #ef4444;
  border-color: #fecaca;
}

.bbg-pnl-val {
  color: #10b981;
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.bbg-pnl-val.is-loss { color: #ef4444; }

.bbg-human-sub {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  line-height: 1.4;
}
.bbg-human-sub:empty { display: none; }
.bbg-human-sub-inline { display: block; margin-top: 3px; }

.bbg-metrics-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bbg-metric-cell {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.bbg-metric-cell:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.bbg-metric-title {
  font-size: 10px;
  color: #64748b;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  font-weight: 600;
}

.bbg-metric-number {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.bbg-metric-number.bbg-accent-gold { color: #b45309; }

.bbg-status-strip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
  font-size: 11px;
  margin-bottom: 14px;
  color: #64748b;
}

.bbg-strip-item span:first-child {
  color: #64748b;
  font-weight: 600;
}

.bbg-strip-item strong {
  color: #334155;
  margin-left: 4px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bbg-loss-text { color: #ef4444 !important; }
.bbg-win-text { color: #10b981 !important; }

.bbg-trades-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 12px;
}

.bbg-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #334155;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

.bbg-tag-live {
  background: #eff6ff;
  color: #2563eb;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  border: 1px solid #bfdbfe;
}

.bbg-trades-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 600px) {
  .bbg-trades-grid { grid-template-columns: 1fr; }
}

.bbg-trade-item.open { grid-column: 1 / -1; }

.bbg-trade-pill {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  background: #ffffff;
}

.bbg-trade-pill:hover { filter: brightness(0.98); }

.bbg-trade-win {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #10b981;
}

.bbg-trade-loss {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #ef4444;
}

.bbg-trade-pill.open {
  border-color: #94a3b8;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.25);
}

.bbg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}

.bbg-trade-win .bbg-dot { background: #10b981; }
.bbg-trade-loss .bbg-dot { background: #ef4444; }

.bbg-trade-val {
  flex: 1;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.bbg-trade-win .bbg-trade-val { color: #10b981; }
.bbg-trade-loss .bbg-trade-val { color: #ef4444; }

.bbg-trade-date { display: none; }

.bbg-trade-detail {
  margin-top: 6px;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  overflow-x: auto;
  background: #f0fdf4;
}

.bbg-trade-item:has(.bbg-trade-loss) .bbg-trade-detail {
  background: #fef2f2;
  border-color: #fecaca;
}

.bbg-trade-detail[hidden] { display: none !important; }

.bbg-trade-detail .trade-pill-table-wrap {
  background: transparent;
}

.bbg-trade-detail .trade-pill-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 11px;
  font-family: inherit;
  color: #166534;
  background: transparent;
}

.bbg-trade-detail .trade-pill-table th,
.bbg-trade-detail .trade-pill-table td {
  padding: 8px 10px;
  border: 1px solid #bbf7d0;
  white-space: nowrap;
  color: #166534;
  background: #f0fdf4;
}

.bbg-trade-detail .trade-pill-table th {
  color: #15803d;
  font-size: 10px;
  letter-spacing: 0.04em;
  font-weight: 700;
  background: #ecfdf5;
}

.bbg-trade-detail .trade-pill-table tbody tr:nth-child(even) td {
  background: #ecfdf5;
}

.bbg-trade-item:has(.bbg-trade-loss) .bbg-trade-detail .trade-pill-table,
.bbg-trade-item:has(.bbg-trade-loss) .bbg-trade-detail .trade-pill-table th,
.bbg-trade-item:has(.bbg-trade-loss) .bbg-trade-detail .trade-pill-table td {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.bbg-trade-item:has(.bbg-trade-loss) .bbg-trade-detail .trade-pill-table th {
  color: #b91c1c;
  background: #fff1f2;
}

.bbg-trade-item:has(.bbg-trade-loss) .bbg-trade-detail .trade-pill-table tbody tr:nth-child(even) td {
  background: #fff1f2;
}

.bbg-trade-detail .trade-pill-table .pnl.up { color: #10b981; font-weight: 700; }
.bbg-trade-detail .trade-pill-table .pnl.down { color: #ef4444; font-weight: 700; }

.bbg-footer-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  font-size: 10px;
  color: #64748b;
  margin-top: 10px;
  padding: 0 4px;
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {
  .bbg-terminal-card { padding: 12px; margin: 10px auto; }
  .bbg-flow-value { font-size: 18px; }
  .bbg-footer-bar { flex-direction: column; }
}

/* ---- Bottom conversion CTA: black/gold, sits right under the equity
   curve — the one dead-end-breaking exit from the report toward TG bind. */
.strategy-cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 16px 0;
  padding: 18px 20px;
  background: linear-gradient(135deg, #0b0f10 0%, #131a1c 100%);
  border: 1px solid #c9a227;
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
.strategy-cta-banner .cta-text {
  flex: 1 1 320px;
  min-width: 0;
}
.strategy-cta-banner .cta-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
  color: #f7d774;
  margin-bottom: 6px;
}
.strategy-cta-banner .cta-title span#cta-strat-name {
  color: #10e28a;
}
.strategy-cta-banner .cta-desc {
  font-size: 12.5px;
  line-height: 1.5;
  color: #cbd5e1;
}
.strategy-cta-banner .cta-btn-gold {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 13px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #0b0f10;
  background: linear-gradient(135deg, #ffe58a 0%, #c9a227 100%);
  border: 1px solid #c9a227;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.35);
  transition: transform 0.08s ease, filter 0.15s ease;
}
.strategy-cta-banner .cta-btn-gold:hover { filter: brightness(1.05); }
.strategy-cta-banner .cta-btn-gold:active { transform: translateY(1px) scale(0.99); }
@media (max-width: 768px) {
  .strategy-cta-banner { flex-direction: column; align-items: stretch; padding: 16px; }
  .strategy-cta-banner .cta-btn-gold { text-align: center; justify-content: center; }
}
