// Phone mockups for the landing page. Each mirrors a screen from the
// real Lumynax app — chat appbar with personality dropdown, home recall card,
// reminders tab, memory groups. Pure CSS-in-JSX, no images.

const PhoneAppHeader = ({ title, sub, accent = '#8A7DFF', icon, action }) =>
<div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '6px 18px 14px' }}>
    <div style={{
    width: 36, height: 36, borderRadius: 12, background: `linear-gradient(135deg, ${accent}, #EC6FB8)`,
    display: 'flex', alignItems: 'center', justifyContent: 'center', color: 'white',
    boxShadow: `0 8px 20px -6px ${accent}80`, flexShrink: 0
  }}>{icon}</div>
    <div style={{ lineHeight: 1.15, flex: 1, minWidth: 0 }}>
      <div style={{ fontSize: 17, fontWeight: 800, color: '#F0F0FF', letterSpacing: '-0.005em' }}>{title}</div>
      {sub && <div style={{ fontSize: 11.5, color: '#AAABCC', fontWeight: 600 }}>{sub}</div>}
    </div>
    {action}
  </div>;


const PhoneFrame = ({ children }) =>
<div className="phone">
    <div className="notch"></div>
    <div className="screen">
      <div className="phone-statusbar">
        <span>9:41</span>
        <span className="right" aria-hidden>
          <svg width="16" height="10" viewBox="0 0 16 10" fill="none"><path d="M1 9V5M5 9V3M9 9V1M13 9V5" stroke="white" strokeWidth="1.5" strokeLinecap="round" /></svg>
          <svg width="14" height="10" viewBox="0 0 14 10" fill="none"><path d="M1 5C2.5 3 4.5 2 7 2s4.5 1 6 3M3 7.5c1-1.2 2.3-1.8 4-1.8s3 .6 4 1.8" stroke="white" strokeWidth="1.4" strokeLinecap="round" /></svg>
          <svg width="22" height="10" viewBox="0 0 22 10" fill="none"><rect x="1" y="1.5" width="17" height="7" rx="1.6" stroke="white" strokeOpacity="0.6" /><rect x="2.5" y="3" width="13" height="4" rx="0.6" fill="white" /><rect x="19" y="4" width="1.5" height="2" rx="0.5" fill="white" fillOpacity="0.6" /></svg>
        </span>
      </div>
      {children}
    </div>
  </div>;


const PhoneBottomNav = ({ active }) =>
<div style={{
  position: 'absolute', bottom: 0, left: 0, right: 0,
  background: 'rgba(15,15,26,0.92)', backdropFilter: 'blur(20px)',
  borderTop: '1px solid rgba(255,255,255,0.06)',
  padding: '10px 12px 18px',
  display: 'flex', justifyContent: 'space-around'
}}>
    {[
  ['home', 'Ana Sayfa', 'M3 11.5 12 4l9 7.5V20a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1Z'],
  ['chat', 'Sohbet', 'M21 12a8 8 0 1 1-3.4-6.6L21 4l-1 4 1 4Z'],
  ['rem', 'Hat\u0131rlatma', 'M6 8a6 6 0 0 1 12 0c0 5 2 6 2 6H4s2-1 2-6Zm4 11a2 2 0 0 0 4 0'],
  ['prof', 'Profil', 'M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-8 9a8 8 0 0 1 16 0']].
  map(([key, label, d]) => {
    const on = key === active;
    return (
      <div key={key} style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 4 }}>
          <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke={on ? '#8A7DFF' : '#6B6B8A'} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
            <path d={d} />
          </svg>
          <div style={{ fontSize: 9.5, fontWeight: 600, color: on ? '#8A7DFF' : '#6B6B8A' }}>{label}</div>
          {on && <div style={{ width: 18, height: 2, borderRadius: 2, background: '#8A7DFF' }}></div>}
        </div>);

  })}
  </div>;


