// icons.jsx — reusable SVG icons and brand glyphs for the ForestStore ad.

// Brand color palette from Arboreal Native
const FS = {
  surface:       '#fcf9f1',
  surfaceLow:    '#f6f3eb',
  surfaceMid:    '#f1eee6',
  surfaceHigh:   '#ebe8e0',
  surfaceDeep:   '#e5e2db',
  ink:           '#1c1c17',
  inkSoft:       '#414844',
  outline:       '#717974',
  outlineLight:  '#c1c8c3',
  primary:       '#000b06',       // soil
  primaryDark:   '#00261a',
  primaryMid:    '#0f3d2e',       // soil-deep
  secondary:     '#166c46',
  sapling:       '#a3f4c3',       // sapling-mint
  saplingDim:    '#88d7a8',
  inverseGreen:  '#a8cfbc',
  error:         '#ba1a1a',
  white:         '#ffffff',
};

// ── Sapling: stylized 3-leaf sapling, the brand mark ────────────────────────
function Sapling({ size = 200, color = FS.primaryMid, accent = FS.sapling, progress = 1 }) {
  // progress 0..1 controls how much has grown
  const p = Math.max(0, Math.min(1, progress));
  // Stem: 0..0.5 draws stem; 0.5..1 draws leaves
  const stemP = Math.min(1, p / 0.5);
  const leavesP = Math.max(0, (p - 0.45) / 0.55);

  const stemY = 100 - 60 * stemP; // grows from 100 up to 40

  return (
    <svg width={size} height={size} viewBox="0 0 120 120" fill="none">
      {/* ground line */}
      <line x1="20" y1="105" x2="100" y2="105" stroke={color} strokeWidth="2" strokeLinecap="round" opacity="0.35"/>

      {/* stem */}
      <path
        d={`M 60 105 L 60 ${stemY}`}
        stroke={color}
        strokeWidth="3"
        strokeLinecap="round"
      />

      {/* left leaf */}
      <g style={{
        transform: `scale(${leavesP}) translate(0px, ${(1 - leavesP) * 6}px)`,
        transformOrigin: '60px 70px',
        transition: 'none',
        opacity: leavesP,
      }}>
        <path
          d="M 60 70 Q 38 55, 30 72 Q 36 88, 60 80 Z"
          fill={accent}
          stroke={color}
          strokeWidth="2.5"
          strokeLinejoin="round"
        />
      </g>
      {/* right leaf */}
      <g style={{
        transform: `scale(${leavesP}) translate(0px, ${(1 - leavesP) * 6}px)`,
        transformOrigin: '60px 60px',
        opacity: leavesP,
      }}>
        <path
          d="M 60 60 Q 84 48, 92 65 Q 84 82, 60 72 Z"
          fill={accent}
          stroke={color}
          strokeWidth="2.5"
          strokeLinejoin="round"
        />
      </g>
      {/* top bud */}
      <g style={{
        transform: `scale(${leavesP})`,
        transformOrigin: `60px ${stemY}px`,
        opacity: leavesP,
      }}>
        <ellipse cx="60" cy={stemY - 4} rx="6" ry="9" fill={accent} stroke={color} strokeWidth="2"/>
      </g>
    </svg>
  );
}

// ── Tree: a slightly fuller, taller version of the sapling ──────────────────
function Tree({ size = 220, color = FS.primaryMid, accent = FS.sapling, progress = 1 }) {
  const p = Math.max(0, Math.min(1, progress));

  // multiple layers of leaves grow in stages
  const stem = Math.min(1, p / 0.4);
  const layer1 = Math.max(0, Math.min(1, (p - 0.35) / 0.25));
  const layer2 = Math.max(0, Math.min(1, (p - 0.55) / 0.25));
  const layer3 = Math.max(0, Math.min(1, (p - 0.75) / 0.25));

  return (
    <svg width={size} height={size} viewBox="0 0 160 200" fill="none">
      <line x1="20" y1="180" x2="140" y2="180" stroke={color} strokeWidth="2" strokeLinecap="round" opacity="0.35"/>

      {/* trunk */}
      <path
        d={`M 80 180 L 80 ${180 - 130 * stem}`}
        stroke={color}
        strokeWidth="4"
        strokeLinecap="round"
      />

      {/* lowest leaves */}
      <g style={{ transform: `scale(${layer1})`, transformOrigin: '80px 130px', opacity: layer1 }}>
        <ellipse cx="55" cy="130" rx="18" ry="14" fill={accent} stroke={color} strokeWidth="2.5" />
        <ellipse cx="105" cy="130" rx="18" ry="14" fill={accent} stroke={color} strokeWidth="2.5" />
      </g>
      {/* mid leaves */}
      <g style={{ transform: `scale(${layer2})`, transformOrigin: '80px 95px', opacity: layer2 }}>
        <ellipse cx="60" cy="95" rx="20" ry="16" fill={accent} stroke={color} strokeWidth="2.5"/>
        <ellipse cx="100" cy="95" rx="20" ry="16" fill={accent} stroke={color} strokeWidth="2.5"/>
        <ellipse cx="80" cy="80" rx="22" ry="17" fill={accent} stroke={color} strokeWidth="2.5"/>
      </g>
      {/* top crown */}
      <g style={{ transform: `scale(${layer3})`, transformOrigin: '80px 55px', opacity: layer3 }}>
        <ellipse cx="80" cy="55" rx="26" ry="20" fill={accent} stroke={color} strokeWidth="2.5"/>
      </g>
    </svg>
  );
}

