create-pmos 0.388.0 → 0.389.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/package.json +13 -13
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-insights-test.js +16 -21
  7. package/workspace/changelog.json +12 -0
  8. package/workspace/guide/briefing-premium.md +19 -9
  9. package/workspace/lib/briefing-premium-agent.js +3 -0
  10. package/workspace/lib/report-chat.js +37 -0
  11. package/workspace/package-lock.json +2 -2
  12. package/workspace/package.json +1 -1
  13. package/workspace/premium-chat-chart-tab-test.js +150 -0
  14. package/workspace/premium-chat-report-tab-test.js +127 -0
  15. package/workspace/public/pm/goal-chat.js +2 -1
  16. package/workspace/public/pm/premium-chart-draw.js +58 -0
  17. package/workspace/public/pm/premium-chart-tab.js +157 -0
  18. package/workspace/public/pm/premium-chat.js +8 -2
  19. package/workspace/public/pm/premium-insights.js +17 -79
  20. package/workspace/public/pm/premium-report-tab.js +233 -0
  21. package/workspace/public/pm/premium-shell.js +35 -3
  22. package/workspace/public/pm/premium-vw-report.css +60 -0
  23. package/workspace/public/pm/premium.css +1 -120
  24. package/workspace/public/pm/report-chat.js +89 -0
  25. package/workspace/test-lists/premium-chat-chart-tab.json +12 -0
  26. package/workspace/test-lists/premium-chat-report-tab.json +12 -0
  27. package/workspace/premium-studio-chart-test.js +0 -193
  28. package/workspace/premium-studio-report-test.js +0 -277
  29. package/workspace/premium-studio-test.js +0 -185
  30. package/workspace/public/pm/premium-studio-design.js +0 -298
  31. package/workspace/public/pm/premium-studio-report.js +0 -291
  32. package/workspace/public/pm/premium-studio.js +0 -453
  33. package/workspace/test-lists/premium-studio-chart.json +0 -13
  34. package/workspace/test-lists/premium-studio-report.json +0 -9
  35. package/workspace/test-lists/premium-studio.json +0 -9
