// Icon library — minimal SVG, single style
const Icon = ({ name, size = 18, stroke = 1.6 }) => {
  const props = { width: size, height: size, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: stroke, strokeLinecap: 'round', strokeLinejoin: 'round' };
  const paths = {
    search: <><circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/></>,
    arrow: <><path d="M5 12h14"/><path d="m13 6 6 6-6 6"/></>,
    arrowUp: <><path d="M7 17 17 7"/><path d="M7 7h10v10"/></>,
    play: <><polygon points="6 4 20 12 6 20 6 4" fill="currentColor"/></>,
    check: <><path d="M5 12l5 5 9-11"/></>,
    plus: <><path d="M12 5v14M5 12h14"/></>,
    star: <><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" fill="currentColor" stroke="none"/></>,
    pin: <><path d="M20 10c0 7-8 13-8 13s-8-6-8-13a8 8 0 0 1 16 0Z"/><circle cx="12" cy="10" r="3"/></>,
    mail: <><rect x="3" y="5" width="18" height="14" rx="2"/><path d="m3 7 9 6 9-6"/></>,
    phone: <><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.37 1.9.72 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.35 1.85.59 2.81.72A2 2 0 0 1 22 16.92Z"/></>,
    bookmark: <><path d="m19 21-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16Z"/></>,
    verified: <><path d="m9 12 2 2 4-4"/><path d="M12 2 4 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-8-3Z"/></>,
    spark: <><path d="M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M5.6 18.4l2.1-2.1M16.3 7.7l2.1-2.1"/></>,
    chat: <><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"/></>,
    chevron: <><path d="m6 9 6 6 6-6"/></>,
    eye: <><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></>,
    bolt: <><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" fill="currentColor" stroke="none" opacity="0.15"/><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></>,
    globe: <><circle cx="12" cy="12" r="10"/><path d="M2 12h20M12 2a15.3 15.3 0 0 1 0 20M12 2a15.3 15.3 0 0 0 0 20"/></>,
    // category icons
    megaphone: <><path d="m3 11 18-5v12L3 14"/><path d="M11.6 16.8a3 3 0 1 1-5.8-1.6"/></>,
    coin: <><circle cx="12" cy="12" r="9"/><path d="M14 9.5a2.5 2.5 0 0 0-5 0c0 1.5 1 2 2.5 2s2.5.5 2.5 2a2.5 2.5 0 0 1-5 0M12 7v10"/></>,
    heart: <><path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.29 1.51 4.04 3 5.5l7 7Z"/></>,
    cpu: <><rect x="4" y="4" width="16" height="16" rx="2"/><rect x="9" y="9" width="6" height="6"/><path d="M9 1v3M15 1v3M9 20v3M15 20v3M20 9h3M20 15h3M1 9h3M1 15h3"/></>,
    book: <><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2Z"/><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7Z"/></>,
    shirt: <><path d="M20.4 7.5 16 4l-4 3-4-3-4.4 3.5L5 11h2v9h10v-9h2Z"/></>,
    briefcase: <><rect x="2" y="7" width="20" height="14" rx="2"/><path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/></>,
    map: <><polygon points="1 6 8 3 16 6 23 3 23 18 16 21 8 18 1 21 1 6"/><path d="M8 3v15M16 6v15"/></>,
    home: <><path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"/><path d="M9 22V12h6v10"/></>,
    sparkles: <><path d="M12 3 13.5 9.5 20 11l-6.5 1.5L12 19l-1.5-6.5L4 11l6.5-1.5Z"/><path d="M19 3v4M21 5h-4"/></>,
    chart: <><path d="M3 3v18h18"/><path d="m7 14 4-4 4 4 5-5"/></>,
    bed: <><path d="M2 9v12M22 9v12M2 14h20M2 18h20"/><path d="M22 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v3"/><circle cx="7" cy="11" r="2"/></>,
    lamp: <><path d="M8 2h8l2 7H6Z"/><path d="M12 9v13M9 22h6"/></>,
    utensils: <><path d="M3 2v7c0 1.1.9 2 2 2h2v11M7 2v9M21 15V2a4 4 0 0 0-4 4v6c0 1.1.9 2 2 2h2v9"/></>,
    plug: <><path d="M9 2v6M15 2v6M5 8h14v3a7 7 0 0 1-14 0ZM12 18v4"/></>,
    truck: <><path d="M1 3h15v13H1zM16 8h4l3 3v5h-7"/><circle cx="5.5" cy="18.5" r="2.5"/><circle cx="18.5" cy="18.5" r="2.5"/></>,
    cart: <><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.7 13.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6"/></>,
    building: <><rect x="4" y="2" width="16" height="20" rx="2"/><path d="M9 22v-4h6v4M8 6h.01M16 6h.01M12 6h.01M8 10h.01M16 10h.01M12 10h.01M8 14h.01M16 14h.01M12 14h.01"/></>,
    // feature tile icons
    'feat-video': <><polygon points="23 7 16 12 23 17 23 7"/><rect x="1" y="5" width="15" height="14" rx="2"/></>,
    'feat-library': <><path d="M3 3h4v18H3zM10 3h4v18h-4zM18 3l3 .5-2 18-3-.5z"/></>,
    'feat-lead': <><polygon points="12 2 15 9 22 9 17 14 19 22 12 17 5 22 7 14 2 9 9 9 12 2" stroke="currentColor"/></>,
    'feat-listing': <><path d="M9 11l3 3 8-8"/><path d="M20 12v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h11"/></>,
    'feat-rapid': <><path d="m13 2-3 7h5l-3 13"/></>,
    'feat-promo': <><circle cx="6" cy="6" r="3"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="12" r="3"/><path d="m8.6 7.4 6.8 3.2M8.6 16.6l6.8-3.2"/></>,
    'feat-secure': <><path d="M12 2 4 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5Z"/><path d="m9 12 2 2 4-4"/></>,
    'feat-rank': <><path d="M3 3v18h18"/><path d="m7 14 4-4 4 4 5-5"/><circle cx="20" cy="9" r="2" fill="currentColor"/></>,
  };
  return <svg {...props}>{paths[name] || paths.search}</svg>;
};

window.Icon = Icon;