// ── Receipt / invoice glyph used in problem scene ───────────────────────────
function Receipt({ width = 220, height = 280, label = 'INVOICE', amount = 'LKR 150,000', subtitle = 'Setup fee', color = FS.ink, accent = FS.error }) {
  return (
    <svg width={width} height={height} viewBox="0 0 220 280" fill="none" style={{ display: 'block' }}>
      <defs>
        <pattern id="ttooth" patternUnits="userSpaceOnUse" width="14" height="14">
          <path d="M0 7 L7 0 L14 7" stroke={color} strokeWidth="0" fill="none"/>
        </pattern>
      </defs>
      <path d="M 10 6 L 210 6 L 210 250 L 200 260 L 190 250 L 180 260 L 170 250 L 160 260 L 150 250 L 140 260 L 130 250 L 120 260 L 110 250 L 100 260 L 90 250 L 80 260 L 70 250 L 60 260 L 50 250 L 40 260 L 30 250 L 20 260 L 10 250 Z"
        fill={FS.white} stroke={color} strokeWidth="2" strokeLinejoin="round"/>

      <text x="22" y="38" fontFamily="Geist Mono, monospace" fontSize="11" fontWeight="600" fill={FS.outline} letterSpacing="0.12em">{label}</text>
      <text x="22" y="62" fontFamily="Geist, sans-serif" fontSize="16" fontWeight="500" fill={FS.inkSoft}>{subtitle}</text>

      <line x1="22" y1="82" x2="198" y2="82" stroke={FS.outlineLight} strokeWidth="1" strokeDasharray="3 3"/>

      <text x="22" y="120" fontFamily="Geist Mono, monospace" fontSize="10" fontWeight="600" fill={FS.outline} letterSpacing="0.1em">AMOUNT DUE</text>
      <text x="22" y="160" fontFamily="Instrument Serif, serif" fontSize="34" fontWeight="400" fill={accent}>{amount}</text>

      <line x1="22" y1="185" x2="198" y2="185" stroke={FS.outlineLight} strokeWidth="1" strokeDasharray="3 3"/>

      {/* Faux line items */}
      <rect x="22" y="200" width="110" height="6" rx="3" fill={FS.surfaceDeep}/>
      <rect x="22" y="214" width="86" height="6" rx="3" fill={FS.surfaceDeep}/>
      <rect x="22" y="228" width="130" height="6" rx="3" fill={FS.surfaceDeep}/>
    </svg>
  );
}

