/* The charts under a chat answer (docs/chat-charts.md). Only the app's own tokens (so light and dark follow the theme with no rule of their own), only logical properties (so the figure follows the
   language's direction around a picture whose time axis always runs left to right), and no colour that means good or bad: the accent for the company, the neutral inks for the rest, a hatched
   outlined fill for an estimate. Targets are 44 px. */

.cc { display: grid; gap: 10px; min-width: 0; max-width: 100%; }
.cc-figure { --cc-surface: var(--panel-2); margin: 0; padding: 10px 12px 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--cc-surface); }
/* A table that is wider than the panel scrolls inside its own box: no child may make the figure wider than the panel. */
.cc-figure > * { min-width: 0; }
.cc-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cc-title { flex: 1; min-width: 0; margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; }
.cc-sym { font-weight: 700; }
.cc-close { flex: none; margin-inline-end: -8px; }
.cc-state { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-height: 96px; color: var(--muted); font-size: 14px; }
.cc-facts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin: 0; color: var(--muted); }
.cc-fact b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.cc-note { margin: 0; line-height: 1.4; }

/* The picture: drawn at the box's own width; the box is left to right whatever the page's direction, so the time runs oldest to newest from the left. */
.cc-plot { position: relative; width: 100%; min-height: 212px; direction: ltr; }
.cc-svg { display: block; max-width: 100%; user-select: none; -webkit-user-select: none; }
.cc-grid line { stroke: var(--line); stroke-width: 1; }
.cc-grid line.cc-zero { stroke: var(--line-2); }
.cc-tick, .cc-x, .cc-row { fill: var(--muted); font-size: 10.5px; font-family: inherit; font-variant-numeric: tabular-nums; }
.cc-x.sub { fill: var(--faint); font-size: 10px; }
.cc-val { fill: var(--text); font-size: 10.5px; font-weight: 600; font-family: inherit; font-variant-numeric: tabular-nums; }
.cc-row { fill: var(--text); font-size: 10px; }

/* An estimate has its fill drawn by the picture's own hatch (the fill attribute names it); only a report has the plain one. */
.cc-bar:not(.est) { fill: var(--accent); }
.cc-bar.peer:not(.est) { fill: var(--faint); }
.cc-bar.est { stroke: var(--accent); stroke-width: 1.5; }
.cc-hatch-bg { fill: var(--cc-surface); }
.cc-hatch-line { stroke: var(--accent); stroke-width: 2; }
.cc-dot { fill: var(--text); stroke: var(--cc-surface); stroke-width: 2; }
.cc-dot.hollow { fill: var(--cc-surface); stroke: var(--text); stroke-width: 2; }
.cc-median { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 5 4; }
.cc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cc-line.l0 { stroke: var(--accent); }
.cc-line.l1 { stroke: var(--text); stroke-dasharray: 6 3; }
.cc-line.l2 { stroke: var(--muted); stroke-dasharray: 1.5 4; }
.cc-mark { stroke: var(--cc-surface); stroke-width: 2; }
.cc-mark.l0 { fill: var(--accent); }
.cc-mark.l1 { fill: var(--text); }
.cc-mark.l2 { fill: var(--muted); }

/* One area for each category, full height: where the pointer and the keyboard land. */
.cc-hit { fill: transparent; outline: none; touch-action: pan-y; }
.cc-hit.on { fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.cc-hit:focus-visible { stroke: var(--accent); stroke-width: 2; }
.cc-tip { position: absolute; top: 2px; z-index: 2; transform: translateX(-50%); min-width: 130px; max-width: min(260px, 92%); padding: 8px 10px; display: grid; gap: 3px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); line-height: 1.35; pointer-events: none; text-align: start; }
.cc-tip[hidden] { display: none; }
.cc-tip-period { font-weight: 600; }
.cc-tip-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cc-tip-name { min-width: 0; color: var(--muted); }
.cc-tip-value { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cc-tip-more { font-size: 12px; }

/* The legend: a key for each kind of mark, drawn as the mark is, so identity is never colour alone. */
.cc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); }
.cc-legend-item { display: inline-flex; }
.cc-key { display: inline-flex; align-items: center; gap: 6px; }
.cc-swatch { flex: none; display: inline-block; }
.cc-swatch.bar { width: 12px; height: 12px; border-radius: 3px; background: var(--accent); }
.cc-swatch.peer { width: 12px; height: 12px; border-radius: 3px; background: var(--faint); }
.cc-swatch.est { width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid var(--accent); background: repeating-linear-gradient(135deg, var(--accent) 0 1.5px, var(--cc-surface) 1.5px 4px); }
.cc-swatch.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text); }
.cc-swatch.dot.hollow { box-sizing: border-box; border: 2px solid var(--text); background: transparent; }
.cc-swatch.line { width: 18px; height: 0; border-top: 2px solid var(--accent); }
.cc-swatch.line.l1 { border-top: 2px dashed var(--text); }
.cc-swatch.line.l2 { border-top: 2px dotted var(--muted); }
.cc-swatch.median { width: 18px; height: 0; border-top: 1.5px dashed var(--text); }
.cc-legend-row { flex-basis: 100%; }

/* "Show the numbers": the same figures as a table, scrolling inside its own box so the panel never scrolls sideways. */
.cc-table summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; color: var(--accent); font-size: 14px; }
.cc-table-wrap { overflow-x: auto; max-width: 100%; }
.cc-numbers { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.cc-numbers th, .cc-numbers td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
.cc-numbers thead th { color: var(--muted); font-weight: 500; white-space: normal; text-transform: none; letter-spacing: 0; vertical-align: bottom; min-width: 5em; }
.cc-numbers td { text-align: end; }
.cc-numbers tbody th { font-weight: 500; }
.cc-numbers tr.est td, .cc-numbers tr.est th { color: var(--muted); }
.cc-numbers tr.fact th { color: var(--muted); }

.cc-prov { display: grid; gap: 2px; line-height: 1.4; }
.cc-prov-title { font-weight: 600; }
.cc-prov-row { overflow-wrap: anywhere; }
.cc-link { display: inline-flex; align-items: center; min-height: var(--tap); }

/* The chips: a prepared request each, 44 px, and the way to open another beside an open chart. */
.cc-offers { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cc-offers-label { flex-basis: 100%; }
button.cc-chip { min-height: var(--tap); padding: 8px 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 14px; font-weight: 400; line-height: 1.3; white-space: normal; text-align: start; cursor: pointer; }
button.cc-chip:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 899px) {
  .cc-figure { padding: 8px 10px 10px; }
}
