create-pmos 0.617.0 → 0.618.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 +20 -14
  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-initiative-test.js +2 -1
  7. package/workspace/changelog.json +19 -0
  8. package/workspace/guide/layout.md +9 -4
  9. package/workspace/lib/board-premium.js +1 -0
  10. package/workspace/lib/board-trail.js +3 -1
  11. package/workspace/lib/core-docs.js +1 -1
  12. package/workspace/lib/engine/boards.js +2 -2
  13. package/workspace/lib/okr-goals.js +2 -1
  14. package/workspace/lib/routes-boards.js +20 -4
  15. package/workspace/lib/status-when.js +15 -2
  16. package/workspace/package-lock.json +2 -2
  17. package/workspace/package.json +1 -1
  18. package/workspace/premium-board-actions-test.js +1 -0
  19. package/workspace/public/pm/bd-work.css +5 -4
  20. package/workspace/public/pm/cozy-day-pick.css +9 -8
  21. package/workspace/public/pm/cozy-home.css +54 -2
  22. package/workspace/public/pm/cozy-pop-work.css +29 -0
  23. package/workspace/public/pm/cozy-pop-work.js +151 -13
  24. package/workspace/public/pm/cozy-popup.css +6 -1
  25. package/workspace/public/pm/cozy-popup.js +26 -7
  26. package/workspace/public/pm/cozy-status-when.js +17 -2
  27. package/workspace/public/pm/cozy-task-pop.css +34 -0
  28. package/workspace/public/pm/cozy-task-pop.js +199 -0
  29. package/workspace/public/pm/home-app.js +7 -1
  30. package/workspace/public/pm/home-chat.js +13 -7
  31. package/workspace/public/pm/home-data.js +31 -1
  32. package/workspace/public/pm/home-ini.js +7 -1
  33. package/workspace/public/pm/page-chat.js +1 -1
  34. package/workspace/public/pm/premium-board.js +18 -4
  35. package/workspace/test-lists/chat-turns.json +9 -0
@@ -25,6 +25,7 @@ import * as ED from './ini-edit.js';
25
25
  import * as SW from './cozy-status-when.js'; // When did this happen? after a status pick (round 3 point 18)
26
26
  import * as DP from './cozy-day-pick.js'; // the app's own day field, "15 Oct 2026"
27
27
  const { localToday } = DP;
28
+ import { rowBar } from './bd-span.js'; // the stages row: the Board's own bar (round 3 point 22)
28
29
  import * as AK from './artefact-kind.js'; // the Kind of a file and one row per kind (round 3 point 16), shared with the Library // the rename and its Undo, the same write as the old List (batch 18 item 16)
29
30
 
30
31
  const CSS = new URL('./cozy-pop-work.css', import.meta.url).href;
@@ -111,6 +112,28 @@ function productName(p, ws) {
111
112
  return n && !M.idShaped(n) ? n : '';
112
113
  }
113
114
 
115
+ /* the initiative's tasks as one list (round 3 point 22): the Backlog's own list and grouping (pm/bd-backlog.js listHtml / bindList), read from
116
+ * GET /api/backlog once per product. Until that module is on the page, or while the route answers nothing, the stages keep their tasks as before. */
117
+ let BK = null, bkRedraw = null;
118
+ import('./bd-backlog.js').then((m) => { BK = m && typeof m.listHtml === 'function' && typeof m.bindList === 'function' ? m : false; if (BK && bkRedraw) bkRedraw(); }).catch(() => { BK = false; });
119
+ const BKT = new Map(); // ws|board → tasks | null while reading | false when the route is not there
120
+ function bkTasks(ws, board) {
121
+ if (!BK || !board) return false;
122
+ const k = (ws || '') + '|' + board;
123
+ if (!BKT.has(k)) {
124
+ BKT.set(k, null);
125
+ pmGet('/api/backlog?ws=' + encodeURIComponent(ws || '') + '&board=' + encodeURIComponent(board))
126
+ .then((x) => {
127
+ if (x && x.ok && Array.isArray(x.tasks)) { BKT.set(k, x.tasks); if (bkRedraw) bkRedraw(); }
128
+ else if (x && x.pending) { BKT.delete(k); setTimeout(() => { if (bkRedraw) bkRedraw(); }, 1500); }
129
+ else BKT.set(k, false);
130
+ }).catch(() => BKT.set(k, false));
131
+ }
132
+ return BKT.get(k);
133
+ }
134
+ const bkReread = (ws, board) => { BKT.delete((ws || '') + '|' + (board || '')); };
135
+ const BKFOLD = new Map(); // initiative id → { fold, more } as the PM left the list
136
+
114
137
  /* ── the parts ── */
115
138
  /* the Overview explains the initiative (round 3 point 10): Problem, Goal, Done when from its own records, one status line, PMOS suggests, then
116
139
  * Details › for the grid. A line with no source says so in grey with a ✦ offer; nothing is invented. */
@@ -205,7 +228,44 @@ function rowHtml(x, W, C, sugRows) {
205
228
  return `<div class="pw-tr pw-kr${x.done ? ' done' : ''}${x.lit ? ' lit' : ''}" role="row" data-pw-row="${esc(x.uid)}" data-pw-sec="${esc(x.sec)}"><span class="pw-it"><i class="pw-bul${x.ms ? ' ms' : ''}" aria-hidden="true"></i>${title}${ib(`data-pw-open="${esc(x.uid)}"`, 'Open the task', P.open, 'xs hov')}${ib(`data-pw-row-more="${esc(x.uid)}" aria-haspopup="menu"`, 'More for ' + x.title, P.more, 'xs hov')}</span>${stc}${dtc}${tl}</div>`
206
229
  + (s ? `<div class="pw-tr pw-sugrow" role="row"><span class="pw-it">${sugLine(s, true)}</span></div>` : '');
207
230
  }
