// ============================================================
// Alumnus member app — daily-life screens 1.8 → 1.12
// ============================================================
const { Icon: MI, Crest: MCrest, Avatar: MAvatar, Button: MBtn, Eyebrow: MEyebrow,
        Pill: MPill, Card: MCard, TabBar: MTab, Sparkline: MSpark, Bars: MBars, MEMBER, SPONSOR } = window.AL;

// ─────────────────────────────────────────────────────────────
// 1.8  Home / Today
// ─────────────────────────────────────────────────────────────
const M_Home = ({ nav = () => {}, patternEmerging = false }) => (
  <div style={{ background: 'var(--bg-page)', height: '100%', position: 'relative',
                overflow: 'auto', boxSizing: 'border-box' }}>
    <div style={{ padding: '60px 24px 110px' }}>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start',
                    marginBottom: 24 }}>
        <div>
          <div style={{ fontSize: 11.5, letterSpacing: '0.06em', textTransform: 'uppercase',
                        color: 'var(--fg-tertiary)', fontWeight: 500, marginBottom: 6 }}>
            Thursday · Day {patternEmerging ? 45 : 30}
          </div>
          <div style={{ fontFamily: 'var(--font-display)', fontSize: 28, fontWeight: 400,
                        letterSpacing: '-0.012em', lineHeight: '32px' }}>Good morning, Anna.</div>
        </div>
        <MCrest size={28}/>
      </div>

      {/* Membership counter — quiet badge */}
      <div style={{
        display: 'inline-flex', alignItems: 'center', gap: 10,
        padding: '8px 14px', borderRadius: 999,
        background: 'var(--color-oat)', color: 'var(--fg-secondary)',
        fontSize: 12, fontWeight: 500, marginBottom: 24,
      }}>
        <MIcon name="graduation-cap" size={14} color="var(--color-brass-dark)"/>
        Class of {MEMBER.classYear} · {patternEmerging ? 45 : 30} days continuing
      </div>

      {/* Hero: this-week note */}
      <div style={{
        background: 'var(--color-ivy)', color: 'var(--color-bone)',
        padding: '24px 22px', borderRadius: 4, marginBottom: 18,
      }}>
        <div style={{ fontSize: 10.5, letterSpacing: '0.1em', textTransform: 'uppercase',
                      color: 'var(--color-brass-soft)', fontWeight: 500, marginBottom: 12 }}>
          Where you are
        </div>
        <div style={{ fontFamily: 'var(--font-display)', fontSize: 22, lineHeight: '30px',
                      fontWeight: 400, letterSpacing: '-0.008em' }}>
          {patternEmerging
            ? "Your network has been quietly notified. Maria asked to call you tonight."
            : "You're tracking steady this week. Sleep is back on rhythm and meetings are full."}
        </div>
      </div>

      {/* Worth a look (only when pattern emerging) */}
      {patternEmerging && (
        <button onClick={() => nav('alert')} style={{
          width: '100%', textAlign: 'left',
          background: 'var(--bg-elevated)', border: 'none',
          borderLeft: '3px solid var(--color-brass)',
          borderRadius: 4, padding: '16px 18px', marginBottom: 18, cursor: 'pointer',
          boxShadow: 'var(--shadow-soft)',
        }}>
          <div style={{ fontSize: 10.5, letterSpacing: '0.1em', textTransform: 'uppercase',
                        color: 'var(--color-brass-dark)', fontWeight: 600, marginBottom: 6 }}>
            Worth a look
          </div>
          <div style={{ fontFamily: 'var(--font-display)', fontSize: 17, lineHeight: '23px',
                        fontWeight: 500, color: 'var(--fg-primary)', marginBottom: 4 }}>
            Three missed mornings and a late Tuesday.
          </div>
          <div style={{ fontSize: 13, lineHeight: '18px', color: 'var(--fg-secondary)' }}>
            Beth and Maria can see this. Dr. Singh has been alerted.
          </div>
        </button>
      )}

      {/* Next meeting card */}
      <div style={{
        background: 'var(--bg-surface)', border: '1px solid var(--border-hairline)',
        borderRadius: 4, padding: '16px 18px', marginBottom: 18,
        display: 'flex', alignItems: 'center', gap: 14,
      }}>
        <div style={{
          width: 48, height: 48, borderRadius: 4,
          background: 'var(--color-bone)', border: '1px solid var(--border-hairline)',
          display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center',
          lineHeight: 1, padding: '2px 0',
        }}>
          <div style={{ fontSize: 9, color: 'var(--color-brass-dark)', textTransform: 'uppercase',
                        letterSpacing: '0.06em', fontWeight: 600 }}>Thu</div>
          <div style={{ fontFamily: 'var(--font-display)', fontSize: 20, fontWeight: 500 }}>14</div>
        </div>
        <div style={{ flex: 1, minWidth: 0 }}>
          <div style={{ fontSize: 11, color: 'var(--fg-tertiary)', letterSpacing: '0.04em',
                        textTransform: 'uppercase', fontWeight: 500, marginBottom: 3 }}>Next meeting · in 90 min</div>
          <div style={{ fontSize: 15, fontWeight: 600 }}>St. Margaret's evening group</div>
          <div style={{ fontSize: 12.5, color: 'var(--fg-tertiary)' }}>7:30 pm · 442 Bay St</div>
        </div>
        <MBtn variant="primary" size="sm">Check in</MBtn>
      </div>

      {/* Daily check-in prompt */}
      <button onClick={() => nav('checkin')} style={{
        width: '100%', textAlign: 'left',
        background: 'transparent', border: '1px solid var(--color-ivy)',
        borderRadius: 4, padding: '16px 18px', cursor: 'pointer', marginBottom: 22,
        display: 'flex', alignItems: 'center', gap: 14,
      }}>
        <MIcon name="notebook" size={22} color="var(--color-ivy)"/>
        <div style={{ flex: 1, minWidth: 0 }}>
          <div style={{ fontSize: 14.5, fontWeight: 600, color: 'var(--fg-primary)' }}>
            How is today landing?
          </div>
          <div style={{ fontSize: 12.5, color: 'var(--fg-tertiary)' }}>Two minutes. Just for you.</div>
        </div>
        <MIcon name="caret-right" size={16} color="var(--color-stone)"/>
      </button>

      <MEyebrow style={{ marginBottom: 10 }}>Recent</MEyebrow>
      {[
        { i: 'check-circle',  t: 'Checked in at Pine Tree IOP', s: 'Monday evening' },
        { i: 'chat-circle',   t: 'Beth replied to your note',    s: 'Tuesday · "proud of you"' },
        { i: 'moon-stars',    t: '7 nights of steady sleep',     s: 'last week' },
      ].map((r, i) => (
        <div key={i} style={{
          display: 'flex', alignItems: 'center', gap: 14, padding: '12px 0',
          borderBottom: i < 2 ? '1px solid var(--border-hairline)' : 'none',
        }}>
          <MIcon name={r.i} size={20} color="var(--color-moss)"/>
          <div style={{ flex: 1 }}>
            <div style={{ fontSize: 14, color: 'var(--fg-primary)' }}>{r.t}</div>
            <div style={{ fontSize: 12, color: 'var(--fg-tertiary)' }}>{r.s}</div>
          </div>
        </div>
      ))}

      <MEyebrow style={{ marginTop: 22, marginBottom: 10 }}>Reach out</MEyebrow>
      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 10 }}>
        {[
          { label: 'Beth · sponsor', i: 'phone' },
          { label: 'Maria · mom', i: 'phone' },
          { label: 'Dr. Singh', i: 'chat-circle' },
          { label: 'Crisis line', i: 'lifebuoy' },
        ].map((c, i) => (
          <div key={i} style={{
            padding: '12px 14px', background: 'var(--bg-surface)',
            border: '1px solid var(--border-hairline)', borderRadius: 4,
            display: 'flex', alignItems: 'center', gap: 10,
          }}>
            <MIcon name={c.i} size={16} color={c.i === 'lifebuoy' ? 'var(--color-ember)' : 'var(--color-ivy)'}/>
            <div style={{ fontSize: 13, fontWeight: 500 }}>{c.label}</div>
          </div>
        ))}
      </div>
    </div>
    <MTab active="home" onNav={nav}/>
  </div>
);

