// ─────────────────────────────────────────────────────────────
// Section C · Join-forest flows.
//
// Three variants — they're complementary, not alternatives:
//   C1 · Open join     — single tap. Preview sheet → "Join" → animated
//                        bead-onto-ladder, lands in your forests list.
//   C2 · Moderated     — requires moderator approval. Includes the
//                        "request with a note" beat + pending state +
//                        decision view from the moderator's side.
//   C3 · Referral code — a small inline flow for "I have a code".
//
// All three share a Forest-preview sheet at the top — what a stranger
// sees before deciding.
// ─────────────────────────────────────────────────────────────


// ─── Shared forest preview header (read-only) ───
function ForestPreviewHero({ forest }) {
  const intensity = forestIntensity(forest);
  return (
    <RowAmbience seed={forest.id || forest.name} intensity={intensity} borderRadius={0}>
    <div style={{
      padding: '14px 16px 16px', borderBottom: '0.5px solid #1F2B16',
      background: 'linear-gradient(180deg, #0F1A09 0%, transparent 100%)',
    }}>
      <div style={{ display: 'flex', alignItems: 'center', gap: 14 }}>
        <BreathingForestGlyph size={48} hot={forest.activeNow > 5} intensity={intensity}/>
        <div style={{ flex: 1, minWidth: 0 }}>
          <div style={{ display: 'flex', alignItems: 'center', gap: 6, flexWrap: 'wrap' }}>
            <span style={{ font: '500 22px var(--font-mono)', color: '#F2EDE4', letterSpacing: '-0.01em' }}>
              {forest.name}
            </span>
            <KindChip kind={forest.kind}/>
            <JoinChip mode={forest.join}/>
          </div>
          <div style={{ font: 'italic 400 13.5px var(--font-serif)', color: '#A8C5A0', marginTop: 5 }}>
            {forest.blurb}
          </div>
        </div>
      </div>
      <div style={{ display: 'flex', alignItems: 'center', gap: 14, marginTop: 14,
                    font: '400 12px var(--font-sans)', color: '#8A9678' }}>
        <span><b style={{ color: '#F2EDE4', fontWeight: 500 }}>{fmtBig(forest.members)}</b> members</span>
        <span>·</span>
        <span><b style={{ color: '#F2EDE4', fontWeight: 500 }}>{forest.growing}</b> growing</span>
        <span>·</span>
        <span style={{ display: 'inline-flex', alignItems: 'center', gap: 5 }}>
          <SignalDot signal={forest.signal}/>
          <LiveCounter baseline={forest.activeNow} range={2}
            style={{ font: '500 12px var(--font-mono)', color: '#A8C5A0' }}/>
          <span>active</span>
        </span>
      </div>
    </div>
    </RowAmbience>
  );
}


// Live "what they're saying right now" tease — the strongest hook for
// converting a stranger into a member. Two pulses of recent activity.
function ForestLivePeek() {
  return (
    <div style={{ padding: '14px 16px 6px' }}>
      <div style={{ font: '500 10.5px var(--font-sans)', color: '#76AB78',
                    letterSpacing: '0.12em', textTransform: 'uppercase', marginBottom: 10 }}>
        What's growing
      </div>
      <LeafStagger staggerMs={70} style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
        {PHILOSOPHY_ROOTS.slice(0, 3).map(p => (
          <div key={p.id} style={{
            padding: '11px 12px', background: '#111D0A', border: '0.5px solid #1F2B16',
            borderRadius: 12,
          }}>
            <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
              <Avatar handle={p.handle} size={22} accent="#5E8048"/>
              <span style={{ font: '500 12px var(--font-mono)', color: '#F2EDE4' }}>{p.handle}</span>
              <span style={{ font: '400 11px var(--font-sans)', color: '#586552' }}>· {p.age}</span>
              {p.hot && <span style={{ marginLeft: 'auto', fontSize: 0 }}><TypingDots/></span>}
            </div>
            <div style={{ font: '400 13px/1.45 var(--font-sans)', color: '#C9D2BB', marginTop: 6 }}>
              {p.body}
            </div>
          </div>
        ))}
      </LeafStagger>
    </div>
  );
}


