/**
 * trader-performance.css — Performance workspace (BT.traderPerformance).
 * Dark flat BT/v3 tokens with concrete hex fallbacks (never a bare var() that
 * could render white). HTML labels/legend/readout at 13px so SVG carries lines
 * only — no tiny low-contrast SVG text. Responsive SVG line plots.
 */

.tp-root {
  color: var(--v3-text, #e0e0e0);
  font-size: 13px;
}

.tp-unavailable .tp-notice,
.tp-notice {
  padding: 16px 18px;
  border: 1px solid var(--v3-border, rgba(255,255,255,.075));
  border-radius: 8px;
  background: var(--v3-surface, #14161b);
  color: var(--v3-text-dim, #9aa4b2);
  font-size: 13px;
}

.tp-meta {
  font-size: 12px;
  color: var(--v3-text-dim, #6b7280);
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.tp-qual {
  border: 1px solid var(--v3-border, rgba(255,255,255,.12));
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--v3-warn, #d9a441);
}

/* ── metric grid ── */
.tp-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.tp-metric {
  background: var(--v3-surface, #14161b);
  border: 1px solid var(--v3-border, rgba(255,255,255,.075));
  border-radius: 8px;
  padding: 10px 12px;
}
.tp-metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--v3-text-dim, #6b7280);
  margin-bottom: 4px;
}
.tp-metric-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--v3-text-bright, #ffffff);
  font-variant-numeric: tabular-nums;
}

/* ── shared date cursor control ── */
.tp-cursor-ctl {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.tp-cursor-label {
  font-size: 12px;
  color: var(--v3-text-dim, #6b7280);
}
.tp-slider {
  width: 100%;
  accent-color: var(--v3-accent, #4f8cff);
}
.tp-readout {
  font-size: 13px;
  color: var(--v3-text, #e0e0e0);
  font-variant-numeric: tabular-nums;
  min-height: 18px;
}
.tp-readout b { color: var(--v3-text-bright, #ffffff); }

/* ── legend (HTML, not SVG text) ── */
.tp-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  margin-bottom: 10px;
}
.tp-key { display: inline-flex; align-items: center; gap: 6px; color: var(--v3-text-dim, #9aa4b2); }
.tp-key::before {
  content: "";
  width: 14px; height: 3px; border-radius: 2px;
  background: currentColor;
}
.tp-key.tp-eq   { color: var(--v3-accent, #4f8cff); }
.tp-key.tp-bench{ color: var(--v3-text-dim, #9aa4b2); }
.tp-key.tp-cmp  { color: var(--v3-warn, #d9a441); }

/* ── SVG panels ── */
.tp-panels { display: flex; flex-direction: column; gap: 16px; }
.tp-panel {
  background: var(--v3-surface, #14161b);
  border: 1px solid var(--v3-border, rgba(255,255,255,.075));
  border-radius: 8px;
  padding: 10px 12px;
}
.tp-panel-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--v3-text-dim, #6b7280);
  margin-bottom: 8px;
}
.tp-svg {
  display: block;
  width: 100%;
  height: 180px;
}
.tp-empty { color: var(--v3-text-dim, #6b7280); font-size: 13px; padding: 24px 0; text-align: center; }

.tp-line { stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.tp-line.tp-eq    { stroke: var(--v3-accent, #4f8cff); }
.tp-line.tp-bench { stroke: var(--v3-text-dim, #6b7280); stroke-dasharray: 4 3; }
.tp-line.tp-cmp   { stroke: var(--v3-warn, #d9a441); stroke-dasharray: 2 3; }
.tp-line.tp-dd    { stroke: var(--v3-danger, #e0524a); }
.tp-line.tp-exp   { stroke: var(--v3-ok, #3fb27f); }
.tp-cursor { stroke: var(--v3-text-bright, #ffffff); stroke-width: 1; opacity: .35; }

/* ── monthly tiles ── */
.tp-monthly { margin-top: 18px; }
.tp-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.tp-tile {
  background: var(--v3-surface, #14161b);
  border: 1px solid var(--v3-border, rgba(255,255,255,.075));
  border-radius: 6px;
  padding: 8px 10px;
}
.tp-tile.tp-partial { border-style: dashed; opacity: .85; }
.tp-tile-month { font-size: 11px; color: var(--v3-text-dim, #6b7280); }
.tp-partial-tag {
  font-size: 10px;
  color: var(--v3-warn, #d9a441);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tp-tile-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--v3-text-bright, #ffffff);
  font-variant-numeric: tabular-nums;
}

.tp-cmp-reason {
  margin-top: 10px;
  font-size: 12px;
  color: var(--v3-text-dim, #6b7280);
  font-style: italic;
}

@media (max-width: 640px) {
  .tp-svg { height: 150px; }
  .tp-metric-value { font-size: 15px; }
}

.tp-plot-row {display:flex; gap:8px; min-width:0;}
.tp-y-axis {display:flex; flex-direction:column; justify-content:space-between; flex:0 0 78px; height:180px; font-size:12px; color:#aab6c5; text-align:right; font-variant-numeric:tabular-nums;}
.tp-plot-row .tp-svg {min-width:0; flex:1;}
.tp-grid {stroke:#526071;stroke-width:.5;opacity:.35;fill:none;}
.tp-axis-dates {display:flex;justify-content:space-between;margin:8px 0 0 86px;font-size:12px;color:#aab6c5;}
.tp-method,.tp-notes {font-size:12px;line-height:1.5;color:#aab6c5;margin:0 0 14px;}
.tp-metric {min-width:0;}.tp-metric-value {overflow-wrap:anywhere;}
@media(max-width:640px){.tp-y-axis{height:150px;flex-basis:67px;font-size:11px;}.tp-axis-dates{margin-left:75px;}}