// Need MIcon alias since I renamed Icon in the namespace
const MIcon = MI;

// ─────────────────────────────────────────────────────────────
// 1.9  Daily Check-In
// ─────────────────────────────────────────────────────────────
const M_CheckIn = ({ nav = () => {} }) => {
  const feelings = [
    { i: 'sun',        l: 'Light',    on: false },
    { i: 'cloud-sun',  l: 'Mixed',    on: true },
    { i: 'cloud',      l: 'Heavy',    on: false },
    { i: 'wind',       l: 'Restless', on: false },
  ];
  return (
    <div style={{ padding: '76px 28px 40px', height: '100%', boxSizing: 'border-box',
                  display: 'flex', flexDirection: 'column' }}>
      <button onClick={() => nav('home')} style={{ background: 'none', border: 'none',
              color: 'var(--fg-secondary)', fontSize: 14, padding: 0, marginBottom: 22,
              cursor: 'pointer', display: 'inline-flex', alignItems: 'center', gap: 6, alignSelf: 'flex-start' }}>
        <MIcon name="x" size={16}/> Close
      </button>
      <MEyebrow tone="brass" style={{ marginBottom: 10 }}>Check-in · 2 of 3</MEyebrow>
      <h1 style={{ fontFamily: 'var(--font-display)', fontSize: 28, lineHeight: '34px',
                   fontWeight: 400, letterSpacing: '-0.012em', margin: '0 0 28px' }}>
        How is today landing?
      </h1>

      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 10, marginBottom: 32 }}>
        {feelings.map(f => (
          <div key={f.l} style={{
            padding: '20px 16px', borderRadius: 4,
            background: f.on ? 'var(--color-ivy)' : 'var(--bg-surface)',
            color: f.on ? 'var(--color-bone)' : 'var(--fg-primary)',
            border: `1px solid ${f.on ? 'var(--color-ivy)' : 'var(--border-hairline)'}`,
            display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: 10,
          }}>
            <MIcon name={f.i} size={26} color={f.on ? 'var(--color-brass)' : 'var(--color-stone)'}/>
            <div style={{ fontSize: 15, fontWeight: 500 }}>{f.l}</div>
          </div>
        ))}
      </div>

      <MEyebrow style={{ marginBottom: 10 }}>Anything you want to put down</MEyebrow>
      <div style={{
        background: 'var(--bg-surface)', border: '1px solid var(--border-hairline)',
        borderRadius: 4, padding: '14px 16px', minHeight: 110, fontSize: 14.5,
        lineHeight: '22px', color: 'var(--fg-primary)',
        fontStyle: 'italic', fontFamily: 'var(--font-display)',
      }}>
        Slept fine. Work was a lot today — that meeting with John drained me. Looking forward to St. Margaret's tonight.
      </div>
      <button style={{
        marginTop: 8, padding: '8px 0', background: 'none', border: 'none',
        color: 'var(--color-brass-dark)', fontSize: 13, cursor: 'pointer',
        display: 'inline-flex', alignItems: 'center', gap: 6, alignSelf: 'flex-start',
      }}>
        <MIcon name="microphone" size={14}/> Voice memo instead
      </button>

      <div style={{ marginTop: 'auto', display: 'flex', flexDirection: 'column', gap: 10 }}>
        <div style={{ fontSize: 12, color: 'var(--fg-tertiary)', textAlign: 'center', fontStyle: 'italic',
                      fontFamily: 'var(--font-display)' }}>
          Only you see this. We notice patterns, never contents.
        </div>
        <MBtn variant="primary" full onClick={() => nav('home')}>Save check-in</MBtn>
      </div>
    </div>
  );
};