@@ -0,0 +1,233 @@
1
+ /* pm/premium-report-tab.js — the Report tab beside a chat (initiative premium-reports-from-chat, slice B; PRD R1–R4). It replaces the Insight Studio's
2
+ * Report mode: the PM asks in the chat, Claude ends its answer with a `pmos-report` block (public/pm/report-chat.js), and this tab shows it.
3
+ *
4
+ * A NEW REPORT (block.proposal): its name, what it answers, audience, format, the seven sections every new report has, and the Schedule chip.
5
+ * Set it up posts POST /api/report-setups/setup. A report with Schedule Off (none said) is then paused at once with POST /api/report-setups/edit,
6
+ * so it runs once (PM, 2026-10-21).
7
+ * A SET-UP REPORT (block.id): the Schedule chip (POST .../edit), Structure | Design with their versions, the cycles (drafts and issued reports) and
8
+ * Delete template (POST .../remove). A change Claude proposes in words (block.structure, block.design, block.schedule) shows as one press.
9
+ * Structure: GET /api/report-structure; turn, accept (Use this) and revert (Undo). Design: GET /api/report-design and its version renders;
10
+ * turn, accept (This is it) and revert. A draft is discarded (POST /api/report-documents/discard); an issued report is kept for good and can
11
+ * only be archived (POST /api/report-documents/archive).
12
+ *
13
+ * Every write is a press here, behind the launch nonce (http.js pmPost). Claude writes nothing: the routes refuse an agent session. A render is
14
+ * HTML the server sanitized, shown in a frame with an empty sandbox, so nothing in it runs. Nothing is sent outward. */
15
+ import { pmGet, pmPost } from './http.js';
16
+ import { vwOpen, vwStyle, vwConfirm } from './premium-viewer.js';
17
+
18
+ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
19
+ const OUT = { 'google-slides': 'Google Slides', 'google-doc': 'Google Doc', 'google-sheets': 'Google Sheets', confluence: 'Confluence page', pdf: 'PDF' };
20
+ const FRAME = [['Headline', 'The one thing the readers must know this cycle.'], ['Timeline', 'The dated items, written in full.'], ['Initiatives', 'Done, in progress, next and the key open item.'],
21
+ ['New since last report', 'What is new in the window, each with its date.'], ['Decided this cycle', 'The decisions, marked Decided or Acknowledged.'], ['Needs your call', 'The asks to the readers: what, who, by when.'], ['Sources', 'The sources reached and not reached.']];
22
+ const DAYN = { Mon: 'Mondays', Tue: 'Tuesdays', Wed: 'Wednesdays', Thu: 'Thursdays', Fri: 'Fridays', Sat: 'Saturdays', Sun: 'Sundays' };
23
+ const POLL_MS = 1200, POLL_MAX = 240000;
24
+ const ws = () => new URLSearchParams(location.search).get('ws') || '';
25
+ const qs = (o) => Object.entries(o).filter(([, v]) => v != null && v !== '').map(([k, v]) => k + '=' + encodeURIComponent(v)).join('&');
26
+ const post = (p, body) => pmPost(p, Object.assign(ws() ? { ws: ws() } : {}, body)).catch(() => null);
27
+ const get = (p, o) => pmGet(p + '?' + qs(Object.assign({ ws: ws() }, o))).catch(() => null);
28
+
29
+ /** The schedule in words: 'off' or null is Off. */
30
+ export function schedWords(s) {
31
+ if (!s || s === 'off') return 'Off · runs once';
32
+ const t = s.time || '09:00';
33
+ if (s.cadence === 'daily') return 'Daily at ' + t;
34
+ if (s.cadence === 'monthly') return 'Monthly on day ' + (s.dayOfMonth || 1) + ' at ' + t;
35
+ return (s.cadence === 'weekly' ? 'Weekly, ' : 'Every two weeks, ') + (DAYN[s.day] || 'Mondays') + ' at ' + t;
36
+ }
37
+ const sameSched = (a, b) => schedWords(a) === schedWords(b);
38
+ /** The choices of the Schedule chip, the current day kept for weekly ones. */
39
+ export function schedChoices(cur) {
40
+ const day = cur && cur !== 'off' && cur.day ? cur.day : 'Mon';
41
+ return ['off', { cadence: 'daily', time: '09:00' }, { cadence: 'weekly', day, time: '09:00' }, { cadence: 'bi-weekly', day, time: '09:00' }, { cadence: 'monthly', dayOfMonth: 1, time: '09:00' }];
42
+ }
43
+
44
+ const T = new Map(); // tab id → its state
45
+ /** Open (or refresh) the Report tab for a checked block (report-chat.js cleanBlock). */
46
+ export function openReportTab(block) {
47
+ if (!block) return null;
48
+ vwStyle('report');
49
+ const id = 'report:' + (block.id || block.proposal.name).toLowerCase().replace(/[^a-z0-9]+/g, '-').slice(0, 60);
50
+ let t = T.get(id);
51
+ if (!t || JSON.stringify(t.block) !== JSON.stringify(block)) {
52
+ t = { id, block, sched: block.proposal ? (block.proposal.schedule || 'off') : null, open: false, view: 'structure', busy: false, msg: '', setup: null, docs: [], S: null, Z: null, sv: null, dv: null, render: new Map(), gone: false, loaded: false };
53
+ T.set(id, t);
54
+ if (block.id) load(t);
55
+ }
56
+ return vwOpen({ id, title: 'Report', icon: 'doc', render: (el) => draw(t, el), wire: (el) => { el.onclick = (e) => press(t, e); } });
57
+ }
58
+ const paneOf = (t) => document.querySelector(`#dOut .obody.vw[data-vw="${CSS.escape(t.id)}"]`);
59
+ const redraw = (t) => { const el = paneOf(t); if (el) draw(t, el); };
60
+
61
+ async function load(t) {
62
+ const rid = t.block.id;
63
+ const [L, D, S] = await Promise.all([get('/api/report-setups'), get('/api/report-documents'), get('/api/report-structure', { id: rid })]);
64
+ t.setup = L && Array.isArray(L.setups) ? L.setups.find((s) => s.id === rid) || null : null;
65
+ t.gone = !!L && !t.setup;
66
+ t.docs = D && Array.isArray(D.docs) ? D.docs.filter((d) => d.id.startsWith(rid + '/')).sort((a, b) => (a.slot < b.slot ? 1 : -1)) : [];
67
+ if (S && S.ok) { t.S = S.structure; if (t.sv == null) t.sv = t.S.current; }
68
+ t.loaded = true;
69
+ if (t.view === 'design') await loadDesign(t);
70
+ redraw(t);
71
+ if (t.S && t.S.running) poll(t, 'structure');
72
+ }
73
+ async function loadDesign(t) {
74
+ const r = await get('/api/report-design', { id: t.block.id });
75
+ if (!r || !r.ok) { t.Z = { err: (r && r.error) || 'The design of this report could not be read.' }; return; }
76
+ t.Z = r.design;
77
+ if (t.dv == null) t.dv = t.Z.current != null ? t.Z.current : (t.Z.saved ? t.Z.saved.version : null);
78
+ await renderOf(t, t.dv);
79
+ if (t.Z.running) poll(t, 'design');
80
+ }
81
+ async function renderOf(t, n) {
82
+ if (n == null || t.render.has(n)) return;
83
+ try { const r = await fetch('/api/report-design/version?' + qs({ ws: ws(), id: t.block.id, n }), { credentials: 'same-origin' }); if (r.ok) t.render.set(n, await r.text()); } catch { /* shown as unread */ }
84
+ }
85
+ /* One structure or design job runs at a time; wait for it, then show its newest version. */
86
+ async function poll(t, kind) {
87
+ const end = Date.now() + POLL_MAX;
88
+ while (Date.now() < end && paneOf(t)) {
89
+ await new Promise((ok) => setTimeout(ok, POLL_MS));
90
+ if (kind === 'structure') {
91
+ const S = await get('/api/report-structure', { id: t.block.id });
92
+ if (S && S.ok && !S.structure.running) { t.S = S.structure; t.sv = t.S.current; t.busy = false; t.msg = lastSaid(t.S.log); redraw(t); return; }
93
+ } else {
94
+ const r = await get('/api/report-design', { id: t.block.id });
95
+ if (r && r.ok && !r.design.running) { t.Z = r.design; t.dv = t.Z.current; await renderOf(t, t.dv); t.busy = false; t.msg = lastSaid(t.Z.log); redraw(t); return; }
96
+ }
97
+ }
98
+ t.busy = false; t.msg = 'PMOS has not answered yet. The new version shows when you open this report again.'; redraw(t);
99
+ }
100
+ const lastSaid = (log) => { const l = (log || []).filter((x) => x.who === 'pmos').pop(); return l ? l.text : ''; };
101
+
102
+ /* ── drawing ── */
103
+ const btn = (a, label, o = {}) => `<button type="button" class="btn${o.sec ? ' sec' : ''}${o.cls ? ' ' + o.cls : ''}" data-rt="${esc(a)}"${o.off ? ' disabled' : ''}${o.pressed != null ? ` aria-pressed="${o.pressed}"` : ''}>${esc(label)}</button>`;
104
+ function schedHtml(t, cur) {
105
+ const chip = `<button type="button" class="rt-chip" data-rt="sched" aria-expanded="${t.open}"><em>Schedule</em><b>${esc(schedWords(cur))}</b></button>`;
106
+ if (!t.open) return chip;
107
+ const opts = schedChoices(cur).map((s, i) => `<button type="button" role="menuitemradio" aria-checked="${sameSched(s, cur)}" data-rt="pick|${i}">${esc(schedWords(s))}</button>`).join('');
108
+ const days = cur && cur !== 'off' && (cur.cadence === 'weekly' || cur.cadence === 'bi-weekly')
109
+ ? `<div class="rt-days" role="group" aria-label="Day">${Object.keys(DAYN).slice(0, 5).map((d) => btn('day|' + d, d, { sec: cur.day !== d, pressed: cur.day === d })).join('')}</div>` : '';
110
+ return chip + `<div class="rt-menu" role="menu" aria-label="Schedule">${opts}${days}<p class="rt-note">Or say it in the chat: “make it every two weeks”.</p></div>`;
111
+ }
112
+ const sectionsHtml = (L) => `<ol class="rt-secs">${L.map(([h, d]) => `<li><b>${esc(h)}</b>${d ? `<span>${esc(d)}</span>` : ''}</li>`).join('')}</ol>`;
113
+
114
+ function draw(t, el) {
115
+ const ask = el.querySelector(':scope > .vcf'); // an open confirm card outlives a redraw (a poll or a load), so its answer still lands
116
+ el.innerHTML = `<div class="rt">${t.block.proposal ? newHtml(t) : setupHtml(t)}${t.msg ? `<p class="rt-msg" role="status">${esc(t.msg)}</p>` : ''}</div>`;
117
+ if (ask) el.prepend(ask);
118
+ el.querySelectorAll('iframe[data-rt-frame]').forEach((f) => { f.srcdoc = t.render.get(+f.dataset.rtFrame) || ''; });
119
+ }
120
+ function newHtml(t) {
121
+ const p = t.block.proposal;
122
+ return `<p class="rt-eye">New report · from this chat</p><h3 class="rt-h">${esc(p.name)}</h3>${p.purpose ? `<p class="rt-sub">${esc(p.purpose)}</p>` : ''}`
123
+ + `<p class="rt-meta">For ${esc(p.audience)} · ${esc(OUT[p.output] || p.output)}</p><div class="rt-row">${schedHtml(t, t.sched)}</div>`
124
+ + `<p class="rt-label">Sections</p>${sectionsHtml(FRAME)}<p class="rt-note">Every new report has these sections. Once it is set up, ask in the chat to shape them.</p>`
125
+ + `<div class="rt-foot">${btn('setup', t.busy ? 'Setting it up' : 'Set it up', { off: t.busy })}</div>`;
126
+ }
127
+ function setupHtml(t) {
128
+ const s = t.setup;
129
+ if (!t.loaded) return '<p class="rt-note" role="status">Reading the report.</p>';
130
+ if (t.gone) return `<p class="rt-eye">Report</p><h3 class="rt-h">${esc(t.block.id)}</h3><p class="rt-note">This template is deleted, or it is not set up in this workspace. Its issued reports are kept.</p>${cyclesHtml(t)}`;
131
+ const cur = s.status === 'paused' ? 'off' : s.schedule;
132
+ const want = t.block.schedule && !sameSched(t.block.schedule, cur) ? `<div class="rt-ask"><p>Claude proposes: <b>${esc(schedWords(t.block.schedule))}</b></p>${btn('sched-use', 'Change the schedule', { off: t.busy })}</div>` : '';
133
+ return `<p class="rt-eye">Report template</p><h3 class="rt-h">${esc(s.name)}</h3><p class="rt-meta">For ${esc(s.audience || 'no one named')} · ${esc(OUT[s.output] || s.output)}${s.next_draft ? ' · next draft ' + esc(s.next_draft.slice(0, 10)) : ''}</p>`
134
+ + `<div class="rt-row">${schedHtml(t, cur)}</div>${want}`
135
+ + `<div class="rt-seg" role="group" aria-label="Step">${btn('view|structure', 'Structure', { sec: t.view !== 'structure', pressed: t.view === 'structure' })}${btn('view|design', 'Design', { sec: t.view !== 'design', pressed: t.view === 'design' })}</div>`
136
+ + (t.view === 'design' ? designHtml(t) : structureHtml(t)) + cyclesHtml(t)
137
+ + `<div class="rt-foot rt-end">${btn('remove', 'Delete template', { sec: true, cls: 'rt-del', off: t.busy })}</div>`;
138
+ }
139
+ function stepper(kind, n, list, saved) {
140
+ if (n == null || !list.length) return '';
141
+ const i = list.findIndex((v) => v.n === n);
142
+ return `<div class="rt-ver"><button type="button" class="rt-arrow" data-rt="${kind}|${list[i - 1] ? list[i - 1].n : n}" aria-label="Earlier version"${i <= 0 ? ' disabled' : ''}>‹</button>`
143
+ + `<span>${kind === 'sv' ? 'S' : 'D'}${n}${n === saved ? ' · saved' : ' · not saved'}</span><button type="button" class="rt-arrow" data-rt="${kind}|${list[i + 1] ? list[i + 1].n : n}" aria-label="Later version"${i >= list.length - 1 ? ' disabled' : ''}>›</button></div>`;
144
+ }
145
+ function structureHtml(t) {
146
+ const S = t.S, V = (S && S.versions) || [];
147
+ const plan = S && S.plan, shown = t.sv;
148
+ const L = plan && plan.outline ? plan.outline.map((x) => [x.title, x.notes || '']) : FRAME;
149
+ const ask = t.block.structure && !(S && S.running) ? `<div class="rt-ask"><p>Your change: <b>“${esc(t.block.structure)}”</b></p>${btn('s-turn', 'Make the next version', { off: t.busy })}</div>` : '';
150
+ const working = S && S.running ? '<p class="rt-note" role="status">PMOS is making the next version.</p>' : '';
151
+ const save = shown != null && S && shown !== S.saved ? btn('s-accept', 'Use this', { off: t.busy }) : '';
152
+ const undo = V.some((v) => v.n < (S ? S.current : 0)) ? btn('s-undo', 'Undo', { sec: true, off: t.busy }) : '';
153
+ return `${stepper('sv', shown, V, S && S.saved)}${ask}${working}${sectionsHtml(L)}${!V.length ? '<p class="rt-note">No structure version yet: each cycle uses these sections. Say in the chat how to shape them.</p>' : ''}${save || undo ? `<div class="rt-foot">${undo}${save}</div>` : ''}`;
154
+ }
155
+ function designHtml(t) {
156
+ const Z = t.Z;
157
+ if (!Z) return '<p class="rt-note" role="status">Reading the design.</p>';
158
+ if (Z.err) return `<p class="rt-note">${esc(Z.err)}</p>`;
159
+ const V = Z.versions || [], saved = Z.saved ? Z.saved.version : null;
160
+ const ask = t.block.design && !Z.running ? `<div class="rt-ask"><p>Your change: <b>“${esc(t.block.design)}”</b></p>${btn('d-turn', 'Make the next version', { off: t.busy })}</div>` : '';
161
+ const working = Z.running ? '<p class="rt-note" role="status">PMOS is making the next version.</p>' : '';
162
+ const frame = t.dv != null ? (t.render.has(t.dv) ? `<iframe class="rt-frame" sandbox="" title="Design version D${t.dv}" data-rt-frame="${t.dv}"></iframe>` : '<p class="rt-note">This version could not be read.</p>')
163
+ : '<p class="rt-note">No design version yet. Say in the chat how it should look, or attach a sample. Each cycle uses the standard look until then.</p>';
164
+ const save = t.dv != null && t.dv !== saved ? btn('d-accept', 'This is it', { off: t.busy }) : '';
165
+ const undo = V.some((v) => v.n < (Z.current || 0)) ? btn('d-undo', 'Undo', { sec: true, off: t.busy }) : '';
166
+ return `${stepper('dv', t.dv, V, saved)}${ask}${working}${frame}${save || undo ? `<div class="rt-foot">${undo}${save}</div>` : ''}`;
167
+ }
168
+ function cyclesHtml(t) {
169
+ if (!t.docs.length) return '';
170
+ const row = (d) => `<li><span class="rt-tag ${d.state}">${d.state === 'issued' ? 'Issued' : 'Draft'}</span><span class="rt-slot">${esc(d.slot)}${d.archived ? ' · archived' : ''}</span>`
171
+ + (d.state === 'issued' ? btn((d.archived ? 'unarchive|' : 'archive|') + d.path, d.archived ? 'Bring back' : 'Archive', { sec: true, off: t.busy }) : btn('discard|' + d.path, 'Discard', { sec: true, off: t.busy })) + '</li>';
172
+ return `<p class="rt-label">Reports</p><ul class="rt-cyc">${t.docs.map(row).join('')}</ul><p class="rt-note">An issued report is kept for good. A draft can be discarded until it is issued.</p>`;
173
+ }
174
+
175
+ /* ── pressing ── */
176
+ async function act(t, fn) { t.busy = true; t.msg = ''; redraw(t); const m = await fn(); t.busy = false; if (m != null) t.msg = m; redraw(t); }
177
+ const why = (r, d) => (r && r.error) || d;
178
+ async function setSchedule(t, s) {
179
+ if (t.block.proposal) { t.sched = s; t.open = false; redraw(t); return; }
180
+ t.open = false;
181
+ await act(t, async () => {
182
+ const r = await post('/api/report-setups/edit', { id: t.block.id, schedule: s === 'off' ? { cadence: 'off' } : s });
183
+ if (!r || !r.ok) return 'The schedule did not change: ' + why(r, 'the page could not reach PMOS') + '.';
184
+ t.setup = r.setup; return 'Schedule: ' + schedWords(r.setup.status === 'paused' ? 'off' : r.setup.schedule) + '.';
185
+ });
186
+ }
187
+ async function press(t, e) {
188
+ const b = e.target.closest('[data-rt]'); if (!b || b.disabled) return;
189
+ const [a, v] = [b.dataset.rt.split('|')[0], b.dataset.rt.slice(b.dataset.rt.indexOf('|') + 1)];
190
+ const cur = t.block.proposal ? t.sched : t.setup && (t.setup.status === 'paused' ? 'off' : t.setup.schedule);
191
+ if (a === 'sched') { t.open = !t.open; redraw(t); return; }
192
+ if (a === 'pick') { await setSchedule(t, schedChoices(cur)[+v]); return; }
193
+ if (a === 'day') { await setSchedule(t, Object.assign({}, cur, { day: v })); return; }
194
+ if (a === 'sched-use') { await setSchedule(t, t.block.schedule); return; }
195
+ if (a === 'view') { t.view = v; redraw(t); if (v === 'design' && !t.Z) { await loadDesign(t); redraw(t); } return; }
196
+ if (a === 'sv') { t.sv = +v; redraw(t); return; }
197
+ if (a === 'dv') { t.dv = +v; await renderOf(t, t.dv); redraw(t); return; }
198
+ if (a === 'setup') { await setUp(t); return; }
199
+ const id = t.block.id;
200
+ if (a === 's-turn') { t.busy = true; t.msg = ''; redraw(t); const r = await post('/api/report-structure/turn', { id, text: t.block.structure }); if (!r || !r.ok) { t.busy = false; t.msg = 'That did not start: ' + why(r, 'no answer') + '.'; redraw(t); return; } t.S = Object.assign({}, t.S, { running: true }); t.block = Object.assign({}, t.block, { structure: undefined }); redraw(t); poll(t, 'structure'); return; }
201
+ if (a === 'd-turn') { t.busy = true; t.msg = ''; redraw(t); const r = await post('/api/report-design/turn', { id, text: t.block.design, points: [] }); if (!r || !r.ok) { t.busy = false; t.msg = 'That did not start: ' + why(r, 'no answer') + '.'; redraw(t); return; } t.Z = Object.assign({}, t.Z, { running: true }); t.block = Object.assign({}, t.block, { design: undefined }); redraw(t); poll(t, 'design'); return; }
202
+ if (a === 's-accept') { await act(t, async () => { const r = await post('/api/report-structure/accept', { id, n: t.sv }); if (!r || !r.ok) return why(r, 'The structure was not saved.'); t.S = r.structure; return 'S' + t.sv + ' is saved. The next cycle follows it.'; }); return; }
203
+ if (a === 's-undo') { const V = t.S.versions.filter((x) => x.n < t.S.current); const to = V[V.length - 1].n; await act(t, async () => { const r = await post('/api/report-structure/revert', { id, n: to }); if (!r || !r.ok) return why(r, 'Undo did not go through.'); t.S = r.structure; t.sv = t.S.current; return 'Back to S' + to + '.'; }); return; }
204
+ if (a === 'd-accept') { await act(t, async () => { const r = await post('/api/report-design/accept', { id, n: t.dv }); if (!r || !r.ok) return why(r, 'The design was not saved.'); t.Z = r.design; return 'D' + t.dv + ' is the saved design. The next cycle follows it.'; }); return; }
205
+ if (a === 'd-undo') { const V = t.Z.versions.filter((x) => x.n < t.Z.current); const to = V[V.length - 1].n; await act(t, async () => { const r = await post('/api/report-design/revert', { id, n: to }); if (!r || !r.ok) return why(r, 'Undo did not go through.'); t.Z = r.design; t.dv = t.Z.current; await renderOf(t, t.dv); return 'Back to D' + to + '.'; }); return; }
206
+ if (a === 'discard' || a === 'archive' || a === 'unarchive') {
207
+ if (a === 'discard' && !(await vwConfirm(paneOf(t), { text: 'Discard this draft? It is deleted. Issued reports are not touched.', yes: 'Discard', no: 'Keep it' }))) return;
208
+ await act(t, async () => {
209
+ const r = await post('/api/report-documents/' + (a === 'discard' ? 'discard' : 'archive'), a === 'discard' ? { path: v } : { path: v, archived: a === 'archive' });
210
+ if (!r || !r.ok) return why(r, 'That did not go through.');
211
+ await load(t); return a === 'discard' ? 'The draft is discarded.' : a === 'archive' ? 'Archived. It is kept, and hidden from the list.' : 'It is back in the list.';
212
+ });
213
+ return;
214
+ }
215
+ if (a === 'remove') {
216
+ if (!(await vwConfirm(paneOf(t), { text: 'Delete this template? Its schedule stops now. Its issued reports and its open draft stay.', yes: 'Delete template', no: 'Keep it' }))) return;
217
+ await act(t, async () => { const r = await post('/api/report-setups/remove', { id }); if (!r || !r.ok) return why(r, 'The template was not deleted.'); await load(t); return 'Template deleted. Its schedule stopped; its reports are kept.'; });
218
+ }
219
+ }
220
+ async function setUp(t) {
221
+ const p = t.block.proposal;
222
+ const schedule = t.sched === 'off' ? { cadence: 'weekly', day: 'Mon', time: '09:00' } : t.sched;
223
+ await act(t, async () => {
224
+ const r = await post('/api/report-setups/setup', { proposal: { name: p.name, purpose: p.purpose || p.name, audience: p.audience, source: 'work', output: p.output, schedule,
225
+ sources: p.sources.length ? p.sources : ['The records of this workspace'], learned_from: 'Set up from a chat.' } });
226
+ if (!r || !r.ok) return 'It was not set up: ' + why(r, 'the page could not reach PMOS') + '.';
227
+ if (t.sched === 'off') await post('/api/report-setups/edit', { id: r.setup.id, schedule: { cadence: 'off' } });
228
+ // the tab now shows the set-up report
229
+ t.block = { kind: 'report', id: r.setup.id }; t.loaded = false; await load(t);
230
+ const d = r.drafted || {};
231
+ return 'Set up. ' + (d.path ? 'The first draft is written.' : 'The first draft was not written' + (d.error ? ': ' + d.error : '') + '.') + (t.sched === 'off' ? ' Schedule is Off, so it runs once.' : '');
232
+ });
233
+ }
@@ -9,6 +9,11 @@ import { chipActs, openLive, openFocus, mountRecord, HL_LINE } from './premium-v
9
9
  import { lineItems, behindOf, whenRead } from './freshness-words.js';
