// screens-interests.jsx — Interests list, Interest detail w/ seed dossier,
// Interest creation w/ seeding (new).

// ─────────────────────────────────────────────────────────────
// INTERESTS LIST
// ─────────────────────────────────────────────────────────────
function ScreenInterests() {
  return (
    <div className="rv-screen rv">
      <StatusBar time="9:14"/>

      {/* Top bar */}
      <div style={{ position: 'absolute', top: 56, left: 0, right: 0, padding: '6px 20px',
        display: 'flex', justifyContent: 'space-between', alignItems: 'center', zIndex: 5 }}>
        <button style={iconBtnLight}><IcChevL s={20} stroke="var(--text)"/></button>
        <h1 style={{
          margin: 0, fontFamily: 'var(--display)', fontWeight: 800,
          fontSize: 18, letterSpacing: '-0.03em', color: 'var(--text)',
        }}>Interests</h1>
        <button style={iconBtnAccent}><IcPlus s={18} stroke="var(--accent)"/></button>
      </div>

      <div style={{ position: 'absolute', top: 110, left: 0, right: 0, bottom: 0, overflow: 'auto', paddingBottom: 200 }}>
        <div style={{ padding: '8px 20px 14px' }}>
          <p style={{ margin: 0, fontSize: 13, color: 'var(--text-3)', lineHeight: 1.5 }}>
            6 active · gathering 73 new items today.
          </p>
        </div>

        <div style={{ padding: '0 16px', display: 'flex', flexDirection: 'column', gap: 10 }}>
          <InterestCard name="AI coding agents"          motivation="Capability, not benchmarks — what actually ships." unread={12} activity={0.85} tilt="sky"      sources={5}/>
          <InterestCard name="Semiconductors & HBM"      motivation="Tracking the supply chain that gates AI compute."  unread={7}  activity={0.62} tilt="midnight" sources={4}/>
          <InterestCard name="AI policy & geopolitics"   motivation="Where rules and chips collide. Slow but big."     unread={3}  activity={0.45} tilt="magenta" sources={6}/>
          <InterestCard name="Climate"                   motivation="Real shifts in energy, not climate Twitter."       unread={0}  activity={0.30} tilt="teal"    sources={3} paused/>
          <InterestCard name="Indian equity markets"     motivation="Mid-cap names, Q-on-Q narrative, macro setup."     unread={5}  activity={0.70} tilt="sand"    sources={5}/>
          <InterestCard name="NBA & player development"  motivation="Wemby arc, two-way coaching, shooting form."       unread={2}  activity={0.55} tilt="plum"    sources={4}/>
        </div>
      </div>

      <MiniPlayer title="The Wednesday Brief" progress={0.32}/>
      <TabBar active="today"/>
      <HomeIndicator/>
    </div>
  );
}

const iconBtnLight = {
  width: 38, height: 38, borderRadius: 12, border: '0.5px solid var(--line)',
  background: 'var(--bg-1)', display: 'flex', alignItems: 'center', justifyContent: 'center',
};
const iconBtnAccent = {
  width: 38, height: 38, borderRadius: 12,
  border: '0.5px solid var(--accent)', background: 'var(--accent-tint)',
  display: 'flex', alignItems: 'center', justifyContent: 'center',
};

