// icons.jsx — line icon set for PsyFit. Stroke uses currentColor.

function Icon({ name, size = 24, stroke = 2, style = {}, fill = 'none' }) {
  const p = { fill: 'none', stroke: 'currentColor', strokeWidth: stroke, strokeLinecap: 'round', strokeLinejoin: 'round' };
  const paths = {
    // nav
    home: <><path {...p} d="M3 11l9-7 9 7"/><path {...p} d="M5 10v9a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-9"/></>,
    plan: <><rect {...p} x="3" y="4" width="18" height="17" rx="2.5"/><path {...p} d="M3 9h18M8 2.5v3M16 2.5v3M8 14h4M8 17.5h7"/></>,
    progress: <><path {...p} d="M4 19V5M4 19h16"/><path {...p} d="M7 15l4-5 3 3 5-7"/></>,
    calendar: <><rect {...p} x="3" y="4.5" width="18" height="16.5" rx="2.5"/><path {...p} d="M3 9.5h18M8 2.5v4M16 2.5v4"/></>,
    profile: <><circle {...p} cx="12" cy="8" r="4"/><path {...p} d="M4 21c0-4 4-6 8-6s8 2 8 6"/></>,
    // actions
    plus: <path {...p} d="M12 5v14M5 12h14"/>,
    minus: <path {...p} d="M5 12h14"/>,
    check: <path {...p} d="M4 12.5l5 5 11-12"/>,
    chevR: <path {...p} d="M9 5l7 7-7 7"/>,
    chevL: <path {...p} d="M15 5l-7 7 7 7"/>,
    chevD: <path {...p} d="M5 9l7 7 7-7"/>,
    close: <path {...p} d="M5 5l14 14M19 5L5 19"/>,
    search: <><circle {...p} cx="11" cy="11" r="7"/><path {...p} d="M20 20l-4-4"/></>,
    flame: <path {...p} d="M12 3c1 3 4 4.5 4 8.5a4 4 0 0 1-8 0c0-1.5.7-2.5 1.4-3.4C8 9.5 7.5 11 7.5 12.5 7.5 9 9.5 6 12 3z"/>,
    dumbbell: <><path {...p} d="M6.5 6.5l11 11"/><path {...p} d="M3.5 8.5l-1 1a1.4 1.4 0 0 0 0 2l3 3a1.4 1.4 0 0 0 2 0l1-1"/><path {...p} d="M20.5 15.5l1-1a1.4 1.4 0 0 0 0-2l-3-3a1.4 1.4 0 0 0-2 0l-1 1"/><path {...p} d="M14.5 5.5l4 4M5.5 14.5l4 4"/></>,
    clock: <><circle {...p} cx="12" cy="12" r="9"/><path {...p} d="M12 7v5l3.5 2"/></>,
    trophy: <><path {...p} d="M7 4h10v4a5 5 0 0 1-10 0V4z"/><path {...p} d="M7 5H4v2a3 3 0 0 0 3 3M17 5h3v2a3 3 0 0 1-3 3M9 17h6M10 21h4M12 13v4"/></>,
    bolt: <path {...p} d="M13 2L4 14h7l-1 8 9-12h-7l1-8z"/>,
    target: <><circle {...p} cx="12" cy="12" r="9"/><circle {...p} cx="12" cy="12" r="5"/><circle {...p} cx="12" cy="12" r="1" fill="currentColor"/></>,
    edit: <><path {...p} d="M4 20h4L19 9l-4-4L4 16v4z"/><path {...p} d="M14 6l4 4"/></>,
    trash: <><path {...p} d="M4 7h16M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2M6 7l1 13a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1l1-13"/></>,
    timer: <><circle {...p} cx="12" cy="13" r="8"/><path {...p} d="M12 13V9M9 2h6"/></>,
    settings: <><circle {...p} cx="12" cy="12" r="3"/><path {...p} d="M12 2v3M12 19v3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M2 12h3M19 12h3M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1"/></>,
    share: <><circle {...p} cx="6" cy="12" r="2.5"/><circle {...p} cx="17" cy="6" r="2.5"/><circle {...p} cx="17" cy="18" r="2.5"/><path {...p} d="M8.2 10.8l6.6-3.6M8.2 13.2l6.6 3.6"/></>,
    fire: <path {...p} d="M12 3c1 3 4 4.5 4 8.5a4 4 0 0 1-8 0c0-1.5.7-2.5 1.4-3.4C8 9.5 7.5 11 7.5 12.5 7.5 9 9.5 6 12 3z"/>,
    play: <path {...p} d="M7 4.5l13 7.5-13 7.5V4.5z" fill="currentColor" stroke="none"/>,
    bell: <><path {...p} d="M6 9a6 6 0 0 1 12 0c0 5 2 6 2 6H4s2-1 2-6z"/><path {...p} d="M10 20a2 2 0 0 0 4 0"/></>,
    heart: <path {...p} d="M12 20s-7-4.5-9.5-9C1 8 2.5 4.5 6 4.5c2 0 3 1 4 2.5 1-1.5 2-2.5 4-2.5 3.5 0 5 3.5 3.5 6.5C19 15.5 12 20 12 20z"/>,
    ruler: <><rect {...p} x="3" y="8" width="18" height="8" rx="1.5"/><path {...p} d="M7 8v3M11 8v4M15 8v3M19 8v4"/></>,
    apple: <><path {...p} d="M12 8c-1-2-3-2.5-4.5-2C5 6.8 4 9 4.5 12c.4 2.5 2 6 3.5 6 1 0 1.5-.6 2.5-.6s1.5.6 2.5.6c1.5 0 3.1-3.5 3.5-6 .3-2-.2-3.6-1.5-4.5"/><path {...p} d="M12 8c0-2 1.2-3.3 3-3.5"/></>,
  };
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill={fill} style={{ display: 'block', flexShrink: 0, ...style }}>
      {paths[name] || null}
    </svg>
  );
}

Object.assign(window, { Icon });