// ─────────────────────────────────────────────────────────────
// 1.10 Meeting Detail
// ─────────────────────────────────────────────────────────────
const M_MeetingDetail = ({ nav = () => {} }) => {
  const history = ['attended','attended','attended','missed','attended','attended','attended','upcoming'];
  return (
    <div style={{ background: 'var(--bg-page)', height: '100%', overflow: 'auto', boxSizing: 'border-box' }}>
      {/* Map header */}
      <div style={{ position: 'relative', height: 180, background: '#cdc3a8' }}>
        {/* fake map */}
        <svg viewBox="0 0 360 180" width="100%" height="100%" preserveAspectRatio="none">
          <rect width="360" height="180" fill="#D6CCB1"/>
          {[40, 100, 140].map((y, i) => (
            <path key={i} d={`M 0 ${y} Q 90 ${y - 14} 180 ${y} T 360 ${y}`}
                  stroke="#B8AB85" strokeWidth="2" fill="none"/>
          ))}
          {[80, 200, 310].map((x, i) => (
            <path key={i} d={`M ${x} 0 L ${x - 12} 180`} stroke="#B8AB85" strokeWidth="2" opacity="0.5"/>
          ))}
          <circle cx="180" cy="90" r="36" fill="rgba(30,58,46,0.12)" stroke="#1E3A2E" strokeWidth="1" strokeDasharray="3 4"/>
          <circle cx="180" cy="90" r="8" fill="#1E3A2E"/>
          <circle cx="180" cy="90" r="3" fill="#A8843C"/>
        </svg>
        <button onClick={() => nav('meetings')} style={{
          position: 'absolute', top: 60, left: 20,
          width: 36, height: 36, borderRadius: 999,
          background: 'rgba(242,237,226,0.95)', border: 'none',
          display: 'flex', alignItems: 'center', justifyContent: 'center',
          cursor: 'pointer', boxShadow: '0 2px 6px rgba(0,0,0,0.1)',
        }}>
          <MIcon name="caret-left" size={16}/>
        </button>
      </div>

      <div style={{ padding: '20px 24px 100px' }}>
        <MEyebrow tone="brass" style={{ marginBottom: 8 }}>Tonight · in 90 minutes</MEyebrow>
        <h1 style={{ fontFamily: 'var(--font-display)', fontSize: 26, lineHeight: '32px',
                     fontWeight: 400, letterSpacing: '-0.01em', margin: '0 0 6px' }}>
          St. Margaret's evening group
        </h1>
        <div style={{ fontSize: 13.5, color: 'var(--fg-secondary)' }}>
          7:30 pm · 442 Bay St, St. Petersburg · runs 60 min
        </div>

        <MBtn variant="primary" full size="lg" style={{ marginTop: 20, marginBottom: 8 }} onClick={() => nav('home')}>
          Check in when you arrive
        </MBtn>
        <div style={{ fontSize: 12, color: 'var(--fg-tertiary)', textAlign: 'center', marginBottom: 22 }}>
          Activates automatically inside the room
        </div>

        <MEyebrow style={{ marginBottom: 10 }}>Attendance · last 8 weeks</MEyebrow>
        <div style={{ display: 'flex', gap: 6, marginBottom: 8 }}>
          {history.map((s, i) => {
            const tone = s === 'attended' ? '#4F6A4A' : s === 'missed' ? '#C9A363' : '#D7CFBC';
            return (
              <div key={i} style={{ flex: 1, display: 'flex', flexDirection: 'column',
                                    alignItems: 'center', gap: 4 }}>
                <div style={{ width: '100%', aspectRatio: '1/1', borderRadius: 3, background: tone }}/>
                <div style={{ fontSize: 10, color: 'var(--fg-tertiary)' }}>{['8w','7w','6w','5w','4w','3w','2w','1w'][i]}</div>
              </div>
            );
          })}
        </div>
        <div style={{ display: 'flex', gap: 14, fontSize: 11.5, color: 'var(--fg-tertiary)',
                      marginBottom: 22 }}>
          <span><span style={{display:'inline-block', width:8, height:8, background:'#4F6A4A', borderRadius:2, marginRight:6}}/>Attended</span>
          <span><span style={{display:'inline-block', width:8, height:8, background:'#C9A363', borderRadius:2, marginRight:6}}/>Missed</span>
          <span><span style={{display:'inline-block', width:8, height:8, background:'#D7CFBC', borderRadius:2, marginRight:6}}/>Upcoming</span>
        </div>

        <MEyebrow style={{ marginBottom: 10 }}>Contact</MEyebrow>
        <div style={{ display: 'flex', alignItems: 'center', gap: 14,
                      padding: '12px 0', borderTop: '1px solid var(--border-hairline)',
                      borderBottom: '1px solid var(--border-hairline)' }}>
          <MAvatar initials="DK" tone="oat" size={36}/>
          <div style={{ flex: 1 }}>
            <div style={{ fontSize: 14, fontWeight: 500 }}>Diane K. · chair</div>
            <div style={{ fontSize: 12, color: 'var(--fg-tertiary)' }}>Text-friendly</div>
          </div>
          <MBtn variant="ghost" size="sm" icon="chat-circle">Message</MBtn>
        </div>
        <button style={{
          marginTop: 16, padding: '12px 0', background: 'none', border: 'none',
          color: 'var(--color-stone)', fontSize: 13, cursor: 'pointer',
        }}>Mark attended manually</button>
      </div>
    </div>
  );
};