// Members preview row — mutual folk first.
function MembersStrip({ members = PHILOSOPHY_MEMBERS_PREVIEW }) {
  return (
    <div style={{ padding: '6px 16px 12px' }}>
      <div style={{ font: '500 10.5px var(--font-sans)', color: '#76AB78',
                    letterSpacing: '0.12em', textTransform: 'uppercase', marginBottom: 8 }}>
        Who's in
      </div>
      <div style={{ display: 'flex', gap: -4, alignItems: 'center', flexWrap: 'wrap' }}>
        <div style={{ display: 'flex' }}>
          {members.slice(0, 6).map((m, i) => (
            <span key={m.handle} style={{ marginLeft: i === 0 ? 0 : -8 }}>
              <Avatar handle={m.handle} size={28}
                accent={m.rel === 'friend' ? '#5E8048' : m.rel === 'acquaintance' ? '#A8C5A0' : '#586552'}/>
            </span>
          ))}
        </div>
        <span style={{ marginLeft: 10, font: '400 12px var(--font-sans)', color: '#8A9678' }}>
          <span style={{ color: '#A8C5A0' }}>4 from your folk</span> · + 1.8k strangers
        </span>
      </div>
    </div>
  );
}


// ──────────────────────────────────────────────────────────────
// C1 · Open join.
// "Slow Cooking" — public + open. One sustained tap, animated
// confirmation, then the forest lives in the user's list.
// ──────────────────────────────────────────────────────────────
function JoinC1_Open() {
  const forest = DISCOVER_FORESTS.find(f => f.id === 'd2'); // Slow Cooking
  const [state, setState] = React.useState('preview'); // preview | joining | joined

  React.useEffect(() => {
    if (state !== 'joining') return;
    const id = setTimeout(() => setState('joined'), 900);
    return () => clearTimeout(id);
  }, [state]);

  return (
    <div style={{ flex: 1, display: 'flex', flexDirection: 'column', minHeight: 0, background: '#0B1306' }}>
      <ForestPreviewHero forest={forest}/>
      <PhoneBody style={{ paddingBottom: 110 }}>
        <ForestLivePeek/>
        <MembersStrip members={[
          { handle: 'oakling', rel: 'acquaintance' },
          { handle: 'birch-7', rel: 'stranger' },
          { handle: 'tulip-aa', rel: 'stranger' },
          { handle: 'samh', rel: 'friend' },
          { handle: 'fern-12', rel: 'stranger' },
          { handle: 'marina_k', rel: 'acquaintance' },
        ]}/>
      </PhoneBody>

      {/* Fixed bottom CTA */}
      <div style={{
        padding: '12px 16px 16px', borderTop: '0.5px solid #1F2B16',
        background: '#0B1306', position: 'relative',
      }}>
        {state === 'preview' && (
          <Btn kind="primary" full onClick={() => setState('joining')}>Join — one tap</Btn>
        )}
        {state === 'joining' && (
          <Btn kind="primary" full style={{ opacity: 0.7 }}>
            <span style={{ marginRight: 8 }}><TypingDots color="#F2EDE4"/></span>
            Growing your place here…
          </Btn>
        )}
        {state === 'joined' && <JoinedConfirmation forest={forest}/>}
        {state === 'preview' && (
          <div style={{ font: 'italic 400 11.5px var(--font-serif)', color: '#586552',
                        textAlign: 'center', marginTop: 8 }}>
            Members can leave at any time. You'll arrive as a Stranger.
          </div>
        )}
      </div>

      <BottomNavFolk active="forests" hasNewSunlight={false}/>
    </div>
  );
}