function InterestCard({ name, motivation, unread, activity, tilt, sources, paused }) {
  const stripes = {
    sky:      'var(--accent)',
    midnight: 'var(--text)',
    magenta:  'var(--magenta)',
    teal:     'var(--good)',
    sand:     'var(--yellow)',
    plum:     'var(--magenta-deep)',
  };
  return (
    <div style={{
      position: 'relative',
      padding: 14, borderRadius: 18,
      background: 'var(--bg-1)', border: '0.5px solid var(--line)',
      display: 'flex', gap: 14, alignItems: 'stretch',
      overflow: 'hidden',
      opacity: paused ? 0.55 : 1,
      boxShadow: '0 1px 0 rgba(24,30,50,0.03)',
    }}>
      <div style={{
        width: 4, borderRadius: 4, flexShrink: 0, alignSelf: 'stretch',
        background: stripes[tilt] || 'var(--accent)',
      }}/>
      <div style={{ flex: 1, minWidth: 0 }}>
        <div style={{ display: 'flex', alignItems: 'baseline', justifyContent: 'space-between', gap: 10 }}>
          <div style={{
            fontFamily: 'var(--display)', fontWeight: 700,
            fontSize: 18, lineHeight: 1.12, color: 'var(--text)',
            letterSpacing: '-0.03em',
          }}>{name}</div>
          {unread > 0 && (
            <span className="rv-pill" style={{
              background: 'var(--magenta)', color: '#fff',
              padding: '3px 9px', fontSize: 10.5,
            }}>+{unread} new</span>
          )}
        </div>
        <div style={{ marginTop: 6, fontSize: 13, color: 'var(--text-2)', lineHeight: 1.45 }}>
          {motivation}
        </div>

        <div style={{ marginTop: 12, display: 'flex', alignItems: 'center', gap: 10 }}>
          <ActivityBars value={activity} active={!paused}/>
          <span style={{ fontSize: 11, color: 'var(--text-3)' }}>
            {paused ? 'Paused' : activity > 0.7 ? 'Hot' : activity > 0.4 ? 'Researching' : 'Quiet'}
          </span>
          <span style={{ width: 3, height: 3, background: 'var(--text-4)', borderRadius: '50%' }}/>
          <span style={{ fontSize: 11, color: 'var(--text-3)' }}>{sources} sources</span>
        </div>
      </div>
    </div>
  );
}

