/* ============================================================
   SHLOK — Icon library (stroke line icons)
   → window.Icon
   ============================================================ */
const Icon = (function () {
  const S = { fill: "none", stroke: "currentColor", strokeWidth: 1.7, strokeLinecap: "round", strokeLinejoin: "round" };

  // path/element sets keyed by name
  const P = {
    // ---- UI ----
    chevronLeft: <polyline points="15 5 8 12 15 19" />,
    arrowRight: (<g><line x1="4" y1="12" x2="19" y2="12" /><polyline points="13 6 19 12 13 18" /></g>),
    check: <polyline points="5 12.5 10 17.5 19 7" />,
    search: (<g><circle cx="11" cy="11" r="7" /><line x1="16.5" y1="16.5" x2="21" y2="21" /></g>),
    x: (<g><line x1="6" y1="6" x2="18" y2="18" /><line x1="18" y1="6" x2="6" y2="18" /></g>),
    share: (<g><circle cx="6" cy="12" r="2.4" /><circle cx="17.5" cy="6" r="2.4" /><circle cx="17.5" cy="18" r="2.4" /><line x1="8.1" y1="11" x2="15.4" y2="7" /><line x1="8.1" y1="13" x2="15.4" y2="17" /></g>),
    mic: (<g><rect x="9" y="3" width="6" height="11" rx="3" /><path d="M5.5 11a6.5 6.5 0 0 0 13 0" /><line x1="12" y1="17.5" x2="12" y2="21" /></g>),
    pencil: (<g><path d="M4 20h4l10-10-4-4L4 16v4Z" /><line x1="13.5" y1="6.5" x2="17.5" y2="10.5" /></g>),
    skipDots: (<g><circle cx="6" cy="12" r="1.4" /><circle cx="12" cy="12" r="1.4" /><circle cx="18" cy="12" r="1.4" /></g>),
    sparkles: <path d="M12 3l1.6 4.4L18 9l-4.4 1.6L12 15l-1.6-4.4L6 9l4.4-1.6L12 3Z" />,

    // ---- roles ----
    crown: (<g><path d="M3 8l3.5 9h11L21 8l-5 4-4-7-4 7-5-4Z" /><line x1="6.5" y1="20" x2="17.5" y2="20" /></g>),
    clipboard: (<g><rect x="5" y="5" width="14" height="16" rx="2.5" /><path d="M9 5a3 3 0 0 1 6 0" /><line x1="8.5" y1="11" x2="15.5" y2="11" /><line x1="8.5" y1="15" x2="13.5" y2="15" /></g>),
    calculator: (<g><rect x="5" y="3" width="14" height="18" rx="2.5" /><line x1="8" y1="7" x2="16" y2="7" /><circle cx="9" cy="12" r="0.6" /><circle cx="12" cy="12" r="0.6" /><circle cx="15" cy="12" r="0.6" /><circle cx="9" cy="16" r="0.6" /><circle cx="12" cy="16" r="0.6" /><circle cx="15" cy="16" r="0.6" /></g>),
    headset: (<g><path d="M5 13v-1a7 7 0 0 1 14 0v1" /><rect x="3.5" y="13" width="3.5" height="6" rx="1.5" /><rect x="17" y="13" width="3.5" height="6" rx="1.5" /><path d="M19 19a4 4 0 0 1-4 3h-2" /></g>),
    wrench: <path d="M15.5 4a4.5 4.5 0 0 0-5.6 5.6L4 15.5 8.5 20l5.9-5.9A4.5 4.5 0 0 0 20 8.5l-2.8 2.8-2.5-2.5L17.5 6 15.5 4Z" />,
    home: (<g><path d="M4 11l8-7 8 7" /><path d="M6 10v9h12v-9" /><line x1="10" y1="19" x2="10" y2="14" /><line x1="14" y1="19" x2="14" y2="14" /></g>),

    // ---- business types ----
    store: (<g><path d="M4 9l1-4h14l1 4" /><path d="M4 9a2.5 2.5 0 0 0 5 0 2.5 2.5 0 0 0 5 0 2.5 2.5 0 0 0 5 0" /><path d="M5 11v8h14v-8" /><rect x="9.5" y="14" width="5" height="5" /></g>),
    building: (<g><rect x="5" y="3" width="14" height="18" rx="1.5" /><line x1="9" y1="7" x2="9" y2="7.01" /><line x1="12" y1="7" x2="12" y2="7.01" /><line x1="15" y1="7" x2="15" y2="7.01" /><line x1="9" y1="11" x2="9" y2="11.01" /><line x1="12" y1="11" x2="12" y2="11.01" /><line x1="15" y1="11" x2="15" y2="11.01" /><path d="M10 21v-3h4v3" /></g>),
    hardhat: (<g><path d="M3 17a9 9 0 0 1 18 0" /><line x1="2.5" y1="17" x2="21.5" y2="17" /><path d="M9 9a3 3 0 0 1 6 0v2H9V9Z" /><line x1="12" y1="6" x2="12" y2="9" /></g>),
    key: (<g><circle cx="8" cy="8" r="4" /><line x1="11" y1="11" x2="20" y2="20" /><line x1="17" y1="17" x2="19" y2="15" /><line x1="15" y1="15" x2="17" y2="13" /></g>),
    tools: (<g><path d="M6 3l3 3-2 2-3-3a3 3 0 0 0 4 5l7 7-2 2-7-7" /><path d="M14 7l3-3 3 3-3 3" /></g>),
    grad: (<g><path d="M3 8l9-4 9 4-9 4-9-4Z" /><path d="M7 10v5c0 1.5 2.5 3 5 3s5-1.5 5-3v-5" /><line x1="21" y1="8" x2="21" y2="13" /></g>),
    megaphone: (<g><path d="M4 10v4l11 5V5L4 10Z" /><path d="M4 10H3v4h1" /><path d="M15 8a3 3 0 0 1 0 8" /></g>),
    utensils: (<g><path d="M7 3v8M5 3v5a2 2 0 0 0 4 0V3M7 11v10" /><path d="M16 3c-1.5 0-2.5 2-2.5 5s1 4 2.5 4v9" /></g>),
    calendar: (<g><rect x="4" y="5" width="16" height="16" rx="2.5" /><line x1="4" y1="9.5" x2="20" y2="9.5" /><line x1="8" y1="3" x2="8" y2="7" /><line x1="16" y1="3" x2="16" y2="7" /><path d="M12 13l.9 1.9 2.1.3-1.5 1.5.4 2-1.9-1-1.9 1 .4-2L8.5 15.2l2.1-.3L12 13Z" /></g>),
    factory: (<g><path d="M3 21V9l6 4V9l6 4V6l3-2v17H3Z" /><line x1="7" y1="17" x2="7" y2="18" /><line x1="11" y1="17" x2="11" y2="18" /><line x1="15" y1="17" x2="15" y2="18" /></g>),
    scale: (<g><line x1="12" y1="4" x2="12" y2="20" /><line x1="7" y1="20" x2="17" y2="20" /><path d="M6 6l-3 6a3 3 0 0 0 6 0L6 6Z" /><path d="M18 6l-3 6a3 3 0 0 0 6 0l-3-6Z" /><line x1="6" y1="6" x2="18" y2="6" /></g>),
    ruler: (<g><rect x="3" y="8" width="18" height="8" rx="1.5" transform="rotate(0 12 12)" /><line x1="7" y1="8" x2="7" y2="11" /><line x1="11" y1="8" x2="11" y2="11" /><line x1="15" y1="8" x2="15" y2="11" /><line x1="19" y1="8" x2="19" y2="11" /></g>),
    pulse: (<g><path d="M4 13h3l2-5 3 9 2-6 1.5 2H20" /><path d="M20 8.5a3.5 3.5 0 0 0-6-2.5 3.5 3.5 0 0 0-6 2.5" opacity="0.45" /></g>),
    dots: (<g><circle cx="6" cy="12" r="1.5" /><circle cx="12" cy="12" r="1.5" /><circle cx="18" cy="12" r="1.5" /></g>),

    // ---- team sizes ----
    person: (<g><circle cx="12" cy="8" r="3.4" /><path d="M5.5 20a6.5 6.5 0 0 1 13 0" /></g>),
    people2: (<g><circle cx="9" cy="8" r="3" /><path d="M3.5 19a5.5 5.5 0 0 1 11 0" /><path d="M15 6.2A3 3 0 0 1 18 11" opacity="0.8" /><path d="M16.5 19a5 5 0 0 0-2-4" opacity="0.8" /></g>),
    people3: (<g><circle cx="12" cy="7.5" r="2.8" /><circle cx="5.5" cy="10" r="2.2" /><circle cx="18.5" cy="10" r="2.2" /><path d="M7.5 19a4.5 4.5 0 0 1 9 0" /><path d="M3 19a3.5 3.5 0 0 1 3-3.4" opacity="0.7" /><path d="M21 19a3.5 3.5 0 0 0-3-3.4" opacity="0.7" /></g>),
    people4: (<g><circle cx="8" cy="8" r="2.4" /><circle cx="16" cy="8" r="2.4" /><circle cx="8" cy="8" r="2.4" /><path d="M4 19a4 4 0 0 1 8 0" /><path d="M12 19a4 4 0 0 1 8 0" /></g>),

    // ---- tools ----
    chat: (<g><path d="M4 6.5A2.5 2.5 0 0 1 6.5 4h11A2.5 2.5 0 0 1 20 6.5v7a2.5 2.5 0 0 1-2.5 2.5H9l-4 4v-4H6.5" /><line x1="8" y1="9" x2="16" y2="9" /><line x1="8" y1="12" x2="13" y2="12" /></g>),
    phone: <path d="M5 4h3l1.5 4-2 1.5a11 11 0 0 0 5 5l1.5-2 4 1.5v3a2 2 0 0 1-2 2A15 15 0 0 1 3 6a2 2 0 0 1 2-2Z" />,
    notebook: (<g><rect x="6" y="3" width="13" height="18" rx="2" /><line x1="6" y1="8" x2="3.5" y2="8" /><line x1="6" y1="12" x2="3.5" y2="12" /><line x1="6" y1="16" x2="3.5" y2="16" /><line x1="10" y1="8" x2="15" y2="8" /><line x1="10" y1="12" x2="15" y2="12" /></g>),
    sheet: (<g><rect x="4" y="4" width="16" height="16" rx="2" /><line x1="4" y1="9.5" x2="20" y2="9.5" /><line x1="4" y1="15" x2="20" y2="15" /><line x1="10" y1="4" x2="10" y2="20" /><line x1="15" y1="4" x2="15" y2="20" /></g>),
    brain: <path d="M9 4a2.5 2.5 0 0 0-2.5 2.5A2.5 2.5 0 0 0 5 11a2.5 2.5 0 0 0 1.5 3A2.5 2.5 0 0 0 9 18.5 2 2 0 0 0 12 17V5.5A1.5 1.5 0 0 0 9 4Zm6 0a2.5 2.5 0 0 1 2.5 2.5A2.5 2.5 0 0 1 19 11a2.5 2.5 0 0 1-1.5 3A2.5 2.5 0 0 1 15 18.5 2 2 0 0 1 12 17" />,
    appwin: (<g><rect x="6" y="3" width="12" height="18" rx="2.5" /><line x1="6" y1="7" x2="18" y2="7" /><circle cx="9" cy="11.5" r="1.3" /><circle cx="13.5" cy="11.5" r="1.3" /><circle cx="9" cy="15.5" r="1.3" /><circle cx="13.5" cy="15.5" r="1.3" /></g>),
    doc: (<g><path d="M7 3h7l4 4v14H7V3Z" /><polyline points="13 3 13 8 18 8" /><line x1="9.5" y1="13" x2="15" y2="13" /><line x1="9.5" y1="16.5" x2="15" y2="16.5" /></g>),
    shuffle: (<g><path d="M3 7h3l9 10h3" /><path d="M3 17h3l3-3.4" /><path d="M13 9l2-2 0 0" opacity="0" /><polyline points="16 4 19 7 16 10" /><polyline points="16 14 19 17 16 20" /><path d="M13.5 10.5L15 9" /></g>),

    // ---- worries / misc ----
    phoneback: (<g><path d="M5 5h3l1.4 3.6-1.8 1.4a10 10 0 0 0 4.4 4.4l1.4-1.8L17 18v2a1.8 1.8 0 0 1-1.8 1.8A14 14 0 0 1 3 7.8 1.8 1.8 0 0 1 5 6V5Z" /><polyline points="14 3 14 7 18 7" /><path d="M14 7a5 5 0 0 1 5-1" opacity="0.7" /></g>),
    sparkle: <path d="M12 3l1.7 4.7L18 9.4l-4.3 1.7L12 16l-1.7-4.9L6 9.4l4.3-1.7L12 3Z" />,
    truck: (<g><rect x="2.5" y="7" width="11" height="9" rx="1" /><path d="M13.5 10h4l3 3v3h-7" /><circle cx="7" cy="18" r="1.8" /><circle cx="17" cy="18" r="1.8" /></g>),
    approve: (<g><circle cx="12" cy="12" r="8.5" /><polyline points="8.5 12.5 11 15 16 9" /></g>),
    folder: <path d="M3 7a2 2 0 0 1 2-2h4l2 2.5h6a2 2 0 0 1 2 2V17a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z" />,
    box: (<g><path d="M4 8l8-4 8 4v8l-8 4-8-4V8Z" /><polyline points="4 8 12 12 20 8" /><line x1="12" y1="12" x2="12" y2="20" /></g>),
    alert: (<g><path d="M12 4l9 16H3L12 4Z" /><line x1="12" y1="10" x2="12" y2="14.5" /><circle cx="12" cy="17" r="0.6" /></g>),
    eye: (<g><path d="M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z" /><circle cx="12" cy="12" r="3" /></g>),
    check2: (<g><circle cx="12" cy="12" r="8.5" /><polyline points="8.5 12 11 14.5 15.5 9.5" /></g>),
    bell: (<g><path d="M6 16V11a6 6 0 0 1 12 0v5l1.5 2.5H4.5L6 16Z" /><path d="M10 19a2 2 0 0 0 4 0" /></g>),
    repeat: (<g><polyline points="17 3 20 6 17 9" /><path d="M4 11V9a3 3 0 0 1 3-3h13" /><polyline points="7 21 4 18 7 15" /><path d="M20 13v2a3 3 0 0 1-3 3H4" /></g>),
    weight: (<g><path d="M5 21l1.5-9h11L19 21H5Z" /><path d="M9 12a3 3 0 0 1 6 0" /><circle cx="12" cy="7" r="2.2" /></g>),

    // ---- sliders / feelings ----
    steer: (<g><circle cx="12" cy="12" r="8.5" /><circle cx="12" cy="12" r="2.2" /><line x1="12" y1="3.5" x2="12" y2="9.8" /><line x1="4.5" y1="16" x2="10" y2="13" /><line x1="19.5" y1="16" x2="14" y2="13" /></g>),
    leaf: (<g><path d="M5 19C4 12 9 5 19 5c0 10-7 15-14 14Z" /><path d="M8 16c3-4 6-6 9-7" /></g>),
    gauge: (<g><path d="M4 18a8 8 0 0 1 16 0" /><line x1="12" y1="18" x2="15.5" y2="11.5" /><circle cx="12" cy="18" r="1.2" /></g>),
    link: (<g><path d="M9.5 14.5l5-5" /><path d="M8 11l-2 2a3 3 0 0 0 4 4l2-2" /><path d="M16 13l2-2a3 3 0 0 0-4-4l-2 2" /></g>),

    // ---- trust ----
    touch: (<g><path d="M9 11V6a1.8 1.8 0 0 1 3.6 0v5" /><path d="M12.6 11V8.5a1.7 1.7 0 0 1 3.4 0V13c0 4-2 7-5.5 7A5 5 0 0 1 6 16l-1.5-3a1.6 1.6 0 0 1 2.7-1.6L9 13" /></g>),
    mobile: (<g><rect x="7" y="3" width="10" height="18" rx="2.5" /><line x1="10.5" y1="18" x2="13.5" y2="18" /></g>),
    shield: (<g><path d="M12 3l7 3v5c0 4.5-3 8-7 10-4-2-7-5.5-7-10V6l7-3Z" /><polyline points="9 12 11 14 15 9.5" /></g>),
    tag: (<g><path d="M4 4h7l9 9-7 7-9-9V4Z" /><circle cx="8" cy="8" r="1.4" /></g>),
    clock: (<g><circle cx="12" cy="12" r="8.5" /><polyline points="12 7.5 12 12 15.5 14" /></g>),
    globe: (<g><circle cx="12" cy="12" r="8.5" /><ellipse cx="12" cy="12" rx="3.6" ry="8.5" /><line x1="3.5" y1="12" x2="20.5" y2="12" /></g>),
    exit: (<g><path d="M14 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8" /><polyline points="16 8 20 12 16 16" /><line x1="10" y1="12" x2="20" y2="12" /></g>),
    userx: (<g><circle cx="10" cy="8" r="3.2" /><path d="M4 20a6 6 0 0 1 11-3.3" /><line x1="16.5" y1="15" x2="21" y2="19.5" /><line x1="21" y1="15" x2="16.5" y2="19.5" /></g>),
    question: (<g><circle cx="12" cy="12" r="8.5" /><path d="M9.5 9.5a2.5 2.5 0 0 1 4.8 1c0 1.7-2.3 2-2.3 3.5" /><circle cx="12" cy="17" r="0.6" /></g>),
  };

  function Icon({ name, size }) {
    if (name === "rupee") {
      return <span className="glyph" aria-hidden="true">{"\u20B9"}</span>;
    }
    const body = P[name] || P.dots;
    return (
      <svg viewBox="0 0 24 24" width={size || 22} height={size || 22} {...S} aria-hidden="true">
        {body}
      </svg>
    );
  }
  return Icon;
})();
window.Icon = Icon;