function JoinedConfirmation({ forest }) {
  return (
    <div style={{ display: 'flex', alignItems: 'center', gap: 14,
                  padding: '8px 0',
                  animation: 'flSheetEnter 360ms var(--ease-organic) both' }}>
      <div style={{ position: 'relative', width: 42, height: 42, flexShrink: 0 }}>
        <span style={{
          position: 'absolute', inset: 0, borderRadius: '50%', background: '#4F8E51',
          animation: 'flBeadGrow 360ms var(--ease-organic) both',
        }}/>
        <span style={{
          position: 'absolute', inset: 0, borderRadius: '50%',
          border: '1.5px solid #D4960C',
          animation: 'flCanopyRipple 1.6s var(--ease-organic) infinite',
        }}/>
        <svg viewBox="0 0 24 24" width="22" height="22"
          style={{ position: 'absolute', left: 10, top: 10 }}>
          <path d="M5 12 L10 17 L19 7" fill="none" stroke="#0B1306" strokeWidth="2.5"
            strokeLinecap="round" strokeLinejoin="round"
            strokeDasharray="30"
            style={{ strokeDashoffset: 30,
                     animation: 'flBranchDraw 460ms var(--ease-organic) 100ms forwards' }}/>
        </svg>
      </div>
      <div style={{ flex: 1, minWidth: 0 }}>
        <div style={{ font: '500 14px var(--font-sans)', color: '#F2EDE4' }}>
          You're in <span style={{ fontFamily: 'var(--font-mono)' }}>{forest.name}</span>
        </div>
        <div style={{ font: 'italic 400 12.5px var(--font-serif)', color: '#A8C5A0', marginTop: 2 }}>
          Take a slow loop before you plant — there's no rush.
        </div>
      </div>
      <Btn kind="primary" size="sm">Enter →</Btn>
    </div>
  );
}


// ──────────────────────────────────────────────────────────────
// C2 · Moderated join.
// Software & Web — public but moderated. The note field is
// optional but encouraged; the pending state is calm, with a
// trace of "you sent it" persistence. Plus, the moderator-side
// view of the same request.
// ──────────────────────────────────────────────────────────────
function JoinC2_Moderated() {
  const forest = DISCOVER_FORESTS.find(f => f.id === 'd4'); // Software & Web
  const [phase, setPhase] = React.useState('preview');  // preview | writing | pending
  const [note, setNote] = React.useState('');

  return (
    <div style={{ flex: 1, display: 'flex', flexDirection: 'column', minHeight: 0, background: '#0B1306' }}>
      <ForestPreviewHero forest={forest}/>
      <PhoneBody style={{ paddingBottom: 130 }}>
        {/* Moderation note */}
        <div style={{ padding: '14px 16px 0' }}>
          <div style={{
            padding: 12, background: 'rgba(212,150,12,0.05)',
            border: '0.5px solid rgba(212,150,12,0.28)', borderRadius: 12,
            display: 'flex', gap: 10,
          }}>
            <FLIcons.Pin size={14} color="#F4DCA0"/>
            <div style={{ flex: 1, font: '400 12.5px/1.55 var(--font-sans)', color: '#F4DCA0' }}>
              Moderators read each request. A short note about why you'd plant here
              usually gets you in within a day.
            </div>
          </div>
        </div>

        <ForestLivePeek/>
        <MembersStrip/>

        {phase === 'pending' && (
          <div style={{ margin: '14px 16px', padding: 14,
                        background: '#0F1A09', border: '0.5px dashed #4F8E51',
                        borderRadius: 12, animation: 'flSheetEnter 360ms var(--ease-organic) both' }}>
            <div style={{ font: '500 10.5px var(--font-sans)', color: '#76AB78',
                          letterSpacing: '0.14em', textTransform: 'uppercase', marginBottom: 6 }}>
              Pending · sent just now
            </div>
            <div style={{ font: 'italic 400 13px var(--font-serif)', color: '#A8C5A0' }}>
              "{note || 'I write web tooling and want to think out loud about it with people who do too.'}"
            </div>
            <div style={{ font: '400 11.5px var(--font-sans)', color: '#586552', marginTop: 8 }}>
              We'll surface a quiet Sunlight notification when a moderator decides.
            </div>
          </div>
        )}
      </PhoneBody>

      <div style={{
        padding: '12px 16px 16px', borderTop: '0.5px solid #1F2B16',
        background: '#0B1306',
      }}>
        {phase === 'preview' && (
          <Btn kind="secondary" full onClick={() => setPhase('writing')}>
            Request to join · with a note
          </Btn>
        )}
        {phase === 'writing' && (
          <div style={{ animation: 'flSheetEnter 280ms var(--ease-organic) both' }}>
            <textarea autoFocus value={note} onChange={e => setNote(e.target.value)}
              placeholder="(optional) why this forest, in a sentence."
              rows={3}
              style={{
                width: '100%', boxSizing: 'border-box',
                background: '#111D0A', border: '0.5px solid #2D3A22',
                borderRadius: 10, color: '#F2EDE4', padding: '11px 12px',
                font: 'italic 400 13px/1.5 var(--font-serif)',
                resize: 'none', outline: 'none',
              }}/>
            <div style={{ display: 'flex', gap: 8, marginTop: 8 }}>
              <Btn kind="ghost" full onClick={() => setPhase('preview')}>Skip note</Btn>
              <Btn kind="primary" full onClick={() => setPhase('pending')}>Send request</Btn>
            </div>
          </div>
        )}
        {phase === 'pending' && (
          <Btn kind="ghost" full disabled>
            <FLIcons.Pin size={14} color="#586552"/>
            <span style={{ marginLeft: 4 }}>Awaiting moderator</span>
          </Btn>
        )}
      </div>

      <BottomNavFolk active="forests" hasNewSunlight={false}/>
    </div>
  );
}


