/* lib/range-chart.css: the styles of the shared range chart (lib/range-chart.js rangeChart), the one copy for
   both the SSR /stocks/<SYM> pages (linked from render.js head(), before stocks.css) and /returns. Also the
   small pieces the chart shares with the stock pages' tables: the regime word colours, .regime-name, the
   .tag chips and .sr-only. Needs lib/tokens.css (--bg2, --bg3, --border, --border2, --text,
   --text2, --text3, --zero-line, the --regime-* word tier) and the page's fonts, which every page defines. */

/* Regime WORD colour tier (AA on --bg). */
.b-risk_off { color: var(--regime-risk-off); }
.b-mildly_off { color: var(--regime-mildly-off); }
.b-neutral { color: var(--regime-neutral); }
.b-mildly_on { color: var(--regime-mildly-on); }
.b-risk_on { color: var(--regime-risk-on); }
.regime-name { text-transform: uppercase; }
/* Visually hidden, still read aloud. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ── Rows: name + tags | labeled bar | how often it rose ── */
.bandmap { display: flex; flex-direction: column; gap: 6px; }
.band-row {
  display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 14px;
  padding: 9px 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg2);
}
.band-row.is-here { border-color: var(--border2); box-shadow: inset 0 0 0 1px var(--border2); }
/* No opacity on the too-little-history row: its text stays at AA (--text3 on --bg2). */
.range-row { grid-template-columns: 136px minmax(0, 1fr) 150px; gap: 18px; }
.range-row.is-insufficient .range-col { height: auto; }
.range-row.is-insufficient .regime-name { color: var(--text3); }
.band-head { display: flex; flex-direction: column; gap: 4px; }
.band-name { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; }
.band-flags { display: flex; flex-wrap: wrap; gap: 4px; }
/* Labeled bar, three tiers (rangeRow): typical label (top), bar + tick (middle), end labels outside the bar's
   ends (bottom). The zero line is the axis: a dashed muted line through the bar tier only (it never enters a
   label tier), behind the bar, at the same x in every row (one shared scale), so it cannot be taken for a
   second tick (the tick is solid, bright and thicker). */
.range-col { position: relative; height: 46px; }
.range-typical { position: absolute; top: 0; transform: translateX(-50%); font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 14px; font-weight: 700; color: var(--text); white-space: nowrap; }
.range-zero { position: absolute; top: 15px; height: 16px; width: 0; border-left: 1px dashed var(--zero-line); opacity: 0.8; z-index: 1; }
.range-band { position: absolute; top: 19px; height: 8px; border-radius: 4px; min-width: 3px; z-index: 2; }
/* A bar end past the capped axis: arrow-shaped, square where it is cut (the real value is printed at the edge). */
.range-band.clip-hi { border-radius: 4px 0 0 4px; clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 0 100%); }
.range-band.clip-lo { border-radius: 0 4px 4px 0; clip-path: polygon(6px 0, 100% 0, 100% 100%, 6px 100%, 0 50%); }
.range-band.clip-lo.clip-hi { border-radius: 0; clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 6px 100%, 0 50%); }
.range-tick { position: absolute; top: 16px; height: 14px; width: 2.5px; border-radius: 1px; transform: translateX(-50%); background: var(--text); z-index: 3; }
.range-lo, .range-hi { position: absolute; top: 32px; font-family: 'JetBrains Mono', monospace; font-size: 9.5px; line-height: 12px; letter-spacing: 0.02em; color: var(--text2); white-space: nowrap; }
.range-lo { padding-right: 3px; }
.range-hi { padding-left: 3px; }
.range-lo.is-clipped, .range-hi.is-clipped { padding: 0; color: var(--text); }
.range-na { display: block; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 0.02em; color: var(--text3); }
.range-legend { margin: -10px 0 12px; font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.04em; color: var(--text3); }
.range-row.is-limited .range-typical, .range-row.is-limited .range-lo, .range-row.is-limited .range-hi { font-style: italic; } /* italics only: no dimming */
.range-facts { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 0.02em; line-height: 1.4; color: var(--text2); }
.rf { white-space: nowrap; }
.range-row.is-limited .range-facts { font-style: italic; }
/* Tags in words: "Today" (the stats strip's label type) and "Limited history". */
.tag { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 400; letter-spacing: 0.12em; line-height: 1.3; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; white-space: nowrap; vertical-align: middle; }
.tag-today { color: var(--text); border: 1px solid var(--border2); background: var(--bg3); }
.tag-limited { color: var(--text2); border: 1px solid var(--border); font-style: normal; }
/* The one line for a missing horizon (rangeChart NO_DATA_LINE) and an empty stock panel. */
.tk-empty { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 0.04em; color: var(--text3); padding: 30px 4px; text-align: center; }

/* Rows stack (name + tags, bar, how often it rose) below 760px, so the bar column never gets too narrow
   for its labels: at 761px it is still ~345px wide. */
@media (max-width: 760px) {
  .range-row { grid-template-columns: 1fr; gap: 4px; padding: 8px 14px 9px; }
  .range-facts { font-size: 10px; }
}
@media (max-width: 600px) {
  .band-row { grid-template-columns: 1fr; gap: 4px; padding: 5px 12px; }
  .band-head { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
  .bandmap { gap: 4px; }
  .band-name { font-size: 10.5px; }
}