function ActivityBars({ value = 0.5, active = true }) {
  const bars = 5;
  const lit = Math.round(value * bars);
  return (
    <div style={{ display: 'inline-flex', alignItems: 'flex-end', gap: 2, height: 14 }}>
      {Array.from({ length: bars }).map((_, i) => {
        const isLit = i < lit;
        const h = 4 + i * 2.2;
        return (
          <div key={i} style={{
            width: 3, height: h, borderRadius: 1,
            background: isLit ? 'var(--accent)' : 'var(--bg-3)',
            opacity: isLit ? (active ? 1 : 0.5) : 1,
          }}/>
        );
      })}
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// INTEREST DETAIL — with seed dossier at top
// The "starting dossier" is what Reverb gathered to bootstrap this
// interest — visible always, expandable. Distinct from "Briefed recently"
// (which is what's been delivered into briefs since).
// ─────────────────────────────────────────────────────────────
function ScreenInterestDetail() {
  return (
    <div className="rv-screen rv">
      <StatusBar time="9:16"/>

      {/* Top bar */}
      <div style={{ position: 'absolute', top: 56, left: 0, right: 0, padding: '6px 18px',
        display: 'flex', justifyContent: 'space-between', alignItems: 'center', zIndex: 5 }}>
        <button style={iconBtnLight}><IcChevL s={20} stroke="var(--text)"/></button>
        <span style={{ fontSize: 14, fontWeight: 600, color: 'var(--text-2)' }}>Interest</span>
        <button style={iconBtnLight}><IcMore s={20} stroke="var(--text)"/></button>
      </div>

      <div style={{ position: 'absolute', top: 106, left: 0, right: 0, bottom: 0, overflow: 'auto', paddingBottom: 200 }}>
        {/* Hero */}
        <div style={{ padding: '6px 22px 20px' }}>
          <div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 10 }}>
            <ColorChip size={28} kind="bolt" bg="var(--accent)" fg="#fff" radius={8}/>
            <span className="rv-overline">+ 12 NEW · LAST 24H</span>
          </div>
          <h1 style={{
            margin: 0, fontFamily: 'var(--display)', fontWeight: 800,
            fontSize: 32, lineHeight: 1, letterSpacing: '-0.04em', color: 'var(--text)',
            textWrap: 'balance',
          }}>
            AI coding agents
          </h1>

          {/* Editable motivation */}
          <div style={{
            marginTop: 16, padding: '14px 16px',
            background: 'var(--bg-1)', border: '0.5px solid var(--line)',
            borderRadius: 16, position: 'relative',
          }}>
            <div className="rv-overline" style={{ fontSize: 10, marginBottom: 6 }}>WHY I CARE</div>
            <div style={{ fontFamily: 'var(--serif)', fontStyle: 'italic', fontSize: 16, lineHeight: 1.4, color: 'var(--text)', textWrap: 'balance' }}>
              Capability, not benchmarks. I want to hear when something actually changes how I'd ship — new loop patterns, eval results that translate to real work, the experience reports that aren't marketing.
            </div>
          </div>
        </div>

        {/* Seed dossier — the "starting dossier" */}
        <div style={{ padding: '4px 18px 22px' }}>
          <div style={{
            background: 'var(--text)', color: '#fff',
            borderRadius: 20, padding: '16px 18px 14px',
            boxShadow: '0 2px 0 rgba(24,30,50,0.18)',
          }}>
            <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 12 }}>
              <div className="rv-overline" style={{ fontSize: 10, color: 'rgba(255,255,255,0.55)' }}>STARTING DOSSIER</div>
              <span style={{ fontSize: 11, color: 'rgba(255,255,255,0.55)', fontWeight: 500 }}>seeded 6 days ago · 8 pieces</span>
            </div>
            <div style={{ fontFamily: 'var(--serif)', fontStyle: 'italic', fontSize: 15.5, lineHeight: 1.4, color: 'rgba(255,255,255,0.92)', marginBottom: 14, textWrap: 'balance' }}>
              Here's what we read first to ground this interest — 5 sources, 8 pieces, one whiteboard.
            </div>

            <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
              <DossierRow src="anthropic"   title="Claude Code: an agent loop, drawn"            time="orig · Mar 6" tagBg="var(--accent)"/>
              <DossierRow src="stratechery" title="Agents, scaffolds, and the coming bottleneck" time="cited · Mar 8" tagBg="var(--magenta)"/>
              <DossierRow src="arxiv"       title="Self-improving loops via execution traces"    time="paper · Mar 4" tagBg="var(--yellow)" tagFg="var(--text)"/>
            </div>

            <button style={{
              marginTop: 12, width: '100%', padding: '10px 12px', borderRadius: 12,
              background: 'rgba(255,255,255,0.10)', color: '#fff',
              border: '0.5px solid rgba(255,255,255,0.18)',
              fontFamily: 'var(--sans)', fontSize: 12.5, fontWeight: 600,
              display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 8,
            }}>
              See all 8 · Make a brief from the dossier <IcChevR s={13}/>
            </button>
          </div>
        </div>

        {/* Explore mix slider */}
        <div style={{ padding: '0 18px 22px' }}>
          <div style={{ padding: 16, borderRadius: 16, background: 'var(--bg-1)', border: '0.5px solid var(--line)' }}>
            <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 14 }}>
              <div>
                <div className="rv-overline" style={{ fontSize: 10, marginBottom: 2 }}>EXPLORE MIX</div>
                <div style={{ fontSize: 13.5, color: 'var(--text-2)' }}>How adventurous should we be?</div>
              </div>
            </div>
            <ExploreMixSlider/>
            <div style={{ display: 'flex', justifyContent: 'space-between', marginTop: 10, fontSize: 11.5 }}>
              <span style={{ color: 'var(--text-3)' }}>Trust my list</span>
              <span style={{ color: 'var(--accent)', fontWeight: 700 }}>A little wider</span>
              <span style={{ color: 'var(--text-3)' }}>Surprise me</span>
            </div>
          </div>
        </div>

        {/* Sources */}
        <div className="rv-overline" style={{ padding: '4px 22px 12px' }}>SOURCES · 5 RANKED</div>
        <div style={{ padding: '0 18px', display: 'flex', flexDirection: 'column', gap: 8 }}>
          <SourceRankRow src="anthropic"     host="anthropic.com"    priority={0.95} kind="pinned"/>
          <SourceRankRow src="stratechery"   host="stratechery.com"  priority={0.82} kind="earned"/>
          <SourceRankRow src="semianalysis"  host="semianalysis.com" priority={0.71} kind="earned"/>
          <SourceRankRow src="theverge"      host="theverge.com"     priority={0.42} kind="earned"/>
          <SourceRankRow src="hbr"           host="hbr.org"          priority={0.18} kind="dropped"/>
        </div>

        <div style={{ padding: '14px 18px 22px' }}>
          <button style={{
            width: '100%', padding: '10px 14px', borderRadius: 14,
            background: 'transparent', border: '0.5px dashed var(--line-strong)',
            color: 'var(--text-3)', fontSize: 13, fontWeight: 500,
            display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 8,
          }}>
            <IcPlus s={14}/> Add a trusted source
          </button>
        </div>

        {/* Recent briefed items */}
        <div className="rv-overline" style={{ padding: '0 22px 10px' }}>BRIEFED RECENTLY</div>
        <div style={{ padding: '0 18px 8px', display: 'flex', flexDirection: 'column', gap: 6 }}>
          <BriefedRow src="anthropic"   title="A loop-first view of agentic systems"  when="Today · 7:30"/>
          <BriefedRow src="stratechery" title="Agents, Scaffolds, and the Coming Bottleneck" when="Today · 7:30"/>
          <BriefedRow src="theverge"    title="Inside Anthropic's developer push"      when="Mon"/>
          <BriefedRow src="arxiv"       title="Self-improving agent loops via execution traces" when="Sun"/>
        </div>
      </div>

      <HomeIndicator/>
    </div>
  );
}