/* ============ Phone A — Memory by topic ============ */
const PhoneMemory = () => {
  const { t, lang } = useI18n();
  const tr = lang === 'tr';

  const topics = tr ? [
    {
      ic: 'briefcase', name: 'İş & Kariyer', count: 12, color: '#7DA8FF',
      items: [
        { text: 'Balina adında bir şirkette çalışıyor', tag: 'Bilgi' },
        { text: 'Finansal özgürlük ve kariyer başarısı elde etmek istiyor', tag: 'Hedef' },
        { text: 'İngilizce seviyesini B1’den B2’ye çıkarmak istiyor', tag: 'Hedef' },
        { text: 'İngilizce öğrenirken düzeltme ve öğretmen gibi rehberlik tercih ediyor', tag: 'Tercih' },
      ],
      more: 8,
    },
    {
      ic: 'pulse', name: 'Spor & Sağlık', count: 8, color: '#7DD3C0',
      items: [
        { text: 'Yaza kadar 5 kilo vererek fit girmek istiyor', tag: 'Hedef' },
        { text: 'Haftaiçi 18:00’den sonra antrenman yapıyor', tag: 'Alışkanlık' },
        { text: 'Spor rutini takip ederken periyodik kontrol ve dostça dürtülme tercih ediyor', tag: 'Tercih' },
      ],
      more: 5,
    },
    {
      ic: 'users', name: 'Yakınları', count: 4, color: '#F5A66B',
      items: [
        { text: 'Kardeşi Deniz var', tag: 'İlişki' },
        { text: 'Minik tatlı kedisi Nero var', tag: 'İlişki' },
        { text: 'Babasını ziyarete gidiyor', tag: 'İlişki' },
      ],
      more: 1,
    },
    {
      ic: 'dots', name: 'Diğerleri', count: 14, color: '#A78BFA',
      items: [
        { text: 'Yazılan dilde yanıt almayı tercih ediyor', tag: 'Tercih' },
        { text: 'Kahve ve kabak çekirdeği seviyor', tag: 'Bilgi' },
      ],
      more: 12,
    },
  ] : [
    {
      ic: 'briefcase', name: 'Work & Career', count: 12, color: '#7DA8FF',
      items: [
        { text: 'Works at a company called Balina', tag: 'Fact' },
        { text: 'Wants financial freedom and career success', tag: 'Goal' },
        { text: 'Wants to lift English from B1 to B2', tag: 'Goal' },
        { text: 'Prefers corrections and teacher-like guidance when practicing English', tag: 'Preference' },
      ],
      more: 8,
    },
    {
      ic: 'pulse', name: 'Health & Sport', count: 8, color: '#7DD3C0',
      items: [
        { text: 'Wants to drop 5 kg by summer', tag: 'Goal' },
        { text: 'Trains weekdays after 18:00', tag: 'Habit' },
        { text: 'Likes light "did you go today?" nudges, not constant tracking', tag: 'Preference' },
      ],
      more: 5,
    },
    {
      ic: 'users', name: 'Close people', count: 4, color: '#F5A66B',
      items: [
        { text: 'Sister Deniz', tag: 'Relation' },
        { text: 'Sweet little cat Nero', tag: 'Relation' },
        { text: 'Visits dad sometimes', tag: 'Relation' },
      ],
      more: 1,
    },
    {
      ic: 'dots', name: 'Other', count: 14, color: '#A78BFA',
      items: [
        { text: 'Prefers replies in the same language she writes', tag: 'Preference' },
        { text: 'Loves coffee and pumpkin seeds', tag: 'Fact' },
      ],
      more: 12,
    },
  ];

  const tagBg = { '#7DD3C0': 'rgba(125,211,192,0.15)', '#EC6FB8': 'rgba(236,111,184,0.16)',
    '#F5A66B': 'rgba(245,166,107,0.16)', '#7DA8FF': 'rgba(125,168,255,0.16)', '#A78BFA': 'rgba(167,139,250,0.18)' };
  const tagToColor = {
    'Hedef': '#7DD3C0', 'Tercih': '#EC6FB8', 'İlişki': '#F5A66B', 'Bilgi': '#7DA8FF', 'Alışkanlık': '#A78BFA',
    'Goal': '#7DD3C0', 'Preference': '#EC6FB8', 'Relation': '#F5A66B', 'Fact': '#7DA8FF', 'Habit': '#A78BFA',
  };

  return (
    <PhoneFrame>
      {/* App bar */}
      <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '6px 18px 14px' }}>
        <button aria-label="back" style={{
          width: 32, height: 32, borderRadius: '50%', border: 0, background: 'transparent',
          display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#F0F0FF'
        }}>
          <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M15 18l-6-6 6-6"/></svg>
        </button>
        <div style={{ fontSize: 20, fontWeight: 900, letterSpacing: '-0.015em', color: '#F0F0FF' }}>{tr ? 'Hafıza' : 'Memory'}</div>
        <div style={{ width: 32 }}></div>
      </div>

      {/* Intro */}
      <div style={{ padding: '0 18px 14px' }}>
        <div style={{ fontSize: 11, color: '#C4A8FF', fontWeight: 800, letterSpacing: '0.06em', textTransform: 'uppercase', marginBottom: 6, display: 'flex', alignItems: 'center', gap: 6 }}>
          <Spark size={10} color="#C4A8FF"/> {tr ? 'Senin hakkında öğrendiklerim' : "What I've learned"}
        </div>
        <div style={{ fontSize: 11.5, color: '#AAABCC', fontWeight: 600 }}>
          {tr ? '38 anı · 4 konu · sen anlattıkça büyür' : '38 memories · 4 topics · grows as you share'}
        </div>
      </div>

      {/* Topic cards */}
      <div style={{ padding: '0 14px 72px', overflow: 'hidden', display: 'flex', flexDirection: 'column', gap: 10 }}>
        {topics.map((topic, ti) => (
          <div key={ti} style={{
            padding: '13px 14px 11px', borderRadius: 18,
            background: '#1A1A2E', border: '1px solid rgba(255,255,255,0.04)'
          }}>
            {/* Topic header */}
            <div style={{ display: 'flex', alignItems: 'center', gap: 10, marginBottom: 9 }}>
              <div style={{
                width: 32, height: 32, borderRadius: 9,
                background: tagBg[topic.color], border: '1px solid ' + topic.color + '30',
                display: 'flex', alignItems: 'center', justifyContent: 'center',
                color: topic.color, flexShrink: 0
              }}>
                {topic.ic === 'briefcase' && <Ic.Briefcase s={16}/>}
                {topic.ic === 'pulse'     && <Ic.Pulse     s={16}/>}
                {topic.ic === 'users'     && <Ic.Users     s={15}/>}
                {topic.ic === 'dots'      && <Ic.Dots      s={16}/>}
              </div>
              <div style={{ fontSize: 14.5, fontWeight: 800, color: '#F0F0FF', flex: 1 }}>{topic.name}</div>
              <div style={{
                fontSize: 11, fontWeight: 800, color: topic.color,
                padding: '3px 9px', borderRadius: 999,
                background: tagBg[topic.color]
              }}>{topic.count}</div>
              <Ic.ChevronDown s={14}/>
            </div>

            {/* Items */}
            <div style={{ display: 'flex', flexDirection: 'column', gap: 9, marginLeft: 2 }}>
              {topic.items.map((it, ii) => {
                const c = tagToColor[it.tag] || '#AAABCC';
                const showMenu = ti === 0 && ii === 1; // demo: second item of first card
                return (
                  <div key={ii} style={{ display: 'flex', alignItems: 'flex-start', gap: 8, position: 'relative' }}>
                    <span style={{ width: 4, height: 4, borderRadius: '50%', background: c, marginTop: 7, flexShrink: 0 }}></span>
                    <div style={{ flex: 1, fontSize: 11.5, color: '#F0F0FF', fontWeight: 500, lineHeight: 1.4,
                      display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical', overflow: 'hidden' }}>{it.text}</div>
                    <span style={{
                      padding: '2px 7px', borderRadius: 999, fontSize: 8.5, fontWeight: 800,
                      background: tagBg[c], color: c, letterSpacing: '0.02em', flexShrink: 0, marginTop: 1
                    }}>{it.tag}</span>
                    <button aria-label="more" style={{
                      width: 22, height: 22, border: 0, background: showMenu ? 'rgba(255,255,255,0.08)' : 'transparent',
                      borderRadius: 6, display: 'flex', alignItems: 'center', justifyContent: 'center',
                      color: showMenu ? '#F0F0FF' : '#6B6B8A', cursor: 'pointer', flexShrink: 0, marginTop: -2
                    }}>
                      <svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor">
                        <circle cx="12" cy="5" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="12" cy="19" r="2"/>
                      </svg>
                    </button>
                    {/* Demo popover on one item */}
                    {showMenu && (
                      <div style={{
                        position: 'absolute', top: 22, right: 0,
                        minWidth: 130, padding: 4, borderRadius: 10,
                        background: '#22223B', border: '1px solid rgba(255,255,255,0.08)',
                        boxShadow: '0 14px 30px -10px rgba(0,0,0,0.6)',
                        zIndex: 3
                      }}>
                        <div style={{ padding: '7px 10px', fontSize: 11.5, color: '#F0F0FF', fontWeight: 600, display: 'flex', alignItems: 'center', gap: 8, borderRadius: 6 }}>
                          <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4Z"/></svg>
                          {tr ? 'D\u00fczenle' : 'Edit'}
                        </div>
                        <div style={{ padding: '7px 10px', fontSize: 11.5, color: '#F0F0FF', fontWeight: 600, display: 'flex', alignItems: 'center', gap: 8, borderRadius: 6 }}>
                          <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 8v4M12 16h.01"/></svg>
                          {tr ? 'Detay' : 'Details'}
                        </div>
                        <div style={{ padding: '7px 10px', fontSize: 11.5, color: '#EC6FB8', fontWeight: 700, display: 'flex', alignItems: 'center', gap: 8, borderRadius: 6 }}>
                          <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"><path d="M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"/></svg>
                          {tr ? 'Sil' : 'Delete'}
                        </div>
                      </div>
                    )}
                  </div>
                );
              })}
              {topic.more > 0 && (
                <div style={{ fontSize: 10.5, color: '#AAABCC', fontWeight: 700, marginTop: 3, paddingLeft: 12 }}>
                  {tr ? '+ ' + topic.more + ' daha' : '+ ' + topic.more + ' more'}
                </div>
              )}
            </div>
          </div>
        ))}
      </div>

      <PhoneBottomNav active="prof"/>
    </PhoneFrame>
  );
};