// ──────────────────────────────────────────────────────────────
// C2b · Moderator view of the same request.
// Showing the other half of the flow — what a moderator sees.
// ──────────────────────────────────────────────────────────────
function JoinC2_ModeratorView() {
  return (
    <div style={{ flex: 1, display: 'flex', flexDirection: 'column', minHeight: 0, background: '#0B1306' }}>
      <div style={{ padding: '14px 16px 10px', borderBottom: '0.5px solid #1F2B16' }}>
        <div style={{ font: '500 10px var(--font-sans)', color: '#8A9678',
                      letterSpacing: '0.10em', textTransform: 'uppercase' }}>Moderator · Software & Web</div>
        <div style={{ font: '500 22px var(--font-mono)', color: '#F2EDE4', marginTop: 2 }}>
          requests
        </div>
        <div style={{ font: 'italic 400 12px var(--font-serif)', color: '#8A9678', marginTop: 3 }}>
          3 waiting · 1d median response time.
        </div>
      </div>

      <PhoneBody style={{ padding: '14px 14px 90px' }}>
        <LeafStagger staggerMs={70} style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
          <RequestCard handle="marina_k" age="14m" mutual="2 from your folk"
            note="I write web tooling and want to think out loud about it with people who do too."
            stage="acquaintance" trees={4} active/>
          <RequestCard handle="fern-12" age="2h" mutual="0 mutuals"
            note="just curious — saw this in discover, the blurb resonates."
            stage="stranger" trees={1}/>
          <RequestCard handle="leaf-902" age="1d" mutual="6 from your folk"
            note="been lurking in Slow Reading. would like to compare ideas."
            stage="stranger" trees={11} active={false}/>
        </LeafStagger>

        <div style={{
          marginTop: 18, padding: 12, background: '#0F1A09',
          border: '0.5px dashed #2D3A22', borderRadius: 12,
          font: 'italic 400 12px/1.55 var(--font-serif)', color: '#8A9678',
        }}>
          Decline silently — they won't know it was you specifically.
        </div>
      </PhoneBody>

      <BottomNavFolk active="forests" hasNewSunlight={true}/>
    </div>
  );
}


function RequestCard({ handle, age, mutual, note, stage, trees, active = false }) {
  return (
    <div style={{
      padding: 14, background: '#111D0A',
      border: `0.5px solid ${active ? '#4F8E51' : '#1F2B16'}`,
      borderRadius: 12, position: 'relative', overflow: 'hidden',
    }}>
      {active && <SunbeamSweep/>}
      <div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
        <Avatar handle={handle} size={36}
          accent={stage === 'acquaintance' ? '#A8C5A0' : '#586552'}/>
        <div style={{ flex: 1, minWidth: 0 }}>
          <div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
            <span style={{ font: '500 14px var(--font-mono)', color: '#F2EDE4' }}>{handle}</span>
            <StageBadge stage={stage}/>
          </div>
          <div style={{ font: '400 11px var(--font-sans)', color: '#586552', marginTop: 3 }}>
            {mutual} · {trees} trees planted · sent {age} ago
          </div>
        </div>
      </div>
      <div style={{ marginTop: 10, padding: '10px 12px',
                    background: '#0B1306', borderRadius: 10,
                    font: 'italic 400 13px/1.5 var(--font-serif)', color: '#C9D2BB',
                    borderLeft: '2px solid #4F8E51' }}>
        {note}
      </div>
      <div style={{ display: 'flex', gap: 8, marginTop: 12 }}>
        <Btn kind="primary" full size="sm">Welcome</Btn>
        <Btn kind="secondary" size="sm">Hold</Btn>
        <Btn kind="ghost" size="sm">Decline</Btn>
      </div>
    </div>
  );
}


