/* ════════════════════════════════════════════════════════════════════════════
   80-chart-title.css — the chart legend's title line (2026-10-21,
   static/js/lib/chart-title.js). Owns .cht-* plus the legend's two new cells
   .cl-ccy (listing currency, once) and .cl-chg (change vs the bar before), and .cl-type (2026-11-19).

   Main chart: the price pane's label row (#rv-price-lbl.cht-line) reads
   "AAPL · Apple Inc. · 5m · Nasdaq · Live"; the OHLC row under it starts
   with the currency. Workspaces chart pane: the same line is the first row
   of .mpc-legend; a tight pane keeps "NVDA · 1D" and runs it inline with
   the OHLC row. No box, no stripe: muted text on the chart with the
   existing label halo, the ticker in the primary text colour.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── main chart: the price pane's label row ── */
.cp-label.cht-line{ gap:0; white-space:nowrap; min-width:0; }
.cht-line .cht-sym{ font-weight:700; color:var(--text-primary); flex:0 0 auto; }
.cht-line .cht-name{
  color:var(--text-secondary); font-weight:500;
  flex:0 1 auto; min-width:0; max-width:28ch; overflow:hidden; text-overflow:ellipsis;
  pointer-events:auto; cursor:default;
}
.cht-line .cht-tail{ color:var(--text-muted); font-weight:500; flex:0 0 auto; }
.cht-line .cht-name:empty, .cht-line .cht-tail:empty{ display:none; }
/* The price state follows the line with the same separator. */
.cht-line .cp-pmeta{ margin-left:0; flex:0 0 auto; }
.cht-line .cp-pmeta::before{ content:"\00a0\00b7\00a0"; color:var(--text-muted); }
/* ── the OHLC row's two new cells (main chart and panes) ── */
.chart-legend .cl-ccy{
  font-family:var(--font-sans); font-weight:600; color:var(--text-muted);
  letter-spacing:.02em;
}
.chart-legend .cl-ccy[hidden]{ display:none; }
/* What the row's values are, when the chart does not draw traded prices
   (2026-11-19): "HA" on Heikin Ashi, "Renko 0.60" (the type and its size),
   "Base 306.60, first visible close" on Baseline. Same muted text as the
   currency, no new type size. */
.chart-legend .cl-type{
  font-family:var(--font-sans); font-weight:600; color:var(--text-muted);
  letter-spacing:.02em; white-space:nowrap;
}
.chart-legend .cl-type:empty{ display:none; }
/* A label and its value, kept together when the row wraps. */
.chart-legend .cl-kv{ display:inline-flex; align-items:baseline; gap:0.4375rem; white-space:nowrap; }
.chart-legend .cl-kv:empty{ display:none; }
.chart-legend .cl-chg, .chart-legend .cl-pct{ font-weight:600; }
.chart-legend .cl-chg:empty, .chart-legend .cl-pct:empty{ display:none; }
/* "+0.12 (+0.03%)": the percent sits in brackets after the move, closer
   than the legend's cell gap. */
.chart-legend .cl-chg:not(:empty) + .cl-pct{ margin-left:-0.1875rem; }
.chart-legend .cl-kv:has(> .cl-chg:empty):has(> .cl-pct:empty){ display:none; }
.chart-legend .cl-chg:not(:empty) + .cl-pct::before{ content:"("; }
.chart-legend .cl-chg:not(:empty) + .cl-pct::after{ content:")"; }

/* ── workspace chart pane: the legend's first row ── */
.mpc-legend .cl-title{ font-family:var(--font-sans); font-weight:500; color:var(--text-muted); }
.mpc-legend .cl-title .cht-sym{ font-weight:700; color:var(--text-primary); }
/* white-space:pre, not nowrap: the name's leading " · " is a flex item's
   leading space, which nowrap collapsed ("AAPL· Apple Inc."). */
.mpc-legend .cl-title .cht-name{
  color:var(--text-secondary); max-width:24ch; overflow:hidden; text-overflow:ellipsis; white-space:pre;
}
.mpc-legend .cl-title > span:empty{ display:none; }
/* The pane row gap would split "NVDA · 1D" into spaced words: the title
   runs as one string. */
.mpc-legend .cl-row.cl-title{ gap:0; }
/* A tight pane: ticker and interval only, inline with the OHLC row. */
.mpc-tight .mpc-legend .cl-title .cht-name,
.mpc-tight .mpc-legend .cl-title .cht-exch,
.mpc-tight .mpc-legend .cl-title .cl-meta,
.mpc-tight .mpc-legend .cl-chg{ display:none; }
/* With the absolute move gone the percent reads bare: "+2.41%". */
.mpc-tight .mpc-legend .cl-chg + .cl-pct{ margin-left:0; }
.mpc-tight .mpc-legend .cl-chg + .cl-pct::before,
.mpc-tight .mpc-legend .cl-chg + .cl-pct::after{ content:none; }
.mpc-tight .mpc-legend{ flex-direction:row; flex-wrap:wrap; column-gap:10px; row-gap:2px; }
.mpc-tight .mpc-legend .cl-row{ line-height:1.25em; }

/* The parts are flex items, and a flex item's leading space collapses: keep
   the " · " separators exactly as written. */
.cht-line .cht-name, .cht-line .cht-tail,
.mpc-legend .cl-title > span{ white-space:pre; }

/* The "Not on your watchlist" marker (43-untracked.css) sat centred in this
   row, where the title now runs: it moves to the row's right end, beside the
   price axis, and steps aside on a narrow chart, where the band under the
   chart carries the same Add to watchlist action. */
#cp-price{ container:cht / inline-size; }
#cp-price .utk-chip{ left:auto; right:calc(var(--pane-axis-w, 60px) + 10px); transform:none; }
@container cht (max-width: 680px){
  #cp-price .utk-chip{ display:none !important; }
}
@container cht (max-width: 480px){
  .cht-line .cht-name{ max-width:14ch; }
}

/* The OHLC row is longer now (currency + change): on a narrow chart it wraps
   under itself instead of running into the price axis and its chips. */
#chart-legend{ max-width:calc(100% - var(--pane-axis-w, 3.75rem) - 1.5rem - var(--cp-left-inset, 0px)); }
#chart-legend .cl-ohlc{ flex-wrap:wrap; row-gap:0; }
/* The title row likewise stops short of the axis. */
.cp-label.cht-line{ right:var(--pane-axis-w, 3.75rem); overflow:hidden; }
/* A tight pane: the OHLC row wraps under itself inside the legend box
   rather than losing C, the change and V off the right edge. */
.mpc-tight .mpc-legend .cl-ohlc{ white-space:normal; flex-wrap:wrap; row-gap:0; }