/* ============ Phone B — Chat (matches real appbar with personality dropdown) ============ */
// Small ✦ AI avatar + timestamp shown below each Lumynax message.
const ChatBubbleMeta = ({ time }) =>
<div style={{ display: 'flex', alignItems: 'center', gap: 6, paddingLeft: 2 }}>
    <div style={{
    width: 22, height: 22, borderRadius: '50%',
    background: 'radial-gradient(circle at 30% 30%, rgba(196,168,255,0.45), rgba(107,91,255,0.15) 60%, transparent 80%)',
    display: 'flex', alignItems: 'center', justifyContent: 'center',
    boxShadow: '0 0 14px rgba(138,125,255,0.45)'
  }}>
      <LumynaxMark size={14} halo={false} gradient={true} glow={false} animate={false} />
    </div>
    <span style={{ fontSize: 10, color: '#6B6B8A', fontWeight: 600 }}>{time}</span>
  </div>;


// Side-by-side message row: bubble on one side, avatar+timestamp on the other.
const UserMessageRow = ({ text, time }) => (
  <div style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'flex-end', gap: 6 }}>
    <div style={{
      maxWidth: '78%',
      background: 'linear-gradient(135deg, #8A7DFF, #EC6FB8)',
      color: '#fff', borderRadius: '16px 16px 4px 16px',
      padding: '10px 13px', fontSize: 13, lineHeight: 1.45,
      boxShadow: '0 12px 22px -10px rgba(107,91,255,0.5)'
    }}>{text}</div>
    <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 3, paddingBottom: 2 }}>
      <div style={{
        width: 22, height: 22, borderRadius: '50%',
        background: 'rgba(138,125,255,0.20)', border: '1px solid rgba(138,125,255,0.35)',
        color: '#C4A8FF', fontSize: 10.5, fontWeight: 800,
        display: 'flex', alignItems: 'center', justifyContent: 'center'
      }}>E</div>
      <span style={{ fontSize: 9.5, color: '#6B6B8A', fontWeight: 600 }}>{time}</span>
    </div>
  </div>
);

const AiMessageRow = ({ children, time }) => (
  <div style={{ display: 'flex', justifyContent: 'flex-start', alignItems: 'flex-end', gap: 6 }}>
    <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 3, paddingBottom: 2 }}>
      <div style={{
        width: 22, height: 22, borderRadius: '50%',
        background: 'radial-gradient(circle at 30% 30%, rgba(196,168,255,0.45), rgba(107,91,255,0.18) 60%, transparent 80%)',
        display: 'flex', alignItems: 'center', justifyContent: 'center',
        boxShadow: '0 0 14px rgba(138,125,255,0.45)'
      }}>
        <LumynaxMark size={14} halo={false} gradient={true} glow={false} animate={false}/>
      </div>
      <span style={{ fontSize: 9.5, color: '#6B6B8A', fontWeight: 600 }}>{time}</span>
    </div>
    <div style={{ maxWidth: '78%' }}>{children}</div>
  </div>
);