10
10
  import { splitGoal, shownUser, goalBlockHtml, goalProgressHtml, goalChipHtml, goalViewHtml, goalNow, slashMatches } from './goal-chat.js';
11
11
  import { mdHtml, userHtml, toolLine, webKind } from './chat-md.js';
12
+ import { splitReport, reportChipHtml, blockSig } from './report-chat.js';
13
+ import { openReportTab } from './premium-report-tab.js';
14
+ import { openChartTab } from './premium-chart-tab.js';
15
+ /** A pmos-report block opens the Report tab, or the Chart tab for a chart or a dashboard (premium-reports-from-chat, slice C). */
16
+ export const openBlockTab = (b) => (b && b.kind === 'report' ? openReportTab(b) : openChartTab(b));
12
17
  import { mountNotes, openNotes, flushNotes, syncNotes } from './premium-notes.js';
13
18
  import { attachMarkup, attachRowMarkup, mountAttach, attachNames, clearAttach, syncAttach, dropFiles, splitFiles, filesHtml, openAttachment } from './premium-attach.js';
14
19
  import { railModel, railHtml, teaser, menuCount, loudestRow, factsOf, titleOf, endAsks, DOT, WORD } from './session-rail.js';
@@ -428,9 +433,9 @@ export function sessionHtml(c, goal = null) {
428
433
  const out = msgs.map((m, i) => {
429
434
  if (m.role === 'user') return turnUser(shownUser(m.text));
430
435
  if (m.role !== 'assistant') return `<p class="toolline" title="${esc((m.calls || []).map((x) => x.tool + (x.target ? ' ' + x.target : '')).join('\n'))}">${esc(toolLine(m.tools))}</p>`;
431
- const g = splitGoal(m.text);
436
+ const g = splitGoal(m.text), rp = splitReport(g.text); // premium-reports-from-chat: a pmos-report block becomes a chip that opens the Report tab
432
437
  const live = i === last && waiting && !!goal && goal.state === 'grilling';
433
- return turnAgent(`<p class="agtag">Claude</p>${g.text ? mdHtml(g.text) : ''}${goalBlockHtml(g.block, { live, state: goal && goal.state })}${chipsHtml(ctx.get(i))}`);
438
+ return turnAgent(`<p class="agtag">Claude</p>${rp.text ? mdHtml(rp.text) : ''}${goalBlockHtml(g.block, { live, state: goal && goal.state })}${reportChipHtml(rp.block, i)}${chipsHtml(ctx.get(i))}`);
434
439
  });
435
440
  if (goalProgressHtml(goal)) out.push(goalChipHtml(goal)); // the goal itself is in the viewer's Goal tab (goalView below)
436
441
  // item-chat-history: an ended session keeps its conversation on the item; the next message picks it up
@@ -478,6 +483,7 @@ export function drawThread(th, key, conv) {
478
483
  ctxAuto(key, conv);
479
484
  S.goal = th.goal || null; S.draft = readyDraft(conv); S.session = th.session || null;
480
485
  goalView(key, conv);
486
+ reportAuto(key, conv);
481
487
  const go = $('#askGo'); if (go) go.disabled = !!th.working; // an earlier read-only run still answering
482
488
  const n = $('#askNote'); if (n) n.textContent = th.working ? 'The agent is answering. You can write again when it has.' : conv && conv.ask ? 'Claude is waiting for your answer above.' : CHAT_NOTE;
483
489
  if (atEnd) b.scrollTop = b.scrollHeight;
@@ -518,7 +524,7 @@ function ctxPeek(it) {
518
524
  const f = $('#askF'); if (!f) return;
519
525
  if (!b) { f.insertAdjacentHTML('beforebegin', '<button type="button" class="ctxpeek" id="ctxPeek" hidden></button>'); b = $('#ctxPeek'); }
520
526
  b.innerHTML = `<span>${esc(it.sub)} · <b>${esc(it.title)}</b></span><em>View</em>`; b.hidden = false;
521
- b.onclick = () => { ctxPeek(null); if (it.kind === 'goal') openGoal(); else openCtx(it, ctxWhere()); };
527
+ b.onclick = () => { ctxPeek(null); if (it.kind === 'goal') openGoal(); else if (it.kind === 'report') openBlockTab(it.block); else openCtx(it, ctxWhere()); };
522
528
  CTX.peekTimer = setTimeout(() => ctxPeek(null), 15000);
523
529
  }
524
530
  $('#dBody').addEventListener('click', (e) => {
@@ -552,6 +558,32 @@ $('#dBody').addEventListener('click', (e) => {
552
558
  e.preventDefault(); openGoal();
553
559
  if (innerWidth < 1000 && !chatPage()) setTab('out');
554
560
  });
561
+ /* premium-reports-from-chat (R1): the newest pmos-report block in a finished answer opens the Report tab by itself, once, on a desktop, and is
562
+ * offered in the bar over the box on a phone. A block that was already there when the chat opened opens nothing; its chip opens it. */
563
+ const RV = { key: null, sig: null };
564
+ function newestReport(conv) {
565
+ const ms = (conv && conv.messages) || [];
566
+ for (let i = ms.length - 1; i >= 0; i--) { if (ms[i].role !== 'assistant') continue; const b = splitReport(splitGoal(ms[i].text).text).block; if (b) return b; }
567
+ return null;
568
+ }
569
+ function reportAuto(key, conv) {
570
+ const busy = !conv || conv.ask || conv.turn === 'agent' || conv.turn === 'tool';
571
+ if (busy && RV.key === key) return;
572
+ const b = newestReport(conv), sig = blockSig(b);
573
+ const first = RV.key !== key; RV.key = key;
574
+ const was = RV.sig; RV.sig = sig;
575
+ if (first || !b || sig === was) return;
576
+ const P = b.proposal, name = P ? (b.kind === 'chart' ? P.title || P.measure : P.name) : b.id;
577
+ if (desk()) openBlockTab(b); else ctxPeek({ kind: 'report', block: b, title: name, sub: b.kind === 'report' ? 'Report' : b.kind === 'chart' ? 'Chart' : 'Dashboard' });
578
+ }
579
+ $('#dBody').addEventListener('click', (e) => {
580
+ const c = e.target.closest('[data-report-open]'); if (!c) return;
581
+ e.preventDefault();
582
+ const m = ((S.conv && S.conv.messages) || [])[+c.dataset.reportOpen];
583
+ const b = m ? splitReport(splitGoal(m.text).text).block : null;
584
+ if (b) openBlockTab(b);
585
+ if (innerWidth < 1000 && !chatPage()) setTab('out');
586
+ });
555
587
  /** The draft of the newest ready goal block in the conversation, which Start sends as the confirmed goal. */
556
588
  function readyDraft(conv) {
557
589
  const ms = (conv && conv.messages) || [];
@@ -0,0 +1,60 @@
1
+ @font-face{font-family:"Space Grotesk";src:url(/vendor/space-grotesk-var.woff2) format("woff2");font-weight:300 700;font-display:swap}
2
+ @font-face{font-family:"IBM Plex Mono";src:url(/vendor/ibm-plex-mono-400.woff2) format("woff2");font-weight:400;font-display:swap}
3
+ @font-face{font-family:"IBM Plex Mono";src:url(/vendor/ibm-plex-mono-500.woff2) format("woff2");font-weight:500;font-display:swap}
4
+ @font-face{font-family:"IBM Plex Mono";src:url(/vendor/ibm-plex-mono-700.woff2) format("woff2");font-weight:600 700;font-display:swap}
5
+ :root{--fs-1:11px;--fs-2:12px;--fs-3:14px;--fs-4:16px;--fs-5:20px;--fs-6:28px}
6
+ /* pm/premium-vw-report.css — the Report tab beside a chat (initiative premium-reports-from-chat, slice B; premium-report-tab.js).
7
+ * Loaded once by vwStyle('report'). Sizes are only var(--fs-1..6), weights 400/500/600 (premium-console-type.test.js). */
8
+ .rt{max-width:760px;margin:0 auto;padding:4px 2px 24px;display:flex;flex-direction:column;align-items:stretch;gap:12px;text-align:left}
9
+ .rt>*{align-self:stretch}
10
+ .rt .btn,.obody:has(>.rt)>.vcf .btn{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:0 16px;border:1px solid var(--solid);border-radius:6px;background:var(--solid);color:var(--on-solid);font-size:var(--fs-2);font-weight:600;white-space:nowrap}
11
+ .rt .btn.sec,.obody:has(>.rt)>.vcf .btn.sec{background:transparent;border-color:var(--hair);color:var(--ink)}
12
+ .rt .btn:disabled{opacity:.5;cursor:default}
13
+ .rt-eye{margin:0;font:500 var(--fs-1) var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3)}
14
+ .rt-h{margin:0;font-size:var(--fs-5);font-weight:600;color:var(--ink);overflow-wrap:anywhere}
15
+ .rt-sub{margin:0;font-size:var(--fs-3);color:var(--ink-2)}
16
+ .rt-meta,.rt-note{margin:0;font-size:var(--fs-2);color:var(--ink-3)}
17
+ .rt-label{margin:6px 0 0;font-size:var(--fs-2);font-weight:600;color:var(--ink-2)}
18
+ .rt-msg{margin:0;padding:10px 12px;border-radius:8px;background:var(--well);font-size:var(--fs-3);color:var(--ink)}
19
+ .rt-row{display:flex;flex-direction:column;gap:8px;align-items:flex-start}
20
+ .rt-chip{align-self:flex-start;display:inline-flex;flex-direction:column;align-items:flex-start;gap:1px;min-height:44px;padding:6px 14px;border:1px solid var(--hair);border-radius:6px;background:var(--card-solid,var(--card));color:var(--ink);text-align:left;cursor:pointer}
21
+ .rt-chip em{font-style:normal;font-size:var(--fs-1);color:var(--ink-3)}
22
+ .rt-chip b{font-size:var(--fs-3);font-weight:600}
23
+ .rt-menu{display:flex;flex-direction:column;gap:2px;width:100%;max-width:360px;padding:6px;border:1px solid var(--hair);border-radius:8px;background:var(--card-solid,var(--card));box-shadow:var(--card-shadow)}
24
+ .rt-menu>button{min-height:44px;padding:0 12px;border-radius:6px;text-align:left;font-size:var(--fs-3);color:var(--ink);background:none}
25
+ .rt-menu>button[aria-checked="true"]{background:var(--well);font-weight:600}
26
+ @media (hover:hover){.rt-menu>button:hover{background:var(--well)}}
27
+ .rt-menu .rt-note{padding:6px 12px}
28
+ .rt-days{display:flex;flex-wrap:wrap;gap:6px;padding:6px 6px 2px}
29
+ .rt-days .btn{min-height:44px;min-width:52px;padding:0 10px}
30
+ .rt-ask{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border-radius:8px;background:var(--well)}
31
+ .rt-ask p{margin:0;font-size:var(--fs-3);color:var(--ink-2);flex:1 1 200px;min-width:0;overflow-wrap:anywhere}
32
+ .rt-ask b{color:var(--ink);font-weight:600}
33
+ .rt .rt-seg{display:inline-flex;gap:4px;padding:3px;border-radius:6px;background:var(--well);align-self:flex-start}
34
+ .rt-seg .btn.sec{border-color:transparent}
35
+ .rt-seg .btn{min-height:40px;border-radius:6px}
36
+ .rt-ver{display:flex;align-items:center;gap:6px;font:500 var(--fs-2) var(--mono);color:var(--ink-2)}
37
+ .rt-arrow{width:44px;height:44px;border:1px solid var(--hair);border-radius:6px;background:var(--card-solid,var(--card));color:var(--ink);font-size:var(--fs-4);cursor:pointer}
38
+ .rt-arrow:disabled{opacity:.4;cursor:default}
39
+ .rt-secs{margin:0;padding:0;list-style:none;border:1px solid var(--hair);border-radius:8px;background:var(--card-solid,var(--card))}
40
+ .rt-secs li{display:flex;flex-direction:column;gap:2px;padding:10px 14px;border-top:1px solid var(--hair)}
41
+ .rt-secs li:first-child{border-top:0}
42
+ .rt-secs b{font-size:var(--fs-3);font-weight:600;color:var(--ink)}
43
+ .rt-secs span{font-size:var(--fs-2);color:var(--ink-3)}
44
+ .rt-frame{width:100%;aspect-ratio:16/10;border:1px solid var(--hair);border-radius:8px;background:var(--card-solid,var(--card))}
45
+ .rt-cyc{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:6px}
46
+ .rt-cyc li{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-height:44px;padding:4px 4px 4px 10px;border:1px solid var(--hair);border-radius:8px}
47
+ .rt-slot{flex:1;min-width:0;font-size:var(--fs-3);color:var(--ink)}
48
+ .rt-tag{padding:2px 8px;border-radius:6px;font:500 var(--fs-1) var(--mono);text-transform:uppercase}
49
+ .rt-tag.draft{background:var(--well);color:var(--ink-2)}
50
+ .rt-tag.issued{background:color-mix(in srgb,var(--good) 16%,transparent);color:var(--ink)}
51
+ .rt-foot{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
52
+ .rt-foot .btn{min-height:44px}
53
+ .rt-end{margin-top:6px;padding-top:12px;border-top:1px solid var(--hair)}
54
+ .rt-del{color:var(--bad)}
55
+ .rt button:focus-visible{outline:2px solid var(--ember);outline-offset:2px}
56
+ /* the Chart tab (premium-chart-tab.js, slice C): a chart at a readable size, a dashboard's charts side by side where they fit */
57
+ .rt .ct-tile{max-width:460px}
58
+ .rt .ct-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;margin:0}
59
+ .rt .ct-grid .nempty{align-self:start;padding:12px 14px;border-radius:8px;background:var(--well)}
60
+ .rt .ct-grid .nempty p{margin:0;font-size:var(--fs-2);color:var(--ink-2)}
@@ -915,90 +915,7 @@ button.pst{border:0;font:inherit;color:inherit;text-align:left;cursor:pointer}bu
915
915
  .addf .cact{display:flex;flex-wrap:wrap;gap:10px}.addf .note[role="status"]{margin:0;min-height:1.2em}
916
916
  @media (max-width:760px){.inirw>.ini2{padding-right:48px}.baiact .dmcta,.lifeb .dmcta,.baa .dmcta{height:44px}.baa .baact .dmcta{flex:1;justify-content:center}.bapl button{min-height:44px}}
917
917
 
918
- /* ── Insight Studio (initiative premium-studio-dashboard): the mockup's Dashboard mode; brief, tray, library, preview, checks and footer ── */
919
- #dlg.stud .p-out .obody{padding-bottom:0}
920
- .stu{display:grid;gap:12px;min-width:0}
921
- .stt{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}
922
- #dlg.stud #askF,#dlg.stud #askNote{display:none}
923
- .stx{display:flex;align-items:center;gap:12px}
924
- .stx .lk,.stlh .lk,.stdone{min-height:44px;padding:0 10px;font-size:var(--fs-2)}
925
- .stsug{margin:0;font-size:var(--fs-3);color:var(--ink-2);line-height:1.5;padding:0 2px}
926
- .stbr{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
927
- .suc{display:grid;gap:2px;align-content:center;min-height:52px;padding:8px 12px;border-radius:14px;background:var(--well);box-shadow:inset 0 0 0 1px var(--hair);max-width:100%;text-align:left;transition:background .2s}
928
- .suc em{font-style:normal;font-size:var(--fs-1);font-weight:600;color:var(--ink-3);white-space:nowrap}
929
- .suc b{font-size:var(--fs-3);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
930
- .suc.on{background:var(--solid);color:var(--on-solid)}
931
- .suc.on em{color:color-mix(in oklab,var(--on-solid) 70%,transparent)}
932
- .suc.req{box-shadow:inset 0 0 0 1.5px color-mix(in oklab,var(--ember) 60%,transparent)}
933
- .sup{padding:14px;border-radius:18px;background:var(--well);display:grid;gap:10px}
934
- .stdone{justify-self:end}
935
- .sol{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:8px}
936
- .sto{display:grid;gap:2px;text-align:left;padding:10px 12px;border-radius:14px;background:var(--card-solid);box-shadow:inset 0 0 0 1px var(--hair);align-content:start;min-height:44px}
937
- .sto b{font-size:var(--fs-3)}
938
- .sto small{font-size:var(--fs-2);color:var(--ink-3);line-height:1.35}
939
- .sto[aria-pressed="true"]{box-shadow:inset 0 0 0 2px var(--ink)}
940
- .sti{width:100%;height:44px;border-radius:12px;border:1px solid var(--hair);background:var(--card-solid);padding:0 12px;font:inherit;font-size:var(--fs-3);color:var(--ink)}
941
- .sti:focus{outline:2px solid var(--ember);outline-offset:1px}
942
- .sul{list-style:none;margin:0;padding:0;display:grid;gap:6px}
943
- .sul li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;border-radius:12px;background:var(--card-solid)}
944
- .sul small{display:block;color:var(--ink-3);font-size:var(--fs-2)}
945
- .stlc{display:flex;gap:4px;flex:none}
946
- .stlc button{min-width:44px;height:44px;border-radius:10px;background:var(--well);display:grid;place-items:center;padding:0 10px}
947
- .stlc svg{width:15px;height:15px}
948
- .stlc button:disabled{opacity:.35}
949
- .stlib{padding:14px;border-radius:18px;background:var(--well)}
950
- .stlh{display:flex;align-items:center;gap:10px}
951
- .stlh small{color:var(--ink-3);margin-right:auto}
952
- .stlib .label{margin:10px 0 0}
953
- .stlg{display:grid;gap:6px;margin-top:6px}
954
- .stli{display:grid;grid-template-columns:96px minmax(0,1fr) auto;gap:12px;align-items:center;text-align:left;padding:8px 12px;border-radius:12px;background:var(--card-solid);min-height:44px}
955
- .stli .spk{width:96px;height:30px}
956
- .stli .spk path{fill:none;stroke:var(--ink-2);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
957
- .stli b{font-size:var(--fs-3)}
958
- .stli small{display:block;color:var(--ink-3);font-size:var(--fs-2)}
959
- .stli em{font-style:normal;font-size:var(--fs-2);font-weight:600;color:var(--ink-2)}
960
- .stli:disabled{opacity:.5}
961
- .stlic{display:grid;place-items:center;width:96px}
962
- .stlic svg{width:22px;height:22px;color:var(--ink-3)}
963
- .stpvw{padding:16px;border-radius:18px;background:var(--card-solid);box-shadow:inset 0 0 0 1px var(--hair);min-width:0}
964
- .stpvw .ndt{margin:0;font-size:var(--fs-4);font-weight:600;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
965
- .stpvw .npin2{font-size:var(--fs-1);font-weight:600;padding:3px 9px;border-radius:999px;background:var(--well);color:var(--ink-2)}
966
- .stpvw .stuse{margin:4px 0 10px;font-size:var(--fs-3)}
967
- .stgone{margin:4px 0 0}
968
- .suck{border-radius:16px;background:var(--well);overflow:hidden}
969
- .suckb{display:flex;align-items:center;gap:10px;width:100%;min-height:48px;padding:10px 14px;text-align:left}
970
- .suckb svg{width:18px;height:18px;flex:none}
971
- .suckb b{font-size:var(--fs-3);white-space:nowrap}
972
- .suckb span{font-size:var(--fs-2);color:var(--ink-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}
973
- .suckb svg:last-child{margin-left:auto;transition:transform .2s}
974
- .suckb[aria-expanded="true"] svg:last-child{transform:rotate(180deg)}
975
- .suck.bad .suckb>svg:first-child{color:var(--ember-ink)}
976
- .stbar{margin:0 14px 12px;width:auto}
977
- .stbar b{width:0}.stbar[data-n="1"] b{width:16.67%}.stbar[data-n="2"] b{width:33.33%}.stbar[data-n="3"] b{width:50.0%}.stbar[data-n="4"] b{width:66.67%}.stbar[data-n="5"] b{width:83.33%}.stbar[data-n="6"] b{width:100.0%}
978
- .sucl{list-style:none;margin:0;padding:0 14px 12px;display:grid;gap:8px}
979
- .sucl li{display:grid;grid-template-columns:18px minmax(0,1fr) auto;gap:10px;align-items:center}
980
- .sucl li svg{width:16px;height:16px}
981
- .sucl li.bad svg{color:var(--ember-ink)}
982
- .sucl b{font-size:var(--fs-2);display:block}
983
- .sucl small{font-size:var(--fs-2);color:var(--ink-3)}
984
- .stmsg{min-height:1.2em;margin:0;color:var(--ember-ink)}
985
- .stft{display:flex;gap:8px;align-items:center;flex-wrap:wrap;position:sticky;bottom:0;padding:10px 0 12px;background:linear-gradient(to top,var(--card-solid) 70%,transparent)}
986
- .stft .sp{flex:1}
987
- .stft .dmcta{height:44px}
988
- @media (max-width:700px){.sol{grid-template-columns:minmax(0,1fr)}.stli{grid-template-columns:72px minmax(0,1fr)}.stli .spk,.stlic{width:72px}.stli em{grid-column:2}.stt{gap:8px}.sucl li{grid-template-columns:18px minmax(0,1fr)}.sucl li .dmcta{grid-column:2;justify-self:start}}
989
- /* ── Insight Studio, Chart mode (initiative premium-studio-chart): the mode switch, More, and the four chart forms the page and the Studio share ── */
990
- .stt{justify-content:space-between}
991
- .stmd{display:inline-flex;gap:4px;padding:4px;border-radius:999px;background:var(--well)}
992
- .stmd button{min-height:44px;padding:0 16px;border-radius:999px;font-size:var(--fs-3);font-weight:600;color:var(--ink-2)}
993
- .stmd button[aria-pressed="true"]{background:var(--card-solid);color:var(--ink);box-shadow:0 1px 2px color-mix(in oklab,var(--ink) 18%,transparent)}
994
- .stmd button:focus-visible{outline:2px solid var(--ember);outline-offset:1px}
995
- .suc.stmore{background:transparent;box-shadow:inset 0 0 0 1px var(--hair);border-style:dashed}
996
- .sor{display:flex;gap:8px;flex-wrap:wrap}.sor .dmcta{height:44px}
997
- .stbar[data-t="5"][data-n="1"] b{width:20%}.stbar[data-t="5"][data-n="2"] b{width:40%}.stbar[data-t="5"][data-n="3"] b{width:60%}.stbar[data-t="5"][data-n="4"] b{width:80%}.stbar[data-t="5"][data-n="5"] b{width:100%}
998
- .stu{grid-template-columns:minmax(0,1fr)}
999
- .stpvw>.mt1{grid-template-columns:minmax(0,1fr)}
1000
- .stvt{margin-top:8px;font-size:var(--fs-2)}.stvt summary{cursor:pointer;color:var(--ink-2);min-height:44px;display:flex;align-items:center}
1001
- .stsrc{margin:8px 0 0;font-size:var(--fs-2);color:var(--ink-3)}
918
+ /* ── a chart in its four forms (initiative premium-studio-chart C3): the Insights page and the Chart tab beside a chat share them (premium-chart-draw.js) ── */
1002
919
  .mfm .mval{font-size:var(--fs-5)}
1003
920
  .mfm .mhero{font-size:var(--fs-6);line-height:1;letter-spacing:-.03em}
1004
921
  .mfm .nspk{width:100%;height:auto;display:block;margin-top:8px;overflow:visible}
@@ -1017,13 +934,6 @@ button.pst{border:0;font:inherit;color:inherit;text-align:left;cursor:pointer}bu
1017
934
  .mnote{margin:6px 0 0 4px;font-size:var(--fs-2);color:var(--ink-2)}
1018
935
  .mt1 .mwhy{font-size:var(--fs-2);color:var(--ink-3);margin-top:4px}
1019
936
  .ntf .lk+.lk{margin-left:4px}
1020
- /* ── Insight Studio, Report mode (initiative premium-studio-report): the report's sections in the preview ── */
1021
- .stsec{padding:10px 0;border-top:1px solid var(--hair)}
1022
- .stsec:first-of-type{margin-top:12px}
1023
- .stsec h4{margin:0;font-size:var(--fs-3);font-weight:600;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
1024
- .stsec .mut{margin:3px 0 0;font-size:var(--fs-2);line-height:1.4}
1025
- .stlc small{font-size:var(--fs-2);color:var(--ink-3);white-space:nowrap;align-self:center}
1026
- .stlc button{font-size:var(--fs-2);font-weight:600}
1027
937
  /* ── a report read on the page (initiative premium-report-read): the deck, the page, the menus, the design row and Present. From the mockup's report sheet ── */
1028
938
  #dlg.rdrd:not(.rdiss) #askF,#dlg.rdrd:not(.rdiss) #askNote{display:none}
1029
939
  .rdr{display:grid;gap:12px;min-width:0}
@@ -1892,13 +1802,6 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
1892
1802
  .phstats b{font-size:var(--t-lead,20px);font-weight:600;color:var(--ink)}
1893
1803
  .phstats span{font-size:var(--t-small);color:var(--ink-3)}
1894
1804
  }
1895
- .stsub{grid-column:1/-1;flex:0 0 100%;justify-self:start;margin-bottom:4px}
1896
- .dzbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin-bottom:10px}
1897
- .dzth{align-items:flex-start}
1898
- .dzth button{position:relative;flex:0 0 132px;padding:6px}
1899
- .dzth .rdfc{border-radius:10px}
1900
- .dzth i{position:absolute;right:10px;bottom:8px;font:600 var(--fs-1) var(--mono);font-style:normal;color:var(--ink-3)}
1901
- .stlk{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.stlk .sti{flex:1 1 200px}
1902
1805
  /* initiative page: Tasks paging and the about-popup of a document with no file */
1903
1806
  .tkpg{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:12px}.tkpg>span{display:flex;align-items:center;gap:10px}.tkpg small{color:var(--ink-2)}
1904
1807
  .tkpg .dmcta:disabled{opacity:.45;cursor:default}
@@ -2053,30 +1956,8 @@ button.wl-row[aria-pressed="true"] .wl-tog{background:var(--solid);color:var(--o
2053
1956
  .lgdf{margin-top:6px;white-space:pre-wrap;overflow-wrap:anywhere}.lgdf del{color:var(--bad);text-decoration:line-through}
2054
1957
  .evl .hsr .lk{grid-column:2;justify-self:start;min-height:44px;display:inline-flex;align-items:center}.evl .hsr .dsdf{grid-column:2}
2055
1958
 
2056
- /* The Studio's size (Normal, Half, 3/4, Whole). Whole is .full. Half is the Studio's two parts as tabs, as on a narrow window. Not shown on a phone. */
2057
- .stsz{display:none;gap:2px}
2058
1959
  @media (min-width:1000px){.stsz{display:inline-flex}}
2059
- .stsz .lk[aria-pressed="true"]{background:var(--well);border-radius:999px;font-weight:600;color:var(--ink)}
2060
- @media (min-width:1000px){
2061
- .dlg.stud.sz-half:not(.full){width:50vw;min-width:560px;height:min(90vh,860px)}
2062
- .dlg.stud.sz-three-quarters:not(.full){width:75vw;height:min(90vh,860px)}
2063
- .dlg.stud.sz-half[data-mode="split"] #dTabs{display:flex}
2064
- .dlg.stud.sz-half[data-mode="split"] .dgrid{grid-template-columns:minmax(0,1fr)}
2065
- .dlg.stud.sz-half[data-mode="split"] .dgrid[data-tab="chat"] .p-out,.dlg.stud.sz-half[data-mode="split"] .dgrid[data-tab="out"] .p-work{display:none}
2066
- }
2067
- .dzact{display:inline-flex;gap:8px;flex-wrap:wrap;margin-left:auto}
2068
- .dzact .dmcta[aria-pressed="true"]{background:var(--solid);color:var(--on-solid)}
2069
- .dzbig{position:relative;cursor:crosshair}
2070
- .dzpin{position:absolute;left:var(--rp-pinx,0);top:var(--rp-piny,0);transform:translate(-50%,-50%);min-width:24px;height:24px;padding:0 6px;border-radius:999px;background:var(--ember);color:var(--on-solid);font:600 var(--fs-2) var(--mono);display:grid;place-items:center;box-shadow:0 1px 4px color-mix(in oklab,var(--ink) 30%,transparent);pointer-events:none}
2071
- .dzsay{margin-top:12px;padding:12px;border-radius:14px;background:var(--well)}
2072
- .dzsh{display:flex;align-items:center;justify-content:space-between;gap:8px}
2073
- .dzon{display:inline-flex;align-items:center;gap:6px;min-height:44px;font-size:var(--fs-2)}
2074
- .dzsay .sul li{display:flex;align-items:center;gap:8px}
2075
- .dzsay .sul .sti{flex:1 1 auto;min-width:0}
2076
- .dzpn{flex:0 0 auto;min-width:24px;height:24px;border-radius:999px;background:var(--ember);color:var(--on-solid);font:600 var(--fs-2) var(--mono);display:grid;place-items:center}
2077
- .dzcg{display:grid;grid-template-columns:1fr 1fr;gap:12px}
2078
1960
  @media (max-width:700px){.dzcg{grid-template-columns:1fr}}
2079
- .dzch{margin-bottom:6px}
2080
1961
  /* board Metrics card: the lead line's inline "open Insights" link, as the mockup draws it */
2081
1962
  .mhint .lk{display:inline;font-size:var(--fs-2);font-weight:600;color:var(--ink);text-decoration:underline;text-underline-offset:2px;padding:0}
2082
1963
  .mhint .lk:hover{color:var(--ember-ink)}