(()=>{const l=window.React,de=window.KIND_REGISTRY;if(!l)return;const e=l.createElement,g=l.useState;function z(i){return(window.KIND_REGISTRY||{})[i]||null}function E(i){const t=z(i);return t&&Array.isArray(t.mockItems)&&t.mockItems.length?t.mockItems:null}function R(){const i=z("memberHome");return i&&typeof i.liveSource=="string"?i.liveSource:"seed"}const c={accent:"var(--app-accent,#00f3ff)",success:"var(--app-success,#00d4b8)",fail:"var(--app-fail,#f43f6c)",warn:"var(--app-warn,#f8d974)",pending:"var(--app-pending,#b06bff)",idle:"var(--app-ink,#e6e3da)"};function u(i,t,s){return`color-mix(in srgb, ${i} ${t}%, ${s||"transparent"})`}function f(i,t){const s=c[i]||c.idle;return t?{color:"var(--app-ink-faint,rgba(230,227,218,.38))",border:"1px solid var(--app-rule,rgba(255,255,255,.07))",background:"var(--app-rule-soft,rgba(255,255,255,.04))"}:{color:s,border:`1px solid ${u(s,30,"var(--app-rule,rgba(255,255,255,.07))")}`,background:u(s,10)}}function m(i,t){return e("svg",{width:t||18,height:t||18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},e("path",{d:i}))}function T(i,t,s){return e("svg",{width:s||18,height:s||18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},e("path",{d:i}),e("path",{d:t}))}function L(i,t){return e("svg",{width:t||18,height:t||18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},e("circle",{cx:12,cy:12,r:9}),e("path",{d:i}))}const p={cpu:"M9 3v2M15 3v2M9 19v2M15 19v2M20 9h1M20 14h1M3 9h1M3 14h1M6 6h12v12H6zM9.5 9.5h5v5h-5z",user:"M20 21a8 8 0 1 0-16 0M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8",target:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8M12 12h.01",inbox:"M4 13h4l1.5 3h5L16 13h4M4 13V6h16v7",sun:"M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8M12 3v2M12 19v2M5 5l1.5 1.5M17.5 17.5 19 19M3 12h2M19 12h2M5 19l1.5-1.5M17.5 6.5 19 5",receipt:"M6 3h12v18l-3-2-3 2-3-2-3 2zM9 8h6M9 12h6",refresh:"M20 11a8 8 0 1 0-2 5.3M20 4v5h-5",book:"M5 4a2 2 0 0 1 2-2h11v18H7a2 2 0 0 0-2 2zM5 20a2 2 0 0 1 2-2h11",send:"M22 2 11 13M22 2l-7 20-4-9-9-4z",check:"M5 13l4 4L19 7",squares:"M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z",chat:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",bolt:"M13 3 4 14h6l-1 7 9-11h-6z",arrow:"M5 12h14M13 6l6 6-6 6"},y={"ads-ops":{name:"Ads Ops",desc:"Bid + budget adjustments across ad accounts",last:"12m ago",icon:p.target},"inbox-triage":{name:"Inbox Triage",desc:"Sorts + drafts replies for the shared inbox",last:"18m ago",icon:p.inbox},"daily-brief":{name:"Daily Brief",desc:"Morning summary of metrics + priorities",last:"06:12",icon:p.sun},"invoice-watch":{name:"Invoice Watch",desc:"Flags overdue + mismatched invoices",last:"1h ago",icon:p.receipt},"crm-sync":{name:"CRM Sync",desc:"Keeps contact + deal records in sync",last:"3h ago",icon:p.refresh},"research-desk":{name:"Research Desk",desc:"Background research + competitive scans",last:"9h ago",icon:p.book}},v=["ads-ops","inbox-triage","daily-brief","invoice-watch","crm-sync","research-desk"],_={"ads-ops":!0,"inbox-triage":!0,"daily-brief":!0,"invoice-watch":!0,"crm-sync":!1,"research-desk":!1},P=[{kind:"agent",actor:"Ads Ops",text:"Paused 3 underperforming ad sets and reallocated $420 of budget to the top performer.",at:"12m ago",icon:p.target},{kind:"agent",actor:"Inbox Triage",text:"Drafted replies to 5 support emails \u2014 2 are awaiting your approval.",at:"18m ago",icon:p.inbox},{kind:"system",actor:"Context engine",text:"Refreshed the company context snapshot (14 sources).",at:"41m ago",icon:p.cpu},{kind:"human",actor:"Jordan",text:"Approved the invoice adjustment for Meridian Co.",at:"1h ago",icon:p.user},{kind:"agent",actor:"Daily Brief",text:"Sent the 06:12 morning brief to your inbox.",at:"3h ago",icon:p.sun},{kind:"agent",actor:"Research Desk",text:"Logged 4 competitor pricing changes to the research doc.",at:"5h ago",icon:p.book}],N=[{id:"ops-agent",name:"Ops Agent",kind:"agent",preview:"Paused 3 underperforming ad sets and reallocated\u2026",at:"12m",unread:2},{id:"research-desk",name:"Research Desk",kind:"agent",preview:"Logged 4 competitor pricing changes to the\u2026",at:"5h",unread:0},{id:"invoice-watch",name:"Invoice Watch",kind:"agent",preview:"Flagged an overdue invoice from Meridian Co.",at:"1h",unread:1},{id:"jordan",name:"Jordan",kind:"human",preview:"Approved the invoice adjustment",at:"1h",unread:0}],V={"ops-agent":[{who:"agent",text:"Paused 3 underperforming ad sets and reallocated $420 of budget to the top performer.",at:"12m ago"},{who:"agent",text:"Want me to extend this to the EU campaign too?",at:"11m ago"}],"research-desk":[{who:"agent",text:"Logged 4 competitor pricing changes to the research doc.",at:"5h ago"}],"invoice-watch":[{who:"agent",text:"Flagged an overdue invoice from Meridian Co. \u2014 14 days past due.",at:"1h ago"},{who:"agent",text:"Should I send a follow-up reminder?",at:"58m ago"}],jordan:[{who:"you",whoName:"Jordan",text:"Approved the invoice adjustment for Meridian Co.",at:"1h ago"},{who:"agent",text:"Done \u2014 adjustment applied and the vendor notified.",at:"59m ago"}]},B=[{id:"t1",title:"Approve invoice adjustment \u2014 Meridian Co.",meta:"Due today",from:"Invoice Watch",pill:"fail",pillLabel:"Due today"},{id:"t2",title:"Review 2 drafted inbox replies",meta:"Due today",from:"Inbox Triage",pill:"fail",pillLabel:"Due today"},{id:"t3",title:"Approve EU ad budget extension",meta:"Due tomorrow",from:"Ads Ops",pill:"warn",pillLabel:"Tomorrow"},{id:"t4",title:"Confirm CRM sync mapping for new fields",meta:"Completed",from:"CRM Sync",pill:"pending",pillLabel:"Done"},{id:"t5",title:"Read the weekly research digest",meta:"This week",from:"Research Desk",pill:"idle",pillLabel:"This week"}],H={t1:!1,t2:!1,t3:!1,t4:!0,t5:!1},W=[{icon:"check",num:2,label:"Approvals pending",sub:"awaiting your review",tone:"fail",target:"tasks"},{icon:"chat",num:3,label:"Unread threads",sub:"from agents & teammates",tone:"accent",target:"threads"},{icon:"clock",num:1,label:"Due today",sub:"needs attention",tone:"fail",target:"tasks"}],O=[{icon:"check",num:0,label:"Approvals pending",sub:"nothing waiting",tone:"success",target:"tasks"},{icon:"chat",num:0,label:"Unread threads",sub:"inbox clear",tone:"success",target:"threads"},{icon:"clock",num:0,label:"Due today",sub:"no deadlines",tone:"success",target:"tasks"}],q=[{key:"home",label:"Home"},{key:"services",label:"Services"},{key:"threads",label:"Threads"},{key:"tasks",label:"Tasks"}],J=[{key:"live",label:"Live",dot:c.success},{key:"loading",label:"Loading",dot:c.accent},{key:"empty",label:"Empty",dot:c.idle},{key:"error",label:"Error",dot:c.fail}];function K(i){return i.slice(0,6).map(t=>({kind:"agent",actor:t.agent||t.title||"Agent",text:t.subtitle||t.preview||t.statusLabel||t.title||"",at:t.startedAt||t.lastRunAt||t.triggered||"",icon:p.bolt}))}function U(i){const t=s=>s==="warn"?"warn":s==="running"?"accent":s==="ok"?"success":"idle";return i.slice(0,8).map(s=>({id:s.id,title:s.title||"Project",meta:s.subtitle||s.statusLabel||"",from:s.agent||"\u2014",pill:t(s.status),pillLabel:s.statusLabel||s.status||""}))}const C="personal-home-suite-style";function Y(){if(document.getElementById(C))return;const i=`
    .phsuite{display:flex;flex-direction:column;gap:20px;height:100%;min-height:0;overflow:auto;font-size:14px;line-height:1.45;color:var(--app-ink,#e6e3da);font-family:var(--app-font-body,"Inter",system-ui,sans-serif);}
    .phsuite *,.phsuite *::before,.phsuite *::after{box-sizing:border-box;}
    .phsuite button{font:inherit;color:inherit;background:none;border:0;}
    .phsuite input{font:inherit;color:inherit;}
    .phsuite .mono{font-family:var(--app-font-mono,"JetBrains Mono",SFMono-Regular,monospace);font-variant-numeric:tabular-nums;}
    .phsuite .pill{display:inline-flex;align-items:center;gap:4px;font-family:var(--app-font-mono,"JetBrains Mono",SFMono-Regular,monospace);font-size:10px;text-transform:uppercase;letter-spacing:.05em;padding:2px 8px;border-radius:var(--app-radius-pill,9999px);white-space:nowrap;}

    /* ---- greeting / view head ---- */
    .phsuite .ph-greet{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;flex-wrap:wrap;}
    .phsuite .ph-overline{display:flex;align-items:center;gap:12px;font-size:.6rem;font-weight:600;text-transform:uppercase;letter-spacing:.15rem;color:var(--app-accent,#00f3ff);margin-bottom:10px;}
    .phsuite .ph-overline .bar{width:20px;height:2px;background:var(--app-accent,#00f3ff);box-shadow:0 0 8px ${u("var(--app-accent,#00f3ff)",40)};}
    .phsuite .ph-title{margin:0 0 6px;font-weight:900;letter-spacing:-.03em;font-size:2rem;line-height:1.05;color:var(--app-ink,#e6e3da);}
    .phsuite .ph-sub{margin:0;color:var(--app-ink-soft,rgba(230,227,218,.62));font-size:.9rem;}
    .phsuite .ph-sub b{color:var(--app-ink,#e6e3da);font-weight:600;}

    /* ---- tab nav ---- */
    .phsuite .ph-tabs{display:flex;gap:2px;border-bottom:1px solid var(--app-rule,rgba(255,255,255,.07));overflow-x:auto;}
    .phsuite .ph-tab{padding:10px 15px;border-bottom:2px solid transparent;margin-bottom:-1px;cursor:pointer;font-family:var(--app-font-mono,"JetBrains Mono",SFMono-Regular,monospace);font-size:11.5px;text-transform:uppercase;letter-spacing:.06em;white-space:nowrap;transition:all .2s ease;color:var(--app-ink-soft,rgba(230,227,218,.62));}
    .phsuite .ph-tab.on{color:var(--app-accent,#00f3ff);border-bottom-color:var(--app-accent,#00f3ff);}

    /* ---- state switcher ---- */
    .phsuite .ph-switch{display:flex;gap:4px;padding:4px;background:var(--app-elevated,#2a2a2e);border:1px solid var(--app-rule,rgba(255,255,255,.07));border-radius:.7rem;align-self:flex-start;}
    .phsuite .ph-switch-btn{display:inline-flex;align-items:center;gap:6px;padding:5px 11px;border-radius:.5rem;cursor:pointer;font-family:var(--app-font-mono,"JetBrains Mono",SFMono-Regular,monospace);font-size:10.5px;text-transform:uppercase;letter-spacing:.05em;transition:all .2s ease;color:var(--app-ink-soft,rgba(230,227,218,.62));}
    .phsuite .ph-switch-btn.on{background:var(--app-surface,#1a1a1c);color:var(--app-ink,#e6e3da);}
    .phsuite .ph-switch-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0;}

    /* ---- needs strip ---- */
    .phsuite .needs-strip{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;}
    .phsuite .needs-card{display:flex;align-items:center;gap:14px;background:var(--app-surface,#1a1a1c);border:1px solid var(--app-rule,rgba(255,255,255,.07));border-radius:.75rem;padding:16px 18px;cursor:pointer;transition:border-color .2s ease;text-align:left;width:100%;}
    .phsuite .needs-card:hover{border-color:var(--app-ink-faint,rgba(230,227,218,.38));}
    .phsuite .needs-icon{width:38px;height:38px;border-radius:.6rem;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
    .phsuite .needs-num{font-weight:900;font-size:1.5rem;line-height:1;color:var(--app-ink,#e6e3da);}
    .phsuite .needs-label{font-size:.82rem;font-weight:600;color:var(--app-ink,#e6e3da);}
    .phsuite .needs-sub{font-size:.72rem;color:var(--app-ink-faint,rgba(230,227,218,.38));}
    .phsuite .needs-chev{margin-left:auto;color:var(--app-ink-faint,rgba(230,227,218,.38));flex-shrink:0;}

    /* ---- generic grid/panel ---- */
    .phsuite .grid-2{display:grid;grid-template-columns:1.5fr 1fr;gap:18px;align-items:start;}
    .phsuite .panel{background:var(--app-surface,#1a1a1c);border:1px solid var(--app-rule,rgba(255,255,255,.07));border-radius:.75rem;padding:20px;}
    .phsuite .panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;}
    .phsuite .panel-title{margin:0;font-weight:600;font-size:.95rem;color:var(--app-ink,#e6e3da);}
    .phsuite .panel-stack{display:flex;flex-direction:column;gap:14px;}

    /* ---- activity feed ---- */
    .phsuite .feed-row{display:flex;gap:12px;padding:11px 0;border-bottom:1px solid var(--app-rule-soft,rgba(255,255,255,.04));}
    .phsuite .feed-row:last-child{border-bottom:0;padding-bottom:0;}
    .phsuite .feed-glyph{width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
    .phsuite .feed-body{flex:1;min-width:0;}
    .phsuite .feed-top{display:flex;align-items:center;gap:8px;margin-bottom:2px;flex-wrap:wrap;}
    .phsuite .feed-actor{font-weight:600;font-size:.82rem;color:var(--app-ink,#e6e3da);}
    .phsuite .feed-at{font-size:.7rem;color:var(--app-ink-faint,rgba(230,227,218,.38));margin-left:auto;flex-shrink:0;}
    .phsuite .feed-text{font-size:.82rem;color:var(--app-ink-soft,rgba(230,227,218,.62));}
    .phsuite .feed-tag{font-size:.6rem;text-transform:uppercase;letter-spacing:.06em;padding:1px 6px;border-radius:var(--app-radius-pill,9999px);}
    .phsuite .feed-tag.k-agent{color:var(--app-accent,#00f3ff);background:${u(c.accent,12)};}
    .phsuite .feed-tag.k-human{color:var(--app-pending,#b06bff);background:${u(c.pending,12)};}
    .phsuite .feed-tag.k-system{color:var(--app-ink-faint,rgba(230,227,218,.38));background:var(--app-rule-soft,rgba(255,255,255,.04));}

    /* ---- quick-launch + account ---- */
    .phsuite .ql-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
    .phsuite .ql-tile{display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:.6rem;border:1px solid var(--app-rule,rgba(255,255,255,.07));background:var(--app-elevated,#2a2a2e);}
    .phsuite .ql-mark{width:26px;height:26px;border-radius:.45rem;display:flex;align-items:center;justify-content:center;color:var(--app-accent,#00f3ff);background:${u(c.accent,12)};}
    .phsuite .ql-name{font-size:.78rem;font-weight:600;}
    .phsuite .acct-row{display:flex;align-items:center;justify-content:space-between;padding:9px 0;border-bottom:1px solid var(--app-rule-soft,rgba(255,255,255,.04));}
    .phsuite .acct-row:last-of-type{border-bottom:0;}
    .phsuite .acct-label{font-size:.78rem;color:var(--app-ink-soft,rgba(230,227,218,.62));}
    .phsuite .progress-track{height:6px;border-radius:9999px;background:var(--app-rule-soft,rgba(255,255,255,.04));overflow:hidden;margin:8px 0 12px;}
    .phsuite .progress-fill{height:100%;border-radius:9999px;background:var(--app-accent,#00f3ff);}
    .phsuite .btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:9px 14px;border-radius:var(--app-radius-sm,6px);font-weight:600;font-size:.78rem;cursor:pointer;border:1px solid transparent;transition:all .15s ease;}
    .phsuite .btn-primary{background:var(--app-accent,#00f3ff);color:var(--app-accent-ink,#0e0e10);}
    .phsuite .btn-primary:hover{box-shadow:var(--app-shadow-glow,0 0 24px rgba(0,243,255,.18));}
    .phsuite .btn-ghost{background:transparent;color:var(--app-ink-soft,rgba(230,227,218,.62));border-color:var(--app-rule,rgba(255,255,255,.07));}
    .phsuite .btn-ghost:hover{background:var(--app-elevated,#2a2a2e);color:var(--app-ink,#e6e3da);}
    .phsuite .btn-block{width:100%;}

    /* ---- services ---- */
    .phsuite .svc-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;}
    .phsuite .svc-card{display:flex;flex-direction:column;gap:12px;background:var(--app-surface,#1a1a1c);border:1px solid var(--app-rule,rgba(255,255,255,.07));border-radius:.75rem;padding:18px;}
    .phsuite .svc-top{display:flex;align-items:flex-start;gap:12px;}
    .phsuite .svc-mark{width:34px;height:34px;border-radius:.6rem;display:flex;align-items:center;justify-content:center;color:var(--app-accent,#00f3ff);background:${u(c.accent,12)};flex-shrink:0;}
    .phsuite .svc-name{font-weight:600;font-size:.9rem;margin:0 0 2px;}
    .phsuite .svc-desc{font-size:.76rem;color:var(--app-ink-soft,rgba(230,227,218,.62));margin:0;}
    .phsuite .svc-bottom{display:flex;align-items:center;justify-content:space-between;margin-top:auto;}
    .phsuite .svc-status{display:flex;align-items:center;gap:6px;font-size:.72rem;color:var(--app-ink-faint,rgba(230,227,218,.38));}
    .phsuite .svc-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0;}
    .phsuite .toggle{position:relative;width:36px;height:20px;border-radius:9999px;background:var(--app-rule,rgba(255,255,255,.07));cursor:pointer;flex-shrink:0;transition:background .2s ease;}
    .phsuite .toggle.on{background:var(--app-accent,#00f3ff);}
    .phsuite .toggle-knob{position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:var(--app-ink,#e6e3da);transition:transform .2s ease;}
    .phsuite .toggle.on .toggle-knob{transform:translateX(16px);background:var(--app-accent-ink,#0e0e10);}

    /* ---- threads ---- */
    .phsuite .threads-wrap{display:flex;gap:0;border:1px solid var(--app-rule,rgba(255,255,255,.07));border-radius:.75rem;overflow:hidden;min-height:420px;}
    .phsuite .thread-list{width:280px;flex-shrink:0;border-right:1px solid var(--app-rule,rgba(255,255,255,.07));background:var(--app-surface,#1a1a1c);overflow:auto;}
    .phsuite .thread-item{display:flex;flex-direction:column;gap:4px;padding:13px 16px;border-bottom:1px solid var(--app-rule-soft,rgba(255,255,255,.04));cursor:pointer;width:100%;text-align:left;}
    .phsuite .thread-item.on{background:var(--app-elevated,#2a2a2e);}
    .phsuite .thread-item-top{display:flex;align-items:center;justify-content:space-between;gap:8px;}
    .phsuite .thread-name{font-weight:600;font-size:.82rem;}
    .phsuite .thread-at{font-size:.68rem;color:var(--app-ink-faint,rgba(230,227,218,.38));flex-shrink:0;}
    .phsuite .thread-preview{font-size:.75rem;color:var(--app-ink-soft,rgba(230,227,218,.62));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
    .phsuite .thread-unread{display:inline-flex;align-items:center;justify-content:center;min-width:16px;height:16px;padding:0 4px;border-radius:9999px;background:var(--app-accent,#00f3ff);color:var(--app-accent-ink,#0e0e10);font-size:.6rem;font-weight:700;}
    .phsuite .thread-view{flex:1;display:flex;flex-direction:column;min-width:0;background:var(--app-surface,#1a1a1c);}
    .phsuite .thread-view-head{padding:14px 18px;border-bottom:1px solid var(--app-rule,rgba(255,255,255,.07));font-weight:600;font-size:.88rem;}
    .phsuite .thread-msgs{flex:1;padding:18px;display:flex;flex-direction:column;gap:12px;overflow:auto;}
    .phsuite .msg{max-width:72%;padding:10px 13px;border-radius:.7rem;font-size:.82rem;line-height:1.4;}
    .phsuite .msg.from-agent{align-self:flex-start;background:var(--app-elevated,#2a2a2e);border:1px solid var(--app-rule,rgba(255,255,255,.07));}
    .phsuite .msg.from-you{align-self:flex-end;background:${u(c.accent,16)};border:1px solid ${u(c.accent,30,"var(--app-rule,rgba(255,255,255,.07))")};}
    .phsuite .msg-at{display:block;margin-top:4px;font-size:.65rem;color:var(--app-ink-faint,rgba(230,227,218,.38));}
    .phsuite .thread-compose{display:flex;gap:8px;padding:14px 18px;border-top:1px solid var(--app-rule,rgba(255,255,255,.07));}
    .phsuite .thread-input{flex:1;padding:9px 12px;border-radius:.55rem;border:1px solid var(--app-rule,rgba(255,255,255,.07));background:var(--app-elevated,#2a2a2e);color:var(--app-ink,#e6e3da);}
    .phsuite .thread-input::placeholder{color:var(--app-ink-faint,rgba(230,227,218,.38));}

    /* ---- tasks ---- */
    .phsuite .task-list{display:flex;flex-direction:column;}
    .phsuite .task-row{display:flex;align-items:center;gap:12px;padding:13px 0;border-bottom:1px solid var(--app-rule-soft,rgba(255,255,255,.04));}
    .phsuite .task-row:last-child{border-bottom:0;}
    .phsuite .checkbox{width:18px;height:18px;border-radius:.3rem;border:1px solid var(--app-rule,rgba(255,255,255,.07));display:flex;align-items:center;justify-content:center;flex-shrink:0;cursor:pointer;color:var(--app-accent-ink,#0e0e10);}
    .phsuite .checkbox.on{background:var(--app-accent,#00f3ff);border-color:var(--app-accent,#00f3ff);}
    .phsuite .task-body{flex:1;min-width:0;}
    .phsuite .task-title{font-size:.85rem;font-weight:600;}
    .phsuite .task-title.done{text-decoration:line-through;color:var(--app-ink-faint,rgba(230,227,218,.38));}
    .phsuite .task-meta{font-size:.72rem;color:var(--app-ink-faint,rgba(230,227,218,.38));}

    /* ---- onboarding ---- */
    .phsuite .onb-wrap{display:flex;flex-direction:column;gap:22px;max-width:640px;}
    .phsuite .onb-steps{display:flex;align-items:center;gap:8px;}
    .phsuite .onb-node{display:flex;align-items:center;gap:8px;flex:1;}
    .phsuite .onb-dot{width:26px;height:26px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:.7rem;font-weight:700;border:1px solid var(--app-rule,rgba(255,255,255,.07));color:var(--app-ink-faint,rgba(230,227,218,.38));flex-shrink:0;}
    .phsuite .onb-node.is-active .onb-dot{border-color:var(--app-accent,#00f3ff);color:var(--app-accent,#00f3ff);background:${u(c.accent,12)};}
    .phsuite .onb-node.is-done .onb-dot{background:var(--app-success,#00d4b8);border-color:var(--app-success,#00d4b8);color:var(--app-accent-ink,#0e0e10);}
    .phsuite .onb-node-label{font-size:.76rem;color:var(--app-ink-soft,rgba(230,227,218,.62));white-space:nowrap;}
    .phsuite .onb-node.is-active .onb-node-label{color:var(--app-ink,#e6e3da);font-weight:600;}
    .phsuite .onb-rule{flex:1;height:1px;background:var(--app-rule,rgba(255,255,255,.07));}
    .phsuite .onb-panel{background:var(--app-surface,#1a1a1c);border:1px solid var(--app-rule,rgba(255,255,255,.07));border-radius:.75rem;padding:22px;}
    .phsuite .onb-field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px;}
    .phsuite .onb-field label{font-size:.72rem;text-transform:uppercase;letter-spacing:.04em;color:var(--app-ink-faint,rgba(230,227,218,.38));}
    .phsuite .onb-input{padding:9px 12px;border-radius:.55rem;border:1px solid var(--app-rule,rgba(255,255,255,.07));background:var(--app-elevated,#2a2a2e);color:var(--app-ink,#e6e3da);}
    .phsuite .onb-pick{display:flex;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid var(--app-rule-soft,rgba(255,255,255,.04));}
    .phsuite .onb-pick:last-child{border-bottom:0;}
    .phsuite .onb-pick-mark{width:28px;height:28px;border-radius:.5rem;display:flex;align-items:center;justify-content:center;color:var(--app-accent,#00f3ff);background:${u(c.accent,12)};flex-shrink:0;}
    .phsuite .onb-pick-body{flex:1;}
    .phsuite .onb-pick-name{font-weight:600;font-size:.82rem;}
    .phsuite .onb-pick-desc{font-size:.72rem;color:var(--app-ink-faint,rgba(230,227,218,.38));}
    .phsuite .onb-term{background:var(--app-bg,#0e0e10);border:1px solid var(--app-rule,rgba(255,255,255,.07));border-radius:.6rem;padding:14px 16px;font-family:var(--app-font-mono,"JetBrains Mono",SFMono-Regular,monospace);font-size:.74rem;line-height:1.7;max-height:220px;overflow:auto;}
    .phsuite .onb-term-line{display:flex;gap:8px;}
    .phsuite .onb-term-tag{flex-shrink:0;width:34px;}
    .phsuite .onb-done{display:flex;flex-direction:column;align-items:center;text-align:center;gap:14px;padding:36px 20px;}
    .phsuite .onb-done-badge{width:56px;height:56px;border-radius:50%;background:${u(c.success,14)};color:var(--app-success,#00d4b8);display:flex;align-items:center;justify-content:center;}
    .phsuite .onb-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px;}

    /* ---- loading / empty / error shared states ---- */
    .phsuite .sk{position:relative;overflow:hidden;background:var(--app-elevated,#2a2a2e);border-radius:.5rem;}
    .phsuite .sk::after{content:"";position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(90deg,transparent,${u("var(--app-ink,#e6e3da)",8)},transparent);animation:ph-shimmer 1.4s infinite;}
    @keyframes ph-shimmer{100%{transform:translateX(100%);}}
    .phsuite .sk-card{height:74px;}
    .phsuite .sk-row{height:16px;margin-bottom:10px;}
    .phsuite .sk-panel{height:280px;}
    .phsuite .sk-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;}
    .phsuite .empty-state,.phsuite .error-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:10px;padding:52px 20px;color:var(--app-ink-soft,rgba(230,227,218,.62));}
    .phsuite .empty-orb,.phsuite .error-orb{width:52px;height:52px;border-radius:50%;display:flex;align-items:center;justify-content:center;margin-bottom:4px;}
    .phsuite .empty-orb{background:var(--app-rule-soft,rgba(255,255,255,.04));color:var(--app-ink-faint,rgba(230,227,218,.38));}
    .phsuite .error-orb{background:${u(c.fail,14)};color:var(--app-fail,#f43f6c);}
    .phsuite .empty-title,.phsuite .error-title{font-weight:600;color:var(--app-ink,#e6e3da);font-size:.95rem;}
    .phsuite .error-actions{display:flex;gap:10px;margin-top:8px;}

    /* ---- responsive: member dashboards vs the SAME /member API (canvas#288 M7) ----
       Personal Home home.css stacking breakpoints (1100/1000px) + the Canvas 2.0
       Adaptive Shell contract (<=960px: right-panel collapse + single-column
       detail-split). These keep #personal/home overflow-free down to a 375px
       mobile viewport (the mobile e2e asserts no horizontal scroll). */
    @media (max-width:1100px){
      .phsuite .needs-strip{grid-template-columns:repeat(2,1fr);}
      .phsuite .sk-grid{grid-template-columns:repeat(2,1fr);}
    }
    @media (max-width:1000px){
      .phsuite .grid-2{grid-template-columns:1fr;}
    }
    @media (max-width:960px){
      /* Adaptive Shell: collapse the two-pane detail-split into one column so the
         280px thread-list + conversation view never force a horizontal scroll. */
      .phsuite .threads-wrap{flex-direction:column;min-height:0;}
      .phsuite .thread-list{width:100%;border-right:0;border-bottom:1px solid var(--app-rule,rgba(255,255,255,.07));max-height:280px;}
      .phsuite .svc-grid{grid-template-columns:1fr;}
    }
    @media (max-width:860px){
      .phsuite .grid-2{grid-template-columns:1fr;}
      .phsuite .needs-strip{grid-template-columns:1fr;}
      .phsuite .svc-grid{grid-template-columns:1fr;}
      .phsuite .sk-grid{grid-template-columns:1fr;}
      .phsuite .ph-title{font-size:1.6rem;}
    }
    `,t=document.createElement("style");t.id=C,t.textContent=i,document.head.appendChild(t)}function G(i){return i==="check"?L("M9 12l2 2 4-4",18):i==="chat"?m(p.chat,18):i==="clock"?T("M12 7v5l3 2","M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18",18):m(p.check,18)}function M(i){Y();const[,t]=g(0);l.useEffect(()=>{function a(){t(o=>o+1)}return window.addEventListener("member-live-hydrated",a),()=>window.removeEventListener("member-live-hydrated",a)},[]);const[s,A]=g("home"),[h,j]=g("live"),[S,X]=g(_),[D,Q]=g("ops-agent"),[Z,I]=g(""),[ee,ae]=g(H),$=v.reduce((a,o)=>a+(S[o]?1:0),0),F=typeof window.__onboardingStep=="number"&&window.__onboardingStep<6;function te(a){X(o=>({...o,[a]:!o[a]}))}function re(a){ae(o=>({...o,[a]:!o[a]}))}function ie(a){A(a)}function ne(){return e("div",{className:"ph-tabs"},q.map(a=>e("button",{key:a.key,className:`ph-tab${s===a.key?" on":""}`,onClick:()=>A(a.key)},a.label)))}function se(){return e("div",{className:"ph-switch"},J.map(a=>e("button",{key:a.key,className:`ph-switch-btn${h===a.key?" on":""}`,onClick:()=>j(a.key)},e("span",{className:"ph-switch-dot",style:{background:a.dot}}),a.label)))}function d(a,o){return e("div",{className:"ph-greet"},e("div",null,e("div",{className:"ph-overline"},e("span",{className:"bar"}),"Personal workspace"),e("h1",{className:"ph-title"},a),o?e("p",{className:"ph-sub"},o):null),se())}function x(){return e("div",{className:"panel-stack"},e("div",{className:"sk-grid"},[0,1,2].map(a=>e("div",{key:a,className:"sk sk-card"}))),e("div",{className:"grid-2"},e("div",{className:"sk sk-panel"}),e("div",{className:"sk sk-panel"})))}function k(){return e("div",{className:"error-state"},e("div",{className:"error-orb"},T("M12 9v4M12 17h.01","M10.3 3.9 2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",26)),e("div",{className:"error-title"},"Couldn't reach the context engine"),e("div",null,"Retrying in the background usually resolves this within a minute."),e("div",{className:"error-actions"},e("button",{className:"btn btn-primary",onClick:()=>j("live")},"Retry"),e("button",{className:"btn btn-ghost"},"View status")))}function w(a,o,r){return e("div",{className:"empty-state"},e("div",{className:"empty-orb"},m(r||p.check,24)),e("div",{className:"empty-title"},a),e("div",null,o))}function oe(){if(h==="loading")return e(l.Fragment,null,d("Welcome back, Alex."),x());if(h==="error")return e(l.Fragment,null,d("Welcome back, Alex."),k());const a=h==="empty"?O:W,o=E("runs"),r=o?K(o):P;return e(l.Fragment,null,d("Welcome back, Alex.",e(l.Fragment,null,"Personal workspace \xB7 ",e("b",null,`${$} services`)," active \xB7 synced 06:12 \xB7 context online")),e("div",{className:"needs-strip"},a.map(n=>e("button",{key:n.label,className:"needs-card",onClick:()=>ie(n.target)},e("span",{className:"needs-icon",style:f(n.tone)},G(n.icon)),e("span",null,e("div",{className:"needs-num"},String(n.num)),e("div",{className:"needs-label"},n.label),e("div",{className:"needs-sub"},n.sub)),e("span",{className:"needs-chev"},m(p.arrow,16))))),e("div",{className:"grid-2"},e("div",{className:"panel"},e("div",{className:"panel-head"},e("h3",{className:"panel-title"},"Activity")),h==="empty"?w("Nothing to show yet","Activity from your agents will show up here.",p.cpu):r.map(n=>e("div",{key:n.actor+n.at,className:"feed-row"},e("span",{className:"feed-glyph",style:f(n.kind==="human"?"pending":"accent")},m(n.icon,15)),e("div",{className:"feed-body"},e("div",{className:"feed-top"},e("span",{className:"feed-actor"},n.actor),e("span",{className:`feed-tag k-${n.kind}`},n.kind),e("span",{className:"feed-at mono"},n.at)),e("div",{className:"feed-text"},n.text))))),e("div",{className:"panel-stack"},e("div",{className:"panel"},e("div",{className:"panel-head"},e("h3",{className:"panel-title"},"Quick launch")),e("div",{className:"ql-grid"},v.filter(n=>S[n]).map(n=>e("div",{key:n,className:"ql-tile"},e("span",{className:"ql-mark"},m(y[n].icon,14)),e("span",{className:"ql-name"},y[n].name))))),e("div",{className:"panel"},e("div",{className:"panel-head"},e("h3",{className:"panel-title"},"Account")),e("div",{className:"acct-row"},e("span",{className:"acct-label"},"Plan"),e("span",{className:"pill",style:f("accent")},"Pro")),e("div",{className:"acct-row"},e("span",{className:"acct-label"},"Context engine"),e("span",{className:"pill",style:f("success")},"Online")),F?e("div",{className:"acct-label",style:{marginTop:10}},"Onboarding \xB7 in progress"):null,F?e("button",{className:"btn btn-primary btn-block",onClick:()=>window.NAV.go("personal","onboarding")},"Finish setup"):null))))}function pe(){return h==="loading"?e(l.Fragment,null,d("Services"),x()):h==="error"?e(l.Fragment,null,d("Services"),k()):h==="empty"?e(l.Fragment,null,d("Services"),e("div",{className:"panel"},w("No services connected yet","Connect a service to start automating your workspace.",p.squares))):e(l.Fragment,null,d("Services",`${$} of ${v.length} services active`),e("div",{className:"svc-grid"},v.map(a=>{const o=y[a],r=!!S[a];return e("div",{key:a,className:"svc-card"},e("div",{className:"svc-top"},e("span",{className:"svc-mark"},m(o.icon,18)),e("span",{style:{flex:1}},e("p",{className:"svc-name"},o.name),e("p",{className:"svc-desc"},o.desc))),e("div",{className:"svc-bottom"},e("span",{className:"svc-status"},e("span",{className:"svc-dot",style:{background:r?c.success:"var(--app-ink-faint,rgba(230,227,218,.38))"}}),r?`Active \xB7 ${o.last}`:"Paused"),e("span",{className:`toggle${r?" on":""}`,onClick:()=>te(a)},e("span",{className:"toggle-knob"}))))})))}function le(){if(h==="loading")return e(l.Fragment,null,d("Threads"),x());if(h==="error")return e(l.Fragment,null,d("Threads"),k());if(h==="empty")return e(l.Fragment,null,d("Threads"),e("div",{className:"panel"},w("No conversations yet","Threads from agents and teammates will appear here.",p.chat)));const a=N.find(r=>r.id===D)||N[0],o=V[a.id]||[];return e(l.Fragment,null,d("Threads"),e("div",{className:"threads-wrap"},e("div",{className:"thread-list"},N.map(r=>e("button",{key:r.id,className:`thread-item${r.id===D?" on":""}`,onClick:()=>Q(r.id)},e("div",{className:"thread-item-top"},e("span",{className:"thread-name"},r.name),r.unread>0?e("span",{className:"thread-unread"},String(r.unread)):e("span",{className:"thread-at mono"},r.at)),e("div",{className:"thread-preview"},r.preview)))),e("div",{className:"thread-view"},e("div",{className:"thread-view-head"},a.name),e("div",{className:"thread-msgs"},o.map((r,n)=>e("div",{key:n,className:`msg from-${r.who==="you"?"you":"agent"}`},r.text,e("span",{className:"msg-at"},r.who==="you"?r.whoName:a.name," \xB7 ",r.at)))),e("div",{className:"thread-compose"},e("input",{className:"thread-input",placeholder:"Write a message\u2026",value:Z,onChange:r=>I(r.target.value)}),e("button",{className:"btn btn-primary",onClick:()=>I("")},m(p.send,14))))))}function ce(){if(h==="loading")return e(l.Fragment,null,d("Tasks"),x());if(h==="error")return e(l.Fragment,null,d("Tasks"),k());const a=E("projects"),o=a?U(a):i&&i.kind&&i.kind.mockItems&&i.kind.mockItems.length?i.kind.mockItems:B;return h==="empty"?e(l.Fragment,null,d("Tasks"),e("div",{className:"panel"},w("Nothing on your plate","You're all caught up \u2014 new tasks will land here.",p.check))):e(l.Fragment,null,d("Tasks"),e("div",{className:"panel"},e("div",{className:"task-list"},o.map(r=>{const n=!!ee[r.id];return e("div",{key:r.id,className:"task-row"},e("span",{className:`checkbox${n?" on":""}`,onClick:()=>re(r.id)},n?m(p.check,12):null),e("span",{className:"task-body"},e("div",{className:`task-title${n?" done":""}`},r.title),e("div",{className:"task-meta"},`${r.from} \xB7 ${r.meta}`)),e("span",{className:"pill",style:f(r.pill)},r.pillLabel))}))))}let b;return s==="services"?b=pe():s==="threads"?b=le():s==="tasks"?b=ce():b=oe(),e("div",{className:"phsuite","data-live-source":R()},ne(),b)}window.PERSONAL_HOME_SUITE_VIEW_FN=M,window.VIEWS=window.VIEWS||{},window.VIEWS.personalHomeSuite=M,M.displayName="PersonalHomeSuiteView"})();
