// icons.jsx — simple stroke icons (geometric, 24px viewBox)
const Svg = ({ s = 18, sw = 1.6, children, fill = "none", ...p }) => (
  <svg width={s} height={s} viewBox="0 0 24 24" fill={fill} stroke="currentColor"
       strokeWidth={sw} strokeLinecap="round" strokeLinejoin="round"
       style={{ flexShrink: 0, display: "block" }} {...p}>{children}</svg>
);

const Icon = {
  github: (p) => (
    <svg width={p.s || 18} height={p.s || 18} viewBox="0 0 24 24" fill="currentColor" style={{ flexShrink: 0, display: "block" }} {...p}>
      <path d="M12 2C6.48 2 2 6.58 2 12.25c0 4.53 2.87 8.37 6.84 9.73.5.1.68-.22.68-.49 0-.24-.01-.88-.01-1.73-2.78.62-3.37-1.37-3.37-1.37-.46-1.18-1.11-1.5-1.11-1.5-.91-.64.07-.62.07-.62 1 .07 1.53 1.06 1.53 1.06.89 1.56 2.34 1.11 2.91.85.09-.66.35-1.11.63-1.37-2.22-.26-4.56-1.14-4.56-5.07 0-1.12.39-2.03 1.03-2.75-.1-.26-.45-1.3.1-2.71 0 0 .84-.28 2.75 1.05a9.34 9.34 0 0 1 5 0c1.91-1.33 2.75-1.05 2.75-1.05.55 1.41.2 2.45.1 2.71.64.72 1.03 1.63 1.03 2.75 0 3.94-2.35 4.81-4.58 5.06.36.32.68.94.68 1.9 0 1.37-.01 2.48-.01 2.82 0 .27.18.6.69.49A10.02 10.02 0 0 0 22 12.25C22 6.58 17.52 2 12 2Z"/>
    </svg>
  ),
  shield: (p) => <Svg {...p}><path d="M12 3l7 3v5c0 4.5-3 7.6-7 9-4-1.4-7-4.5-7-9V6l7-3z"/></Svg>,
  shieldCheck: (p) => <Svg {...p}><path d="M12 3l7 3v5c0 4.5-3 7.6-7 9-4-1.4-7-4.5-7-9V6l7-3z"/><path d="M9 11.8l2 2 4-4"/></Svg>,
  lock: (p) => <Svg {...p}><rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/></Svg>,
  eye: (p) => <Svg {...p}><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z"/><circle cx="12" cy="12" r="3"/></Svg>,
  database: (p) => <Svg {...p}><ellipse cx="12" cy="5.5" rx="8" ry="3"/><path d="M4 5.5v6c0 1.66 3.58 3 8 3s8-1.34 8-3v-6"/><path d="M4 11.5v6c0 1.66 3.58 3 8 3s8-1.34 8-3v-6"/></Svg>,
  trash: (p) => <Svg {...p}><path 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"/></Svg>,
  check: (p) => <Svg {...p}><path d="M5 12.5l4.5 4.5L19 7"/></Svg>,
  checkCircle: (p) => <Svg {...p}><circle cx="12" cy="12" r="9"/><path d="M8.5 12.5l2.5 2.5 4.5-5"/></Svg>,
  x: (p) => <Svg {...p}><path d="M6 6l12 12M18 6L6 18"/></Svg>,
  xCircle: (p) => <Svg {...p}><circle cx="12" cy="12" r="9"/><path d="M9 9l6 6M15 9l-6 6"/></Svg>,
  question: (p) => <Svg {...p}><circle cx="12" cy="12" r="9"/><path d="M9.2 9.3a2.8 2.8 0 0 1 5.4 1c0 1.8-2.6 2.2-2.6 3.7"/><circle cx="12" cy="17" r="0.6" fill="currentColor"/></Svg>,
  chevron: (p) => <Svg {...p}><path d="M9 6l6 6-6 6"/></Svg>,
  chevronDown: (p) => <Svg {...p}><path d="M6 9l6 6 6-6"/></Svg>,
  arrowRight: (p) => <Svg {...p}><path d="M5 12h14M13 6l6 6-6 6"/></Svg>,
  branch: (p) => <Svg {...p}><circle cx="6" cy="6" r="2.4"/><circle cx="6" cy="18" r="2.4"/><circle cx="18" cy="8" r="2.4"/><path d="M6 8.4v7.2M8.4 7.4c4 .6 4.6 2.2 4.6 4.6v2"/></Svg>,
  commit: (p) => <Svg {...p}><circle cx="12" cy="12" r="3.2"/><path d="M12 3v5.8M12 15.2V21"/></Svg>,
  diff: (p) => <Svg {...p}><path d="M6 3v8M3 6h6M6 16h6M16 3l-3 3 3 3M18 21v-8M21 18h-6"/></Svg>,
  flag: (p) => <Svg {...p}><path d="M5 21V4M5 4h11l-2 4 2 4H5"/></Svg>,
  filter: (p) => <Svg {...p}><path d="M3 5h18l-7 8v6l-4-2v-4z"/></Svg>,
  download: (p) => <Svg {...p}><path d="M12 3v12M7 11l5 5 5-5M5 21h14"/></Svg>,
  doc: (p) => <Svg {...p}><path d="M7 3h7l4 4v14H7z"/><path d="M14 3v4h4M9.5 12.5h5M9.5 16h5"/></Svg>,
  code: (p) => <Svg {...p}><path d="M9 8l-4 4 4 4M15 8l4 4-4 4"/></Svg>,
  bolt: (p) => <Svg {...p}><path d="M13 2L4 14h6l-1 8 9-12h-6z"/></Svg>,
  search: (p) => <Svg {...p}><circle cx="11" cy="11" r="6.5"/><path d="M16 16l4.5 4.5"/></Svg>,
  warn: (p) => <Svg {...p}><path d="M12 4l9 16H3z"/><path d="M12 10v4M12 17.4v.2"/></Svg>,
  key: (p) => <Svg {...p}><circle cx="8" cy="14" r="4"/><path d="M11 11l8-8M16 5l2 2M14 7l2 2"/></Svg>,
  star: (p) => <Svg {...p}><path d="M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.8-5.2 2.8 1-5.8L4.5 9.7l5.9-.9z"/></Svg>,
  box: (p) => <Svg {...p}><path d="M12 3l8 4.5v9L12 21l-8-4.5v-9z"/><path d="M4 7.5l8 4.5 8-4.5M12 12v9"/></Svg>,
  layers: (p) => <Svg {...p}><path d="M12 3l9 5-9 5-9-5z"/><path d="M3 13l9 5 9-5"/></Svg>,
  sliders: (p) => <Svg {...p}><path d="M4 7h10M18 7h2M4 17h2M10 17h10"/><circle cx="16" cy="7" r="2"/><circle cx="8" cy="17" r="2"/></Svg>,
  dot: (p) => <svg width={p.s || 10} height={p.s || 10} viewBox="0 0 10 10" style={{ flexShrink: 0, display: "block" }} {...p}><circle cx="5" cy="5" r="4" fill="currentColor"/></svg>,
  spinner: (p) => (
    <svg width={p.s || 18} height={p.s || 18} viewBox="0 0 24 24" fill="none" style={{ flexShrink: 0, display: "block", animation: "spin 0.8s linear infinite" }} {...p}>
      <circle cx="12" cy="12" r="9" stroke="currentColor" strokeWidth="2.4" opacity="0.18"/>
      <path d="M21 12a9 9 0 0 0-9-9" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round"/>
    </svg>
  ),
  link: (p) => <Svg {...p}><path d="M9 15l6-6M10.5 6.5l1.8-1.8a3.5 3.5 0 0 1 5 5L14.5 12M13.5 17.5l-1.8 1.8a3.5 3.5 0 0 1-5-5L9 11.5"/></Svg>,
  clock: (p) => <Svg {...p}><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3.5 2"/></Svg>,
  copy: (p) => <Svg {...p}><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a1 1 0 0 1 1-1h9"/></Svg>,
  restart: (p) => <Svg {...p}><path d="M20 11.5a8 8 0 1 1-2.4-5.7"/><path d="M20 3.2v4.6h-4.6"/></Svg>,
  func: (p) => <Svg {...p}><path d="M14 4h-1.5A2.5 2.5 0 0 0 10 6.5v11A2.5 2.5 0 0 1 7.5 20H6M7 12h7"/></Svg>,
  globe: (p) => <Svg {...p}><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3c2.5 2.4 2.5 15.6 0 18M12 3c-2.5 2.4-2.5 15.6 0 18"/></Svg>,
};

window.Icon = Icon;
