/* FinPulse icons — stroke SVGs, 24 viewBox, currentColor. Exports Icon to window. */
const FP_ICONS = {
  markets: 'M3 3v18h18 M7 14l4-4 3 3 5-6',
  stocks: 'M4 18l5-5 3 3 8-8 M16 5h4v4',
  indices: 'M3 12h4l2-7 4 14 2-7h6',
  funds: 'M12 3a9 9 0 1 0 9 9h-9z M12 3v9h9 M12 3a9 9 0 0 1 9 9',
  ipo: 'M12 2l3 6 6 .5-4.5 4 1.5 6-6-3.5-6 3.5 1.5-6L3 8.5 9 8z',
  news: 'M4 5h16v14H4z M8 9h8 M8 13h8 M8 17h5',
  screener: 'M3 5h18 M6 12h12 M10 19h4',
  portfolio: 'M3 8h18v11H3z M8 8V6a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2 M3 13h18',
  calc: 'M5 3h14v18H5z M8 7h8 M8 11h2 M12 11h2 M16 11h0 M8 15h2 M12 15h2 M8 18h6',
  search: 'M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14z M20 20l-3.5-3.5',
  bell: 'M6 9a6 6 0 1 1 12 0c0 5 2 6 2 6H4s2-1 2-6 M10 21h4',
  sun: 'M12 4v-2 M12 22v-2 M5 5L3.5 3.5 M20.5 20.5L19 19 M5 19l-1.5 1.5 M20.5 3.5L19 5 M4 12H2 M22 12h-2 M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8z',
  moon: 'M21 12.8A8.5 8.5 0 1 1 11.2 3a6.5 6.5 0 0 0 9.8 9.8z',
  menu: 'M4 6h16 M4 12h16 M4 18h16',
  user: 'M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8z M4 20c0-4 3.5-6 8-6s8 2 8 6',
  chevright: 'M9 6l6 6-6 6',
  arrowup: 'M12 19V5 M6 11l6-6 6 6',
  arrowdown: 'M12 5v14 M6 13l6 6 6-6',
  x: 'M6 6l12 12 M18 6L6 18',
  sliders: 'M4 6h10 M18 6h2 M4 12h2 M10 12h10 M4 18h8 M16 18h4 M14 4v4 M6 10v4 M12 16v4',
  clock: 'M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18z M12 7v5l3 2',
  star: 'M12 3l2.7 5.5 6 .9-4.3 4.2 1 6-5.4-2.8-5.4 2.8 1-6L3.3 9.4l6-.9z',
  trend: 'M3 17l6-6 4 4 8-8 M21 7v4 M21 7h-4',
  more: 'M5 12h.01 M12 12h.01 M19 12h.01',
  gear: 'M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6 M19.4 13a7.9 7.9 0 0 0 0-2l2-1.5-2-3.5-2.4 1a7.9 7.9 0 0 0-1.7-1l-.4-2.5h-4l-.4 2.5a7.9 7.9 0 0 0-1.7 1l-2.4-1-2 3.5 2 1.5a7.9 7.9 0 0 0 0 2l-2 1.5 2 3.5 2.4-1a7.9 7.9 0 0 0 1.7 1l.4 2.5h4l.4-2.5a7.9 7.9 0 0 0 1.7-1l2.4 1 2-3.5z',
  link: 'M10 14a4 4 0 0 0 6 .5l3-3a4 4 0 0 0-6-6l-1.5 1.5 M14 10a4 4 0 0 0-6-.5l-3 3a4 4 0 0 0 6 6l1.5-1.5',
  refresh: 'M4 12a8 8 0 0 1 14-5l2 2 M20 5v4h-4 M20 12a8 8 0 0 1-14 5l-2-2 M4 19v-4h4',
};

function Icon({ name, size = 20, fill = false, style }) {
  const d = FP_ICONS[name];
  if (!d) return null;
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none"
      stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" style={style}>
      {d.split(' M').map((seg, i) => <path key={i} d={(i ? 'M' : '') + seg} fill={fill ? 'currentColor' : 'none'} fillOpacity={fill ? 0.12 : 0} />)}
    </svg>
  );
}
Object.assign(window, { Icon });
