/* charts-b: fig-backlog, fig-depreciation, fig-chain, fig-growth-margin.
   Scoped under each figure id. Colors only through CSS variables, so dark mode follows the page. */

/* Before the chart is drawn (or with JavaScript off) the fallback table is the content: no blank box above it. */
#fig-backlog .chart:not(.is-ready),
#fig-depreciation .chart:not(.is-ready),
#fig-chain .chart:not(.is-ready),
#fig-growth-margin .chart:not(.is-ready) { min-height: 0; }

#fig-backlog .chart.is-ready,
#fig-depreciation .chart.is-ready,
#fig-chain .chart.is-ready,
#fig-growth-margin .chart.is-ready { min-height: 0; }

/* ---------- fig-backlog ---------- */
#fig-backlog .fig-backlog-callout {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
  margin: 0 0 14px; padding: 10px 14px;
  background: var(--compute-wash); border-radius: 8px;
}
#fig-backlog .fig-backlog-big {
  font: 600 30px/1.1 var(--serif); color: var(--compute); font-variant-numeric: tabular-nums;
}
#fig-backlog .fig-backlog-callout-t { flex: 1 1 200px; min-width: 0; font-size: 15px; line-height: 1.45; color: var(--ink); }
#fig-backlog .fig-backlog-axis { stroke: var(--line); stroke-width: 1; }
#fig-backlog .fig-backlog-rule { stroke: var(--line); stroke-width: 1; }
#fig-backlog .fig-backlog-name { font-size: 14px; font-weight: 600; fill: var(--ink); }
#fig-backlog .fig-backlog-muted { font-size: 13px; font-weight: 400; fill: var(--muted); }
#fig-backlog .fig-backlog-val { font-size: 14px; font-weight: 600; fill: var(--ink); }
#fig-backlog .fig-backlog-bar { fill: var(--compute); }
#fig-backlog .fig-backlog-bar.is-neo { fill: var(--compute); fill-opacity: 0.45; }

/* ---------- fig-depreciation ---------- */
#fig-depreciation .fig-depreciation-h {
  font: 600 15px/1.3 var(--sans); color: var(--ink); margin: 18px 0 8px;
}
#fig-depreciation .fig-depreciation-h:first-child { margin-top: 0; }
#fig-depreciation .fig-depreciation-legend { margin: 0 0 8px; }
#fig-depreciation .fig-depreciation-sw.is-bar { background: var(--cost); }
#fig-depreciation .fig-depreciation-sw.is-base { background: var(--ink); border-radius: 50%; }
#fig-depreciation .fig-depreciation-sw.is-high { background: var(--cash); border-radius: 50%; }
#fig-depreciation .fig-depreciation-grid { stroke: var(--line); stroke-width: 1; }
#fig-depreciation .fig-depreciation-zero { stroke: var(--ink); stroke-width: 1.25; }
#fig-depreciation .fig-depreciation-tick { font-size: 13px; fill: var(--muted); }
#fig-depreciation .fig-depreciation-muted { font-size: 13px; fill: var(--muted); }
#fig-depreciation .fig-depreciation-halo { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
#fig-depreciation .fig-depreciation-bar { fill: var(--cost); fill-opacity: 0.85; }
#fig-depreciation .fig-depreciation-val { font-size: 13px; font-weight: 600; fill: var(--ink); }
#fig-depreciation .fig-depreciation-life { font-size: 14px; font-weight: 600; fill: var(--ink); }
#fig-depreciation .fig-depreciation-dot-base { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
#fig-depreciation .fig-depreciation-dot-high { fill: var(--cash); stroke: var(--surface); stroke-width: 2; }
#fig-depreciation .fig-depreciation-v-base { font-size: 13px; font-weight: 600; fill: var(--ink); }
#fig-depreciation .fig-depreciation-v-high { font-size: 13px; font-weight: 600; fill: var(--cash); }
#fig-depreciation .fig-depreciation-name {
  font-size: 14px; font-weight: 600; fill: var(--ink);
  paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round;
}
#fig-depreciation .fig-depreciation-range { stroke: var(--chips); stroke-width: 5; stroke-linecap: round; stroke-opacity: 0.45; }
#fig-depreciation .fig-depreciation-pdot { fill: var(--chips); stroke: var(--surface); stroke-width: 2; }
#fig-depreciation .fig-depreciation-note {
  font-size: 14px; line-height: 1.5; color: var(--muted); margin: 10px 0 0;
  padding-left: 12px; border-left: 3px solid var(--line);
}

/* ---------- fig-chain ---------- */
#fig-chain .fig-chain-legend { margin: 0 0 10px; }
#fig-chain .fig-chain-bar { fill: var(--muted); }
#fig-chain .fig-chain-bar.is-chips, #fig-chain .fig-chain-sw.is-chips { fill: var(--chips); background: var(--chips); }
#fig-chain .fig-chain-bar.is-power, #fig-chain .fig-chain-sw.is-power { fill: var(--power); background: var(--power); }
#fig-chain .fig-chain-bar.is-compute, #fig-chain .fig-chain-sw.is-compute { fill: var(--compute); background: var(--compute); }
#fig-chain .fig-chain-bar.is-buildings, #fig-chain .fig-chain-sw.is-buildings { fill: var(--buildings); background: var(--buildings); }
#fig-chain .fig-chain-bar.is-loss, #fig-chain .fig-chain-sw.is-loss { fill: var(--cost); background: var(--cost); }
#fig-chain .fig-chain-zero { stroke: var(--ink); stroke-width: 1; }
#fig-chain .fig-chain-main { font-size: 14px; font-weight: 600; fill: var(--ink); }
#fig-chain .fig-chain-muted { font-size: 13px; font-weight: 400; fill: var(--muted); }
#fig-chain .fig-chain-val { font-size: 14px; font-weight: 600; fill: var(--ink); }
#fig-chain .fig-chain-val.is-loss { fill: var(--cost); }
#fig-chain .fig-chain-note {
  font-size: 14px; line-height: 1.5; color: var(--muted); margin: 12px 0 0;
  padding-left: 12px; border-left: 3px solid var(--line);
}

/* ---------- fig-growth-margin ---------- */
#fig-growth-margin .fig-growth-margin-grid { stroke: var(--line); stroke-width: 1; }
#fig-growth-margin .fig-growth-margin-zero { stroke: var(--ink); stroke-width: 1.25; }
#fig-growth-margin .fig-growth-margin-edge { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; }
#fig-growth-margin .fig-growth-margin-tick { font-size: 13px; fill: var(--muted); }
#fig-growth-margin .fig-growth-margin-muted { font-size: 13px; fill: var(--muted); }
#fig-growth-margin .fig-growth-margin-pt { stroke: var(--surface); stroke-width: 2; }
#fig-growth-margin .fig-growth-margin-pt.is-cloud { fill: var(--compute); }
#fig-growth-margin .fig-growth-margin-pt.is-loss { fill: var(--cost); }
#fig-growth-margin .fig-growth-margin-pt.is-supplier { fill: var(--chips); }
#fig-growth-margin .fig-growth-margin-ring { fill: var(--surface); stroke: var(--compute); stroke-width: 2.5; }
#fig-growth-margin .fig-growth-margin-lbl {
  font-size: 14px; font-weight: 600; fill: var(--ink);
  paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round;
}
#fig-growth-margin .fig-growth-margin-lbl.is-note { font-size: 13px; font-weight: 400; fill: var(--muted); }