function DossierRow({ src, title, time, tagBg, tagFg = '#fff' }) {
  const tag = time.split(' · ')[0];
  const when = time.split(' · ')[1];
  return (
    <div style={{
      display: 'flex', alignItems: 'center', gap: 11,
      padding: '10px 12px', borderRadius: 12,
      background: 'rgba(255,255,255,0.06)',
      border: '0.5px solid rgba(255,255,255,0.10)',
    }}>
      <Favicon src={src} size={22} radius={6}/>
      <div style={{ flex: 1, minWidth: 0 }}>
        <div style={{ fontSize: 13, fontWeight: 600, color: '#fff', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{title}</div>
        <div style={{ display: 'flex', alignItems: 'center', gap: 6, marginTop: 3 }}>
          <span style={{
            padding: '1px 6px', borderRadius: 4,
            background: tagBg, color: tagFg,
            fontFamily: 'var(--display)', fontSize: 9, fontWeight: 800,
            letterSpacing: '0.08em', textTransform: 'uppercase',
          }}>{tag}</span>
          <span style={{ fontSize: 10.5, color: 'rgba(255,255,255,0.5)' }}>{when}</span>
        </div>
      </div>
      <button style={{
        width: 28, height: 28, borderRadius: 999, border: 0,
        background: 'rgba(255,255,255,0.10)', color: '#fff',
        display: 'flex', alignItems: 'center', justifyContent: 'center',
      }}>
        <IcPlay s={11}/>
      </button>
    </div>
  );
}

function ExploreMixSlider() {
  return (
    <div style={{ position: 'relative', height: 18, display: 'flex', alignItems: 'center' }}>
      <div style={{ position: 'absolute', left: 0, right: 0, height: 4, borderRadius: 4, background: 'var(--bg-3)' }}/>
      <div style={{ position: 'absolute', left: 0, height: 4, borderRadius: 4, width: '38%', background: 'var(--accent)' }}/>
      {[0, 0.25, 0.5, 0.75, 1].map((p,i) => (
        <div key={i} style={{ position: 'absolute', left: `calc(${p*100}% - 1px)`, width: 2, height: 8, background: 'var(--bg-1)', borderRadius: 1 }}/>
      ))}
      <div style={{ position: 'absolute', left: 'calc(38% - 11px)', width: 22, height: 22, borderRadius: 999, background: '#fff', boxShadow: '0 4px 12px rgba(24,30,50,0.18), 0 0 0 4px rgba(61,143,224,0.2), 0 0 0 0.5px var(--line-strong)' }}/>
    </div>
  );
}

function SourceRankRow({ src, host, priority, kind }) {
  const kindMap = {
    pinned:  { label: 'PINNED',  fg: 'var(--accent)',   bg: 'var(--accent-tint)' },
    earned:  { label: 'EARNED',  fg: 'var(--text-2)',   bg: 'var(--bg-3)' },
    dropped: { label: 'DROPPED', fg: 'var(--text-4)',   bg: 'transparent' },
  };
  const k = kindMap[kind];
  return (
    <div style={{
      display: 'flex', alignItems: 'center', gap: 12,
      padding: '12px 14px', borderRadius: 14,
      background: 'var(--bg-1)', border: '0.5px solid var(--line)',
      opacity: kind === 'dropped' ? 0.55 : 1,
    }}>
      <Favicon src={src} size={28} radius={7}/>
      <div style={{ flex: 1, minWidth: 0 }}>
        <div style={{ display: 'flex', alignItems: 'baseline', gap: 8 }}>
          <div style={{ fontSize: 13.5, fontWeight: 600, color: 'var(--text)' }}>{host}</div>
          <span style={{ fontSize: 9, fontWeight: 800, letterSpacing: '0.1em', color: k.fg, background: k.bg, padding: '2px 6px', borderRadius: 999 }}>{k.label}</span>
        </div>
        <div style={{ marginTop: 6, height: 3, borderRadius: 3, background: 'var(--bg-3)', overflow: 'hidden' }}>
          <div style={{ width: `${priority*100}%`, height: '100%', background: kind === 'pinned' ? 'var(--accent)' : kind === 'dropped' ? 'var(--text-4)' : 'var(--accent-soft)' }}/>
        </div>
      </div>
      {kind === 'pinned' ? <IcPin s={14} stroke="var(--accent)" w={2}/> : <IcChevR s={14} stroke="var(--text-4)"/>}
    </div>
  );
}

function BriefedRow({ src, title, when }) {
  return (
    <div style={{ display: 'flex', alignItems: 'center', gap: 12, padding: '10px 6px' }}>
      <Favicon src={src} size={22} radius={5}/>
      <div style={{ flex: 1, minWidth: 0 }}>
        <div style={{ fontSize: 13.5, color: 'var(--text)', fontWeight: 500, lineHeight: 1.3, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{title}</div>
        <div style={{ fontSize: 11, color: 'var(--text-3)', marginTop: 1 }}>{when}</div>
      </div>
      <IcChevR s={14} stroke="var(--text-4)"/>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// INTEREST CREATION — w/ live seeding
// As the user types, Reverb shows what it would seed: sources, items,
// and a starter dossier. Choosing how aggressive to fetch is the
// "Explore mix" up front. CTA: "Add + brief me now".
// ─────────────────────────────────────────────────────────────
function ScreenInterestNew() {
  return (
    <div className="rv-screen rv">
      <StatusBar time="9:18"/>

      {/* Top bar */}
      <div style={{ position: 'absolute', top: 56, left: 0, right: 0, padding: '6px 18px',
        display: 'flex', justifyContent: 'space-between', alignItems: 'center', zIndex: 5 }}>
        <button style={iconBtnLight}><IcClose s={18} stroke="var(--text-2)"/></button>
        <span style={{ fontSize: 14, fontWeight: 600, color: 'var(--text)' }}>New interest</span>
        <div style={{ width: 38 }}/>
      </div>

      <div style={{ position: 'absolute', top: 106, left: 0, right: 0, bottom: 120, overflow: 'auto' }}>
        {/* Hero copy */}
        <div style={{ padding: '6px 22px 16px' }}>
          <h1 style={{
            margin: 0, fontFamily: 'var(--display)', fontWeight: 800,
            fontSize: 28, lineHeight: 1.02, letterSpacing: '-0.04em', color: 'var(--text)',
            textWrap: 'balance',
          }}>
            What should we<br/>keep track of?
          </h1>
        </div>

        {/* Name input */}
        <div style={{ padding: '0 18px 10px' }}>
          <div style={{
            padding: '14px 16px',
            background: 'var(--bg-1)', border: '1.5px solid var(--accent)',
            borderRadius: 14, position: 'relative',
            boxShadow: '0 0 0 4px rgba(61,143,224,0.12)',
          }}>
            <div className="rv-overline" style={{ fontSize: 9.5, marginBottom: 5 }}>INTEREST</div>
            <div style={{ fontFamily: 'var(--display)', fontWeight: 700, fontSize: 19, color: 'var(--text)', letterSpacing: '-0.03em' }}>
              Defense tech &amp; autonomy
              <span style={{ display: 'inline-block', width: 2, height: 18, background: 'var(--accent)', marginLeft: 2, verticalAlign: 'text-bottom', animation: 'rv-pulse 1.1s ease-in-out infinite' }}/>
            </div>
          </div>
        </div>

        {/* Why I care */}
        <div style={{ padding: '0 18px 18px' }}>
          <div style={{ padding: '12px 16px', background: 'var(--bg-1)', border: '0.5px solid var(--line)', borderRadius: 14 }}>
            <div className="rv-overline" style={{ fontSize: 9.5, marginBottom: 5 }}>WHY I CARE — OPTIONAL</div>
            <div style={{ fontFamily: 'var(--serif)', fontStyle: 'italic', fontSize: 15, lineHeight: 1.4, color: 'var(--text-2)' }}>
              The Anduril/Shield AI thesis &mdash; want to track procurement wins, not vibe takes.
            </div>
          </div>
        </div>

        {/* Live seeding — what Reverb is finding */}
        <div style={{ padding: '0 18px 18px' }}>
          <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 10 }}>
            <span className="rv-overline">↗ FOUND SO FAR</span>
            <span style={{
              fontSize: 10.5, fontWeight: 700, letterSpacing: '0.06em',
              color: 'var(--accent)', display: 'inline-flex', alignItems: 'center', gap: 5,
            }}>
              <span style={{
                width: 6, height: 6, borderRadius: 999, background: 'var(--accent)',
                animation: 'rv-pulse 1.1s ease-in-out infinite',
              }}/>
              READING NOW
            </span>
          </div>

          {/* Sources cluster */}
          <div style={{
            padding: '12px 14px',
            background: 'var(--bg-1)', border: '0.5px solid var(--line)',
            borderRadius: 14, marginBottom: 10,
          }}>
            <div style={{ fontSize: 12, fontWeight: 600, color: 'var(--text-2)', marginBottom: 8 }}>
              <span style={{ fontFamily: 'var(--display)', fontWeight: 800, color: 'var(--text)', fontSize: 14 }}>5 sources</span> match this so far
            </div>
            <div style={{ display: 'flex', gap: 6, flexWrap: 'wrap' }}>
              <SourceTag src="reuters"   host="reuters.com"/>
              <SourceTag src="ft"        host="ft.com"/>
              <SourceTag src="bloomberg" host="bloomberg.com"/>
              <SourceTag src="axios"     host="axios.com"/>
              <SourceTag src="theverge"  host="theverge.com"/>
            </div>
          </div>

          {/* Seed dossier preview — 3 items with include toggle */}
          <div style={{
            background: 'var(--bg-1)', border: '0.5px solid var(--line)',
            borderRadius: 14, overflow: 'hidden',
          }}>
            <div style={{ padding: '12px 14px 4px', display: 'flex', alignItems: 'baseline', justifyContent: 'space-between' }}>
              <span style={{ fontFamily: 'var(--display)', fontWeight: 800, fontSize: 14, color: 'var(--text)', letterSpacing: '-0.025em' }}>Starting dossier</span>
              <span style={{ fontSize: 11.5, color: 'var(--text-3)' }}>3 picked &middot; tap to skip</span>
            </div>
            <SeedRow src="reuters"   title="Anduril wins $42M Pentagon contract for autonomous sentries" when="2d ago" picked/>
            <SeedRow src="ft"        title="Shield AI's Series F doubles valuation to $5.3B"             when="1w ago" picked/>
            <SeedRow src="axios"     title="Inside the Replicator initiative — the numbers behind the slogan" when="3w ago" picked/>
            <SeedRow src="theverge"  title="Why DoD wants 'attritable' drones — and what that means" when="1m ago"/>
          </div>
        </div>

        {/* Mix dial */}
        <div style={{ padding: '0 18px 18px' }}>
          <div style={{ padding: 14, borderRadius: 14, background: 'var(--bg-1)', border: '0.5px solid var(--line)' }}>
            <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 12 }}>
              <span style={{ fontFamily: 'var(--display)', fontWeight: 800, fontSize: 13, color: 'var(--text)', letterSpacing: '-0.02em' }}>Starting mix</span>
              <span style={{ fontSize: 11, color: 'var(--accent)', fontWeight: 700 }}>A little wider</span>
            </div>
            <ExploreMixSlider/>
          </div>
        </div>
      </div>

      {/* Bottom CTA — sticky */}
      <div style={{
        position: 'absolute', left: 0, right: 0, bottom: 30,
        padding: '14px 18px 10px',
        background: 'linear-gradient(180deg, rgba(255,255,255,0) 0%, var(--bg) 32%)',
        zIndex: 10,
      }}>
        <button style={{
          width: '100%', height: 56, borderRadius: 14, border: 0,
          background: 'var(--accent)', color: '#fff',
          fontFamily: 'var(--display)', fontWeight: 700, fontSize: 15.5, letterSpacing: '-0.01em',
          display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 10,
          boxShadow: '0 2px 0 rgba(24,30,50,0.18), 0 14px 28px rgba(61,143,224,0.30)',
        }}>
          Add interest <span style={{ opacity: 0.7, fontWeight: 600 }}>·</span> brief me now
          <IcChevR s={16} w={2.6}/>
        </button>
      </div>

      <HomeIndicator/>
    </div>
  );
}

function SourceTag({ src, host }) {
  return (
    <span style={{
      display: 'inline-flex', alignItems: 'center', gap: 6,
      padding: '4px 9px 4px 4px', borderRadius: 999,
      background: 'var(--bg-2)', border: '0.5px solid var(--line)',
      fontSize: 11.5, fontWeight: 600, color: 'var(--text-2)', letterSpacing: '-0.01em',
    }}>
      <Favicon src={src} size={16} radius={4}/>{host}
    </span>
  );
}

function SeedRow({ src, title, when, picked }) {
  return (
    <div style={{
      display: 'flex', alignItems: 'center', gap: 11,
      padding: '10px 14px',
      borderTop: '0.5px solid var(--line)',
    }}>
      <Favicon src={src} size={20} radius={5}/>
      <div style={{ flex: 1, minWidth: 0 }}>
        <div style={{ fontSize: 13, fontWeight: 500, color: 'var(--text)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{title}</div>
        <div style={{ fontSize: 11, color: 'var(--text-3)', marginTop: 1 }}>{when}</div>
      </div>
      <div style={{
        width: 22, height: 22, borderRadius: 7,
        background: picked ? 'var(--accent)' : 'var(--bg-2)',
        border: picked ? 'none' : '0.5px solid var(--line-strong)',
        color: '#fff',
        display: 'flex', alignItems: 'center', justifyContent: 'center',
      }}>
        {picked && <IcCheck s={12} w={2.8}/>}
      </div>
    </div>
  );
}

Object.assign(window, {
  ScreenInterests, ScreenInterestDetail, ScreenInterestNew,
  InterestCard, ActivityBars, DossierRow, SeedRow,
});
