/* Icon set — single source of truth. Hand-picked lucide-style strokes. */
const Icon = ({ d, size = 16, stroke = 'currentColor', fill = 'none', style, ...rest }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill={fill} stroke={stroke}
    strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" style={style} {...rest}>
    {typeof d === 'string' ? <path d={d} /> : d}
  </svg>
);

const I = {
  search: <Icon d={<><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></>} />,
  plus: <Icon d="M12 5v14M5 12h14" />,
  grid: <Icon d={<><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></>} />,
  list: <Icon d={<><path d="M8 6h13M8 12h13M8 18h13"/><circle cx="4" cy="6" r="1"/><circle cx="4" cy="12" r="1"/><circle cx="4" cy="18" r="1"/></>} />,
  chevronDown: <Icon d="m6 9 6 6 6-6" />,
  chevronRight: <Icon d="m9 18 6-6-6-6" />,
  chevronLeft: <Icon d="m15 18-6-6 6-6" />,
  close: <Icon d="M18 6 6 18M6 6l12 12" />,
  check: <Icon d="M20 6 9 17l-5-5" />,
  filter: <Icon d="M22 3H2l8 9.5V19l4 2v-8.5L22 3Z" />,
  sort: <Icon d={<><path d="M3 7h13M3 12h9M3 17h5"/><path d="m17 11 4 4 4-4" transform="translate(-4 -2)"/></>} />,
  apps: <Icon d={<><rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/></>} />,
  database: <Icon d={<><ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M3 5v14c0 1.7 4 3 9 3s9-1.3 9-3V5"/><path d="M3 12c0 1.7 4 3 9 3s9-1.3 9-3"/></>} />,
  flow: <Icon d={<><circle cx="6" cy="6" r="3"/><circle cx="18" cy="6" r="3"/><circle cx="12" cy="18" r="3"/><path d="M9 6h6M6 9l4 6M18 9l-4 6"/></>} />,
  settings: <Icon d={<><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1Z"/></>} />,
  monitor: <Icon d={<><rect x="2" y="3" width="20" height="14" rx="2"/><path d="M8 21h8M12 17v4"/></>} />,
  smartphone: <Icon d={<><rect x="6" y="2" width="12" height="20" rx="2"/><path d="M11 18h2"/></>} />,
  tablet: <Icon d={<><rect x="4" y="2" width="16" height="20" rx="2"/><path d="M11 18h2"/></>} />,
  share: <Icon d={<><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><path d="m8.59 13.51 6.83 3.98M15.41 6.51 8.59 10.49"/></>} />,
  play: <Icon d="M6 3v18l15-9z" fill="currentColor" />,
  pause: <Icon d={<><rect x="6" y="4" width="4" height="16"/><rect x="14" y="4" width="4" height="16"/></>} fill="currentColor" />,
  undo: <Icon d={<><path d="M3 7v6h6"/><path d="M21 17a9 9 0 0 0-15-6.7L3 13"/></>} />,
  redo: <Icon d={<><path d="M21 7v6h-6"/><path d="M3 17a9 9 0 0 1 15-6.7L21 13"/></>} />,
  copy: <Icon d={<><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></>} />,
  external: <Icon d={<><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><path d="M15 3h6v6M10 14 21 3"/></>} />,
  more: <Icon d={<><circle cx="5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/></>} fill="currentColor" />,
  kai: <Icon d={<><path d="M12 2 14 8 20 10 14 12 12 18 10 12 4 10 10 8 Z"/><path d="M18 3 18.8 5 21 5.8 18.8 6.5 18 8.5 17.2 6.5 15 5.8 17.2 5Z" fill="currentColor"/></>} />,
  sparkle: <Icon d="M12 2 14 8 20 10 14 12 12 18 10 12 4 10 10 8Z" />,
  wand: <Icon d={<><path d="m3 21 9-9M15 6l3 3M12.5 2.5 17 7M17.5 2.5 22 7l-4.5 4.5L13 7Z"/></>} />,
  template: <Icon d={<><rect x="3" y="3" width="18" height="6" rx="1"/><rect x="3" y="13" width="8" height="8" rx="1"/><rect x="15" y="13" width="6" height="8" rx="1"/></>} />,
  code: <Icon d="m8 6-6 6 6 6M16 6l6 6-6 6M14 4 10 20" />,
  link: <Icon d={<><path d="M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.5 1.5"/><path d="M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.5-1.5"/></>} />,
  unlink: <Icon d={<><path d="m15 4 3-3 5 5-3 3M9 20l-3 3-5-5 3-3M5 3l16 16M10 13a5 5 0 0 0 6 .5"/></>} />,
  alert: <Icon d={<><path d="M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"/><path d="M12 9v4M12 17h.01"/></>} />,
  info: <Icon d={<><circle cx="12" cy="12" r="10"/><path d="M12 16v-4M12 8h.01"/></>} />,
  bot: <Icon d={<><rect x="3" y="8" width="18" height="12" rx="2"/><circle cx="8" cy="14" r="1" fill="currentColor"/><circle cx="16" cy="14" r="1" fill="currentColor"/><path d="M12 8V4M8 4h8M2 14h1M21 14h1"/></>} />,
  blank: <Icon d={<><rect x="4" y="3" width="16" height="18" rx="2"/><path d="M9 10h6M9 14h4"/></>} />,
  chart: <Icon d="M3 3v18h18M8 14v4M12 10v8M16 6v12" />,
  table: <Icon d={<><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18M3 15h18M9 3v18M15 3v18"/></>} />,
  text: <Icon d="M4 7V5h16v2M9 5v14M15 19h-6" />,
  arrow: <Icon d="M5 12h14M13 5l7 7-7 7" />,
  arrowUp: <Icon d="M7 17 17 7M7 7h10v10" />,
  arrowDown: <Icon d="M7 7l10 10M17 17H7V7" />,
  star: <Icon d="M12 2 15.09 8.26 22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01Z" />,
  globe: <Icon d={<><circle cx="12" cy="12" r="10"/><path d="M2 12h20M12 2a15 15 0 0 1 0 20 15 15 0 0 1 0-20"/></>} />,
  lock: <Icon d={<><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></>} />,
  user: <Icon d={<><circle cx="12" cy="7" r="4"/><path d="M4 21v-2a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v2"/></>} />,
  bell: <Icon d={<><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/></>} />,
  trend: <Icon d="M3 17l6-6 4 4 8-8M14 7h7v7" />,
  eye: <Icon d={<><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/></>} />,
  refresh: <Icon d="M3 2v6h6M21 22v-6h-6M21 10a9 9 0 0 0-15-4L3 8M3 14a9 9 0 0 0 15 4l3-2" />,
  help: <Icon d={<><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3M12 17h.01"/></>} />,
  folder: <Icon d="M3 7a2 2 0 0 1 2-2h4l2 3h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z" />,
  swap: <Icon d="M7 16V4m0 0L3 8m4-4 4 4M17 8v12m0 0 4-4m-4 4-4-4" />,
  home: <Icon d="M3 11 12 2l9 9v10a1 1 0 0 1-1 1h-5v-7h-6v7H4a1 1 0 0 1-1-1z" />,
  clock: <Icon d={<><circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/></>} />,
  deploy: <Icon d={<><path d="M4 20h16M12 4v12M6 10l6-6 6 6"/></>} />,
  logs: <Icon d={<><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M7 9h10M7 13h10M7 17h6"/></>} />,
  users: <Icon d={<><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75"/></>} />,
  git: <Icon d={<><circle cx="6" cy="18" r="3"/><circle cx="18" cy="6" r="3"/><path d="M18 9v6a4 4 0 0 1-4 4H6"/></>} />,
  terminal: <Icon d="M4 17l6-6-6-6M12 19h8" />,
  building: <Icon d={<><rect x="3" y="7" width="18" height="14" rx="1"/><path d="M8 7V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v3"/><path d="M9 12h.01M12 12h.01M15 12h.01M9 16h.01M15 16h.01"/></>} />,
  diamond: <Icon d="M12 2 22 12 12 22 2 12Z" />,
  sphere: <Icon d={<><circle cx="12" cy="12" r="9"/><path d="M12 3a15 15 0 0 1 0 18M3 12a15 15 0 0 0 18 0"/></>} />,
  trash: <Icon d={<><path d="M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"/></>} />,
  vault: <Icon d={<><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="12" cy="12" r="4"/><path d="M12 8v-2M12 18v-2M8 12H6M18 12h-2M9.5 9.5l-1.5-1.5M16 16l-1.5-1.5M14.5 9.5l1.5-1.5M8 16l1.5-1.5"/></>} />,
  catalog: <Icon d={<><rect x="2" y="3" width="20" height="14" rx="2"/><path d="M8 21h8M12 17v4"/><path d="M7 8h10M7 12h6"/></>} />,
  components: <Icon d={<><rect x="2" y="2" width="6" height="6" rx="1"/><rect x="16" y="2" width="6" height="6" rx="1"/><rect x="9" y="9" width="6" height="6" rx="1"/><rect x="2" y="16" width="6" height="6" rx="1"/><rect x="16" y="16" width="6" height="6" rx="1"/></>} />,
  workspaces: <Icon d={<><rect x="3" y="3" width="8" height="8" rx="1"/><rect x="13" y="3" width="8" height="8" rx="1"/><rect x="3" y="13" width="8" height="8" rx="1"/><rect x="13" y="13" width="8" height="8" rx="1"/></>} />,
  lineage: <Icon d={<><circle cx="5" cy="5" r="2"/><circle cx="19" cy="5" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="5" cy="19" r="2"/><circle cx="19" cy="19" r="2"/><path d="M7 5h10M5 7v10M19 7v10M7 19h10M14 10l4-4M10 14l-4 4"/></>} />,
  heartComment: <Icon d={<><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/><path d="M12 8c-1.7 0-3 1.3-3 3s3 4 3 4 3-1.3 3-4-1.3-3-3-3z" fill="currentColor"/></>} />,
  sidebarCollapse: <Icon d={<><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M9 3v18M14 9l-3 3 3 3"/></>} />,
};

Object.assign(window, { Icon, I });