const PhoneChat = () => {
  const { t } = useI18n();
  return (
    <PhoneFrame>
      {/* Chat appbar matching the actual app: back arrow, centered Lumynax + "Arkada\u015f\u0131n v" dropdown */}
      <div style={{
        display: 'flex', alignItems: 'center', padding: '6px 14px 12px',
        borderBottom: '1px solid rgba(255,255,255,0.05)'
      }}>
        <button aria-label="back" style={{
          width: 32, height: 32, borderRadius: '50%', border: 0, background: 'transparent',
          display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#F0F0FF', cursor: 'pointer'
        }}>
          <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M15 18l-6-6 6-6" /></svg>
        </button>
        <div style={{ flex: 1, display: 'flex', justifyContent: 'center', alignItems: 'center', gap: 10 }}>
          <div style={{
            width: 36, height: 36, borderRadius: 12,
            background: 'linear-gradient(135deg, #6B5BFF, #9D96FF)',
            display: 'flex', alignItems: 'center', justifyContent: 'center',
            boxShadow: '0 3px 10px rgba(107,91,255,0.4)'
          }}>
            <LumynaxMark size={26} halo={false} gradient={false} glow={false} animate={false} />
          </div>
          <div style={{ lineHeight: 1.1 }}>
            <div style={{ fontSize: 15, fontWeight: 800 }}>
              <span style={{ color: '#F0F0FF' }}>Lumy</span>
              <span style={{ background: 'linear-gradient(135deg,#8A7DFF,#EC6FB8)', WebkitBackgroundClip: 'text', backgroundClip: 'text', color: 'transparent' }}>nax</span>
            </div>
            <div style={{ display: 'flex', alignItems: 'center', gap: 4, color: '#8A7DFF', fontSize: 11, fontWeight: 700 }}>
              {t('phone.chat_subtitle')}
              <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"><path d="M6 9l6 6 6-6" /></svg>
            </div>
          </div>
        </div>
        <div style={{ width: 32 }}></div>
      </div>

      <div style={{ padding: '14px 14px 88px', display: 'flex', flexDirection: 'column', gap: 12, height: 'calc(100% - 80px)', overflow: 'hidden' }}>
        {/* User message — bubble on left, meta on right */}
        <UserMessageRow text={t('phone.chat_them')} time="12:18" />

        {/* AI confirmation bubble — meta on left of bubble */}
        <AiMessageRow time="12:18">
          <div style={{
            background: 'rgba(255,255,255,0.05)', border: '1px solid rgba(255,255,255,0.08)',
            color: '#F0F0FF', borderRadius: '16px 16px 16px 4px',
            padding: '10px 13px', fontSize: 13, lineHeight: 1.45
          }}>
            {t('phone.chat_me_b')}
          </div>
        </AiMessageRow>

        {/* "Hatırlatıcı oluşturuldu" — small chip aligned under the AI bubble */}
        <div style={{ display: 'flex', alignItems: 'center', gap: 8, paddingLeft: 38 }}>
          <div style={{
            background: 'rgba(138,125,255,0.10)', border: '1px solid rgba(138,125,255,0.28)',
            borderRadius: 12, padding: '8px 11px', display: 'flex', gap: 8, alignItems: 'center', flex: '0 1 auto'
          }}>
            <div style={{ width: 26, height: 26, borderRadius: 8, background: 'rgba(138,125,255,0.22)',
              display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#C4A8FF', flexShrink: 0 }}>
              <Ic.Reminder s={14} />
            </div>
            <div style={{ lineHeight: 1.2 }}>
              <div style={{ fontSize: 10.5, fontWeight: 800, color: '#C4A8FF', textTransform: 'uppercase', letterSpacing: '0.06em' }}>{t('phone.chat_me_a').replace(/^✦ /, '')}</div>
              <div style={{ fontSize: 11.5, color: '#F0F0FF', fontWeight: 700, marginTop: 1 }}>Doktor randevusu · Yarın 17:00</div>
            </div>
          </div>
        </div>

        {/* User reply */}
        <UserMessageRow text={t('phone.chat_them2')} time="12:20" />

        {/* AI reply */}
        <AiMessageRow time="12:20">
          <div style={{
            background: 'rgba(255,255,255,0.05)', border: '1px solid rgba(255,255,255,0.08)',
            color: '#F0F0FF', borderRadius: '16px 16px 16px 4px',
            padding: '10px 13px', fontSize: 13, lineHeight: 1.45
          }}>{t('phone.chat_me_c')}</div>
        </AiMessageRow>
      </div>

      {/* Composer pinned bottom — solid background, matches real app */}
      <div style={{
        position: 'absolute', bottom: 12, left: 12, right: 12,
        background: '#1A1A2E', border: '1px solid rgba(255,255,255,0.06)',
        borderRadius: 22, padding: '10px 8px 10px 14px',
        boxShadow: '0 -10px 30px -10px rgba(0,0,0,0.6)'
      }}>
        <div style={{ fontSize: 12, color: '#6B6B8A', fontWeight: 500, marginBottom: 6 }}>
          {t('phone.chat_placeholder')}
        </div>
        <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
          <div style={{ display: 'flex', gap: 14, color: '#6B6B8A' }}>
            <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
              <rect x="3" y="5" width="18" height="14" rx="2" /><circle cx="9" cy="11" r="2" /><path d="m21 17-5-5-10 9" />
            </svg>
            <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
              <rect x="9" y="3" width="6" height="12" rx="3" /><path d="M5 11a7 7 0 0 0 14 0" /><path d="M12 18v3" />
            </svg>
          </div>
          <div style={{
            padding: '7px 14px 7px 12px', borderRadius: 999,
            background: 'linear-gradient(135deg, #8A7DFF, #EC6FB8)',
            color: 'white', fontSize: 12, fontWeight: 800, display: 'inline-flex', alignItems: 'center', gap: 6,
            boxShadow: '0 10px 22px -8px rgba(236,111,184,0.5)'
          }}>
            <svg width="14" height="12" viewBox="0 0 14 12" fill="none">
              <path d="M1 7V5M3.5 9V3M6 11V1M8.5 9V3M11 7V5M13 6.5V5.5" stroke="white" strokeWidth="1.4" strokeLinecap="round" />
            </svg>
            Speak
          </div>
        </div>
      </div>
    </PhoneFrame>);

};

/* ============ Phone C — Home screen 1:1 with the real app ============ */
const PhoneRecall = () => {
  const { t, lang } = useI18n();
  const tabs = t('phone.recall_tabs');
  const active = t('phone.recall_active');
  const greeting = lang === 'tr' ? 'Merhaba Ebru' : 'Hi Mia';
  const moodTitle = lang === 'tr' ? 'Bugün nasıl hissediyorsun?' : 'How feel today?';
  const last3 = lang === 'tr' ? 'Son 3 gün' : 'Last 3';
  const remTitle = lang === 'tr' ? 'Hatırlatıcı' : 'Reminder';
  const remBody = lang === 'tr' ? 'Strateji toplantısı' : 'Strategy review';
  const remTime = '17:00';
  const ctaTitle = lang === 'tr' ? 'Konuşmak ister misin?' : 'Want to talk?';
  const ctaSub = lang === 'tr'
    ? '22 saat önce: "Bugün biraz tuhaf hissediyorum…"'
    : '22h ago: "feeling a bit off today…"';
  // Short recall body so card fits with fade
  const recallShort = lang === 'tr'
    ? 'Bu hafta sende sakin bir sabitlik fark ettim. Normalde iş temposu seni dalgalandırırdı; ama bu hafta söyleşimiz iyiydi, uyku saatlerin biraz daha erkene kaydı, salı akşamı keşfettiğin o kafede o filtre kahveyi sevdiğini söyledin.'
    : 'I noticed a quiet steadiness in you this week. Work tempo usually rocks you, but our chats felt good, your sleep settled, and on Tuesday you told me about that filter coffee you fell for at the new café.';
  return (
    <PhoneFrame>
      {/* === Home appbar === */}
      <div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '8px 18px 16px' }}>
        <div style={{
          width: 44, height: 44, borderRadius: 14,
          background: 'linear-gradient(180deg, #8A7DFF 0%, #6B5BFF 100%)',
          display: 'flex', alignItems: 'center', justifyContent: 'center',
          boxShadow: '0 5px 14px -5px rgba(107,91,255,0.5)', flexShrink: 0
        }}>
          <LumynaxMark size={28} halo={false} gradient={false} glow={false} animate={false} />
        </div>
        <div style={{ flex: 1, lineHeight: 1.05, minWidth: 0 }}>
          <div style={{ fontSize: 20, fontWeight: 900, letterSpacing: '-0.015em' }}>
            <span style={{ color: '#F0F0FF' }}>Lumy</span>
            <span style={{ background: 'linear-gradient(135deg,#8A7DFF,#EC6FB8)', WebkitBackgroundClip: 'text', backgroundClip: 'text', color: 'transparent' }}>nax</span>
          </div>
          <div style={{ fontSize: 11.5, color: '#6B6B8A', fontWeight: 600, marginTop: 3, whiteSpace: 'nowrap' }}>{greeting} <span>👋</span></div>
        </div>
        <div style={{
          padding: '5px 10px', borderRadius: 999,
          background: 'rgba(40,40,60,0.55)',
          color: '#AAABCC', fontSize: 11, fontWeight: 600, display: 'inline-flex', alignItems: 'center', gap: 3,
          whiteSpace: 'nowrap', flexShrink: 0
        }}>
          {lang === 'tr' ? "Pro'ya Geç" : 'Go Pro'} <span style={{ color: '#C4A8FF', fontSize: 11 }}>⚡</span>
        </div>
      </div>

      <div style={{ padding: '0 14px 78px', display: 'flex', flexDirection: 'column', gap: 18, overflow: 'hidden' }}>
        {/* === Sana Özel === */}
        <div style={{ position: 'relative' }}>
          <div style={{ position: 'absolute', top: 0, left: 10, right: 10, height: 2, background: '#7DD3C0', borderRadius: 999, opacity: 0.9 }}></div>
          <div style={{
            marginTop: 4, padding: '12px 14px 8px', borderRadius: 20,
            background: '#15152A', border: '1px solid rgba(255,255,255,0.04)',
            position: 'relative', overflow: 'hidden'
          }}>
            <div style={{ display: 'flex', alignItems: 'flex-start', gap: 10, marginBottom: 8 }}>
              <div style={{
                width: 34, height: 34, borderRadius: 10,
                background: '#1F2138', border: '1px solid rgba(255,255,255,0.06)',
                display: 'flex', alignItems: 'center', justifyContent: 'center', position: 'relative', flexShrink: 0
              }}>
                <Spark size={13} color="#FFFFFF" />
                <span style={{ position: 'absolute', top: 3, right: 4, fontSize: 6, color: '#FFFFFF', opacity: 0.85 }}>✦</span>
                <span style={{ position: 'absolute', bottom: 4, left: 4, fontSize: 5, color: '#FFFFFF', opacity: 0.7 }}>✦</span>
              </div>
              <div style={{ lineHeight: 1.2, paddingTop: 0, minWidth: 0, flex: 1 }}>
                <div style={{ fontSize: 14.5, fontWeight: 800, color: '#F0F0FF', letterSpacing: '-0.015em', whiteSpace: 'nowrap' }}>{lang === 'tr' ? 'Sana Özel' : 'Just for you'}</div>
                <div style={{ fontSize: 10.5, color: '#6B6B8A', fontWeight: 600, marginTop: 1, whiteSpace: 'nowrap' }}>{lang === 'tr' ? '18 saat önce' : '18 hours ago'}</div>
              </div>
            </div>

            <div style={{ display: 'flex', gap: 6, marginBottom: 8 }}>
              {tabs.map((tab, i) => {
                const on = tab === active;
                return (
                  <span key={i} style={{
                    padding: '3px 11px', borderRadius: 999,
                    fontSize: 11, fontWeight: 700,
                    color: on ? '#0F0F1A' : '#AAABCC',
                    background: on ? '#F0F0FF' : 'transparent',
                    border: on ? 'none' : '1px solid rgba(255,255,255,0.12)'
                  }}>{tab}</span>
                );
              })}
            </div>

            <div style={{ position: 'relative', maxHeight: 74, overflow: 'hidden' }}>
              <p style={{ margin: 0, fontSize: 12, lineHeight: 1.4, color: '#F0F0FF', fontWeight: 500 }}>
                {recallShort}
              </p>
              <div style={{ position: 'absolute', bottom: 0, left: 0, right: 0, height: 30, background: 'linear-gradient(to bottom, rgba(21,21,42,0), #15152A 80%)' }}></div>
            </div>

            <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: 2 }}>
              <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="#6B6B8A" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"><path d="M6 9l6 6 6-6"/></svg>
            </div>
          </div>
        </div>

        {/* === Mood card === */}
        <div style={{
          padding: '14px 16px 14px', borderRadius: 20,
          background: '#15152A', border: '1px solid rgba(255,255,255,0.04)'
        }}>
          <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', marginBottom: 12, gap: 8 }}>
            <div style={{ fontSize: 15.5, fontWeight: 800, color: '#F0F0FF', lineHeight: 1.25, flex: 1 }}>{moodTitle}</div>
            <div style={{ textAlign: 'right', lineHeight: 1.15, flexShrink: 0 }}>
              <div style={{ fontSize: 11.5, color: '#AAABCC', fontWeight: 800, marginBottom: 3, whiteSpace: 'nowrap' }}>{last3}</div>
              <div style={{ display: 'flex', justifyContent: 'flex-end', gap: 1, fontSize: 14 }}>
                <span>😊</span><span>🤩</span><span>🤩</span>
              </div>
            </div>
          </div>
          <div style={{ display: 'flex', justifyContent: 'space-between', gap: 6 }}>
            {['🤩', '😊', '😐', '😞', '😢'].map((emo, i) => {
              const on = i === 1;
              return (
                <div key={i} style={{
                  width: 42, height: 42, borderRadius: 12,
                  background: on ? 'radial-gradient(circle, rgba(138,125,255,0.45), rgba(138,125,255,0.04) 70%)' : 'transparent',
                  display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 22,
                  boxShadow: on ? '0 0 20px rgba(138,125,255,0.6) inset' : 'none'
                }}>{emo}</div>
              );
            })}
          </div>
        </div>

        {/* === Hatırlatıcı strip === */}
        <div style={{ position: 'relative' }}>
          <div style={{ position: 'absolute', top: 0, left: 10, right: 10, height: 2, background: '#F5C97A', borderRadius: 999, opacity: 0.9 }}></div>
          <div style={{
            marginTop: 4, padding: '12px 14px', borderRadius: 20,
            background: '#15152A', border: '1px solid rgba(255,255,255,0.04)',
            display: 'flex', alignItems: 'center', gap: 12
          }}>
            <div style={{
              width: 42, height: 42, borderRadius: 13,
              background: 'rgba(245,201,122,0.08)', border: '1px solid rgba(245,201,122,0.14)',
              display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#F5C97A', flexShrink: 0
            }}>
              <Ic.Reminder s={20}/>
            </div>
            <div style={{ flex: 1, lineHeight: 1.3, minWidth: 0 }}>
              <div style={{ fontSize: 13, color: '#AAABCC', fontWeight: 500 }}>{remTitle}<span style={{ color: '#F0F0FF', fontWeight: 700, marginLeft: 8 }}>{remTime}</span></div>
              <div style={{ fontSize: 14.5, color: '#F0F0FF', fontWeight: 700, marginTop: 1 }}>{remBody}</div>
            </div>
            <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#6B6B8A" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round"><path d="M9 18l6-6-6-6"/></svg>
          </div>
        </div>

        {/* === Konuşmak ister misin? CTA === */}
        <div style={{
          padding: '14px 14px', borderRadius: 20,
          background: 'linear-gradient(135deg, #8A7DFF, #EC6FB8)',
          display: 'flex', alignItems: 'center', gap: 12, color: 'white',
          boxShadow: '0 14px 28px -12px rgba(107,91,255,0.5)'
        }}>
          <div style={{ width: 42, height: 42, borderRadius: 13, background: 'rgba(255,255,255,0.18)',
            display: 'flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0 }}>
            <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
              <path d="M3 4a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-9l-5 4Z"/>
            </svg>
          </div>
          <div style={{ flex: 1, lineHeight: 1.25, minWidth: 0 }}>
            <div style={{ fontSize: 15.5, fontWeight: 800 }}>{ctaTitle}</div>
            <div style={{ fontSize: 12, opacity: 0.92, fontWeight: 500, marginTop: 3,
              display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical', overflow: 'hidden' }}>{ctaSub}</div>
          </div>
          <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round"><path d="M5 12h14M13 6l6 6-6 6"/></svg>
        </div>
      </div>
      <PhoneBottomNav active="home" />
    </PhoneFrame>);

};

/* ============ Phone D — Reminders tab (matches Hatırlatıcılar screen) ============ */
const PhoneReminders = () => {
  const { t } = useI18n();
  const tabs = t('phone.rem_tabs');
  const active = t('phone.rem_active');
  return (
    <PhoneFrame>
      <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '6px 18px 8px' }}>
        <h3 style={{ margin: 0, fontSize: 22, fontWeight: 900, color: '#F0F0FF', letterSpacing: '-0.02em' }}>
          {t('phone.rem_hdr')}
        </h3>
        <div style={{
          width: 36, height: 36, borderRadius: 12,
          background: 'linear-gradient(135deg, #C4A8FF, #EC6FB8)',
          display: 'flex', alignItems: 'center', justifyContent: 'center', color: 'white',
          boxShadow: '0 10px 22px -8px rgba(236,111,184,0.5)'
        }}>
          <Ic.Plus s={16} />
        </div>
      </div>

      {/* Filter pills */}
      <div style={{ padding: '8px 18px 14px', display: 'flex', gap: 6, overflow: 'hidden' }}>
        {tabs.map((tab, i) => {
          const on = tab === active;
          return (
            <span key={i} style={{
              padding: '6px 12px', borderRadius: 999, fontSize: 11, fontWeight: 700,
              color: on ? '#0F0F1A' : '#AAABCC',
              background: on ? 'linear-gradient(135deg, #FFB3DC, #C4A8FF)' : 'rgba(255,255,255,0.05)',
              border: on ? '1px solid transparent' : '1px solid rgba(255,255,255,0.08)',
              boxShadow: on ? '0 8px 18px -6px rgba(236,111,184,0.4)' : 'none',
              flexShrink: 0, display: 'flex', alignItems: 'center', gap: 4
            }}>
              {tab}
              {i < 3 && <span style={{
                fontSize: 9, fontWeight: 800, opacity: 0.8,
                padding: '1px 6px', borderRadius: 999,
                background: on ? 'rgba(15,15,26,0.18)' : 'rgba(255,255,255,0.06)'
              }}>{i + 1}</span>}
            </span>);

        })}
      </div>

      <div style={{ padding: '0 18px' }}>
        {/* BUGÜN section */}
        <div style={{ display: 'flex', alignItems: 'center', gap: 10, marginBottom: 8 }}>
          <div style={{ fontSize: 10, fontWeight: 800, color: '#AAABCC', letterSpacing: '0.08em' }}>{t('phone.rem_today').toUpperCase()}</div>
          <div style={{ flex: 1, height: 1, background: 'rgba(255,255,255,0.06)' }}></div>
          <div style={{ fontSize: 10, color: '#6B6B8A', fontWeight: 600 }}>1</div>
        </div>
        {t('phone.rem_items_today').map((r, i) =>
        <ReminderRow key={i} r={r} />
        )}

        {/* DAHA SONRA section */}
        <div style={{ display: 'flex', alignItems: 'center', gap: 10, marginTop: 18, marginBottom: 8 }}>
          <div style={{ fontSize: 10, fontWeight: 800, color: '#AAABCC', letterSpacing: '0.08em' }}>{t('phone.rem_later').toUpperCase()}</div>
          <div style={{ flex: 1, height: 1, background: 'rgba(255,255,255,0.06)' }}></div>
          <div style={{ fontSize: 10, color: '#6B6B8A', fontWeight: 600 }}>2</div>
        </div>
        {t('phone.rem_items_later').map((r, i) =>
        <ReminderRow key={i} r={r} />
        )}
      </div>

      <PhoneBottomNav active="rem" />
    </PhoneFrame>);

};

