/**
 * Resolve --chart-color-1..12 from document.documentElement at runtime.
 * Returns hex array. Re-call on theme switch to get current theme values.
 */
export function resolveChartPalette(): string[] {
  if (typeof document === 'undefined') {
    // SSR-safe fallback (default dark theme hex values)
    return [
      '#2fb54e', '#ea4233', '#3892f3', '#f68512', '#2dceae', '#d8c537',
      '#9a4ee5', '#e54eb4', '#4e6ee5', '#e57a4e', '#c47de8', '#a3d837',
    ]
  }
  const style = getComputedStyle(document.documentElement)
  return Array.from({ length: 12 }, (_, i) =>
    style.getPropertyValue(`--chart-color-${i + 1}`).trim() || '#000000'
  )
}
