/* ---- Charts ------------------------------------------------------------------
   Series colours in fixed order, validated (scripts/validate_palette.js from the
   data-viz method) for each theme's surface:
     Ember  (dark, surface #1a1714)  all checks pass, all 8 >= 3:1
     Paper  (light, surface #fff)    passes; slots 3-5 are under 3:1, so every
                                     chart carries value labels and a table view */
:root, :root[data-theme="ember"] {
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --viz-grid: rgba(255, 255, 255, .08);
}
:root[data-theme="paper"] {
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #4a3aa7; --series-8: #e34948;
  --viz-grid: rgba(16, 24, 40, .08);
}
.viz { position: relative; margin: 14px 0; padding: 14px 16px 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.viz.compact { padding: 10px 12px 6px; }
.viz-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.viz-title { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.35; }
.viz-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.viz-toggle { height: 26px; padding: 0 9px; flex-shrink: 0; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 2px 0 6px; font-size: 12.5px; color: var(--text-2); }
.viz-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend i.box { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.viz-legend i.line { width: 14px; height: 2px; border-radius: 2px; background: var(--c); }
.viz-svg { display: block; width: 100%; max-width: 720px; height: auto; overflow: visible; font-family: var(--font); }
.viz-svg:focus { outline: none; }
.viz-svg:focus-visible, .viz-band:focus-visible, .viz-slice:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-base { stroke: var(--border-strong); stroke-width: 1; }
.viz-cross { stroke: var(--text-3); stroke-width: 1; pointer-events: none; }
.viz-axis { fill: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.viz-axis.strong { fill: var(--text-2); font-weight: 500; }
.viz-value { fill: var(--text-2); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; }
.viz-hit { fill: transparent; }
.viz-band { outline: none; }
.viz-band .viz-mark, .viz-slice { transition: filter .12s; }
.viz-band.hot .viz-mark, .viz-slice.hot { filter: brightness(1.15); }
.viz-slice { stroke: var(--surface); stroke-width: 2px; }
.viz-line { fill: none; stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.viz-area { opacity: .1; pointer-events: none; }
.viz-dot { stroke: var(--surface); stroke-width: 2px; pointer-events: none; }
.viz-tip { position: absolute; z-index: 5; transform: translate(-50%, calc(-100% - 12px)); pointer-events: none; min-width: 120px; max-width: 240px;
  padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 12.5px; }
.viz-tip-head { color: var(--text-2); margin-bottom: 4px; font-size: 12px; }
.viz-tip-row { display: flex; align-items: center; gap: 7px; line-height: 1.6; }
.viz-tip-row i { width: 12px; height: 2px; border-radius: 2px; background: var(--c); flex-shrink: 0; }
.viz-tip-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.viz-tip-row span { color: var(--text-3); }
.viz-table { overflow-x: auto; }
.viz-table table { border-collapse: collapse; width: 100%; font-size: 13px; }
.viz-table th, .viz-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: right; font-variant-numeric: tabular-nums; }
.viz-table th:first-child, .viz-table thead th { text-align: left; }
.viz-table thead th { color: var(--text-2); font-weight: 600; }
.viz-table tbody th { font-weight: 500; color: var(--text); }