const REMINDER_ICONS = {
  meeting: { Ic: Ic.Briefcase, color: '#8A7DFF' },
  work: { Ic: Ic.Slides, color: '#7DA8FF' },
  health: { Ic: Ic.Tooth, color: '#8FE0CE' },
  gift: { Ic: Ic.Cake, color: '#EC6FB8' },
  default: { Ic: Ic.Reminder, color: '#8A7DFF' }
};

const ReminderRow = ({ r }) => {
  const toneColor = { primary: '#8A7DFF', soft: '#7DA8FF', pink: '#EC6FB8' }[r.tone] || '#8A7DFF';
  const iconDef = REMINDER_ICONS[r.ic] || REMINDER_ICONS.default;
  const IconComp = iconDef.Ic;
  return (
    <div style={{
      padding: '12px 12px', borderRadius: 14, marginBottom: 8,
      background: 'rgba(255,255,255,0.04)', border: '1px solid rgba(255,255,255,0.06)',
      display: 'flex', alignItems: 'center', gap: 12
    }}>
      <div style={{
        width: 38, height: 38, borderRadius: 11,
        background: `${iconDef.color}1F`, border: `1px solid ${iconDef.color}40`,
        display: 'flex', alignItems: 'center', justifyContent: 'center',
        color: iconDef.color
      }}><IconComp s={18} /></div>
      <div style={{ flex: 1, lineHeight: 1.25, minWidth: 0 }}>
        <div style={{ fontSize: 13, fontWeight: 800, color: '#F0F0FF', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{r.title}</div>
        <div style={{
          display: 'inline-flex', alignItems: 'center', gap: 4, marginTop: 4,
          padding: '2px 7px', borderRadius: 999,
          background: `${toneColor}18`, fontSize: 9.5, fontWeight: 700, color: toneColor
        }}>
          ⧗ {r.left}
        </div>
      </div>
      <div style={{ textAlign: 'right', lineHeight: 1.2 }}>
        <div style={{ fontSize: 14, fontWeight: 800, color: '#F0F0FF' }}>{r.time}</div>
        <div style={{ fontSize: 10, color: '#6B6B8A', fontWeight: 600 }}>{r.sub}</div>
      </div>
    </div>);

};

/* ============ Phone E — Proactive morning (morning message only, user replies normally) ============ */
const PhoneProactive = () => {
  const { t, lang } = useI18n();
  const name = lang === 'tr' ? 'Ebru' : 'Mia';
  const meetingMsg = lang === 'tr' ?
  <>Bugün <b>10’da toplantın</b> var. Öncesinde kısa bir yürüyüş gününü açar mı dersin?</> :
  <>You have a <b>meeting at 10</b>. Want a 15-min walk to ease into the day?</>;
  const goodMorning = lang === 'tr' ? 'Günaydın' : 'Good morning';
  const morningTag = lang === 'tr' ? '08:12 · sabah' : '08:12 · morning';
  const bdayName = lang === 'tr' ? 'Ebru' : 'Mia';
  const bdayLabel = lang === 'tr' ? 'Doğum günü' : 'Birthday';
  const bdayDate = lang === 'tr' ? '6 Haziran · 12 gün kaldı' : 'Jun 6 · 12 days away';
  const replyPlaceholder = lang === 'tr' ? 'Cevapla ya da yeni bir şey anlat…' : 'Reply, or tell me anything…';

  return (
    <PhoneFrame>
      {/* Chat-style appbar to make clear this is in the normal chat */}
      <div style={{
        display: 'flex', alignItems: 'center', padding: '6px 14px 12px',
        borderBottom: '1px solid rgba(255,255,255,0.05)'
      }}>
        <button aria-label="back" style={{
          width: 32, height: 32, borderRadius: '50%', border: 0, background: 'transparent',
          display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#F0F0FF', cursor: 'pointer'
        }}>
          <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M15 18l-6-6 6-6" /></svg>
        </button>
        <div style={{ flex: 1, display: 'flex', justifyContent: 'center', alignItems: 'center', gap: 10 }}>
          <div style={{
            width: 36, height: 36, borderRadius: 12,
            background: 'linear-gradient(135deg, #6B5BFF, #9D96FF)',
            display: 'flex', alignItems: 'center', justifyContent: 'center',
            boxShadow: '0 3px 10px rgba(107,91,255,0.4)'
          }}>
            <LumynaxMark size={26} halo={false} gradient={false} glow={false} animate={false} />
          </div>
          <div style={{ lineHeight: 1.1 }}>
            <div style={{ fontSize: 15, fontWeight: 800 }}>
              <span style={{ color: '#F0F0FF' }}>Lumy</span>
              <span style={{ background: 'linear-gradient(135deg,#8A7DFF,#EC6FB8)', WebkitBackgroundClip: 'text', backgroundClip: 'text', color: 'transparent' }}>nax</span>
            </div>
            <div style={{ display: 'flex', alignItems: 'center', gap: 4, color: '#8A7DFF', fontSize: 11, fontWeight: 700 }}>
              {t('phone.chat_subtitle')}
              <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"><path d="M6 9l6 6 6-6" /></svg>
            </div>
          </div>
        </div>
        <div style={{ width: 32 }}></div>
      </div>

      <div style={{ padding: '14px 14px 88px', display: 'flex', flexDirection: 'column', gap: 12, height: 'calc(100% - 80px)', overflow: 'hidden' }}>
        <div style={{ alignSelf: 'center', fontSize: 10, color: '#6B6B8A', fontWeight: 700, letterSpacing: '0.06em', textTransform: 'uppercase' }}>
          {morningTag}
        </div>

        {/* Lumynax morning message */}
        <AiMessageRow time="08:12">
          <div style={{
            background: 'linear-gradient(135deg, rgba(245,201,122,0.22), rgba(236,111,184,0.14))',
            border: '1px solid rgba(245,201,122,0.28)',
            color: '#F0F0FF', borderRadius: '16px 16px 16px 4px',
            padding: '14px 14px'
          }}>
            <div style={{ fontFamily: 'Fraunces, serif', fontStyle: 'italic', fontSize: 20, lineHeight: 1.15, fontWeight: 500, letterSpacing: '-0.01em', marginBottom: 8 }}>
              {goodMorning} <span style={{ background: 'linear-gradient(135deg,#F5C97A,#EC6FB8)', WebkitBackgroundClip: 'text', backgroundClip: 'text', color: 'transparent' }}>{name}.</span>
            </div>
            <p style={{ margin: 0, fontSize: 12.5, lineHeight: 1.5, fontWeight: 500 }}>{meetingMsg}</p>
            {/* Inline special-day awareness card */}
            <div style={{
              marginTop: 10, padding: '9px 11px', borderRadius: 11,
              background: 'rgba(236,111,184,0.10)', border: '1px solid rgba(236,111,184,0.22)',
              display: 'flex', alignItems: 'center', gap: 8
            }}>
              <div style={{ width: 22, height: 22, borderRadius: 7, background: 'rgba(236,111,184,0.20)',
                display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#EC6FB8', flexShrink: 0 }}>
                <Ic.Cake s={12} />
              </div>
              <div style={{ lineHeight: 1.2, flex: 1, minWidth: 0 }}>
                <div style={{ fontSize: 11, fontWeight: 800 }}>{bdayName} · {bdayLabel}</div>
                <div style={{ fontSize: 10, color: '#AAABCC', fontWeight: 600 }}>{bdayDate}</div>
              </div>
            </div>
          </div>
        </AiMessageRow>

        {/* User replies normally */}
        <UserMessageRow text={lang === 'tr' ? 'Olur, kısa yürüyüş iyi olur. Teşekkürler:)' : 'Sure, a short walk sounds good. Thanks :)'} time="08:14" />

        {/* AI brief follow-up */}
        <AiMessageRow time="08:14">
          <div style={{
            background: 'rgba(255,255,255,0.05)', border: '1px solid rgba(255,255,255,0.08)',
            color: '#F0F0FF', borderRadius: '16px 16px 16px 4px',
            padding: '9px 12px', fontSize: 12.5, lineHeight: 1.45
          }}>{lang === 'tr' ? 'Şık. İyi yürüyüşler, dönünce konuşuruz.' : 'Lovely. Enjoy the walk — talk when you\'re back.'}</div>
        </AiMessageRow>
      </div>

      {/* Composer at bottom — same as chat: user just replies normally */}
      <div style={{
        position: 'absolute', bottom: 12, left: 12, right: 12,
        background: 'rgba(255,255,255,0.05)', border: '1px solid rgba(255,255,255,0.08)',
        borderRadius: 22, padding: '10px 6px 10px 14px'
      }}>
        <div style={{ fontSize: 12, color: '#6B6B8A', fontWeight: 500, marginBottom: 6 }}>{replyPlaceholder}</div>
        <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
          <div style={{ display: 'flex', gap: 14, color: '#6B6B8A' }}>
            <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
              <rect x="3" y="5" width="18" height="14" rx="2" /><circle cx="9" cy="11" r="2" /><path d="m21 17-5-5-10 9" />
            </svg>
            <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
              <rect x="9" y="3" width="6" height="12" rx="3" /><path d="M5 11a7 7 0 0 0 14 0" /><path d="M12 18v3" />
            </svg>
          </div>
          <div style={{
            padding: '7px 14px 7px 12px', borderRadius: 999,
            background: 'linear-gradient(135deg, #8A7DFF, #EC6FB8)',
            color: 'white', fontSize: 12, fontWeight: 800, display: 'inline-flex', alignItems: 'center', gap: 6,
            boxShadow: '0 10px 22px -8px rgba(236,111,184,0.5)'
          }}>
            <svg width="14" height="12" viewBox="0 0 14 12" fill="none">
              <path d="M1 7V5M3.5 9V3M6 11V1M8.5 9V3M11 7V5M13 6.5V5.5" stroke="white" strokeWidth="1.4" strokeLinecap="round" />
            </svg>
            Speak
          </div>
        </div>
      </div>
    </PhoneFrame>);

};

Object.assign(window, { PhoneFrame, PhoneMemory, PhoneChat, PhoneRecall, PhoneReminders, PhoneProactive });