// ── Phone frame with a simple storefront screen ─────────────────────────────
function PhoneStorefront({ width = 360, height = 720, fillProgress = 1 }) {
  const p = Math.max(0, Math.min(1, fillProgress));
  return (
    <svg width={width} height={height} viewBox="0 0 360 720" fill="none">
      {/* body */}
      <rect x="6" y="6" width="348" height="708" rx="46" fill={FS.primary} stroke={FS.primary} strokeWidth="2"/>
      {/* screen */}
      <rect x="18" y="18" width="324" height="684" rx="36" fill={FS.surface}/>
      {/* notch */}
      <rect x="142" y="32" width="76" height="22" rx="11" fill={FS.primary}/>

      {/* top bar */}
      <g opacity={Math.min(1, p * 3)}>
        <circle cx="44" cy="92" r="14" fill={FS.primaryMid}/>
        <text x="68" y="97" fontFamily="Instrument Serif, serif" fontSize="20" fill={FS.ink}>foreststore</text>
        <rect x="290" y="80" width="28" height="24" rx="6" fill={FS.surfaceHigh}/>
      </g>

      {/* hero card */}
      <g opacity={Math.min(1, Math.max(0, (p - 0.1)) * 3)}>
        <rect x="28" y="126" width="304" height="170" rx="20" fill={FS.primaryMid}/>
        <text x="48" y="166" fontFamily="Geist Mono, monospace" fontSize="11" fill={FS.sapling} letterSpacing="0.14em">NEW DROP</text>
        <text x="48" y="208" fontFamily="Instrument Serif, serif" fontSize="36" fill={FS.surface}>Fresh Picks</text>
        <text x="48" y="232" fontFamily="Geist, sans-serif" fontSize="14" fill={FS.inverseGreen}>Curated for you</text>
        <rect x="48" y="252" width="108" height="32" rx="16" fill={FS.sapling}/>
        <text x="74" y="273" fontFamily="Geist, sans-serif" fontSize="13" fontWeight="600" fill={FS.primary}>Shop now</text>
      </g>

      {/* product cards */}
      {[0, 1].map(i => (
        <g key={i} opacity={Math.min(1, Math.max(0, (p - 0.25 - i * 0.15)) * 3)}>
          <rect x={28 + i * 156} y="318" width="148" height="188" rx="18" fill={FS.white} stroke={FS.surfaceDeep}/>
          <rect x={40 + i * 156} y="332" width="124" height="100" rx="12" fill={i === 0 ? FS.sapling : FS.surfaceHigh}/>
          <text x={40 + i * 156} y="456" fontFamily="Geist, sans-serif" fontSize="13" fontWeight="600" fill={FS.ink}>{i === 0 ? 'Linen Tote' : 'Cedar Bowl'}</text>
          <text x={40 + i * 156} y="478" fontFamily="Geist Mono, monospace" fontSize="11" fill={FS.outline}>LKR {i === 0 ? '4,200' : '6,800'}</text>
          <rect x={40 + i * 156} y="488" width="48" height="6" rx="3" fill={FS.surfaceDeep}/>
        </g>
      ))}

      {/* list rows */}
      {[0, 1].map(i => (
        <g key={'r'+i} opacity={Math.min(1, Math.max(0, (p - 0.55 - i * 0.1)) * 3)}>
          <rect x="28" y={528 + i * 56} width="304" height="48" rx="14" fill={FS.surfaceLow}/>
          <rect x="40" y={540 + i * 56} width="24" height="24" rx="6" fill={FS.primaryMid}/>
          <rect x="76" y={544 + i * 56} width="140" height="6" rx="3" fill={FS.inkSoft}/>
          <rect x="76" y={558 + i * 56} width="86" height="5" rx="2.5" fill={FS.outlineLight}/>
        </g>
      ))}

      {/* tab bar */}
      <g opacity={Math.min(1, Math.max(0, (p - 0.7)) * 4)}>
        <rect x="28" y="652" width="304" height="52" rx="26" fill={FS.primary}/>
        <circle cx="60"  cy="678" r="6" fill={FS.sapling}/>
        <circle cx="120" cy="678" r="6" fill={FS.surface} opacity="0.45"/>
        <circle cx="180" cy="678" r="6" fill={FS.surface} opacity="0.45"/>
        <circle cx="240" cy="678" r="6" fill={FS.surface} opacity="0.45"/>
        <circle cx="300" cy="678" r="6" fill={FS.surface} opacity="0.45"/>
      </g>
    </svg>
  );
}