208
- function breakdownHtml(W, C, mode, full, S) {
231
+ /* Work breakdown, round 3 point 22 (Wawan: "Stage not apply to task, it only apply to initiative"): the stages are ONE row of the initiative's
232
+ * own steps with the Board's own bar on the timeline; press a stage for its card (its dates, and the move, which asks when it happened). The
233
+ * tasks are ONE list under it: the Backlog's columns and groups, this initiative's tasks only. A task's old stage stays in its record; it is
234
+ * only not shown. "Open in Backlog" opens Work › Backlog. */
235
+ const stagesOf = (W) => W.rows.filter((x) => x.kind === 'stage' && x.key !== '');
236
+ function stagesRowHtml(W, C, r) {
237
+ const st = stagesOf(W);
238
+ const chips = st.map((x) => `<button type="button" class="pw-sc${x.tone === 'now' ? ' now' : ''}${x.tone === 'dn' ? ' dn' : ''}${x.late ? ' late' : ''}" data-pw-stage="${esc(x.key)}" aria-haspopup="dialog" aria-label="${esc(x.name + (x.tone === 'now' ? ', the stage now' : x.tone === 'dn' ? ', done' : '') + (x.late ? ', late' : '') + '. Open its card')}"><span class="pw-n">${x.tone === 'dn' ? SVG(P.check, 11, 2.4) : esc(x.n)}</span>${esc(x.name)}</button>`).join('');
239
+ let bar = '';
240
+ if (C.tl) {
241
+ const a = Date.parse(W.span.a), b = Date.parse(W.span.b), X = (d) => ((+new Date(d) - a) / Math.max(864e5, b - a)) * 100;
242
+ try { bar = rowBar(r, X, new Date(), { mode: 'all', label: false, pxPct: 4 }); } catch { bar = ''; }
243
+ if (!bar) bar = st.map((x) => barHtml(x, W)).join('');
244
+ bar = `<div class="pw-tl">${bar}${W.tx != null ? `<i class="pw-now" style="left:${W.tx.toFixed(2)}%"></i>` : ''}</div>`;
245
+ }
246
+ return `<div class="pw-tr pw-stgs" role="row"><span class="pw-it"><span class="pw-scs" role="group" aria-label="Stages">${chips}</span></span>${C.status ? '<span></span>' : ''}${C.date ? '<span></span>' : ''}${bar}</div>`;
247
+ }
248
+ function oneListHtml(W, C, mode, full, S, o, r) {
249
+ const tasks = bkTasks(o.ws, o.board);
250
+ const L = Array.isArray(tasks) ? BK.listHtml(tasks, { ini: o.id, cols: ['jira', 'epic', 'who', 'due', 'state'], ...(BKFOLD.get(o.id) || {}) }) : '';
251
+ const spanB = C.tl ? `<button type="button" class="pw-span" data-pw-span aria-haspopup="menu" aria-label="${esc('Span of the timeline: ' + (M.MODES.find((m) => m[0] === mode) || M.MODES[5])[1])}">${esc((M.MODES.find((m) => m[0] === mode) || M.MODES[5])[1])}${SVG(P.down, 12)}</button>` : '';
252
+ const tools = `<span class="pw-tools">${spanB}${ib(`data-pw-big aria-pressed="${!!full}"`, full ? 'Back to the initiative' : 'Give the work breakdown the whole popup', full ? P.in : P.full)}${ib('data-pw-tune="wbs" aria-haspopup="menu"', 'Show or hide columns', P.tune)}</span>`;
253
+ const empty = tasks === null ? '<p class="pw-ltx">Reading the tasks…</p>' : '<p class="pw-ltx">No tasks yet.</p>';
254
+ const head = `<div class="pw-lh"><h4>Tasks</h4><button type="button" class="pw-lk" data-pw-backlog>Open in Backlog${SVG(P.right, 14)}</button></div>`;
255
+ if (full && C.tl && o.bars && o.bars.length) {
256
+ // expanded: the same tasks with their dates and bars on the one timeline; the grouped list is the default view
257
+ const rows = o.bars.map((x) => rowHtml({ ...x, sec: '' }, W, C, new Map())).join('');
258
+ const T = `<div class="pw-card pw-wbs${C.status ? '' : ' nost'}${C.date ? '' : ' nodt'}" role="table" aria-label="Tasks"${tlStyle()}>${headCells(C, W, mode, 'Task')}${rows}</div>`;
259
+ return `<section class="pw-sec" aria-label="Work breakdown"><div class="pw-sech">${tools}</div>`
260
+ + `<div class="pw-card pw-wbs pw-one nost nodt" role="table" aria-label="Stages"${tlStyle()}>${gripHtml()}${headCells({ ...C, status: false, date: false }, W, mode, 'Stages')}${stagesRowHtml(W, { ...C, status: false, date: false }, r)}</div>`
261
+ + `<div class="pw-tasks">${head}${T}</div></section>`;
262
+ }
263
+ return `<section class="pw-sec" aria-label="Work breakdown">${full ? `<div class="pw-sech">${tools}</div>` : `<div class="pw-sech"><h3>Work breakdown</h3>${tools}</div>`}`
264
+ + `<div class="pw-card pw-wbs pw-one${C.tl ? '' : ' notl'} nost nodt" role="table" aria-label="Stages"${tlStyle()}>${C.tl ? gripHtml() : ''}${headCells({ ...C, status: false, date: false }, W, mode, 'Stages')}${stagesRowHtml(W, { ...C, status: false, date: false }, r)}</div>`
265
+ + `<div class="pw-tasks">${head}<div class="pw-bk" data-pw-bk>${L || empty}</div></div></section>`;
266
+ }
267
+ function breakdownHtml(W, C, mode, full, S, o, r) {
268
+ if (BK && o && o.board && bkTasks(o.ws, o.board) !== false) return oneListHtml(W, C, mode, full, S, o, r);
209
269
  const sugRows = W.rowSuggests, ms = !!(S && S.msAdd);
210
270
  // the add row (round 3 point 2): "◇" beside it makes the next one a milestone; typing "◇ " first does the same
211
271
  const add = (key, name) => `<div class="pw-tr pw-add" role="row"><span class="pw-it"><label class="pw-addf">${SVG(P.plus, 14)}<input data-pw-add="${esc(key)}" data-pw-add-name="${esc(name)}" placeholder="${ms ? 'Add a milestone' : 'Add a task'}" aria-label="${esc((ms ? 'Add a milestone to ' : 'Add a task to ') + name)}" maxlength="200" autocomplete="off"></label>`
@@ -238,7 +298,7 @@ function artefactsHtml(rows, C, add = true, o = {}) {
238
298
  const a = g.cur, k = scope + '|' + g.kind, open = ARTOPEN.has(k), vt = AK.versionText(g);
239
299
  const ver = vt && g.earlier.length ? `<button type="button" class="pw-ver" data-pw-ver="${esc(k)}" aria-expanded="${open}">${esc(vt)}${SVG(open ? P.down : P.right, 12)}</button>` : esc(vt);
240
300
  const row = `<div class="pw-ar${a.missing ? ' miss' : ''}" role="row"><span role="cell" class="pw-ak">${esc(g.kind)}</span><span role="cell">${nameCell(a)}</span><span role="cell" class="pw-av">${ver}</span>`
241
- + (C.when ? `<span role="cell"${a.missing ? ' class="warn"' : ''}>${esc(a.missing || a.when || '')}</span>` : '') + '</div>';
301
+ + (C.when ? (a.missing ? `<span role="cell" class="warn" title="${esc(a.missing)}">${esc(String(a.missing).split(' · ')[0])}</span>` : `<span role="cell">${esc(a.when || '')}</span>`) : '') + '</div>';
242
302
  const more = open ? g.earlier.map((e) => `<div class="pw-ar pw-ear" role="row"><span role="cell"></span><span role="cell">${nameCell(e)}</span><span role="cell" class="pw-av">${e.title && AK.versionOf(e.title) ? 'v' + AK.versionOf(e.title) : ''}</span>${C.when ? `<span role="cell">${esc(e.when || '')}</span>` : ''}</div>`).join('') : '';
243
303
  return row + more;
244
304
  }).join('');
@@ -254,14 +314,21 @@ const keyOf = (v, o) => String((o && o.id) || (v && (v.id || v.key)) || '');
254
314
  function model(r, v, o) {
255
315
  const id = keyOf(v, o), S = stOf(id), it = ITEMS.get(id);
256
316
  const g = o.goal || goalOf(o.ws, o.board, r.anchor || v.anchor);
257
- const W = M.workOf(r, v, { ...o, goal: M.idShaped(g) ? '' : g, product: productName(o.product, o.ws), art: artOf(id, o.ws), open: S.open, shut: S.shut, doneOpen: S.doneOpen, moreOpen: S.moreOpen, farOpen: S.farOpen, focus: S.focus, mode: store.get(SPAN, 'full'), items: it || [], dropped: dropped() });
317
+ const W = M.workOf(r, v, { ...o, goal: M.idShaped(g) ? '' : g, product: productName(o.product, o.ws), art: artOf(id, o.ws), open: S.open, shut: S.shut, doneOpen: S.doneOpen, moreOpen: S.moreOpen, farOpen: S.farOpen || !!(BK && o.board), focus: S.focus, mode: store.get(SPAN, 'full'), items: it || [], dropped: dropped() });
258
318
  const mk = M.marksOf(W.span, W.today); W.tx = mk.today;
259
319
  return { W, S, id };
260
320
  }
261
321
  export function html(r, v, o = {}) {
262
322
  const { W, S } = model(r, v, o), C = cols(), mode = store.get(SPAN, 'full');
263
- if (S.big) return `<div class="pw" data-pw-big-on>${breakdownHtml(W, C, mode, true, S)}</div>`;
264
- return `<div class="pw">${overviewHtml(W, S, keyOf(v, o))}${breakdownHtml(W, C, mode, false, S)}${artefactsHtml(W.artefacts, C, true, { scope: keyOf(v, o), recPath: v.prd && (v.prd.path || v.prd) })}</div>`;
323
+ const bo = { ws: o.ws, board: o.board, id: keyOf(v, o) };
324
+ // the expanded one list keeps each task's bar on the timeline (design check): every stage open, read for its task rows only
325
+ if (S.big && BK && o.board) {
326
+ const keys = new Set(W.rows.filter((x) => x.kind === 'stage').map((x) => x.key).concat(''));
327
+ const W2 = M.workOf(r, v, { ...o, goal: '', product: productName(o.product, o.ws), art: [], open: keys, shut: new Set(), doneOpen: new Set(), moreOpen: keys, farOpen: true, mode, items: ITEMS.get(bo.id) || [], dropped: dropped() });
328
+ bo.bars = W2.rows.filter((x) => x.kind === 'task' && !x.done).sort((a, b) => String(a.end || '9999').localeCompare(String(b.end || '9999')));
329
+ }
330
+ if (S.big) return `<div class="pw" data-pw-big-on>${breakdownHtml(W, C, mode, true, S, bo, r)}</div>`;
331
+ return `<div class="pw">${overviewHtml(W, S, keyOf(v, o))}${breakdownHtml(W, C, mode, false, S, bo, r)}${artefactsHtml(W.artefacts, C, true, { scope: keyOf(v, o), recPath: v.prd && (v.prd.path || v.prd) })}</div>`;
265
332
  }
266
333
 
267
334
  /* ── the suggestion as its own page (board 22) ── */
@@ -352,8 +419,29 @@ export function wire(body, h0, x0) {
352
419
  body.__pw = true;
353
420
  function cur() { const x = body.__pwx, r = x && x.r(), v = x && x.v(); return r && v ? { r, v, ...model(r, v, x.o()) } : null; }
354
421
  function redraw() { if (body.__pwh && body.__pwh.redraw) body.__pwh.redraw(); }
355
- goalsRedraw = artRedraw = wsnRedraw = () => { if (body.isConnected && body.querySelector('.pw')) redraw(); };
422
+ goalsRedraw = artRedraw = wsnRedraw = bkRedraw = () => { if (body.isConnected && body.querySelector('.pw')) redraw(); };
356
423
  wireGrip(body);
424
+ // the one list (round 3 point 22): each draw puts a new [data-pw-bk]; the Backlog's own presses are bound to it once
425
+ const bindBk = () => body.querySelectorAll('[data-pw-bk]').forEach((el) => {
426
+ if (el.__bk || !BK || !el.querySelector('.bk')) return;
427
+ el.__bk = true;
428
+ const c = cur(); if (!c) return;
429
+ // the task a Today row opened (round 3 item 11b) is lit in the one list too
430
+ if (c.S.focus) { const fr = el.querySelector(`[data-bkopen$="|${window.CSS.escape(c.S.focus)}"]`); if (fr) fr.closest('[role="row"]').classList.add('lit'); }
431
+ const o = (body.__pwx && body.__pwx.o()) || {}, h = body.__pwh || {}, w = h.where ? h.where() : {}, ws = w.ws || o.ws, board = w.board || o.board;
432
+ BK.bindList(el, {
433
+ post: pmPost,
434
+ say: (m, u) => (u ? undoToast(m, u) : h.toast ? h.toast(m) : undoToast(m)),
435
+ openTask: (t) => { if (t.src === 'jira') { if (h.openTask) h.openTask(t.key || t.id); else if (t.url) window.open(t.url, '_blank', 'noopener'); return; } const cc = cur(); if (cc) openSmall(t.id, cc, body.__pwh, body.__pwx, body, t); },
436
+ reload: async () => { bkReread(ws, board); if (body.__pwh && body.__pwh.reload) await body.__pwh.reload(); else redraw(); },
437
+ }, () => BKT.get((ws || '') + '|' + (board || '')) || []);
438
+ el.addEventListener('bk:redraw', (e) => {
439
+ const p = BKFOLD.get(c.id) || { fold: {}, more: new Set() }, d = e.detail || {};
440
+ BKFOLD.set(c.id, { fold: { ...p.fold, ...(d.fold || {}) }, more: new Set([...(p.more || []), ...(d.more || [])]) });
441
+ redraw();
442
+ });
443
+ });
444
+ bindBk(); new MutationObserver(bindBk).observe(body, { childList: true, subtree: true });
357
445
  const live = (e) => !!body.__pwx && !!e.target.closest('.pw') && !e.target.closest('.pw-sp, [data-pw-level]');
358
446
  body.addEventListener('scroll', () => { if (!body.querySelector(':scope > .pw, .pw:not(.pw-sp)')) return; const c = cur(); if (c) c.S.top = body.scrollTop; }, { passive: true });
359
447
  body.addEventListener('click', async (e) => {
@@ -384,13 +472,15 @@ export function wire(body, h0, x0) {
384
472
  if (d.pwChoice) { const [sid, k] = d.pwChoice.split('|'), s = findSug(W, sid), ch = s && s.choices && s.choices[+k]; if (ch && !sendToChat(ch.ask) && h.toast) h.toast('Open Ask PMOS to send this.'); return; }
385
473
  if (d.pwMore != null) { S.moreOpen.add(d.pwMore); redraw(); return; }
386
474
  if (d.pwVer) { if (ARTOPEN.has(d.pwVer)) ARTOPEN.delete(d.pwVer); else ARTOPEN.add(d.pwVer); redraw(); return; }
387
- if (d.pwRowMore) { rowMenu(b, d.pwRowMore, c, h); return; }
388
- if ('pwAddty' in d) { S.msAdd = !S.msAdd; const f = b.closest('.pw-add'), k = f && f.querySelector('[data-pw-add]') && f.querySelector('[data-pw-add]').dataset.pwAdd; redraw(); if (k != null) setTimeout(() => { const i = body.querySelector(`[data-pw-add="${CSS.escape(k)}"]`); if (i) i.focus(); }, 0); return; }
475
+ if (d.pwRowMore) { rowMenu(b, d.pwRowMore, c, h, body); return; }
476
+ if ('pwAddty' in d) { S.msAdd = !S.msAdd; const f = b.closest('.pw-add'), k = f && f.querySelector('[data-pw-add]') && f.querySelector('[data-pw-add]').dataset.pwAdd; redraw(); if (k != null) setTimeout(() => { const i = body.querySelector(`[data-pw-add="${window.CSS.escape(k)}"]`); if (i) i.focus(); }, 0); return; }
389
477
  if (d.pwFact) { fact(d.pwFact, b, c, h); return; }
390
478
  if (d.pwStatus) { statusMenu(b, d.pwStatus, h, c); return; }
391
479
  if (d.pwDate) { dateMenu(b, d.pwDate, c, h); return; }
392
480
  if (d.pwName) { rename(b, d.pwName, h); return; }
393
- if (d.pwOpen) { if (h.openTask) h.openTask(d.pwOpen); return; }
481
+ if (d.pwOpen) { openSmall(d.pwOpen, c, h, x, body); return; }
482
+ if (d.pwStage) { stageCard(b, d.pwStage, c, h, x); return; }
483
+ if ('pwBacklog' in d) { const o = x.o() || {}, w = h.where ? h.where() : {}, q = new URLSearchParams({ work: 'backlog' }); if (w.ws || o.ws) q.set('ws', w.ws || o.ws); if (o.id) q.set('ini', o.id); location.href = '/premium-board.html?' + q.toString(); return; }
394
484
  if (d.cbMs != null) { msPop(b, d.cbMs, W, h); return; }
395
485
  if (d.pwArt != null) { openArt(W.artefacts[+d.pwArt], h, x); return; }
396
486
  if ('pwAddart' in d) { addArt(x, h); return; }
@@ -407,7 +497,7 @@ export function wire(body, h0, x0) {
407
497
  if (!v) return;
408
498
  await h.addTask(v, t, { section: sec, name: t.dataset.pwAddName, ...(ms ? { milestone: true } : {}) });
409
499
  // Enter only adds the row; the field stays for the next one
410
- setTimeout(() => { const f = body.querySelector(`[data-pw-add="${CSS.escape(sec)}"]`); if (f) { f.value = ''; f.focus(); } }, 0);
500
+ setTimeout(() => { const f = body.querySelector(`[data-pw-add="${window.CSS.escape(sec)}"]`); if (f) { f.value = ''; f.focus(); } }, 0);
411
501
  }
412
502
  });
413
503
  }
@@ -517,7 +607,7 @@ function rename(btn, uid, h) {
517
607
  e.preventDefault();
518
608
  const row = inp.closest('[data-pw-row]'), sec = row ? row.dataset.pwSec : null;
519
609
  inp.blur();
520
- if (sec != null) setTimeout(() => { const f = document.querySelector(`.cz-pop [data-pw-add="${CSS.escape(sec)}"]`); if (f) f.focus(); }, 60);
610
+ if (sec != null) setTimeout(() => { const f = document.querySelector(`.cz-pop [data-pw-add="${window.CSS.escape(sec)}"]`); if (f) f.focus(); }, 60);
521
611
  }
522
612
  });
