/* HTD Icon System — Lucide-style line icons (Program 1.3)
   Consistent 1.6 stroke, optically centered, no emoji. Exposed on window. */
(function () {
  const P = {
    // bottom nav
    home: 'M3 10.5 12 3l9 7.5M5 9.5V20h14V9.5',
    mission: 'M9 11l3 3L22 4M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11',
    feed: 'M4 5h16M4 5v14M4 19h16M20 5v14M8 9h8M8 13h5',
    crew: 'M16 18a4 4 0 0 0-8 0M12 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6M19 18a3 3 0 0 0-4.5-3M5 18a3 3 0 0 1 4.5-3',
    profile: 'M19 20a7 7 0 1 0-14 0M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8',
    // header
    menu: 'M3 6h18M3 12h18M3 18h18',
    bell: 'M6 9a6 6 0 1 1 12 0c0 5 2 6 2 6H4s2-1 2-6M10.5 20a1.8 1.8 0 0 0 3 0',
    compass: 'M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20M16 8l-2.5 5.5L8 16l2.5-5.5z',
    back: 'M15 19l-7-7 7-7',
    chevronRight: 'M9 6l6 6-6 6',
    spark: 'M12 3l2 6 6 .5-4.5 4 1.5 6L12 16l-5.5 3.5 1.5-6L3.5 9.5 10 9z',
    // data / proof
    heart: 'M12 20s-7-4.5-9.5-9C1 8 2.5 4.5 6 4.5c2 0 3.2 1.2 4 2.3.8-1.1 2-2.3 4-2.3 3.5 0 5 3.5 3.5 6.5C19 15.5 12 20 12 20z',
    comment: 'M21 12a8 8 0 0 1-11.5 7.2L4 21l1.8-5A8 8 0 1 1 21 12z',
    share: 'M4 12v7a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-7M16 6l-4-4-4 4M12 2v13',
    more: 'M5 12h.01M12 12h.01M19 12h.01',
    flame: 'M12 22c4 0 7-2.5 7-6.5 0-3.5-2.5-5-3.5-8C14.5 9 13 9.5 12 8 11 6 12 3 9.5 2 10 5 7 6.5 7 11.5 7 13 5 14 5 16c0 3.5 3 6 7 6z',
    shield: 'M12 22s8-3.5 8-10V5l-8-3-8 3v7c0 6.5 8 10 8 10z',
    shieldCheck: 'M12 22s8-3.5 8-10V5l-8-3-8 3v7c0 6.5 8 10 8 10zM9 12l2 2 4-4',
    target: 'M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2',
    pulse: 'M2 12h4l3 8 4-16 3 8h6',
    calendar: 'M3 9h18M7 3v3M17 3v3M5 5h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2z',
    timer: 'M12 22a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM12 10v4l2 2M9 2h6',
    trophy: 'M7 4h10v4a5 5 0 0 1-10 0V4zM7 6H4v1a3 3 0 0 0 3 3M17 6h3v1a3 3 0 0 1-3 3M9 16h6M8 21h8M12 13v3',
    flag: 'M5 21V4M5 4c3-1.5 6 1.5 9 0s4-1 4-1v9s-1.5.5-4 1.5-6-1.5-9 0',
    map: 'M9 4 3 6v14l6-2 6 2 6-2V4l-6 2-6-2zM9 4v14M15 6v14',
    gps: 'M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20M12 2v3M12 19v3M2 12h3M19 12h3M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8z',
    watch: 'M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8.5 5.5 9 2h6l.5 3.5M8.5 18.5 9 22h6l.5-3.5',
    camera: 'M3 8a2 2 0 0 1 2-2h2l1.5-2h7L17 6h2a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8zM12 17a4 4 0 1 0 0-8 4 4 0 0 0 0 8z',
    upload: 'M12 16V4M8 8l4-4 4 4M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2',
    lock: 'M6 11h12a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1zM8 11V8a4 4 0 0 1 8 0v3',
    check: 'M4 12l5 5L20 6',
    x: 'M6 6l12 12M18 6 6 18',
    alert: 'M12 3 2 20h20L12 3zM12 9v5M12 18h.01',
    settings: 'M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM19.4 13a7.7 7.7 0 0 0 0-2l2-1.5-2-3.5-2.4 1a7.6 7.6 0 0 0-1.7-1l-.4-2.5h-4l-.4 2.5a7.6 7.6 0 0 0-1.7 1l-2.4-1-2 3.5L4.6 11a7.7 7.7 0 0 0 0 2l-2 1.5 2 3.5 2.4-1a7.6 7.6 0 0 0 1.7 1l.4 2.5h4l.4-2.5a7.6 7.6 0 0 0 1.7-1l2.4 1 2-3.5L19.4 13z',
    plus: 'M12 5v14M5 12h14',
    trend: 'M3 17l6-6 4 4 8-8M21 7v5h-5',
    zap: 'M13 2 4 14h7l-1 8 9-12h-7l1-8z',
    moon: 'M21 12.8A8 8 0 1 1 11.2 3 6 6 0 0 0 21 12.8z',
    droplet: 'M12 3s6 6.5 6 11a6 6 0 0 1-12 0c0-4.5 6-11 6-11z',
    chart: 'M4 20V10M10 20V4M16 20v-6M22 20H2',
    user: 'M19 20a7 7 0 1 0-14 0M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8',
    plusCircle: 'M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20M12 8v8M8 12h8',
    search: 'M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM21 21l-4.3-4.3',
  };

  function Icon({ name, size = 22, color = 'currentColor', stroke = 1.7, fill = 'none', style }) {
    const d = P[name];
    if (!d) return null;
    return React.createElement('svg', {
      width: size, height: size, viewBox: '0 0 24 24', fill,
      stroke: color, strokeWidth: stroke, strokeLinecap: 'round',
      strokeLinejoin: 'round', style, 'aria-hidden': true,
    }, React.createElement('path', { d }));
  }

  // status bar glyphs (filled, iOS-style)
  function StatusGlyphs() {
    return React.createElement('div', { className: 'sb-right' }, [
      React.createElement('svg', { key: 's', width: 18, height: 12, viewBox: '0 0 18 12', fill: 'var(--bone)' },
        [0,1,2,3].map(i => React.createElement('rect', {
          key: i, x: i*4.6, y: 8 - i*2.4, width: 3.2, height: 4 + i*2.4, rx: 0.6,
          opacity: 1,
        }))),
      React.createElement('svg', { key: 'w', width: 17, height: 12, viewBox: '0 0 17 12', fill: 'var(--bone)' },
        React.createElement('path', { d: 'M8.5 2C5.4 2 2.6 3.2 .6 5.2l1.4 1.4a9 9 0 0 1 13 0l1.4-1.4A11 11 0 0 0 8.5 2zm0 4a6 6 0 0 0-4.2 1.7l1.5 1.5a4 4 0 0 1 5.4 0l1.5-1.5A6 6 0 0 0 8.5 6zm0 4a2.4 2.4 0 0 0-1.7.7l1.7 1.7 1.7-1.7A2.4 2.4 0 0 0 8.5 10z' })),
      React.createElement('svg', { key: 'b', width: 26, height: 13, viewBox: '0 0 26 13' }, [
        React.createElement('rect', { key: 1, x: .5, y: .5, width: 22, height: 12, rx: 3, fill: 'none', stroke: 'var(--bone)', strokeOpacity: .5 }),
        React.createElement('rect', { key: 2, x: 2, y: 2, width: 17, height: 9, rx: 1.5, fill: 'var(--bone)' }),
        React.createElement('rect', { key: 3, x: 23.5, y: 4, width: 2, height: 5, rx: 1, fill: 'var(--bone)', fillOpacity: .5 }),
      ]),
    ]);
  }

  window.HTDIcon = Icon;
  window.HTDStatusGlyphs = StatusGlyphs;
})();