// ──────────────────────────────────────────────────────────────
// C3 · Referral code.
// A small affordance — surface for "Have a referral code?" CTA.
// Each digit is its own input box; on full match, the forest
// reveals itself via the same Preview hero.
// ──────────────────────────────────────────────────────────────
function JoinC3_Referral() {
  const [code, setCode] = React.useState(['F','L','7','2']);  // pre-filled for demo
  const filled = code.every(c => c.length > 0);
  const forest = DISCOVER_FORESTS.find(f => f.id === 'd7');   // Listening Room

  return (
    <div style={{ flex: 1, display: 'flex', flexDirection: 'column', minHeight: 0, background: '#0B1306' }}>
      <CreateHeader title="Use a referral code" subtitle="invite-only forests" />

      <PhoneBody style={{ padding: '20px 16px 90px' }}>
        <div style={{ textAlign: 'center', padding: '12px 0 4px' }}>
          <div style={{ font: 'italic 400 14px/1.5 var(--font-serif)', color: '#A8C5A0' }}>
            A friend planted a sapling for you. Type the four-mark.
          </div>
        </div>

        <div style={{ display: 'flex', gap: 10, justifyContent: 'center', marginTop: 24 }}>
          {code.map((c, i) => (
            <div key={i} style={{
              width: 56, height: 64, borderRadius: 12,
              background: '#111D0A',
              border: c ? '0.5px solid #4F8E51' : '0.5px solid #2D3A22',
              display: 'flex', alignItems: 'center', justifyContent: 'center',
              font: '500 26px var(--font-mono)', color: '#F2EDE4',
              boxShadow: c ? '0 0 0 4px rgba(79,142,81,0.16)' : 'none',
              transition: 'border-color 200ms var(--ease-organic), box-shadow 200ms var(--ease-organic)',
              animation: c ? `flBeadGrow 360ms var(--ease-organic) ${i * 80}ms both` : 'none',
            }}>{c}</div>
          ))}
        </div>

        {filled && (
          <div style={{ marginTop: 28, animation: 'flSheetEnter 420ms var(--ease-organic) both' }}>
            <div style={{ font: '500 10.5px var(--font-sans)', color: '#76AB78',
                          letterSpacing: '0.14em', textTransform: 'uppercase', textAlign: 'center' }}>
              Matched
            </div>
            <div style={{
              marginTop: 12, padding: '14px 16px',
              background: '#0F1A09', border: '0.5px solid #1F2B16', borderRadius: 14,
              display: 'flex', alignItems: 'center', gap: 14,
            }}>
              <BreathingForestGlyph size={44} hot/>
              <div style={{ flex: 1, minWidth: 0 }}>
                <div style={{ display: 'flex', alignItems: 'center', gap: 6, flexWrap: 'wrap' }}>
                  <span style={{ font: '500 17px var(--font-mono)', color: '#F2EDE4' }}>{forest.name}</span>
                  <KindChip kind={forest.kind}/>
                </div>
                <div style={{ font: 'italic 400 13px var(--font-serif)', color: '#A8C5A0', marginTop: 3 }}>
                  {forest.blurb}
                </div>
              </div>
            </div>
            <Btn kind="primary" full style={{ marginTop: 16 }}>Step into the listening room →</Btn>
            <div style={{ font: 'italic 400 11.5px var(--font-serif)', color: '#586552',
                          marginTop: 10, textAlign: 'center' }}>
              The friend who invited you will be visible to you in here. Otherwise everyone's a Stranger.
            </div>
          </div>
        )}
      </PhoneBody>

      <BottomNavFolk active="forests" hasNewSunlight={false}/>
    </div>
  );
}