// ─────────────────────────────────────────────────────────────
// 1.11 Meetings List
// ─────────────────────────────────────────────────────────────
const M_MeetingsList = ({ nav = () => {} }) => {
  const meetings = [
    { d: 'Today',     t: '7:30 pm', n: "St. Margaret's evening group", l: '442 Bay St', status: 'upcoming' },
    { d: 'Tomorrow',  t: '6:00 pm', n: 'Pine Tree IOP',                 l: 'Clearwater',  status: 'upcoming' },
    { d: 'Mon · 5/18',t: '6:00 pm', n: 'Pine Tree IOP',                 l: 'Clearwater',  status: 'attended' },
    { d: 'Sun · 5/17',t: '11:00 am',n: 'Sunday women',                  l: 'Lakewood Hall', status: 'attended' },
    { d: 'Wed · 5/13',t: '7:30 pm', n: "St. Margaret's evening group", l: '442 Bay St', status: 'missed' },
    { d: 'Mon · 5/11',t: '6:00 pm', n: 'Pine Tree IOP',                 l: 'Clearwater',  status: 'attended' },
  ];
  return (
    <div style={{ background: 'var(--bg-page)', height: '100%', position: 'relative',
                  overflow: 'auto', boxSizing: 'border-box' }}>
      <div style={{ padding: '60px 24px 110px' }}>
        <MEyebrow style={{ marginBottom: 6 }}>Your meetings</MEyebrow>
        <h1 style={{ fontFamily: 'var(--font-display)', fontSize: 28, fontWeight: 400,
                     letterSpacing: '-0.012em', margin: '0 0 6px', lineHeight: '32px' }}>
          Twenty-three rooms so far.
        </h1>
        <p style={{ fontSize: 13.5, color: 'var(--fg-secondary)', margin: '0 0 18px' }}>
          That's 92% of the calendar since you came home.
        </p>

        <div style={{ display: 'flex', gap: 4, marginBottom: 18,
                      padding: 3, background: 'var(--color-oat)', borderRadius: 999, width: 'fit-content' }}>
          {['Upcoming', 'Past', 'All'].map((t, i) => (
            <div key={t} style={{
              padding: '6px 14px', borderRadius: 999, fontSize: 12.5, fontWeight: 500,
              background: i === 0 ? 'var(--color-bone)' : 'transparent',
              color: i === 0 ? 'var(--fg-primary)' : 'var(--fg-tertiary)',
              cursor: 'pointer',
            }}>{t}</div>
          ))}
        </div>

        {meetings.map((m, i) => {
          const tone = m.status === 'attended' ? 'moss'
                     : m.status === 'missed'   ? 'brass'
                     : 'oat';
          return (
            <div key={i} onClick={() => nav('meeting')} style={{
              display: 'flex', alignItems: 'center', gap: 14,
              padding: '14px 0', borderBottom: '1px solid var(--border-hairline)',
              cursor: 'pointer',
            }}>
              <div style={{
                width: 50, padding: '6px 0', textAlign: 'center',
                background: 'var(--bg-surface)', border: '1px solid var(--border-hairline)', borderRadius: 4,
              }}>
                <div style={{ fontSize: 9.5, color: 'var(--color-brass-dark)', textTransform: 'uppercase',
                              letterSpacing: '0.04em', fontWeight: 600 }}>{m.d.split(' ')[0]}</div>
                <div style={{ fontFamily: 'var(--font-display)', fontSize: 14, fontWeight: 500 }}>
                  {m.t}
                </div>
              </div>
              <div style={{ flex: 1, minWidth: 0 }}>
                <div style={{ fontSize: 14.5, fontWeight: 500 }}>{m.n}</div>
                <div style={{ fontSize: 12, color: 'var(--fg-tertiary)' }}>{m.l}</div>
              </div>
              <MPill tone={tone} dot>{m.status === 'attended' ? 'Attended' : m.status === 'missed' ? 'Missed' : 'Soon'}</MPill>
            </div>
          );
        })}

        <button style={{
          marginTop: 18, padding: '14px', width: '100%',
          background: 'transparent', border: '1px dashed var(--color-stone-soft)', borderRadius: 4,
          color: 'var(--color-ivy)', fontSize: 14, fontWeight: 500,
          display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 8,
          cursor: 'pointer',
        }}>
          <MIcon name="plus" size={16}/> Add a meeting
        </button>
      </div>
      <MTab active="meetings" onNav={nav}/>
    </div>
  );
};

