* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: #131722; color: #d1d4dc; font-family: 'Trebuchet MS', sans-serif; font-size: 13px; min-width: 840px; }

.dashboard-wrap { max-width: 1600px; margin: 0 auto; }
h1 { padding: 10px 16px; font-size: 14px; color: #9598a1; border-bottom: 1px solid #2a2e39; letter-spacing: 1px; }
h2 { padding: 8px 16px 2px; font-size: 12px; color: #6a6e7a; letter-spacing: 0.5px; }

/* ── Layout: copula pairs left, pools right — equal width columns ── */
.columns-wrap   { display: flex; gap: 12px; padding: 6px; justify-content: center; }
.strategy-column { display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto; }
.copula-column  { width: 920px; }
.pools-column   { width: 920px; }
@media (max-width: 1860px) {
  .columns-wrap { flex-direction: column; }
}

.pair-card {
  background: #1e222d;
  border: 1px solid #2a2e39;
  border-radius: 4px;
  display: grid;
  align-items: start;
  min-height: 240px;
  max-width: 1140px;
}

/* ── Chart area ── */
.chart-area { padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.pair-title { font-size: 11px; color: #9598a1; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.dot-active  { background: #26a69a; }
.dot-idle    { background: #9598a1; }
.dot-waiting { background: #f0b429; }
canvas.willy-chart { display: block; }

/* ── Matrix heatmap ── */
.matrix-area { border-left: 1px solid #2a2e39; padding: 6px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.matrix-title { font-size: 10px; color: #9598a1; margin-bottom: 4px; }
canvas.matrix-canvas { image-rendering: pixelated; }

/* ── Stats panel ── */
.stats-panel { border-left: 1px solid #2a2e39; display: grid; grid-template-columns: 1fr 1fr; align-content: start; }
.stat-label, .stat-value { padding: 3px 8px; border-bottom: 1px solid #2a2e39; font-size: 11px; }
.stat-label { color: #9598a1; }
.stat-value { color: #d1d4dc; text-align: right; font-weight: 500; }

.pos-idle  { color: #9598a1; }
.pos-long  { color: #26a69a; }
.pos-short { color: #ef5350; }
.pos-trail { color: #b39ddb; }
.yes { color: #26a69a; }
.no  { color: #ef5350; }

/* Legend */
.legend { display: flex; gap: 10px; padding: 2px 0; }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 10px; color: #9598a1; }
.legend-line { width: 16px; height: 2px; }

/* ── Overlay / pop-out ── */
.overlay-backdrop {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.75); z-index: 1000;
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 10px; overflow-y: auto;
}
.overlay-backdrop.visible { display: flex; }
.overlay-content {
  background: #1e222d; border: 1px solid #2a2e39; border-radius: 6px;
  padding: 16px; width: 90vw; max-width: 1500px; position: relative;
  overflow-x: auto;
}
.overlay-close {
  position: absolute; top: 10px; right: 14px; font-size: 22px;
  color: #9598a1; cursor: pointer; line-height: 1; background: none; border: none;
  z-index: 1;
}
.overlay-close:hover { color: #d1d4dc; }
@media (max-width: 600px) {
  .overlay-backdrop { padding-top: 0; padding: 0; align-items: flex-start; }
  .overlay-content { width: 100vw; max-width: 100vw; border-radius: 0; padding: 12px 10px; }
}
#overlay-card-slot .pair-card {
  max-width: none;
}
#overlay-card-slot .stat-label,
#overlay-card-slot .stat-value { font-size: 14px; padding: 5px 10px; }
#overlay-card-slot .stats-tab   { font-size: 12px; }