Object.assign(window, {
  JoinC1_Open, JoinC2_Moderated, JoinC2_ModeratorView, JoinC2_EntryPoints, JoinC3_Referral,
  ForestPreviewHero, ForestLivePeek, MembersStrip,
});


// ──────────────────────────────────────────────────────────────
// C2c · Moderator entry points.
// "How do you get to that moderator queue?" — a diagrammatic
// annotation showing the three contextual surfaces where the
// stewardship affordance appears. NOT a phone-shaped artboard:
// it's a layered exposition card.
// ──────────────────────────────────────────────────────────────
function JoinC2_EntryPoints() {
  return (
    <div style={{
      width: 440, height: 760, boxSizing: 'border-box',
      padding: '22px 24px',
      background: '#0B1306', border: '0.5px solid #2D3A22', borderRadius: 14,
      color: '#F2EDE4',
      font: '400 13px/1.55 var(--font-sans)',
      display: 'flex', flexDirection: 'column', overflow: 'hidden',
    }}>
      <div style={{ font: '500 10.5px var(--font-sans)', color: '#F4DCA0',
                    letterSpacing: '0.14em', textTransform: 'uppercase' }}>
        How a moderator gets here
      </div>
      <div style={{ font: 'italic 400 13px/1.55 var(--font-serif)', color: '#A8C5A0',
                    marginTop: 6, marginBottom: 14 }}>
        Stewardship is per-forest, not per-app. No new bottom-nav slot.
        Three quiet surfaces only appear where your role does.
      </div>

      <div style={{ flex: 1, display: 'flex', flexDirection: 'column', gap: 14, overflowY: 'auto' }} className="phone-scroll">
        <EntryRow num="1" title="In-forest header"
          desc="Open a forest you steward — a small sun-pip sits in the header next to Switch.">
          <ForestHeaderWithModPip/>
        </EntryRow>

        <EntryRow num="2" title="Sunlight notification"
          desc="New requests fire as a quiet Sunlight beat. Tap → focused on that request.">
          <SunlightRequestNotif/>
        </EntryRow>

        <EntryRow num="3" title="Yours row · landing"
          desc="The forest's row in your landing shows a pip when requests are pending.">
          <YoursRowWithModPip/>
        </EntryRow>
      </div>

      <div style={{ marginTop: 12, padding: 10, background: '#111D0A',
                    border: '0.5px solid #1F2B16', borderRadius: 10,
                    font: 'italic 400 12px/1.5 var(--font-serif)', color: '#A8C5A0' }}>
        A user who moderates nothing never sees any of this — the moderator
        surface only manifests where their role manifests.
      </div>
    </div>
  );
}


function EntryRow({ num, title, desc, children }) {
  return (
    <div style={{ display: 'flex', gap: 12 }}>
      <span style={{
        width: 26, height: 26, borderRadius: '50%',
        background: '#1B3A1D', border: '0.5px solid #2C5F2E',
        color: '#A8C5A0', font: '500 12px var(--font-mono)',
        display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
        flexShrink: 0, marginTop: 2,
      }}>{num}</span>
      <div style={{ flex: 1, minWidth: 0 }}>
        <div style={{ font: '500 13.5px var(--font-sans)', color: '#F2EDE4' }}>{title}</div>
        <div style={{ font: 'italic 400 12px/1.5 var(--font-serif)', color: '#8A9678', marginTop: 2 }}>{desc}</div>
        <div style={{ marginTop: 8 }}>{children}</div>
      </div>
    </div>
  );
}


// Sun-pip — the moderator's signal that there's stewardship to do.
function ModeratorPip({ count = 3, size = 'sm' }) {
  return (
    <span style={{
      display: 'inline-flex', alignItems: 'center', gap: 4,
      padding: size === 'sm' ? '3px 7px 3px 5px' : '4px 9px 4px 7px',
      background: 'rgba(212,150,12,0.10)',
      border: '0.5px solid rgba(212,150,12,0.40)',
      borderRadius: 999,
      color: '#F4DCA0',
      font: `500 ${size === 'sm' ? 10.5 : 11.5}px var(--font-mono)`,
    }}>
      <span style={{ position: 'relative', display: 'inline-flex' }}>
        <FLIcons.Sun size={size === 'sm' ? 11 : 13} color="#D4960C"/>
        <span style={{
          position: 'absolute', inset: -2, borderRadius: '50%',
          border: '1px solid #D4960C', opacity: 0.6,
          animation: 'flCanopyRipple 2.4s var(--ease-organic) infinite',
        }}/>
      </span>
      <span>{count}</span>
    </span>
  );
}