523
613
  }
@@ -564,15 +654,63 @@ function dateMenu(btn, uid, c, h) {
564
654
  DP.mountDay(due, { label: row.ms ? 'Date' : 'Due', value: row.end || row.start || '', open: !st, onPick: (v) => { closePop(); if (h.dates) h.dates(uid, { due: v }); } });
565
655
  (st || due).querySelector('.dp-in')?.focus();
566
656
  }
567
- function rowMenu(btn, uid, c, h) {
657
+ function rowMenu(btn, uid, c, h, body) {
568
658
  const row = c.W.rows.find((x) => x.uid === uid) || {};
569
659
  openPop(btn, 'pw-rowm', `<button type="button" class="hi-mi" role="menuitem" data-k="kind">${SVG(row.ms ? P.box : P.dia, 14, 2)} ${row.ms ? 'Make it a task' : 'Make it a milestone'}</button>`
570
660
  + `<button type="button" class="hi-mi" role="menuitem" data-k="open">${SVG(P.open, 14)} Open the task</button>` + jiraNote(row), (b) => {
571
661
  closePop();
572
662
  if (b.dataset.k === 'kind') setKind(row, !row.ms, h);
573
- else if (b.dataset.k === 'open' && h.openTask) h.openTask(uid);
663
+ else if (b.dataset.k === 'open') openSmall(uid, c, h, body.__pwx, body);
574
664
  }, { menu: true, label: 'Task' });
575
665
  }
666
+ /* "Open the task" opens the small task popup on top (round 3 point 20, pm/cozy-task-pop.js); ↑ ↓ step through this list. A Jira ticket keeps its
667
+ * ticket view. On close the row is lit for a moment. */
668
+ async function openSmall(uid, c, h, x, body, bt) {
669
+ const row = c.W.rows.find((r) => r.uid === uid) || {};
670
+ if (row.jira) { if (h.openTask) h.openTask(uid); return; }
671
+ const TP = await import('./cozy-task-pop.js');
672
+ const w = h.where ? h.where() : {}, o = (x && x.o && x.o()) || {};
673
+ const one = !!body.querySelector('[data-pw-bk] .bk');
674
+ const list = () => { if (one) return [...body.querySelectorAll('[data-pw-bk] [data-bkopen]')].map((e) => e.dataset.bkopen.split('|').pop()).filter((v) => { const t = (BKT.get((o.ws || '') + '|' + (o.board || '')) || []).find((q) => q.id === v); return !t || t.src !== 'jira'; }); const cc = body.__pwx && body.__pwx.r() ? model(body.__pwx.r(), body.__pwx.v(), body.__pwx.o()) : null; return ((cc && cc.W.rows) || c.W.rows).filter((r) => r.kind === 'task' && !r.jira).map((r) => r.uid); };
675
+ TP.openTask(uid, {
676
+ ws: w.ws || o.ws, board: w.board || o.board, ini: o.id, pmPost,
677
+ toast: (m, undo) => (undo ? undoToast(m, undo) : h.toast ? h.toast(m) : undoToast(m)),
678
+ list, iniTitle: () => ((x && x.v && x.v()) || {}).title || '',
679
+ row: (u) => { const r = c.W.rows.find((q) => q.uid === u) || (bt && bt.id === u ? { uid: bt.id, title: bt.title, status: bt.status || bt.state || '', start: bt.start || '', end: bt.due || '', ms: !!bt.milestone } : null); return r ? { uid: r.uid, title: r.title, status: r.status, start: r.start || '', end: r.end || '', milestone: !!r.ms, since: r.since || '', ini: o.id, board: w.board || o.board } : null; },
680
+ rename: h.rename ? (t, v) => h.rename(t.uid, v) : null,
681
+ onChange: () => { if (h.reload) h.reload(); },
682
+ onClose: (u) => { const r = body.querySelector(`[data-pw-row="${window.CSS.escape(u)}"]`) || body.querySelector(`[data-pw-bk] [data-bkopen$="|${window.CSS.escape(u)}"]`)?.closest('[role="row"]'); if (r) { r.classList.add('lit'); r.scrollIntoView({ block: 'nearest' }); setTimeout(() => r.classList.remove('lit'), 1600); } },
683
+ });
684
+ }
685
+ /* a stage's card (round 3 point 22): its dates and state; for another stage, the move to it, which asks when it happened (point 18) */
686
+ function stageCard(btn, key, c, h, x) {
687
+ const all = stagesOf(c.W), i = all.findIndex((r) => r.key === key), st = all[i]; if (!st) return;
688
+ const now = all.find((r) => r.tone === 'now'), o = x.o() || {}, v = x.v() || {};
689
+ const span = [st.start && M.dayText(st.start, c.W.today), st.end && M.dayText(st.end, c.W.today)].filter(Boolean).join(' – ');
690
+ // the stage's own facts only: a task has no stage (round 3 point 22), so no task count here
691
+ const facts = [st.status, span].filter(Boolean).map((t) => `<p class="hi-small">${esc(t)}</p>`).join('') + (st.late && st.date ? `<p class="hi-small warn">${esc(st.date)}</p>` : '');
692
+ // the action is the first line (design check): another stage → "Move to Plan"; the stage now → "Mark Discover done" (moves to the next one).
693
+ // The day question shows only after the press, and names the action.
694
+ const nx = st.tone === 'now' ? all[i + 1] : null;
695
+ const act = st.tone === 'now' ? (nx ? { to: nx.name, label: 'Mark ' + st.name + ' done', q: 'When was ' + st.name + ' done?', icon: P.check, said: st.name + ' done, moved to ' + nx.name } : null)
696
+ : { to: st.name, label: 'Move to ' + st.name, q: 'When did it move to ' + st.name + '?', icon: P.right, said: 'Moved to ' + st.name };
697
+ const head = `<div class="pw-stch"><p class="hi-h3">${esc(st.name)}</p>${act ? ib('data-mv', act.label, act.icon, 'solid') : ''}</div>`;
698
+ const el = openPop(btn, 'pw-stc', head + (act ? '<div class="pw-when" hidden></div>' : '') + facts, (b) => {
699
+ if (!('mv' in b.dataset) || !act) return;
700
+ const w = el.querySelector('.pw-when'); b.disabled = true; b.classList.add('on'); w.hidden = false;
701
+ SW.askWhen(w, { q: act.q, since: (x.r() || {}).acts?.movedOn || '', onPick: async (day) => {
702
+ closePop();
703
+ const wh = h.where ? h.where() : {}, base = { ws: wh.ws || o.ws, board: wh.board || o.board, id: o.id }, happened = day === localToday() ? null : day;
704
+ const res = await pmPost('/api/boards/move', { ...base, to: act.to, ...(happened ? { happened } : {}) }).catch(() => null);
705
+ if (!res || !res.ok) { if (h.toast) h.toast((res && res.error) || 'It did not move.'); return; }
706
+ const from = now && now.name;
707
+ const said = (v.title ? v.title + ' · ' : '') + SW.whenWords(act.said, happened);
708
+ if (!from) { if (h.toast) h.toast(said); } else undoToast(said, async () => { const u = await pmPost('/api/boards/move', { ...base, to: from, why: 'Undo' }).catch(() => null); if (!u || !u.ok) { if (h.toast) h.toast((u && u.error) || 'The undo did not land.'); } if (h.reload) await h.reload(); });
709
+ if (h.reload) await h.reload();
710
+ } });
711
+ w.querySelector('[data-sw]')?.focus();
712
+ }, { label: st.name, focus: '[data-mv]' });
713
+ }
576
714
  function spanMenu(btn, redraw) {
577
715
  const cur = store.get(SPAN, 'full');
578
716
  openPop(btn, 'pw-span', M.MODES.map(([k, l]) => `<button type="button" class="hi-mi" role="menuitemradio" aria-checked="${k === cur}" data-sp="${k}">${esc(l)}</button>`).join(''), (b) => {
@@ -37,7 +37,10 @@ body.cz-pop-drag, body.cz-pop-drag * { cursor: col-resize !important; user-selec
37
37
  background: var(--cz-well); font-size: var(--fs-row); font-weight: var(--fw-strong); color: var(--cz-ink); }
38
38
  .cz-pop-t span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
39
39
  .cz-pop-go:focus-visible, .cz-pop-t:focus-visible, .cz-pop-ib:focus-visible, .cz-pop-x:focus-visible, .cz-pop-sr:focus-visible, .cz-pop-f:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
40
- .cz-pop-tw { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; }
40
+ .cz-pop-tw { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; row-gap: 0; }
41
+ /* the context line under the session (round 3 point 19a): one quiet line, cut with … */
42
+ .cz-pop-cx { flex: 1 0 100%; min-width: 0; padding-left: 10px; font-size: var(--fs-meta); color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
43
+ .cz-pop-mm { left: auto; right: 12px; width: 260px; }
41
44
  .cz-pop-ib { all: unset; box-sizing: border-box; flex: none; cursor: pointer; width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; color: var(--cz-ink2); }
42
45
  .cz-pop-ib:hover { background: var(--cz-well); color: var(--cz-ink); }
43
46
  .cz-pop-chat { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
@@ -120,3 +123,5 @@ body.cz-pop-drag, body.cz-pop-drag * { cursor: col-resize !important; user-selec
120
123
  body.cz-pop-on { overflow: hidden; }
121
124
  /* the chat side starts with two plain grey lines, no mascot (board 23) */
122
125
  .cz-pop .hm-empty-ad > :not(p) { display: none; }
126
+ /* the phone chat's stream in the popup's column (round 3 point 19b): PMOS's text from the column's 16 px margin, the PM's bubbles to the right */
127
+ .cz-pop .cz-pop-r .cz-pop-chat .hm-log { padding-left: 16px; padding-right: 16px; }
@@ -37,7 +37,7 @@ const I = {
37
37
  chat: 'M5 6.5A2.5 2.5 0 0 1 7.5 4h9A2.5 2.5 0 0 1 19 6.5v7a2.5 2.5 0 0 1-2.5 2.5H11l-4 3.5V16h.5A2.5 2.5 0 0 1 5 13.5z',
38
38
  hide: 'M4 5h16v14H4zM14.5 5v14M9 10l2 2-2 2', close: 'M6 6l12 12M18 6L6 18', down: 'M7 10l5 5 5-5', back: 'M15 6l-6 6 6 6',
39
39
  plus: 'M12 5v14M5 12h14', list: 'M5 7h14M5 12h14M5 17h14', find: 'M11 4.5a6.5 6.5 0 1 0 0 13a6.5 6.5 0 1 0 0-13M16 16l4 4', flag: 'M5 21V4h11l-2 4 2 4H5',
40
- side: 'M3.5 5h17v14h-17zM12 5v14',
40
+ side: 'M3.5 5h17v14h-17zM12 5v14', more: 'M5 12h.01M12 12h.01M19 12h.01',
41
41
  };
42
42
  const CLAUDE = { key: 'claude', name: 'PMOS', initial: 'P' };
43
43
  const MIN_WORK = 480, MIN_CHAT = 320, DEF_CHAT = 460, DAY_MS = 864e5, POLL = 6000, UNDO = 6000, CHOOSER = 5;
@@ -78,7 +78,7 @@ function frame() {
78
78
  + '<div class="cz-pop-l"></div>'
79
79
  + '<div class="cz-pop-grip" role="separator" aria-orientation="vertical" tabindex="0" aria-label="Drag to change the width of the chat. Double-click to reset." title="Drag to change the width. Double-click to reset."><i></i></div>'
80
80
  + '<section class="cz-pop-r" aria-label="Ask PMOS">'
81
- + `<header class="cz-pop-hd"><span class="cz-pop-tile" aria-hidden="true">${svg(I.chat)}</span><div class="cz-pop-tw"></div>${ib('where', 'Open work beside the page', I.side)}${ib('hide', 'Hide the chat', I.hide)}${ib('close', 'Close', I.close)}</header>`
81
+ + `<header class="cz-pop-hd"><span class="cz-pop-tile" aria-hidden="true">${svg(I.chat)}</span><div class="cz-pop-tw"></div>${ib('more', 'More for the chat', I.more)}${ib('close', 'Close', I.close)}</header>`
82
82
  + '<div class="cz-pop-chat"></div><div class="cz-pop-all" hidden></div><div class="cz-pop-toast" role="status" hidden></div></section>'
83
83
  + `<div class="cz-pop-tools" hidden><button type="button" class="cz-pop-ask" data-pop="ask" aria-label="Show Ask PMOS" title="Ask PMOS (Ctrl J)">${svg(I.chat, 18)}<i class="cz-pop-dot" hidden></i></button>${ib('close', 'Close', I.close)}</div>`
84
84
  + '</div>';
@@ -297,8 +297,11 @@ function drawTitle() {
297
297
  S.title.innerHTML = `<button type="button" class="cz-pop-ib" data-pop="unall" aria-label="Back to the session you were in" title="Back to the session you were in">${svg(I.back)}</button><b class="t-row">All sessions</b>`;
298
298
  return;
299
299
  }
300
- const r = curRow(), name = r ? r.name : 'Ask PMOS', on = !!S.menu;
301
- S.title.innerHTML = `<button type="button" class="cz-pop-t" data-pop="pick" aria-haspopup="menu" aria-expanded="${on}" title="Change session" aria-label="${esc(name + '. Change session')}"><span>${esc(name)}</span>${svg(I.down, 16)}</button>`;
300
+ const r = curRow(), name = r ? r.name : 'Ask PMOS', on = !!S.menu && S.menu.dataset.kind !== 'more';
301
+ // one quiet context line under the session (round 3 point 19a, the phone chat's line): what the chat is about, said once
302
+ const a = S.about, cx = a && a.title ? (a.kind === 'initiative' ? 'Initiative' : a.kind === 'program' ? 'Program' : 'About') + ' · ' + a.title : '';
303
+ S.title.innerHTML = `<button type="button" class="cz-pop-t" data-pop="pick" aria-haspopup="menu" aria-expanded="${on}" title="Change session" aria-label="${esc(name + '. Change session')}"><span>${esc(name)}</span>${svg(I.down, 16)}</button>`
304
+ + (cx ? `<small class="cz-pop-cx" title="${esc(cx)}">${esc(cx)}</small>` : '');
302
305
  }
303
306
  /** The chat's last line: the state of the session shown and End session (board 7). Nothing when it is not live and busy. */
304
307
  function stateLine() {
@@ -323,11 +326,26 @@ function openMenu() {
323
326
  const f = m.querySelector('button'); if (f) f.focus();
324
327
  setTimeout(() => document.addEventListener('pointerdown', away, true), 0);
325
328
  }
326
- function away(e) { if (S.menu && !S.menu.contains(e.target) && !e.target.closest('[data-pop="pick"]')) closeMenu(); }
329
+ /* ⋯ in the chat's header (round 3 point 19a: two icons, ⋯ and ✕): where work opens, hide the chat, the sessions, End session */
330
+ function openMore() {
331
+ closeMenu();
332
+ const r = curRow(), m = document.createElement('div');
333
+ m.className = 'cz-pop-m cz-pop-mm'; m.setAttribute('role', 'menu'); m.setAttribute('aria-label', 'More for the chat'); m.dataset.escLayer = '1'; m.dataset.kind = 'more';
334
+ m.innerHTML = `<button type="button" class="cz-pop-f" role="menuitem" data-pop="where">${svg(I.side, 16)}${beside() ? 'Open work in this popup' : 'Open work beside the page'}</button>`
335
+ + `<button type="button" class="cz-pop-f" role="menuitem" data-pop="hide">${svg(I.hide, 16)}Hide the chat<span>Ctrl J</span></button>`
336
+ + `<button type="button" class="cz-pop-f" role="menuitem" data-pop="pick">${svg(I.list, 16)}Sessions</button>`
337
+ + (r && r.live ? `<hr><button type="button" class="cz-pop-f" role="menuitem" data-end="${esc(r.id)}">${svg(I.close, 16)}End session</button>` : '');
338
+ S.right.appendChild(m); S.menu = m;
339
+ const mb = S.card.querySelector('[data-pop="more"]'); if (mb) mb.setAttribute('aria-expanded', 'true');
340
+ const f = m.querySelector('button'); if (f) f.focus();
341
+ setTimeout(() => document.addEventListener('pointerdown', away, true), 0);
342
+ }
343
+ function away(e) { if (S.menu && !S.menu.contains(e.target) && !e.target.closest('[data-pop="pick"], [data-pop="more"]')) closeMenu(); }
327
344
  function closeMenu() {
328
345
  document.removeEventListener('pointerdown', away, true);
329
346
  if (!S.menu) return;
330
347
  S.menu.remove(); S.menu = null; drawTitle();
348
+ const mb = S.card && S.card.querySelector('[data-pop="more"]'); if (mb) mb.setAttribute('aria-expanded', 'false');
331
349
  }
332
350
  /** The full list: Now and Earlier, newest first, with a search box (board 23). */
333
351
  function listHtml(where) {
@@ -410,10 +428,11 @@ function onClick(e) {
410
428
  const b = e.target.closest('[data-pop]'); if (!b) return;
411
429
  const a = b.dataset.pop;
412
430
  if (a === 'close') close();
413
- else if (a === 'where') where();
431
+ else if (a === 'more') { if (S.menu && S.menu.dataset.kind === 'more') closeMenu(); else openMore(); }
432
+ else if (a === 'where') { closeMenu(); where(); }
414
433
  else if (a === 'hide') { chatOn(false, 'press'); closeMenu(); const k = S.tools.querySelector('[data-pop="ask"]'); if (k) k.focus(); }
415
434
  else if (a === 'ask') { chatOn(true, 'press'); if (S.chat && S.chat.focus) S.chat.focus(); }
416
- else if (a === 'pick') { if (S.menu) closeMenu(); else { openMenu(); read(); } }
435
+ else if (a === 'pick') { if (S.menu && S.menu.dataset.kind !== 'more') closeMenu(); else { openMenu(); read(); } }
417
436
  else if (a === 'new') newSession();
418
437
  else if (a === 'all') showAll(true);
419
438
  else if (a === 'unall') showAll(false);
@@ -7,8 +7,13 @@
7
7
  * whenWords(state, happened, today) → the toast: "Done." on today, "Done on 14 Nov, noted today." on an earlier day
8
8
  * askWhen(el, { today, since, onPick(iso) }) draws the line into el: When did this happen? [Today] [Yesterday] [Pick a date]. Today is
9
9
  * preselected, so Enter saves it; Pick a date opens the app's own day field (pm/cozy-day-pick.js) inside the limits.
10
- * Returns { save() } (saves the preselected day). Its presses stop at el. */
10
+ * Returns { save() } (saves the preselected day). Its presses stop at el.
11
+ * localDay() → today on this computer, YYYY-MM-DD
12
+ * whenPop(anchor, { title, since, onPick(day) }) the same line in a small popover under anchor, for a move that has no menu of its own (a stage
13
+ * button); onPick gets null for today and the day for an earlier one. Escape or a press outside moves nothing. */
11
14
  import { mountDay, localToday, dayText } from './cozy-day-pick.js';
15
+ import { openPop, closePop } from './hi-pop.js';
16
+ export const localDay = localToday; // today on this computer, for a caller that has no day field of its own
12
17
 
13
18
  const ms = (v) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(v || '')); return m ? Date.UTC(+m[1], +m[2] - 1, +m[3]) : null; };
14
19
  const iso = (n) => new Date(n).toISOString().slice(0, 10);
@@ -25,11 +30,13 @@ export function whenWords(state, happened, today = localToday()) {
25
30
  const d = new Date(ms(happened)), y = d.getUTCFullYear() !== +String(today).slice(0, 4) ? ' ' + d.getUTCFullYear() : '';
26
31
  return state + ' on ' + d.getUTCDate() + ' ' + MON[d.getUTCMonth()] + y + ', noted today.';
27
32
  }
33
+ const esc0 = (s) => String(s).replace(/[&<>"]/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' })[c]);
34
+ /** o.q: the question, when the action it follows should be named ("When did it move to Plan?"); default "When did this happen?" */
28
35
  export function askWhen(el, o = {}) {
29
36
  const today = o.today || localToday(), L = whenLimits({ today, since: o.since });
30
37
  const done = (v) => { if (o.onPick) o.onPick(v); };
31
38
  el.classList.add('sw');
32
- el.innerHTML = '<p class="sw-q" id="swQ">When did this happen?</p><div class="sw-ch" role="group" aria-labelledby="swQ">'
39
+ el.innerHTML = '<p class="sw-q" id="swQ">' + esc0(o.q || 'When did this happen?') + '</p><div class="sw-ch" role="group" aria-labelledby="swQ">'
33
40
  + '<button type="button" class="sw-b" data-sw="today" aria-pressed="true">Today</button>'
34
41
  + (L.yesterday ? '<button type="button" class="sw-b" data-sw="yday" aria-pressed="false">Yesterday</button>' : '')
35
42
  + (L.min === today ? '' : '<button type="button" class="sw-b" data-sw="pick" aria-pressed="false" aria-expanded="false">Pick a date</button>') + '</div><div class="sw-day"></div>';
@@ -46,3 +53,11 @@ export function askWhen(el, o = {}) {
46
53
  el.addEventListener('keydown', (e) => { if (e.key === 'Enter' && !e.target.closest('button, input, .sw-day')) { e.preventDefault(); e.stopPropagation(); done(today); } });
47
54
  return { save: () => done(today), limits: L, text: (v) => dayText(v) };
48
55
  }
56
+
57
+ export function whenPop(anchor, o = {}) {
58
+ const today = localToday();
59
+ const el = openPop(anchor, 'sw-pop', (o.title ? '<p class="hi-h3">' + String(o.title).replace(/[&<>"']/g, (c) => '&#' + c.charCodeAt(0) + ';') + '</p>' : '') + '<div class="sw-host"></div>', () => {}, { label: o.title || 'When did this happen?' });
60
+ askWhen(el.querySelector('.sw-host'), { today, since: o.since || '', onPick: (day) => { closePop(); if (o.onPick) o.onPick(day && day !== today ? day : null); } });
61
+ const t = el.querySelector('[data-sw]'); if (t) setTimeout(() => t.focus(), 0);
62
+ return el;
63
+ }
@@ -0,0 +1,34 @@
1
+ /* pm/cozy-task-pop.css — the small task popup on top of the one popup (popup round 3 point 20; pm/cozy-task-pop.js). About 560 px wide, its height
2
+ * by content up to 80% of the window; the popup behind is dimmed a little. Above the popup (72), below the menus, pickers and toasts (90 and up).
3
+ * On a phone it is a full-height sheet from the bottom. Tokens: cozy.css. */
4
+ .ctp-scrim { position: fixed; inset: 0; z-index: 76; background: rgba(42, 46, 53, .16); }
5
+ .ctp { position: fixed; z-index: 77; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: 80vh; overflow: auto;
6
+ box-sizing: border-box; padding: 14px 18px 18px; border-radius: 20px; background: var(--cz-card); color: var(--cz-ink); font-family: var(--cz-sans); font-size: var(--fs-body);
7
+ line-height: var(--lh-body, 1.5); box-shadow: 0 28px 70px -24px rgba(42, 46, 53, .5), 0 0 0 1px var(--cz-hair); }
8
+ .ctp[aria-busy="true"] { min-height: 120px; }
9
+ .ctp-h { position: relative; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
10
+ .ctp-kind { display: inline-flex; align-items: center; gap: 4px; flex: none; border: 0; border-radius: 999px; padding: 3px 9px 3px 7px; background: var(--cz-well); color: var(--cz-ink2);
11
+ font: inherit; font-size: var(--fs-meta); cursor: pointer; }
12
+ .ctp-kind:hover { color: var(--cz-ink); }
13
+ .ctp-kind:disabled { cursor: default; }
14
+ .ctp-t { flex: 1; min-width: 0; border: 0; background: none; padding: 2px 4px; margin: 0; text-align: left; font: inherit; font-size: var(--fs-section); font-weight: var(--fw-strong); color: var(--cz-ink);
15
+ border-radius: 8px; cursor: text; overflow-wrap: anywhere; }
16
+ button.ctp-t:hover { background: var(--cz-well); }
17
+ .ctp-ti { box-shadow: 0 0 0 1px var(--cz-hair) inset; background: var(--cz-card); }
18
+ .ctp-tools { display: flex; align-items: center; gap: 2px; flex: none; }
19
+ .ctp-ib { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 999px; background: none; color: var(--cz-ink2); cursor: pointer; }
20
+ .ctp-ib:hover { background: var(--cz-well); color: var(--cz-ink); }
21
+ .ctp-ib:disabled { opacity: .35; cursor: default; background: none; }
22
+ .ctp-ib:focus-visible, .ctp-kind:focus-visible, .ctp-t:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 1px; }
23
+ .ctp-when { margin: 10px 4px 4px; }
24
+ .ctp .ctp-held { box-shadow: 0 0 0 2px var(--cz-blue) inset; border-radius: 999px; }
25
+ .ctp-wh { margin: 0 0 2px; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-ink2); }
26
+ .ctp-none { margin: 8px 4px; color: var(--cz-ink2); }
27
+ .ctp-menu { position: absolute; z-index: 2; right: 30px; top: 34px; min-width: 190px; padding: 6px; display: grid; gap: 1px; border-radius: 12px; background: var(--cz-card);
28
+ box-shadow: 0 8px 28px rgba(42, 46, 53, .18), inset 0 0 0 1px var(--cz-hair); }
29
+ .ctp-menu button { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 7px 8px; border-radius: 7px; font: inherit; font-size: var(--fs-meta); color: var(--cz-ink); text-align: left; cursor: pointer; }
30
+ .ctp-menu button:hover, .ctp-menu button:focus-visible { background: var(--cz-well); outline: none; }
31
+ @media (max-width: 640px) {
32
+ .ctp { left: 0; right: 0; top: 0; bottom: 0; transform: none; width: auto; max-height: none; border-radius: 20px 20px 0 0; top: 24px; }
33
+ }
34
+ .ctp-when .sw { border-top: 0; margin-top: 0; padding-top: 0; }