// Camus — icon glyphs (inline SVG, stroke-based, SF-Symbols-adjacent weights)

const CamusIcon = ({ size = 16, color = "currentColor", ...rest }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...rest}>
    <path d="M12 3v18M5 6.5l14 11M19 6.5l-14 11" stroke={color} strokeWidth="2.2" strokeLinecap="round" />
    <circle cx="12" cy="12" r="2.6" fill={color} stroke="none" />
  </svg>
);

const glyphPaths = {
  sparkle: (
    <path d="M12 3l1.9 5.6L19.5 10l-5.6 1.9L12 17.5l-1.9-5.6L4.5 10l5.6-1.4L12 3zM18.5 15.5l.9 2.6 2.6.9-2.6.9-.9 2.6-.9-2.6-2.6-.9 2.6-.9.9-2.6z" fill="currentColor" stroke="none" />
  ),
  shorten: (
    <>
      <path d="M4 7h16M4 12h10M4 17h6" strokeLinecap="round" />
    </>
  ),
  smile: (
    <>
      <circle cx="12" cy="12" r="8.2" />
      <path d="M8.8 14.2c.8 1.2 1.9 1.8 3.2 1.8s2.4-.6 3.2-1.8" strokeLinecap="round" />
      <circle cx="9.3" cy="9.8" r=".6" fill="currentColor" stroke="none" />
      <circle cx="14.7" cy="9.8" r=".6" fill="currentColor" stroke="none" />
    </>
  ),
  reply: (
    <path d="M9.5 6L4 11l5.5 5M4.5 11H15a5 5 0 015 5v2" strokeLinecap="round" strokeLinejoin="round" />
  ),
  summary: (
    <>
      <rect x="4" y="4" width="16" height="16" rx="3.5" />
      <path d="M8 9.5h8M8 13h5" strokeLinecap="round" />
    </>
  ),
  briefcase: (
    <>
      <rect x="3.5" y="7.5" width="17" height="12" rx="3" />
      <path d="M9 7.5V6a2 2 0 012-2h2a2 2 0 012 2v1.5M3.5 12.5h17" strokeLinecap="round" />
    </>
  ),
  pencil: (
    <path d="M14.5 5.5l4 4L8 20H4v-4L14.5 5.5zM12.5 7.5l4 4" strokeLinecap="round" strokeLinejoin="round" />
  ),
  copy: (
    <>
      <rect x="8.5" y="8.5" width="11" height="11" rx="2.5" />
      <path d="M5.5 14.5h-.2A1.8 1.8 0 013.5 12.7V5.3a1.8 1.8 0 011.8-1.8h7.4a1.8 1.8 0 011.8 1.8v.2" strokeLinecap="round" />
    </>
  ),
  retry: (
    <path d="M5 12a7 7 0 1 1 2 4.9M5 12V7.5M5 12h4.5" strokeLinecap="round" strokeLinejoin="round" fill="none" transform="rotate(40 12 12)" />
  ),
  check: <path d="M5 12.5l4.5 4.5L19 7.5" strokeLinecap="round" strokeLinejoin="round" />,
  lock: (
    <>
      <rect x="5.5" y="10.5" width="13" height="9.5" rx="2.5" />
      <path d="M8.5 10.5V8a3.5 3.5 0 017 0v2.5" />
    </>
  ),
  history: (
    <>
      <circle cx="12" cy="12" r="8.2" />
      <path d="M12 7.5V12l3 2" strokeLinecap="round" strokeLinejoin="round" />
    </>
  ),
  gear: (
    <>
      <circle cx="12" cy="12" r="3" />
      <path d="M12 3.5v2.2M12 18.3v2.2M3.5 12h2.2M18.3 12h2.2M6 6l1.6 1.6M16.4 16.4L18 18M18 6l-1.6 1.6M7.6 16.4L6 18" strokeLinecap="round" />
    </>
  ),
  search: (
    <>
      <circle cx="10.5" cy="10.5" r="6" />
      <path d="M15.2 15.2L20 20" strokeLinecap="round" />
    </>
  ),
  apple: (
    <path d="M15.8 12.6c0-2.2 1.8-3.2 1.9-3.3-1-1.5-2.6-1.7-3.2-1.7-1.4-.1-2.7.8-3.4.8-.7 0-1.8-.8-2.9-.8-1.5 0-2.9.9-3.7 2.2-1.6 2.7-.4 6.8 1.1 9 .7 1.1 1.6 2.3 2.8 2.3 1.1 0 1.5-.7 2.9-.7s1.7.7 2.9.7c1.2 0 2-1.1 2.7-2.2.9-1.2 1.2-2.4 1.2-2.5-.1 0-2.3-.9-2.3-3.8zM13.6 5.9c.6-.8 1-1.8.9-2.9-.9 0-2 .6-2.6 1.4-.6.7-1.1 1.8-1 2.8 1 .1 2.1-.5 2.7-1.3z" fill="currentColor" stroke="none" />
  ),
  arrowUp: <path d="M12 19V5M6 11l6-6 6 6" strokeLinecap="round" strokeLinejoin="round" />,
  plus: <path d="M12 5v14M5 12h14" strokeLinecap="round" />,
  chevron: <path d="M9 6l6 6-6 6" strokeLinecap="round" strokeLinejoin="round" />,
  command: (
    <path d="M9 9V6.5A2.5 2.5 0 1 0 6.5 9H9zm0 0h6m-6 0v6m6-6V6.5A2.5 2.5 0 1 1 17.5 9H15zm0 0v6m0 0h-6m6 0v2.5a2.5 2.5 0 1 0 2.5-2.5H15zm-6 0v2.5A2.5 2.5 0 1 1 6.5 15H9z" strokeLinejoin="round" />
  ),
};

const Glyph = ({ name, size = 16, color = "currentColor", strokeWidth = 1.7, style }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth={strokeWidth} style={{ flex: "none", ...style }}>
    {glyphPaths[name] || null}
  </svg>
);

Object.assign(window, { CamusIcon, Glyph });