// ─────────────────────────────────────────────────────────────
// 1.12 Wellbeing Trends (member's private view)
// ─────────────────────────────────────────────────────────────
const M_Trends = ({ nav = () => {} }) => {
  const sleep = [7.2, 7.5, 7.1, 6.8, 7.4, 7.6, 7.3, 7.2, 6.9, 7.5, 7.2, 7.4, 7.1, 6.7];
  const checkins = [1,1,1,0,1,1,1, 1,1,0,1,1,1,1];
  const meetingsBars = [3,3,2,3,3,3,2];
  return (
    <div style={{ background: 'var(--bg-page)', height: '100%', position: 'relative',
                  overflow: 'auto', boxSizing: 'border-box' }}>
      <div style={{ padding: '60px 24px 110px' }}>
        <MEyebrow style={{ marginBottom: 6 }}>How you're tracking</MEyebrow>
        <h1 style={{ fontFamily: 'var(--font-display)', fontSize: 26, lineHeight: '32px',
                     fontWeight: 400, letterSpacing: '-0.01em', margin: '0 0 6px' }}>
          Steady this month, with a hard Tuesday.
        </h1>
        <p style={{ fontSize: 13.5, lineHeight: '20px', color: 'var(--fg-secondary)', margin: '0 0 22px' }}>
          A written look at your last 30 days. Nothing here is sent to your network.
        </p>

        <div style={{ display: 'flex', gap: 6, marginBottom: 22 }}>
          {['30 days', '60 days', '90 days'].map((t, i) => (
            <div key={t} style={{
              padding: '6px 14px', borderRadius: 999, fontSize: 12, fontWeight: 500,
              background: i === 0 ? 'var(--color-ivy)' : 'transparent',
              color: i === 0 ? 'var(--color-bone)' : 'var(--fg-tertiary)',
              border: i === 0 ? 'none' : '1px solid var(--border-hairline)',
            }}>{t}</div>
          ))}
        </div>

        {/* Meeting attendance */}
        <div style={{ background: 'var(--bg-surface)', border: '1px solid var(--border-hairline)',
                      borderRadius: 4, padding: '18px 20px', marginBottom: 12 }}>
          <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', marginBottom: 12 }}>
            <MEyebrow>Meeting attendance</MEyebrow>
            <span style={{ fontFamily: 'var(--font-display)', fontSize: 22, fontWeight: 500, lineHeight: 1 }}>
              19<span style={{ color: 'var(--fg-tertiary)', fontSize: 14, fontWeight: 400 }}>/21</span>
            </span>
          </div>
          <MBars data={meetingsBars} width={280} height={48} color="#1E3A2E"/>
          <div style={{ display: 'flex', justifyContent: 'space-between', marginTop: 8,
                        fontSize: 10.5, color: 'var(--fg-tertiary)' }}>
            <span>Wk 1</span><span>Wk 4</span><span>Wk 7</span>
          </div>
        </div>

        {/* Sleep rhythm */}
        <div style={{ background: 'var(--bg-surface)', border: '1px solid var(--border-hairline)',
                      borderRadius: 4, padding: '18px 20px', marginBottom: 12 }}>
          <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', marginBottom: 12 }}>
            <MEyebrow>Sleep rhythm</MEyebrow>
            <span style={{ fontFamily: 'var(--font-display)', fontSize: 22, fontWeight: 500, lineHeight: 1 }}>
              7h 14m<span style={{ color: 'var(--fg-tertiary)', fontSize: 12, fontWeight: 400, marginLeft: 6 }}>avg</span>
            </span>
          </div>
          <MSpark data={sleep} width={280} height={56} stroke="#1E3A2E" dots/>
          <div style={{ fontSize: 11.5, color: 'var(--fg-tertiary)', marginTop: 8 }}>
            One short night two weeks ago. Otherwise stable.
          </div>
        </div>

        {/* Daily check-in consistency */}
        <div style={{ background: 'var(--bg-surface)', border: '1px solid var(--border-hairline)',
                      borderRadius: 4, padding: '18px 20px', marginBottom: 18 }}>
          <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', marginBottom: 12 }}>
            <MEyebrow>Check-in consistency</MEyebrow>
            <span style={{ fontFamily: 'var(--font-display)', fontSize: 22, fontWeight: 500, lineHeight: 1 }}>
              26<span style={{ color: 'var(--fg-tertiary)', fontSize: 14, fontWeight: 400 }}> days</span>
            </span>
          </div>
          <div style={{ display: 'flex', gap: 3 }}>
            {Array.from({length: 30}, (_, i) => {
              const has = ![3, 14].includes(i);
              return <div key={i} style={{
                flex: 1, aspectRatio: '1/1', borderRadius: 2,
                background: has ? 'var(--color-ivy)' : 'var(--color-oat-dark)',
                opacity: has ? (0.4 + (i/30) * 0.6) : 1,
              }}/>;
            })}
          </div>
        </div>

        {/* Reflective summary */}
        <div style={{
          padding: '20px 22px', background: 'var(--color-ivy)', color: 'var(--color-bone)',
          borderRadius: 4,
        }}>
          <div style={{ fontSize: 10.5, letterSpacing: '0.1em', textTransform: 'uppercase',
                        color: 'var(--color-brass-soft)', fontWeight: 500, marginBottom: 10 }}>
            What we see
          </div>
          <div style={{ fontFamily: 'var(--font-display)', fontStyle: 'italic',
                        fontSize: 16, lineHeight: '24px' }}>
            Steady rhythm. Sleep is back where it was in April. Meetings have been near full. Some patterns from Tuesday worth noticing on your own — your network was not notified.
          </div>
        </div>
      </div>
      <MTab active="trends" onNav={nav}/>
    </div>
  );
};

window.MemberDaily = { M_Home, M_CheckIn, M_MeetingDetail, M_MeetingsList, M_Trends };
