/* ============ INLINE SVG ICON SET (self-contained, no external font) ============ */
const ICON_PATHS = {
  // line icons (inherit svg stroke=currentColor)
  wifi: <><path d="M2.5 9a15 15 0 0 1 19 0" /><path d="M5.5 12.5a10.5 10.5 0 0 1 13 0" /><path d="M8.5 16a6 6 0 0 1 7 0" /><circle cx="12" cy="19.5" r="1.1" fill="currentColor" stroke="none" /></>,
  "mug-hot": <><path d="M5 8h11v5a4.5 4.5 0 0 1-4.5 4.5h-2A4.5 4.5 0 0 1 5 13V8z" /><path d="M16 9.5h2a2.2 2.2 0 0 1 0 4.4h-2" /><path d="M8 2.5c-.7 1-.7 2 0 3M11.5 2.5c-.7 1-.7 2 0 3" /></>,
  "mug-saucer": <><path d="M6 7.5h9V12a4 4 0 0 1-4 4h-1a4 4 0 0 1-4-4V7.5z" /><path d="M15 8.5h2a2 2 0 0 1 0 4h-2" /><path d="M4 19.5h14" /></>,
  fire: <><path d="M12 2.5c2.6 3 4.2 5.2 4.2 8.7a4.2 4.2 0 0 1-8.4 0c0-1.9 1-3.2 2.1-4 0 1.1.7 1.9 1.6 1.9-.2-2.1.4-4.6.5-6.6z" /></>,
  shower: <><path d="M11 11V6.5A2.5 2.5 0 0 1 13.5 4H17" /><path d="M5.5 11h11" /><path d="M8 14.5v1.5M11 14.5v2.5M14 14.5v1.5" /></>,
  "map-location-dot": <><path d="M9 4 3.5 6v13.5L9 17.5l6 2 5.5-2V4l-5.5 2L9 4z" /><path d="M9 4v13.5M15 6v3" /><path d="M17.5 13c1.5 0 2.5 1 2.5 2.4 0 1.6-2.5 4.1-2.5 4.1S15 17 15 15.4c0-1.4 1-2.4 2.5-2.4z" /></>,
  "location-dot": <><path d="M12 21.5s6.5-5.7 6.5-11A6.5 6.5 0 0 0 5.5 10.5c0 5.3 6.5 11 6.5 11z" /><circle cx="12" cy="10.5" r="2.4" /></>,
  couch: <><path d="M5 11.5V8a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v3.5" /><path d="M3.5 11.5a2 2 0 0 1 2 2V16h13v-2.5a2 2 0 0 1 2-2" /><path d="M6 16v2.5M18 16v2.5" /></>,
  "jug-detergent": <><path d="M9.5 3.5h4V5l1.8 1.8V19a1.2 1.2 0 0 1-1.2 1.2H8.9A1.2 1.2 0 0 1 7.7 19V6.8L9.5 5V3.5z" /><path d="M7.7 11h7.6" /></>,
  "square-parking": <><rect x="4" y="4" width="16" height="16" rx="3.5" /><path d="M9.5 16.5V8h3.1a2.6 2.6 0 0 1 0 5.2H9.5" /></>,
  "plug-circle-bolt": <><path d="M13 3 5.5 13H11l-1 8 8.5-11H13l1-7z" fill="currentColor" stroke="none" /></>,
  "bag-shopping": <><path d="M5.5 8h13l-1 12.2H6.5L5.5 8z" /><path d="M9 8V6.2a3 3 0 0 1 6 0V8" /></>,
  "people-group": <><circle cx="8" cy="8" r="2.8" /><circle cx="16" cy="8" r="2.8" /><path d="M2.5 19.5a5.5 5.5 0 0 1 11 0" /><path d="M14 14.6a5.5 5.5 0 0 1 7.5 4.9" /></>,
  mountain: <><path d="M3 19.5 9.5 7.5l3.5 6.2 2.3-3.6 5.7 9.4H3z" /></>,
  "mountain-sun": <><circle cx="7" cy="6.5" r="2.4" /><path d="M3 19.5l5-7 3 4 4-6 6 9H3z" /></>,
  sun: <><circle cx="12" cy="12" r="4" /><path d="M12 2v2.2M12 19.8V22M2 12h2.2M19.8 12H22M4.8 4.8l1.6 1.6M17.6 17.6l1.6 1.6M19.2 4.8l-1.6 1.6M6.4 17.6l-1.6 1.6" /></>,
  moon: <><path d="M21 13A8.5 8.5 0 1 1 11 3a6.6 6.6 0 0 0 10 10z" /></>,
  star: <><path d="M12 3.2l2.7 5.6 6.1.8-4.5 4.2 1.2 6.1L12 17.2 6.5 19.9l1.2-6.1L3.2 9.6l6.1-.8L12 3.2z" fill="currentColor" stroke="none" /></>,
  "star-o": <><path d="M12 3.2l2.7 5.6 6.1.8-4.5 4.2 1.2 6.1L12 17.2 6.5 19.9l1.2-6.1L3.2 9.6l6.1-.8L12 3.2z" /></>,
  "quote-left": <><path d="M9.2 6C6 6 4 8.2 4 11.4V18h6v-6.6H7.2c0-1.7 1-2.8 2.6-3V6zM20 6c-3.2 0-5.2 2.2-5.2 5.4V18h6v-6.6h-2.8c0-1.7 1-2.8 2.6-3V6z" fill="currentColor" stroke="none" /></>,
  phone: <><path d="M5 4h3.2l1.5 5-2.1 1.5a11.5 11.5 0 0 0 5.4 5.4l1.5-2.1 5 1.5V19a2 2 0 0 1-2.1 2A16 16 0 0 1 3 6.1 2 2 0 0 1 5 4z" /></>,
  envelope: <><rect x="3" y="5" width="18" height="14" rx="2.2" /><path d="m3.5 7 8.5 6 8.5-6" /></>,
  whatsapp: <><path d="M3.8 20.2l1.3-4.1A8.2 8.2 0 1 1 8.9 19l-5.1 1.2z" /><path d="M9 8.6c0 3.2 3.2 6.4 6.4 6.4.6 0 1.1-.5 1.1-1.1l-2.1-1-1 1c-1-.5-2-1.5-2.6-2.6l1-1-1-2.1c-.6 0-1.1.5-1.1 1.1-.4 0-.7.6-.7 1.3z" fill="currentColor" stroke="none" /></>,
  "circle-check": <><circle cx="12" cy="12" r="9" /><path d="m8 12 2.8 2.8L16 9" /></>,
  xmark: <><path d="M6 6l12 12M18 6 6 18" /></>,
  bars: <><path d="M4 7h16M4 12h16M4 17h16" /></>,
  expand: <><path d="M8 3.5H5.5a2 2 0 0 0-2 2V8M16 3.5h2.5a2 2 0 0 1 2 2V8M20.5 16v2.5a2 2 0 0 1-2 2H16M3.5 16v2.5a2 2 0 0 0 2 2H8" /></>,
  "chevron-left": <><path d="M15 5l-7 7 7 7" /></>,
  "chevron-right": <><path d="M9 5l7 7-7 7" /></>,
  circle: <><circle cx="12" cy="12" r="6" fill="currentColor" stroke="none" /></>,
  check: <><path d="M5 12.5l4.2 4.2L19 6.5" /></>,
  "calendar-check": <><rect x="3.5" y="5" width="17" height="15.5" rx="2.2" /><path d="M3.5 9.5h17M8 3v4M16 3v4M9 14.5l2 2 4-4" /></>,
  bed: <><path d="M2.5 18V8M2.5 13H16a3.5 3.5 0 0 1 3.5 3.5V18M19.5 18v-2" /><circle cx="6.5" cy="10.8" r="1.6" /><path d="M9.5 13V9.5h6.2" /></>,
  "arrow-up": <><path d="M12 19.5V5M6 11l6-6 6 6" /></>,
  guitar: <><circle cx="7.5" cy="17.5" r="2.3" fill="currentColor" stroke="none" /><circle cx="16.5" cy="15.5" r="2.3" fill="currentColor" stroke="none" /><path d="M9.8 17.5V6.5l9-2.2v11.2" /><path d="M9.8 9.5l9-2.2" /></>,
  "laptop-code": <><rect x="4" y="5" width="16" height="11" rx="1.8" /><path d="M2 19.5h20" /><path d="M10.5 9 8.5 11l2 2M13.5 9l2 2-2 2" /></>,
  "champagne-glasses": <><path d="M7 4.5h10l-1 5.5a4 4 0 0 1-8 0L7 4.5z" /><path d="M12 13.5v5M9 18.5h6" /></>,
  instagram: <><rect x="4" y="4" width="16" height="16" rx="5" /><circle cx="12" cy="12" r="3.6" /><circle cx="17" cy="7" r="1.1" fill="currentColor" stroke="none" /></>,
  "facebook-f": <><path d="M14.5 7.5H16.5V4.5h-2.2a3.8 3.8 0 0 0-3.8 3.8V10.5H8.2v3h2.3V21h3.2v-7.5h2.4l.5-3h-2.9V8.5a1 1 0 0 1 1-1z" fill="currentColor" stroke="none" /></>,
  youtube: <><rect x="3" y="6" width="18" height="12" rx="3.4" /><path d="M11 9.4 15.2 12 11 14.6V9.4z" fill="currentColor" stroke="none" /></>,
  _fallback: <><circle cx="12" cy="12" r="2.5" fill="currentColor" stroke="none" /></>
};

function Icon({ name = "", className = "", style = {}, ...rest }) {
  const tokens = String(name).trim().split(/\s+/);
  let key = tokens[tokens.length - 1].replace(/^fa-/, "");
  if (key === "star" && /fa-regular/.test(name)) key = "star-o";
  const paths = ICON_PATHS[key] || ICON_PATHS._fallback;
  return (
    <svg
      className={`ic ${className}`.trim()}
      viewBox="0 0 24 24" width="1em" height="1em"
      fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"
      style={{ display: "inline-block", verticalAlign: "-0.125em", flexShrink: 0, ...style }}
      aria-hidden="true" {...rest}
    >
      {paths}
    </svg>
  );
}

Object.assign(window, { Icon });