// ── Website storefront: browser window with a clean storefront page ─────────
function WebsiteStorefront({ width = 760, height = 880, fillProgress = 1 }) {
  const p = Math.max(0, Math.min(1, fillProgress));
  const W = width, H = height;
  return (
    <svg width={W} height={H} viewBox={`0 0 ${W} ${H}`} fill="none">
      {/* outer browser frame */}
      <rect x="0" y="0" width={W} height={H} rx="22" fill={FS.primary}/>

      {/* chrome bar */}
      <rect x="4" y="4" width={W - 8} height="60" rx="18" fill={FS.primaryDark}/>
      {/* traffic lights */}
      <circle cx="32" cy="34" r="7" fill="#ff5f57"/>
      <circle cx="56" cy="34" r="7" fill="#febc2e"/>
      <circle cx="80" cy="34" r="7" fill="#28c840"/>
      {/* URL pill */}
      <rect x={W / 2 - 160} y="16" width="320" height="36" rx="18" fill={FS.surface}/>
      <g transform={`translate(${W / 2 - 144}, 38)`}>
        <svg width="14" height="14" viewBox="0 0 14 14" x="0" y="-11">
          <path d="M3 6 V4 a4 4 0 0 1 8 0 V6" stroke={FS.primaryMid} strokeWidth="1.6" fill="none"/>
          <rect x="2" y="6" width="10" height="6" rx="1.3" fill={FS.primaryMid}/>
        </svg>
      </g>
      <text x={W / 2} y="40" textAnchor="middle" fontFamily="Geist Mono, monospace" fontSize="16" fontWeight="600" fill={FS.primaryMid}>foreststore.co</text>
      {/* refresh / plus on right */}
      <circle cx={W - 36} cy="34" r="14" fill={FS.primaryMid}/>
      <path d={`M${W - 42} 34 H${W - 30} M${W - 36} 28 V40`} stroke={FS.surface} strokeWidth="1.6" strokeLinecap="round"/>

      {/* page surface */}
      <rect x="4" y="68" width={W - 8} height={H - 72} rx="18" fill={FS.surface}/>

      {/* top nav row */}
      <g opacity={Math.min(1, p * 3)}>
        <circle cx="40" cy="106" r="14" fill={FS.primaryMid}/>
        <text x="64" y="112" fontFamily="Instrument Serif, serif" fontSize="22" fill={FS.ink}>foreststore</text>
        {/* nav links right side */}
        <g fontFamily="Geist, sans-serif" fontSize="15" fontWeight="500" fill={FS.ink}>
          <text x={W - 280} y="111">Shop</text>
          <text x={W - 224} y="111">Collections</text>
          <text x={W - 128} y="111">About</text>
        </g>
        <rect x={W - 72} y="92" width="48" height="30" rx="15" fill={FS.primary}/>
        <text x={W - 48} y="111" textAnchor="middle" fontFamily="Geist, sans-serif" fontSize="13" fontWeight="500" fill={FS.surface}>Cart</text>
      </g>

      {/* hero banner */}
      <g opacity={Math.min(1, Math.max(0, (p - 0.08)) * 3)}>
        <rect x="20" y="140" width={W - 40} height="240" rx="20" fill={FS.primaryMid}/>
        <text x="44" y="186" fontFamily="Geist Mono, monospace" fontSize="13" fontWeight="600" fill={FS.sapling} letterSpacing="0.14em">NEW DROP · MONSOON ’25</text>
        <text x="44" y="250" fontFamily="Instrument Serif, serif" fontSize="56" fill={FS.surface}>Fresh Picks</text>
        <text x="44" y="290" fontFamily="Geist, sans-serif" fontSize="18" fill={FS.inverseGreen}>Curated for you · ships island-wide</text>
        <rect x="44" y="312" width="140" height="44" rx="22" fill={FS.sapling}/>
        <text x="114" y="340" textAnchor="middle" fontFamily="Geist, sans-serif" fontSize="15" fontWeight="600" fill={FS.primary}>Shop now</text>
        {/* image placeholder swatches on right */}
        <rect x={W - 260} y="172" width="100" height="180" rx="14" fill={FS.sapling} opacity="0.32"/>
        <rect x={W - 148} y="172" width="100" height="180" rx="14" fill={FS.surface} opacity="0.12"/>
      </g>

      {/* category chips row */}
      <g opacity={Math.min(1, Math.max(0, (p - 0.2)) * 3)}>
        {['All', 'Linen', 'Ceramics', 'Wood', 'Spices', 'Sale'].map((c, i) => {
          const x = 20 + i * 116;
          const active = i === 0;
          return (
            <g key={c}>
              <rect x={x} y="402" width="100" height="38" rx="19" fill={active ? FS.primary : FS.surfaceLow} stroke={active ? FS.primary : FS.surfaceDeep}/>
              <text x={x + 50} y="426" textAnchor="middle" fontFamily="Geist, sans-serif" fontSize="14" fontWeight="500" fill={active ? FS.surface : FS.ink}>{c}</text>
            </g>
          );
        })}
      </g>

      {/* product grid: 3 cols × 2 rows */}
      {[0, 1, 2, 3, 4, 5].map((i) => {
        const col = i % 3;
        const row = Math.floor(i / 3);
        const x = 20 + col * (240 + 12);
        const y = 470 + row * 200;
        const items = [
          { name: 'Linen Tote',   price: '4,200',  swatch: FS.sapling },
          { name: 'Cedar Bowl',   price: '6,800',  swatch: FS.surfaceHigh },
          { name: 'Cotton Wrap',  price: '3,950',  swatch: FS.saplingDim },
          { name: 'Tea Set',      price: '8,400',  swatch: FS.surfaceMid },
          { name: 'Brass Vase',   price: '5,500',  swatch: FS.inverseGreen },
          { name: 'Spice Box',    price: '2,800',  swatch: FS.surfaceLow },
        ];
        const it = items[i];
        const cardP = Math.min(1, Math.max(0, (p - 0.3 - i * 0.04)) * 4);
        return (
          <g key={i} opacity={cardP}>
            <rect x={x} y={y} width="240" height="188" rx="16" fill={FS.white} stroke={FS.surfaceDeep}/>
            <rect x={x + 12} y={y + 12} width="216" height="112" rx="12" fill={it.swatch}/>
            <text x={x + 12} y={y + 148} fontFamily="Geist, sans-serif" fontSize="15" fontWeight="600" fill={FS.ink}>{it.name}</text>
            <text x={x + 12} y={y + 170} fontFamily="Geist Mono, monospace" fontSize="13" fill={FS.outline}>LKR {it.price}</text>
            <rect x={x + 192} y={y + 152} width="36" height="22" rx="11" fill={FS.surfaceLow}/>
            <text x={x + 210} y={y + 168} textAnchor="middle" fontFamily="Geist, sans-serif" fontSize="12" fontWeight="600" fill={FS.secondary}>+</text>
          </g>
        );
      })}
    </svg>
  );
}
function FeatureIcon({ kind, size = 28, color = FS.primaryMid }) {
  const s = size;
  switch (kind) {
    case 'admin':
      return (
        <svg width={s} height={s} viewBox="0 0 24 24" fill="none">
          <rect x="3" y="4" width="18" height="14" rx="2" stroke={color} strokeWidth="1.8"/>
          <path d="M3 9h18" stroke={color} strokeWidth="1.8"/>
          <circle cx="6.5" cy="6.5" r="0.8" fill={color}/>
          <circle cx="9" cy="6.5" r="0.8" fill={color}/>
          <rect x="6" y="11.5" width="6" height="4" rx="1" fill={color} opacity="0.25"/>
          <rect x="13.5" y="11.5" width="4.5" height="1.5" rx="0.7" fill={color}/>
          <rect x="13.5" y="14" width="4.5" height="1.5" rx="0.7" fill={color}/>
        </svg>
      );
    case 'ai':
      return (
        <svg width={s} height={s} viewBox="0 0 24 24" fill="none">
          <path d="M12 3 L13.7 8.3 L19 10 L13.7 11.7 L12 17 L10.3 11.7 L5 10 L10.3 8.3 Z" fill={color}/>
          <circle cx="18.5" cy="5.5" r="1.5" fill={color} opacity="0.6"/>
          <circle cx="6" cy="18" r="1" fill={color} opacity="0.4"/>
        </svg>
      );
    case 'marketplace':
      return (
        <svg width={s} height={s} viewBox="0 0 24 24" fill="none">
          <path d="M3 8 L5 4 H19 L21 8" stroke={color} strokeWidth="1.8" strokeLinejoin="round"/>
          <path d="M4 8 V19 H20 V8" stroke={color} strokeWidth="1.8"/>
          <path d="M3 8 Q3 11, 6 11 Q9 11, 9 8" stroke={color} strokeWidth="1.5"/>
          <path d="M9 8 Q9 11, 12 11 Q15 11, 15 8" stroke={color} strokeWidth="1.5"/>
          <path d="M15 8 Q15 11, 18 11 Q21 11, 21 8" stroke={color} strokeWidth="1.5"/>
        </svg>
      );
    case 'seo':
      return (
        <svg width={s} height={s} viewBox="0 0 24 24" fill="none">
          <circle cx="11" cy="11" r="6" stroke={color} strokeWidth="1.8"/>
          <path d="M16 16 L20 20" stroke={color} strokeWidth="1.8" strokeLinecap="round"/>
          <path d="M8 11 H14 M11 8 V14" stroke={color} strokeWidth="1.4" strokeLinecap="round"/>
        </svg>
      );
    case 'email':
      return (
        <svg width={s} height={s} viewBox="0 0 24 24" fill="none">
          <rect x="3" y="6" width="18" height="13" rx="2" stroke={color} strokeWidth="1.8"/>
          <path d="M3 8 L12 14 L21 8" stroke={color} strokeWidth="1.8" strokeLinejoin="round"/>
        </svg>
      );
    case 'inventory':
      return (
        <svg width={s} height={s} viewBox="0 0 24 24" fill="none">
          <path d="M3 7 L12 3 L21 7 L12 11 Z" stroke={color} strokeWidth="1.8" strokeLinejoin="round"/>
          <path d="M3 7 V17 L12 21 L21 17 V7" stroke={color} strokeWidth="1.8" strokeLinejoin="round"/>
          <path d="M12 11 V21" stroke={color} strokeWidth="1.8"/>
        </svg>
      );
    case 'courier':
      return (
        <svg width={s} height={s} viewBox="0 0 24 24" fill="none">
          <rect x="2" y="7" width="11" height="9" rx="1.2" stroke={color} strokeWidth="1.8"/>
          <path d="M13 10 H17.5 L21 13.5 V16 H13 Z" stroke={color} strokeWidth="1.8" strokeLinejoin="round"/>
          <circle cx="7" cy="18" r="1.8" fill={FS.surface} stroke={color} strokeWidth="1.8"/>
          <circle cx="17" cy="18" r="1.8" fill={FS.surface} stroke={color} strokeWidth="1.8"/>
          <path d="M4.5 10 H10" stroke={color} strokeWidth="1.4" strokeLinecap="round" opacity="0.5"/>
        </svg>
      );
    case 'support':
      return (
        <svg width={s} height={s} viewBox="0 0 24 24" fill="none">
          <path d="M4 12 A8 8 0 0 1 20 12 V17 A2 2 0 0 1 18 19 H16 V13 H20" stroke={color} strokeWidth="1.8" strokeLinejoin="round"/>
          <path d="M4 13 H8 V19 H6 A2 2 0 0 1 4 17 Z" stroke={color} strokeWidth="1.8" strokeLinejoin="round"/>
        </svg>
      );
    case 'app':
      return (
        <svg width={s} height={s} viewBox="0 0 24 24" fill="none">
          <rect x="7" y="3" width="10" height="18" rx="2.5" stroke={color} strokeWidth="1.8"/>
          <circle cx="12" cy="18" r="0.9" fill={color}/>
          <rect x="9" y="6" width="6" height="9" rx="1" fill={color} opacity="0.18"/>
        </svg>
      );
    case 'web':
      return (
        <svg width={s} height={s} viewBox="0 0 24 24" fill="none">
          <rect x="3" y="4" width="18" height="15" rx="2" stroke={color} strokeWidth="1.8"/>
          <path d="M3 8h18" stroke={color} strokeWidth="1.8"/>
          <circle cx="6" cy="6" r="0.7" fill={color}/>
          <circle cx="8.4" cy="6" r="0.7" fill={color}/>
          <circle cx="10.8" cy="6" r="0.7" fill={color}/>
          <rect x="6.5" y="11" width="11" height="1.6" rx="0.8" fill={color} opacity="0.6"/>
          <rect x="6.5" y="14" width="7" height="1.6" rx="0.8" fill={color} opacity="0.4"/>
        </svg>
      );
    case 'check':
      return (
        <svg width={s} height={s} viewBox="0 0 24 24" fill="none">
          <circle cx="12" cy="12" r="9" fill={FS.sapling}/>
          <path d="M7.5 12.5 L10.5 15.5 L16.5 9" stroke={FS.primary} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
        </svg>
      );
    default:
      return null;
  }
}

// ── Pill chip ────────────────────────────────────────────────────────────────
function Pill({ children, bg = FS.surfaceMid, color = FS.ink, mono = false, size = 14 }) {
  return (
    <span style={{
      display: 'inline-flex', alignItems: 'center',
      padding: '8px 16px',
      borderRadius: 999,
      background: bg,
      color,
      fontFamily: mono ? 'Geist Mono, monospace' : 'Geist, sans-serif',
      fontSize: size,
      fontWeight: mono ? 600 : 500,
      letterSpacing: mono ? '0.08em' : '0',
      textTransform: mono ? 'uppercase' : 'none',
      lineHeight: 1,
    }}>{children}</span>
  );
}

Object.assign(window, { FS, Sapling, Tree, Receipt, PhoneStorefront, WebsiteStorefront, FeatureIcon, Pill });