// Entry 1 — in-forest header with the moderator pip.
function ForestHeaderWithModPip() {
  return (
    <div style={{
      padding: '10px 12px', background: '#111D0A',
      border: '0.5px solid #2D3A22', borderRadius: 12,
      display: 'flex', alignItems: 'center', gap: 10,
    }}>
      <button style={{ background: 'transparent', border: 'none', padding: 2,
                       color: '#586552', cursor: 'pointer', display: 'flex' }}>
        <FLIcons.ChevronLeft size={18}/>
      </button>
      <ForestGlyph size={28} hot/>
      <div style={{ flex: 1, minWidth: 0 }}>
        <div style={{ font: '500 14.5px var(--font-mono)', color: '#F2EDE4' }}>Software & Web</div>
        <div style={{ font: '400 11px var(--font-sans)', color: '#586552' }}>2.1k members · steward</div>
      </div>
      <ModeratorPip count={3}/>
      <button style={{
        font: '500 11px var(--font-sans)', color: '#586552',
        background: 'transparent', border: '0.5px solid #2D3A22',
        padding: '4px 9px', borderRadius: 8, cursor: 'pointer',
      }}>Switch</button>
    </div>
  );
}


// Entry 2 — a Sunlight notification card.
function SunlightRequestNotif() {
  return (
    <div style={{
      position: 'relative', overflow: 'hidden',
      padding: '12px 13px', background: '#111D0A',
      border: '0.5px solid rgba(212,150,12,0.32)', borderRadius: 12,
      display: 'flex', alignItems: 'center', gap: 10,
    }}>
      <SunbeamSweep/>
      <span style={{
        width: 32, height: 32, borderRadius: '50%',
        background: 'rgba(212,150,12,0.10)',
        border: '0.5px solid rgba(212,150,12,0.40)',
        display: 'inline-flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0,
      }}>
        <FLIcons.Sun size={16} color="#D4960C"/>
      </span>
      <div style={{ flex: 1, minWidth: 0 }}>
        <div style={{ font: '500 10px var(--font-sans)', color: '#F4DCA0',
                      letterSpacing: '0.10em', textTransform: 'uppercase' }}>
          Stewardship · 2m ago
        </div>
        <div style={{ font: '400 13px/1.45 var(--font-sans)', color: '#F2EDE4', marginTop: 3 }}>
          <span style={{ fontFamily: 'var(--font-mono)' }}>fern-12</span> wants to plant
          in <span style={{ fontFamily: 'var(--font-mono)' }}>Software & Web</span>.
        </div>
      </div>
      <span style={{ font: '400 11px var(--font-sans)', color: '#586552',
                      whiteSpace: 'nowrap', alignSelf: 'flex-start' }}>open →</span>
    </div>
  );
}


// Entry 3 — the Yours-row treatment.
function YoursRowWithModPip() {
  return (
    <div style={{
      padding: '11px 12px', background: '#111D0A',
      border: '0.5px solid #1F2B16', borderRadius: 12,
      display: 'flex', alignItems: 'center', gap: 10,
    }}>
      <BreathingForestGlyph size={30} hot/>
      <div style={{ flex: 1, minWidth: 0 }}>
        <div style={{ display: 'flex', alignItems: 'center', gap: 6, flexWrap: 'wrap' }}>
          <span style={{ font: '500 14px var(--font-sans)', color: '#F2EDE4' }}>Software & Web</span>
          <KindChip kind="public"/>
        </div>
        <div style={{ font: '400 11px var(--font-sans)', color: '#586552', marginTop: 3 }}>
          2.1k members · 28 active · you steward
        </div>
      </div>
      <ModeratorPip count={3}/>
    </div>
  );
}


Object.assign(window, { JoinC2_EntryPoints });
