create-pmos 0.412.0 → 0.414.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 (91) hide show
  1. package/package.json +25 -25
  2. package/payload/AGENTS.md +2 -2
  3. package/payload/KIT-VERSION +1 -1
  4. package/payload/mods/pmos-cockpit/README.md +1 -1
  5. package/payload/mods/pmos-cockpit/hooks/lib/guard.mjs +11 -5
  6. package/payload/planning/evals/eval-calibration.md +1 -1
  7. package/payload/planning/okrs/health-budgets.md +1 -1
  8. package/payload/scripts/pmos-log.sh +18 -4
  9. package/payload/state/discoveries.md +1 -1
  10. package/workspace/board-programs-test.js +2 -2
  11. package/workspace/briefing-premium-board-test.js +45 -9
  12. package/workspace/briefing-premium-test.js +3 -2
  13. package/workspace/changelog.json +24 -0
  14. package/workspace/core-docs-workflow-test.js +144 -0
  15. package/workspace/guide/programs.md +13 -0
  16. package/workspace/guide/workflows.md +15 -1
  17. package/workspace/home-other-product-test.js +18 -0
  18. package/workspace/lib/board-premium.js +8 -2
  19. package/workspace/lib/briefing-premium-agent.js +16 -4
  20. package/workspace/lib/core-docs.js +79 -14
  21. package/workspace/lib/engine/boards.js +20 -12
  22. package/workspace/lib/headless.js +10 -1
  23. package/workspace/lib/initiative-chat.js +50 -0
  24. package/workspace/lib/initiative-premium.js +17 -7
  25. package/workspace/lib/item-cli.js +7 -2
  26. package/workspace/lib/milestone-review.js +120 -0
  27. package/workspace/lib/milestone-suggest.js +176 -0
  28. package/workspace/lib/plan-items.js +1 -1
  29. package/workspace/lib/pmos-verbs.js +7 -1
  30. package/workspace/lib/program-chat.js +1 -1
  31. package/workspace/lib/program-cli.js +56 -0
  32. package/workspace/lib/programs.js +25 -6
  33. package/workspace/lib/routes-boards.js +77 -13
  34. package/workspace/lib/routes-briefing-premium.js +17 -1
  35. package/workspace/lib/routes-core-docs.js +3 -1
  36. package/workspace/lib/routes-programs.js +84 -7
  37. package/workspace/lib/task-cli.js +120 -0
  38. package/workspace/lib/workflow-chat.js +1 -0
  39. package/workspace/lib/workflow-cli.js +91 -6
  40. package/workspace/milestone-suggest-test.js +175 -0
  41. package/workspace/package-lock.json +2 -2
  42. package/workspace/package.json +1 -1
  43. package/workspace/premium-chat-line-test.js +12 -1
  44. package/workspace/premium-vw-item-test.js +3 -3
  45. package/workspace/premium-vw-jira-test.js +2 -1
  46. package/workspace/program-order-test.js +180 -0
  47. package/workspace/public/pm/bd-ini-model.js +81 -0
  48. package/workspace/public/pm/bd-ini-panel.js +123 -58
  49. package/workspace/public/pm/bd-prog-panel.js +54 -14
  50. package/workspace/public/pm/bd-prog.js +3 -3
  51. package/workspace/public/pm/cozy-home.css +5 -0
  52. package/workspace/public/pm/cozy-panel.css +2 -0
  53. package/workspace/public/pm/cozy-viewer.js +10 -3
  54. package/workspace/public/pm/cozy-xv.css +51 -16
  55. package/workspace/public/pm/cozy-xv.js +6 -5
  56. package/workspace/public/pm/goal-chat.js +1 -1
  57. package/workspace/public/pm/home-app.js +35 -19
  58. package/workspace/public/pm/home-ask.js +9 -3
  59. package/workspace/public/pm/home-chat.js +16 -2
  60. package/workspace/public/pm/home-ini-model.js +42 -29
  61. package/workspace/public/pm/home-ini.css +1 -0
  62. package/workspace/public/pm/home-ini.js +26 -34
  63. package/workspace/public/pm/home-list.js +14 -8
  64. package/workspace/public/pm/home-stage-card.js +3 -1
  65. package/workspace/public/pm/home-task.js +41 -65
  66. package/workspace/public/pm/home-today.js +11 -12
  67. package/workspace/public/pm/ms-suggest.css +50 -0
  68. package/workspace/public/pm/ms-suggest.js +98 -0
  69. package/workspace/public/pm/premium-board.js +13 -7
  70. package/workspace/public/pm/premium-initiative-head.js +32 -13
  71. package/workspace/public/pm/premium-viewer.js +1 -0
  72. package/workspace/public/pm/premium-vw-item-model.js +13 -7
  73. package/workspace/public/pm/premium-vw-item.js +49 -5
  74. package/workspace/public/pm/prog-order.css +47 -0
  75. package/workspace/public/pm/prog-order.js +188 -0
  76. package/workspace/public/pm/program-charter.js +47 -7
  77. package/workspace/public/pm/program-model.js +79 -1
  78. package/workspace/public/pm/task-card.css +108 -0
  79. package/workspace/public/pm/task-card.js +271 -0
  80. package/workspace/public/pm/wf-page.js +3 -0
  81. package/workspace/server.js +23 -1
  82. package/workspace/skills/milestone-review.skill +53 -0
  83. package/workspace/skills/workflow-setup.skill +14 -5
  84. package/workspace/stage-card-test.js +11 -0
  85. package/workspace/task-card-test.js +248 -0
  86. package/workspace/test-lists/bd-ini-panel.json +5 -0
  87. package/workspace/test-lists/core-documents-backend.json +15 -3
  88. package/workspace/test-lists/milestone-suggest.json +6 -0
  89. package/workspace/test-lists/program-order.json +6 -0
  90. package/workspace/test-lists/task-card.json +6 -0
  91. package/workspace/test-lists/workflow-stage.json +5 -0
@@ -0,0 +1,188 @@
1
+ /* pm/prog-order.js — the order of a program's initiatives (feedback batch 3 item 5, option A agreed 2026-10-25; canvas RoADrag, RoASuggest,
2
+ * RoAApplied, RoAPhone). One order per program, saved on the program (POST /api/programs/order, lib/programs.js `order` line); the Board, the
3
+ * program page and Home all list the initiatives in it (program-model.js inOrder).
4
+ *
5
+ * gripHtml(title) the drag grip of one row (shows on hover; the row lifts while it moves)
6
+ * sugHtml(p, st) ✦ in the program header: Claude's order from the dates. '' when the dates agree with the order (zero is silence);
7
+ * a blue dot while the PM has not said "not now" to these dates
8
+ * mount(o) once per page. o: { programs() GET /api/programs' list, stateOf(p) programState, saved(program) after a write (the page
9
+ * puts the program in its list and draws again), say(msg, undo) the page's toast, openIni(id, from) for Add dates }
10
+ *
11
+ * THE PAGE'S MARKUP: a container [data-po-list="<program id>"] holds the rows [data-po-id="<initiative id>"] of that program shown here (a product
12
+ * sub-list on a multi-product Board is its own container). The ✦ button is [data-po-sug="<program id>"].
13
+ * Desktop: drag by the grip. Phone: hold the row, then drag. Keyboard: Alt + ↑ or ↓ moves the focused row. Escape puts a lifted row back.
14
+ * Only the PM changes the order: every write is a page press. Claude suggests; ✓ applies it, Undo is in the toast, ✕ is "not now" until a
15
+ * date changes (remembered in this browser, pmos.order.notnow). */
16
+ import { pmPost } from './http.js';
17
+ import { fullOrder, moveTo, suggestOrder } from './program-model.js';
18
+
19
+ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
20
+ const SV = (d, w = 2) => `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${w}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"/></svg>`;
21
+ const GRIP = 'M9 6h.01M9 12h.01M9 18h.01M15 6h.01M15 12h.01M15 18h.01';
22
+ const SPARK = 'M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8zM18 15l.7 1.8 1.8.7-1.8.7L18 20l-.7-1.8-1.8-.7 1.8-.7z';
23
+ const X = 'M6 6l12 12M18 6L6 18', OK = 'M5 12l5 5 9-10', CAL = 'M4 6h16v14H4zM4 10h16M8 3v4M16 3v4M12 13v5M9.5 15.5h5';
24
+ const CSS = '/pm/prog-order.css';
25
+
26
+ /* ── "not now", per program, until a date changes ── */
27
+ const NN_KEY = 'pmos.order.notnow';
28
+ const notNow = () => { try { return JSON.parse(localStorage.getItem(NN_KEY) || '{}') || {}; } catch { return {}; } };
29
+ const setNotNow = (id, sig) => { const m = notNow(); m[id] = sig; try { localStorage.setItem(NN_KEY, JSON.stringify(m)); } catch { /* no storage: the dot comes back on reload */ } };
30
+
31
+ export const gripHtml = (title) => `<button type="button" class="po-grip" data-po-grip aria-label="Move ${esc(title)}. Drag, or press Alt and an arrow key" title="Drag to move">${SV(GRIP, 2.6)}</button>`;
32
+
33
+ export function sugHtml(p, st) {
34
+ const S = suggestOrder(st, p);
35
+ if (!S.differs) return '';
36
+ const dot = notNow()[p.id] !== S.sig;
37
+ return `<button type="button" class="po-sug" data-po-sug="${esc(p.id)}" aria-haspopup="dialog" aria-label="Claude suggests an order from the dates${dot ? '. The dates disagree with the order' : ''}" title="Claude suggests an order from the dates">${SV(SPARK, 1.8)}${dot ? '<span class="po-nd" aria-hidden="true"></span>' : ''}</button>`;
38
+ }
39
+
40
+ let O = null;
41
+ const progOf = (id) => ((O && O.programs()) || []).find((p) => p && p.id === id) || null;
42
+ const idsIn = (list) => [...list.querySelectorAll('[data-po-id]')].filter((r) => r.closest('[data-po-list]') === list).map((r) => r.dataset.poId);
43
+
44
+ /** Saves the order; o.saved draws it. Returns the answer ({ ok, was, program } or { ok: false, error }). */
45
+ async function save(p, order) {
46
+ const r = await pmPost('/api/programs/order', { program: p.id, order }).catch(() => null);
47
+ if (!r || !r.ok) { O.say((r && r.error) || 'The order was not saved.'); return r || { ok: false }; }
48
+ if (r.program) O.saved(r.program);
49
+ return r;
50
+ }
51
+ /** The whole order after one id moves before another of the ids shown in `list` (null: after the last one shown). */
52
+ function moved(p, list, id, before) {
53
+ const shown = idsIn(list), st = O.stateOf(p);
54
+ const all = fullOrder(p, [...new Set(((st && st.inis) || []).map((i) => i.id).concat(shown))], (x) => ((st && st.inis) || []).find((i) => i.id === x)?.title || x);
55
+ // "after the last one shown": before whatever follows it in the whole order, so a row not shown here keeps its place after it
56
+ const tgt = before != null ? before : (() => { const last = shown.filter((x) => x !== id).pop(); const k = all.indexOf(last); return k >= 0 && k + 1 < all.length ? all[k + 1] : null; })();
57
+ return { all, next: moveTo(all, id, tgt === id ? null : tgt) };
58
+ }
59
+ const same = (a, b) => a.length === b.length && a.every((x, i) => x === b[i]);
60
+
61
+ /* ── drag ── */
62
+ let D = null; // { row, list, p, id, y0, slot }
63
+ function slotAt(y) {
64
+ const rows = [...D.list.querySelectorAll('[data-po-id]')].filter((r) => r !== D.row && r.closest('[data-po-list]') === D.list);
65
+ for (const r of rows) { const b = r.getBoundingClientRect(); if (y < b.top + b.height / 2) return r; }
66
+ return null;
67
+ }
68
+ function mark(y) {
69
+ const t = slotAt(y);
70
+ D.before = t ? t.dataset.poId : null;
71
+ if (!D.slot) { D.slot = document.createElement('div'); D.slot.className = 'po-slot'; D.slot.setAttribute('aria-hidden', 'true'); }
72
+ if (t) t.before(D.slot); else { const rows = [...D.list.querySelectorAll('[data-po-id]')].filter((r) => r.closest('[data-po-list]') === D.list); const last = rows[rows.length - 1]; let end = last; while (end && end.nextElementSibling && !end.nextElementSibling.matches('[data-po-id]') && end.nextElementSibling.closest('[data-po-list]') === D.list && end.nextElementSibling.parentElement === last.parentElement) end = end.nextElementSibling; (end || last).after(D.slot); }
73
+ D.row.style.transform = `translateY(${Math.round(y - D.y0) - 6}px)`;
74
+ }
75
+ function start(row, y) {
76
+ const list = row.closest('[data-po-list]'), p = list && progOf(list.dataset.poList);
77
+ if (!p) return false;
78
+ D = { row, list, p, id: row.dataset.poId, y0: y, before: undefined, slot: null };
79
+ row.classList.add('po-lift'); list.classList.add('po-on'); document.body.classList.add('po-dragging');
80
+ mark(y);
81
+ return true;
82
+ }
83
+ async function finish(cancel) {
84
+ if (!D) return;
85
+ const d = D; D = null;
86
+ d.row.classList.remove('po-lift'); d.row.style.transform = ''; d.list.classList.remove('po-on'); document.body.classList.remove('po-dragging');
87
+ if (d.slot) d.slot.remove();
88
+ if (cancel || d.before === undefined) return;
89
+ const { all, next } = moved(d.p, d.list, d.id, d.before);
90
+ if (same(all, next)) return;
91
+ await save(d.p, next);
92
+ }
93
+
94
+ /* ── ✦: Claude's order from the dates ── */
95
+ let POP = null;
96
+ function closePop(focus) {
97
+ if (!POP) return;
98
+ const b = POP.btn; POP.el.remove(); POP = null;
99
+ if (focus && b && b.isConnected) b.focus();
100
+ }
101
+ function openPop(btn) {
102
+ const p = progOf(btn.dataset.poSug); if (!p) return;
103
+ closePop();
104
+ const st = O.stateOf(p), S = suggestOrder(st, p);
105
+ const el = document.createElement('div');
106
+ el.className = 'po-pop'; el.setAttribute('role', 'dialog'); el.setAttribute('aria-label', 'Suggested order');
107
+ el.innerHTML = `<h4><span class="po-sp">${SV(SPARK, 1.8)}</span>Order by dates</h4><p class="po-why">${esc(S.why)}</p>`
108
+ + S.rows.map((r) => `<div class="po-so${r.moved ? ' mv' : ''}${r.none ? ' nod' : ''}"><span class="n">${r.n}</span><b>${esc(r.title)}</b>`
109
+ + (r.none ? `<button type="button" class="po-adb" data-po-dates="${esc(r.id)}" aria-label="Add dates to ${esc(r.title)}" title="Add dates">${SV(CAL, 1.8)}</button>` : `<span class="dt">${esc(r.range)}</span>`)
110
+ + `<span class="r">${esc(r.reason)}</span></div>`).join('')
111
+ + `<div class="po-acts"><button type="button" class="po-ib soft" data-po-no aria-label="Not now. Claude asks again only when a date changes" title="Not now">${SV(X, 1.8)}</button>`
112
+ + `<button type="button" class="po-ib ok" data-po-use aria-label="Use this order" title="Use this order">${SV(OK, 2)}</button></div>`;
113
+ document.body.appendChild(el);
114
+ const b = btn.getBoundingClientRect(), w = Math.min(420, window.innerWidth - 24);
115
+ el.style.width = w + 'px';
116
+ el.style.left = Math.max(12, Math.min(window.innerWidth - w - 12, b.right - w)) + 'px';
117
+ el.style.top = Math.min(b.bottom + 8, Math.max(12, window.innerHeight - el.offsetHeight - 12)) + 'px';
118
+ POP = { el, btn, p, S };
119
+ el.querySelector('[data-po-use]').focus();
120
+ el.addEventListener('click', async (e) => {
121
+ if (e.target.closest('[data-po-no]')) { setNotNow(p.id, S.sig); const id = p.id; closePop(); O.saved(progOf(id) || p); return; }
122
+ const ad = e.target.closest('[data-po-dates]');
123
+ if (ad) { closePop(); if (O.openIni) O.openIni(ad.dataset.poDates, btn); return; }
124
+ if (e.target.closest('[data-po-use]')) {
125
+ const st2 = O.stateOf(p);
126
+ const all = fullOrder(p, ((st2 && st2.inis) || []).map((i) => i.id));
127
+ // the suggested ids first, then any initiative not read here, where it was
128
+ const next = S.ids.concat(all.filter((id) => !S.ids.includes(id)));
129
+ closePop();
130
+ const r = await save(p, next);
131
+ if (r && r.ok) O.say('Ordered by dates · Board, program page and Home', async () => { const u = await save(progOf(p.id) || p, r.was || []); return u; });
132
+ }
133
+ });
134
+ }
135
+
136
+ export function mount(o) {
137
+ O = o;
138
+ if (!document.querySelector(`link[href="${CSS}"]`)) { const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = CSS; document.head.appendChild(l); }
139
+ if (mount.on) return;
140
+ mount.on = true;
141
+ let hold = null; // a phone's hold: { row, x, y, t }
142
+ document.addEventListener('pointerdown', (e) => {
143
+ if (e.button !== 0) return;
144
+ const g = e.target.closest('[data-po-grip]');
145
+ if (g && e.pointerType !== 'touch') { const row = g.closest('[data-po-id]'); if (row && start(row, e.clientY)) { e.preventDefault(); g.setPointerCapture && g.setPointerCapture(e.pointerId); } return; }
146
+ if (e.pointerType === 'touch') {
147
+ const row = e.target.closest('[data-po-id]');
148
+ if (!row || !row.closest('[data-po-list]')) return;
149
+ hold = { row, x: e.clientX, y: e.clientY, t: setTimeout(() => { if (hold && start(hold.row, hold.y)) { hold.on = true; if (navigator.vibrate) navigator.vibrate(10); } }, 420) };
150
+ }
151
+ });
152
+ document.addEventListener('pointermove', (e) => {
153
+ if (hold && !hold.on && Math.hypot(e.clientX - hold.x, e.clientY - hold.y) > 8) { clearTimeout(hold.t); hold = null; }
154
+ if (D) mark(e.clientY);
155
+ });
156
+ // a touch that lifted a row drags it, not the page
157
+ document.addEventListener('touchmove', (e) => { if (D) e.preventDefault(); }, { passive: false });
158
+ const up = () => {
159
+ if (hold) { if (hold.on) { document.body.dataset.poJust = '1'; setTimeout(() => { delete document.body.dataset.poJust; }, 400); } clearTimeout(hold.t); hold = null; }
160
+ if (D) finish(false);
161
+ };
162
+ document.addEventListener('pointerup', up);
163
+ document.addEventListener('pointercancel', () => { if (hold) { clearTimeout(hold.t); hold = null; } if (D) finish(true); });
164
+ // the press that ends a hold-drag is not a tap on the row
165
+ document.addEventListener('click', (e) => { if (document.body.dataset.poJust) { delete document.body.dataset.poJust; e.preventDefault(); e.stopPropagation(); } }, true);
166
+ document.addEventListener('contextmenu', (e) => { if (D || (hold && hold.on)) e.preventDefault(); });
167
+ document.addEventListener('keydown', async (e) => {
168
+ if (e.key === 'Escape') { if (D) { e.stopPropagation(); finish(true); return; } if (POP) { e.stopPropagation(); closePop(true); return; } }
169
+ if (!e.altKey || (e.key !== 'ArrowUp' && e.key !== 'ArrowDown')) return;
170
+ const row = e.target.closest && e.target.closest('[data-po-id]'), list = row && row.closest('[data-po-list]'), p = list && progOf(list.dataset.poList);
171
+ if (!p) return;
172
+ e.preventDefault();
173
+ const shown = idsIn(list), k = shown.indexOf(row.dataset.poId), to = e.key === 'ArrowUp' ? k - 1 : k + 1;
174
+ if (k < 0 || to < 0 || to >= shown.length) return;
175
+ const { all, next } = moved(p, list, row.dataset.poId, e.key === 'ArrowUp' ? shown[to] : shown[to + 1] ?? null);
176
+ if (same(all, next)) return;
177
+ const id = row.dataset.poId, grip = !!e.target.closest('[data-po-grip]');
178
+ const r = await save(p, next);
179
+ // the focus stays on the row that moved, in its new place
180
+ if (r && r.ok) { const n = document.querySelector(`[data-po-list="${CSS_ESC(p.id)}"] [data-po-id="${CSS_ESC(id)}"]`); const f = n && (grip ? n.querySelector('[data-po-grip]') : n.querySelector('button:not([data-po-grip])')); if (f) f.focus(); }
181
+ });
182
+ document.addEventListener('click', (e) => {
183
+ const s = e.target.closest('[data-po-sug]');
184
+ if (s) { e.preventDefault(); e.stopPropagation(); if (POP && POP.btn === s) closePop(); else openPop(s); return; }
185
+ if (POP && !e.target.closest('.po-pop')) closePop();
186
+ });
187
+ }
188
+ const CSS_ESC = (s) => (window.CSS && window.CSS.escape ? window.CSS.escape(s) : String(s).replace(/"/g, '\\"'));
@@ -3,7 +3,10 @@
3
3
  *
4
4
  * openCharter(o) opens the charter in the Viewer as a drill-in of the program (← comes back to it). o: { VW, pmPost, p the program of
5
5
  * GET /api/programs, st its programState, rename the Viewer's rename option for the program, nameOf(id) an initiative's
6
- * title from any board read, at 'milestones' to open there, reload() reads the programs again, say(msg) the toast }
6
+ * title from any board read, at 'milestones' to open there, reload() reads the programs again, say(msg) the toast,
7
+ * suggest? one of Claude's suggestions (pm/ms-suggest.js), filled in as an unsaved change: Save keeps it, as the PM changed it
8
+ * (POST /api/programs/suggestion edit); Discard leaves it waiting, review() → the program's review { checked, running },
9
+ * checkNow() → Promise<bool> asks Claude to check now (canvas XmsgB, last frame) }
7
10
  * The pure parts, for program-charter.test.mjs:
8
11
  * draftOf(p, st) the form's state from the record: { title, goal, owner, why, start, target, jira, ms: [row] }
9
12
  * changesOf(a, b) what differs, in words: ["Pilot live moved to Nov 25", "Support ready deleted", "the goal"]
@@ -50,7 +53,7 @@ export function draftOf(p, st) {
50
53
  const S = new Map(((st && st.milestones) || []).map((m) => [m.id, m]));
51
54
  const ms = ((p && p.milestones) || []).map((m) => {
52
55
  const waits = (m.waits || []).slice(), check = !waits.length, s = S.get(m.id);
53
- return { id: m.id, name: m.name || '', date: m.date || '', waits, stages: { ...(m.stages || {}) }, check, done: check ? m.done === true : false, fixed: !check && !!(s && s.done) };
56
+ return { id: m.id, name: m.name || '', date: m.date || '', waits, stages: { ...(m.stages || {}) }, check, done: check ? m.done === true : false, fixed: !check && !!(s && s.done), risk: m.risk || '' };
54
57
  });
55
58
  return { title: (p && p.title) || '', goal: (p && p.goal) || '', owner: (p && p.owner) || '', why: (p && p.why) || '', start: (p && p.start) || '', target: (p && p.target) || '', jira: (p && p.jira) || '', ms };
56
59
  }
@@ -69,6 +72,7 @@ export function changesOf(a, b) {
69
72
  if (!same(o.waits, m.waits) || o.check !== m.check) out.push(name + (m.check ? ' is ticked by you' : ' waits on other initiatives'));
70
73
  else if (!m.check && !same(picks(o), picks(m))) out.push(name + ' waits on another ◆ stage');
71
74
  if (o.check && m.check && o.done !== m.done) out.push(name + (m.done ? ' done' : ' open again'));
75
+ if ((o.risk || '') !== (m.risk || '')) out.push(name + (m.risk ? ' at risk' : ' no longer at risk'));
72
76
  }
73
77
  for (const o of a.ms) if (!b.ms.some((m) => m.id === o.id)) out.push(o.name + ' deleted');
74
78
  for (const [k, w] of FIELDS) if ((a[k] || '') !== (b[k] || '')) out.push(w);
@@ -117,7 +121,7 @@ export function charterOut(id, D) {
117
121
  let mid = m.id;
118
122
  if (m.isNew || !ID_RE.test(mid)) { const base = slug(m.name) || 'milestone'; mid = base; for (let n = 2; taken.has(mid); n++) mid = base + '-' + n; taken.add(mid); }
119
123
  const st = m.check ? {} : picks(m);
120
- return { id: mid, name: String(m.name).replace(/\s+/g, ' ').trim(), date: m.date || '', waits: m.check ? [] : m.waits.slice(), ...(Object.keys(st).length ? { stages: st } : {}), ...(m.check ? { done: !!m.done } : {}) };
124
+ return { id: mid, name: String(m.name).replace(/\s+/g, ' ').trim(), date: m.date || '', waits: m.check ? [] : m.waits.slice(), ...(Object.keys(st).length ? { stages: st } : {}), ...(m.check ? { done: !!m.done } : {}), ...(m.risk ? { risk: m.risk } : {}) };
121
125
  });
122
126
  return { id, title: D.title, owner: D.owner.trim(), goal: D.goal.trim(), why: D.why.trim(), start: D.start || '', target: D.target || '', jira: D.jira.trim(), milestones: ms };
123
127
  }
@@ -192,12 +196,15 @@ function rowHtml(m, P) {
192
196
  ? `<button type="button" class="pc-ib" data-pc="keep" data-m="${esc(m.id)}" aria-label="${esc('Keep ' + (m.name || 'this draft'))}" title="Keep">${SV(I.check, 16, 2)}</button><button type="button" class="pc-ib" data-pc="drop" data-m="${esc(m.id)}" aria-label="${esc('Drop ' + (m.name || 'this draft'))}" title="Drop">${SV(I.x, 16)}</button>`
193
197
  : `<button type="button" class="pc-ib del" data-pc="del" data-m="${esc(m.id)}" aria-label="${esc('Delete ' + (m.name || 'this milestone'))}" title="Delete">${SV(I.del, 15)}</button>`;
194
198
  const late = !gone.length && lateOf(m, C.st.inis);
199
+ // Claude's change, filled in from the pencil (canvas XmsgB): what it was, and what Save does
200
+ const chg = m.sug ? `<p class="msg-chg">${SV(I.spark, 13)}<span>Claude's change${m.was ? ', was ' + esc(m.was) : ''}, ready to save. Edit it, then Save.</span></p>` : '';
201
+ const risk = m.risk && !m.done && !m.fixed ? `<p class="msg-risk"><i class="pc-wdot" aria-hidden="true"></i><span>At risk: ${esc(m.risk)}</span><button type="button" class="pc-ib" data-pc="unrisk" data-m="${esc(m.id)}" aria-label="${esc('No longer at risk: ' + (m.name || 'this milestone'))}" title="No longer at risk">${SV(I.x, 14)}</button></p>` : '';
195
202
  const warn = gone.length ? `${esc(C.o.nameOf(gone[0].ini) || gone[0].ini)} left the program. Pick another initiative, or tick it yourself.`
196
203
  : late ? `${esc(late.title)} is set to ${late.label === 'Deliver' ? 'deliver' : 'pass ' + esc(late.label)} on ${esc(shortDay(late.date))}, after this date.` : '';
197
- return `<div class="pc-lnw${C.pick === m.id ? ' open' : ''}" role="listitem"><div class="pc-ln${m.draft ? ' sug' : ''}${m.done || m.fixed ? ' dn2' : ''}" data-m="${esc(m.id)}">${mark}`
204
+ return `<div class="pc-lnw${C.pick === m.id ? ' open' : ''}${m.sug ? ' msg-on' : ''}" role="listitem"><div class="pc-ln${m.draft ? ' sug' : ''}${m.done || m.fixed ? ' dn2' : ''}" data-m="${esc(m.id)}">${mark}`
198
205
  + `<input class="pc-fi${nameless ? ' bad' : ''}" data-f="name" data-m="${esc(m.id)}" maxlength="80" value="${esc(m.name)}" placeholder="${nameless ? 'Name it or delete it' : 'Name the milestone'}" aria-label="Milestone name" autocomplete="off">`
199
206
  + date + when + `<span class="pc-ends">${ends}</span></div>`
200
- + (warn ? `<p class="pc-warn"><i aria-hidden="true"></i>${warn}</p>` : '')
207
+ + (warn ? `<p class="pc-warn"><i aria-hidden="true"></i>${warn}</p>` : '') + risk + chg
201
208
  + (C.pick === m.id && !isPhone() ? pickHtml(m) : '') + (isPhone() && C.pick === m.id ? pickHtml(m) : '') + `</div>`;
202
209
  }
203
210
  function msHtml(D, P) {
@@ -214,7 +221,24 @@ function msHtml(D, P) {
214
221
  }
215
222
  h += open.map((m) => rowHtml(m, P)).join('');
216
223
  if (!full) h += `<button type="button" class="pc-ln addl" data-pc="add">${SV(I.plus, 15, 2)}Add a milestone</button>`;
217
- return `<section class="pc-ms" id="pcMs" aria-label="Milestones"><div class="pc-lbl">Milestones${lim}</div><div class="pc-ml" role="list">${h}</div></section>`;
224
+ return `<section class="pc-ms" id="pcMs" aria-label="Milestones"><div class="pc-lbl">Milestones${lim}</div>${checkedHtml()}${C.dropped ? `<p class="msg-chg">${SV(I.spark, 13)}<span>Claude's change: ${esc(C.dropped)} is dropped. Save to keep the change, or Discard.</span></p>` : ''}<div class="pc-ml" role="list">${h}</div></section>`;
225
+ }
226
+ /** When Claude last checked the milestones, and Check now (canvas XmsgB): the line lives here, so the PM can see the checks run. */
227
+ function checkedHtml() {
228
+ if (!C.o.review) return '';
229
+ const R = C.o.review() || {}, run = !!(R.running || C.checking);
230
+ const when = R.checked ? lastWhen(R.checked) : '';
231
+ const line = run ? 'Claude is checking the milestones now.' : 'Claude checks every Monday and when a date, Jira or a meeting changes.' + (when ? ' Last checked ' + when + '.' : '');
232
+ return `<div class="msg-chk">${SV('M12 7v5l3 2M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0', 14)}<span>${esc(line)}</span>${C.o.checkNow ? `<button type="button" class="msg-ib${run ? ' on' : ''}" data-pc="checknow" aria-label="Check now" title="Check now"${run ? ' disabled' : ''}>${SV('M20 11a8 8 0 1 0-2.3 5.7M20 4v7h-7', 15)}</button>` : ''}</div>`;
233
+ }
234
+ /** "today, 09:12", "yesterday, 17:40" or "Oct 21". */
235
+ function lastWhen(iso) {
236
+ const d = new Date(iso); if (Number.isNaN(d.getTime())) return '';
237
+ const t = new Date(); t.setHours(0, 0, 0, 0);
238
+ const day = new Date(d); day.setHours(0, 0, 0, 0);
239
+ const hm = String(d.getHours()).padStart(2, '0') + ':' + String(d.getMinutes()).padStart(2, '0');
240
+ const n = Math.round((t - day) / 86400000);
241
+ return n === 0 ? 'today, ' + hm : n === 1 ? 'yesterday, ' + hm : MON[d.getMonth()] + ' ' + d.getDate();
218
242
  }
219
243
  function askHtml() {
220
244
  const L = changesOf(C.orig, C.D), P = problemsOf(C.D, C.p.members);
@@ -266,6 +290,8 @@ async function save() {
266
290
  C.D = draftOf(C.p, C.st);
267
291
  C.orig = JSON.parse(JSON.stringify(C.D));
268
292
  C.o.say('Charter saved.');
293
+ // a change of Claude's the PM saved from here: it no longer waits (canvas XmsgB, the pencil)
294
+ if (C.sugKey) { const k = C.sugKey; C.sugKey = null; C.dropped = ''; await C.o.pmPost('/api/programs/suggestion', { program: p.id, key: k, answer: 'edit' }).catch(() => null); }
269
295
  if (C.o.reload) await C.o.reload();
270
296
  draw();
271
297
  return true;
@@ -282,6 +308,8 @@ function act(b) {
282
308
  }
283
309
  else if (a === 'tick' && m) { m.check = true; m.waits = []; }
284
310
  else if (a === 'reopen' && m) m.done = false;
311
+ else if (a === 'unrisk' && m) m.risk = '';
312
+ else if (a === 'checknow' && C.o.checkNow && !C.checking) { C.checking = true; draw(); const c = C; C.o.checkNow().then(() => { if (C === c) { C.checking = false; draw(); } }); return; }
285
313
  else if (a === 'del' && m) C.D.ms = C.D.ms.filter((x) => x !== m);
286
314
  else if (a === 'drop' && m) C.D.ms = C.D.ms.filter((x) => x !== m);
287
315
  else if (a === 'keep' && m) m.draft = false;
@@ -290,7 +318,7 @@ function act(b) {
290
318
  else if (a === 'fold') C.fold = !C.fold;
291
319
  else if (a === 'add' && C.D.ms.length < MAX) { const n = { id: newId(), name: '', date: '', waits: [], check: true, done: false, isNew: true }; C.D.ms.push(n); draw(); const i = C.o.VW.body().querySelector(`[data-f="name"][data-m="${n.id}"]`); if (i) i.focus(); return; }
292
320
  else if (a === 'asksave') { const go = C.ask; C.ask = null; save().then((ok) => { if (ok && go) go(); else draw(); }); return; }
293
- else if (a === 'discard') { const go = C.ask; C.ask = null; C.D = JSON.parse(JSON.stringify(C.orig)); if (go) go(); return; }
321
+ else if (a === 'discard') { const go = C.ask; C.ask = null; C.D = JSON.parse(JSON.stringify(C.orig)); C.sugKey = null; C.dropped = ''; if (go) go(); return; }
294
322
  draw();
295
323
  }
296
324
  function onInput(e) {
@@ -307,6 +335,7 @@ export function openCharter(o) {
307
335
  const before = typeof window !== 'undefined' ? window : null;
308
336
  C = { o, p, st: o.st, D: null, orig: null, fold: true, pick: null, ask: null, busy: false };
309
337
  C.D = draftOf(p, o.st); C.orig = JSON.parse(JSON.stringify(C.D));
338
+ if (o.suggest) fillIn(o.suggest);
310
339
  const unload = (e) => { if (dirty()) { e.preventDefault(); e.returnValue = ''; } };
311
340
  o.VW.open({ kind: 'Charter', title: o.title || p.title, sub: 'Charter', icon: 'doc', id: 'charter:' + p.id, back: true, rename: o.rename,
312
341
  onPress: (a) => { if (a === 'save') save(); },
@@ -329,5 +358,16 @@ export function openCharter(o) {
329
358
  },
330
359
  onClose: () => { if (before) before.removeEventListener('beforeunload', unload); C = null; } });
331
360
  }
361
+ /** One of Claude's suggestions, made in the form as an unsaved change (the pencil, canvas XmsgB): Save shows at once, Discard leaves it waiting. */
362
+ function fillIn(i) {
363
+ const m = i.milestone ? rowOf(i.milestone) : null;
364
+ C.sugKey = i.key;
365
+ if (i.op === 'add') { C.D.ms.push({ id: newId(), name: i.name, date: i.date, waits: (i.waits || []).slice(), stages: {}, check: !(i.waits || []).length, done: false, isNew: true, sug: i.why }); return; }
366
+ if (!m) { C.sugKey = null; return; }
367
+ if (i.op === 'move') { m.was = shortDay(m.date); m.date = i.date; m.sug = i.why; }
368
+ else if (i.op === 'rename') { m.was = m.name; m.name = i.name; m.sug = i.why; }
369
+ else if (i.op === 'risk') { m.risk = i.why; m.sug = i.why; }
370
+ else if (i.op === 'drop') { C.dropped = m.name; C.D.ms = C.D.ms.filter((x) => x !== m); }
371
+ }
332
372
  /** The charter's form, when the program it shows is renamed from its header: the name changes in the form too, and stays saved. */
333
373
  export function renamed(id, title) { if (C && C.p.id === id) { C.p = { ...C.p, title }; C.D.title = title; C.orig.title = title; } }
@@ -9,6 +9,9 @@
9
9
  * mergeClose(milestones, days) [{ first, n, items, label, range }] milestones within `days` of the first merge into one counted diamond (PgTimeline)
10
10
  * goalsByPeriod(st, krsOf, now) { current, periods, earlier } the program's goals from its initiatives' KR anchors, per year half (PgProgram)
11
11
  * groupRows(rows, programs, o) [group] programs first, then one group per product (Home, Board, Kanban, Timeline, List)
12
+ * inOrder(list, p, idOf) list sorted by the program's order the PM's sequence first, then the rest A to Z (canvas RoADrag)
13
+ * fullOrder(p, ids) · moveTo(order, id, before) the whole sequence of the ids, and one id moved before another
14
+ * suggestOrder(st, p) { ids, rows, why, differs, sig } Claude's order from the dates (canvas RoASuggest)
12
15
  *
13
16
  * p is one program of GET /api/programs (lib/programs.js merge): { id, title, home, owner, goal, target, milestones, members: [{ ws, initiative }], tasks }.
14
17
  * rowsOf(ws) answers { name, rows } for a product: its name and its initiatives' rows (the Board model's rows, each with id, title, stage).
@@ -75,6 +78,9 @@ export function programState(p, rowsOf, now = Date.now()) {
75
78
  if (product && !products.includes(product)) products.push(product);
76
79
  inis.push({ ws: m.ws, id: row.id, title: row.title || row.id, stage: row.stage || '', at: at(row.stage), product, row });
77
80
  }
81
+ // the program page lists them in the program's order (option A): the one order the Board and Home use too
82
+ const sortedInis = inOrder(inis, p);
83
+ inis.splice(0, inis.length, ...sortedInis);
78
84
  const idx = inis.map((i) => i.at).filter((i) => i >= 0);
79
85
  const lo = idx.length ? Math.min(...idx) : -1, hi = idx.length ? Math.max(...idx) : -1;
80
86
  // D99: an initiative on another workflow counts by its own place: past its first stage, and in a Done stage
@@ -95,7 +101,7 @@ export function programState(p, rowsOf, now = Date.now()) {
95
101
  // the ◆ stage it waits on, named once when every initiative waits on the same one ("reaching Deliver")
96
102
  const names = [...new Set(waits.map((i) => { const x = i.row && i.row.wfStages ? milestoneStageOf(i.row, m) : null; return x ? x.name : 'Deliver'; }))];
97
103
  return { id: m.id, name: m.name, date: m.date || '', day: shortDay(m.date), reach: names.length === 1 ? names[0] : '', waits: waits.map((i) => i.id), titles: waits.map((i) => i.title), n: waits.length, ready,
98
- check, done, late: !!(d && d < today && !done) };
104
+ check, done, late: !!(d && d < today && !done), risk: done ? '' : String(m.risk || '') };
99
105
  });
100
106
  const next = milestones.filter((m) => !m.done).sort((a, b) => String(a.date || '9999').localeCompare(String(b.date || '9999')))[0] || null;
101
107
  const tasks = ((p && p.tasks) || []);
@@ -229,7 +235,79 @@ export function groupRows(rows, programs, o = {}) {
229
235
  sub.rows.push(r); g.rows.push(r);
230
236
  inProg.set(p.id, g);
231
237
  }
238
+ // inside a program, its rows follow the program's order (A to Z while it has none); once the PM ordered it, the product sub-rows follow the
239
+ // first row of each in that order, else they keep the order the products first appear in
240
+ for (const g of inProg.values()) {
241
+ for (const sub of g.products) sub.rows = inOrder(sub.rows, g.program);
242
+ if ((g.program.order || []).length) g.products.sort((a, b) => inOrder(g.rows, g.program).indexOf(a.rows[0]) - inOrder(g.rows, g.program).indexOf(b.rows[0]));
243
+ g.rows = g.products.flatMap((sub) => sub.rows);
244
+ }
232
245
  const empty = (p) => !!o.keepEmpty && o.keepEmpty(p);
233
246
  const progs = live.map((p) => inProg.get(p.id) || (empty(p) ? { kind: 'program', key: 'g:' + p.id, program: p, products: [], rows: [] } : null)).filter(Boolean);
234
247
  return progs.concat(prods.map((name) => ({ kind: 'product', key: 'p:' + name, name, rows: prodRows.get(name) })));
235
248
  }
249
+
250
+ /* ── the order (option A, agreed 2026-10-25; canvas RoADrag, RoASuggest, RoAApplied, RoAPhone) ── */
251
+ /* One order per program, saved on the program (lib/programs.js `order` line). It is the planned sequence the work happens in, not a dependency:
252
+ * nothing blocks on it. An initiative the order does not name (one that joined later, or a program never ordered) follows the named ones, A to Z,
253
+ * so a program the PM never ordered reads A to Z. Milestones keep their date order: this is only the initiatives. */
254
+ const titleOfRow = (x) => String((x && (x.title || x.name || (x.r && (x.r.name || x.r.title)) || x.id)) || '');
255
+ /** list sorted by p.order. idOf(x) is the initiative id of an entry (default x.id). */
256
+ export function inOrder(list, p, idOf = (x) => x && x.id) {
257
+ const order = (p && Array.isArray(p.order) && p.order) || [];
258
+ const rank = (x) => { const i = order.indexOf(String(idOf(x) || '')); return i < 0 ? Infinity : i; };
259
+ return (list || []).slice().sort((a, b) => { const ra = rank(a), rb = rank(b); return ra !== rb ? (ra < rb ? -1 : 1) : titleOfRow(a).localeCompare(titleOfRow(b)); });
260
+ }
261
+ /** The whole sequence: ids is every initiative id to place (ids the order names that are not in ids stay where they are, so an initiative not read
262
+ * here keeps its place). Returns [id]. */
263
+ export function fullOrder(p, ids, titleOf) {
264
+ const order = (p && Array.isArray(p.order) && p.order) || [];
265
+ const t = titleOf || ((id) => id);
266
+ const rest = (ids || []).filter((id) => !order.includes(id)).sort((a, b) => String(t(a)).localeCompare(String(t(b))));
267
+ return order.concat(rest.filter((id, i) => rest.indexOf(id) === i));
268
+ }
269
+ /** order with id moved before `before` (null: to the end). Pure. */
270
+ export function moveTo(order, id, before) {
271
+ const out = (order || []).filter((x) => x !== id);
272
+ const i = before == null ? -1 : out.indexOf(before);
273
+ out.splice(i < 0 ? out.length : i, 0, id);
274
+ return out;
275
+ }
276
+
277
+ /** The dates an initiative row says: its start, its planned finish (end) and the ◆ program milestones that wait on it. */
278
+ function datesOf(i, p) {
279
+ const r = (i && i.row) || i || {};
280
+ const ms = ((p && p.milestones) || []).filter((m) => m && dayOf(m.date) && (m.waits || []).includes(i.id)).sort(byDate);
281
+ return { start: dayOf(r.start) ? String(r.start).slice(0, 10) : '', end: dayOf(r.end) ? String(r.end).slice(0, 10) : '', ms: ms[0] || null };
282
+ }
283
+ /** Claude's order from the dates (canvas RoASuggest). st is programState (st.inis in the current order), p the program.
284
+ * An initiative sorts by its start; with no start, by its first ◆ milestone date; with neither, by its planned finish; ties by the finish, then A
285
+ * to Z. A row with no date at all goes last and says so (it offers Add dates). Each row carries the reason it sits where it does.
286
+ * → { ids, rows: [{ id, title, n, range, reason, moved, none }], why, differs, sig }. differs is false when the dates agree with the order, or
287
+ * when no initiative has a date: then ✦ shows nothing (zero is silence). sig changes only when a date changes: "not now" holds until it does. */
288
+ export function suggestOrder(st, p) {
289
+ const inis = (st && st.inis) || [];
290
+ const rows = inis.map((i) => { const d = datesOf(i, p); return { i, d, key: d.start || (d.ms && d.ms.date) || d.end || '' }; });
291
+ const dated = rows.filter((x) => x.key), none = rows.filter((x) => !x.key);
292
+ dated.sort((a, b) => a.key.localeCompare(b.key) || String(a.d.end || '9999').localeCompare(String(b.d.end || '9999')) || a.i.title.localeCompare(b.i.title));
293
+ const seq = dated.concat(none);
294
+ const now = inis.map((i) => i.id), ids = seq.map((x) => x.i.id);
295
+ const differs = dated.length > 0 && ids.some((id, k) => id !== now[k]);
296
+ const out = seq.map((x, k) => {
297
+ const { d } = x, prev = k ? seq[k - 1].i.title : '';
298
+ const range = d.start && d.end ? shortDay(d.start) + ' – ' + shortDay(d.end) : d.start ? 'from ' + shortDay(d.start) : d.end ? 'to ' + shortDay(d.end) : d.ms ? '◆ ' + shortDay(d.ms.date) : '';
299
+ let reason;
300
+ if (!x.key) reason = 'No dates yet, so it goes last. Add dates and Claude checks again.';
301
+ else if (d.start) reason = k === 0 ? 'Starts first, on ' + shortDay(d.start) + '.' : seq[k - 1].d.start === d.start ? 'Starts the same day as ' + prev + ' and finishes later.' : 'Starts ' + shortDay(d.start) + ', after ' + prev + '.';
302
+ else if (d.ms) reason = 'No start date. Its ◆ ' + d.ms.name + ' is ' + shortDay(d.ms.date) + '.';
303
+ else reason = 'No start date. It finishes ' + shortDay(d.end) + '.';
304
+ return { id: x.i.id, title: x.i.title, n: k + 1, range, reason, moved: now[k] !== x.i.id, none: !x.key };
305
+ });
306
+ const set = p && Array.isArray(p.order) && p.order.length;
307
+ const why = (set ? 'Today the order is yours.' : 'Today the list is A to Z.') + (out.length > 1 ? ' By the dates, ' + out[0].title + ' comes first and ' + out[out.length - 1].title + ' last.' : '');
308
+ const sig = rows.map((x) => x.i.id + '=' + x.d.start + '/' + x.d.end + '/' + ((x.d.ms && x.d.ms.date) || '')).sort().join('|');
309
+ return { ids, rows: out, why, differs, sig };
310
+ }
311
+ /** Whether the initiative's workflow reaches Jira: Product feature does, and so does another workflow with a Build stage. A Tender or a
312
+ * migration that never goes to Jira says nothing about Jira epics (zero is silence; Wawan, 2026-10-25). */
313
+ export const toJira = (r) => !r.wf || !r.wf.id || r.wf.id === 'product-feature' || (r.wfStages || []).some((x) => x && (x.key === 'build' || /\bbuild\b/i.test(x.name || '')));
@@ -0,0 +1,108 @@
1
+ /* pm/task-card.css — one task, edited where it opens (task-card.js; canvas XetX1Rest, XetX1Dates, XetX1Done, XetX1Jira, XetX1Phone).
2
+ * Over cozy.css's tokens, so the dark theme follows. The card: the five status buttons and the due line; chips for owner and group; notes and
3
+ * the initiative in place. Popovers open right under the control that opened them. */
4
+ .tkc { display: flex; flex-direction: column; gap: 16px; padding: 6px 2px 18px; font-size: 14px; color: var(--cz-ink); }
5
+ .tkc button { font: inherit; color: inherit; background: transparent; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left; }
6
+ .tkc button:disabled { cursor: default; }
7
+ .tkc svg { flex: none; }
8
+ .tkc .anc { position: relative; display: inline-flex; }
9
+
10
+ /* the card: status and due */
11
+ .tkc .acc { background: var(--cz-well); border-radius: 20px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
12
+ .tkc .seg { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
13
+ .tkc .seg button { width: 40px; height: 40px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--cz-card); color: var(--cz-ink3); }
14
+ .tkc .seg button:hover { color: var(--cz-ink); }
15
+ .tkc .seg button.on { width: auto; padding: 0 14px 0 12px; background: var(--cz-bluebg); color: var(--cz-blueink); font-weight: 800; font-size: 13.5px; box-shadow: inset 0 0 0 1.5px var(--cz-blue); }
16
+ .tkc .seg button.on.i-done { background: var(--cz-okbg); color: var(--cz-ok); box-shadow: inset 0 0 0 1.5px var(--cz-ok); }
17
+ .tkc .seg button.on.i-wont, .tkc .seg button.on.i-arch { background: var(--cz-well2); color: var(--cz-ink2); box-shadow: inset 0 0 0 1.5px var(--cz-hair); }
18
+ .tkc .duel { display: flex; align-items: center; gap: 8px; }
19
+ .tkc .due-b { height: 34px; padding: 0 12px 0 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; color: var(--cz-risk); }
20
+ .tkc .due-b:hover, .tkc .due-b.open { background: var(--cz-riskbg); }
21
+ .tkc .due-b.ok { color: var(--cz-ink2); }
22
+ .tkc .due-b.ok:hover, .tkc .due-b.ok.open, .tkc .due-b.none:hover, .tkc .due-b.none.open { background: var(--cz-well2); }
23
+ .tkc .due-b.none { width: 34px; padding: 0; justify-content: center; color: var(--cz-ink3); }
24
+ .tkc .due-b.open { box-shadow: 0 0 0 1.5px var(--cz-blue); }
25
+ .tkc .acc .r { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--cz-ink3); }
26
+ .tkc .acc .r.late { color: var(--cz-risk); }
27
+ /* a Jira ticket: plain text, no hover; the key and how fresh the read is */
28
+ .tkc .rost { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--cz-blueink); padding: 4px; cursor: default; }
29
+ .tkc .jl { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--cz-ink3); font-weight: 600; padding: 0 4px; }
30
+ .tkc .jl .jt { width: 18px; height: 18px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; background: var(--cz-bluebg); color: var(--cz-blueink); font-size: 10px; font-weight: 800; }
31
+ .tkc .jl .jk { font-weight: 700; color: var(--cz-blueink); }
32
+ .tkc .jl .jk:hover { text-decoration: underline; }
33
+
34
+ /* chips: owner and group */
35
+ .tkc .chips { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 44px; }
36
+ .tkc .chip { height: 34px; padding: 0 12px 0 10px; border-radius: 999px; background: var(--cz-well); display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: var(--cz-ink2); white-space: nowrap; }
37
+ .tkc .chip:hover, .tkc .chip.open { background: var(--cz-well2); }
38
+ .tkc .chip.open { box-shadow: 0 0 0 1.5px var(--cz-blue); }
39
+ .tkc .chip.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--cz-hair); color: var(--cz-ink3); width: 34px; padding: 0; justify-content: center; }
40
+ .tkc .chip.ro { background: transparent; padding: 0 6px; cursor: default; }
41
+ .tkc .av2 { width: 22px; height: 22px; border-radius: 50%; background: var(--cz-bluebg); color: var(--cz-blueink); font-size: 10.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
42
+ .tkc .av2.j { background: var(--cz-riskbg); color: var(--cz-risk); }
43
+ .tkc .av2.no { background: transparent; border: 1.5px dashed var(--cz-ink3); }
44
+
45
+ /* notes, edited in place */
46
+ .tkc .nt { margin-left: 44px; border: 0; outline: 0; resize: none; field-sizing: content; min-height: 80px; border-radius: 16px; padding: 10px 12px; font: inherit; font-size: 14.5px; line-height: 1.55; color: var(--cz-ink); background: transparent; }
47
+ .tkc .nt::placeholder { color: var(--cz-ink3); }
48
+ .tkc .nt:hover { background: var(--cz-well); }
49
+ .tkc .nt:focus { background: var(--cz-card); box-shadow: 0 0 0 1.5px var(--cz-blue), 0 0 0 5px var(--cz-bluebg); }
50
+
51
+ /* the initiative, with the move icon */
52
+ .tkc .tk-ini { margin-left: 44px; display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--cz-hair); padding-top: 12px; }
53
+ .tkc .tk-ini .go { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: 14px; }
54
+ .tkc .tk-ini .go:hover { background: var(--cz-well); }
55
+ .tkc .tk-ini .go b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
56
+ .tkc .tk-ini .cv { margin-left: auto; color: var(--cz-ink3); display: inline-flex; }
57
+ .tkc .tl2 { width: 28px; height: 28px; border-radius: 9px; background: var(--cz-bluebg); color: var(--cz-blueink); font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
58
+ .tkc .tkc-ib { width: 40px; height: 40px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--cz-ink2); }
59
+ .tkc .tkc-ib:hover, .tkc .tkc-ib.open { background: var(--cz-well); }
60
+ .tkc .tkc-ib.s { width: 32px; height: 32px; }
61
+ .tkc .tkc-msg { margin: 0 0 0 44px; font-size: 13px; color: var(--cz-red); }
62
+ .tkc .tkc-msg:empty { display: none; }
63
+
64
+ /* popovers: right under the control */
65
+ .tkc .tkc-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 8; background: var(--cz-card); border-radius: 16px; box-shadow: 0 24px 50px -20px rgba(42,46,53,.4), 0 0 0 1px var(--cz-hair); padding: 6px; display: flex; flex-direction: column; min-width: 220px; max-height: 320px; overflow: auto; }
66
+ .tkc .tkc-pop.r { left: auto; right: 0; }
67
+ .tkc .tkc-pop .o { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 10px; font-size: 13.5px; font-weight: 600; width: 100%; }
68
+ .tkc .tkc-pop .o:hover, .tkc .tkc-pop .o.hl { background: var(--cz-well); }
69
+ .tkc .tkc-pop .o .k { margin-left: auto; color: var(--cz-blueink); }
70
+ .tkc .tkc-pop hr { border: 0; border-top: 1px solid var(--cz-hair); margin: 4px 6px; }
71
+ .tkc .tkc-new input { width: 100%; box-sizing: border-box; height: 38px; border: 0; border-radius: 10px; padding: 0 10px; margin-bottom: 4px; font: inherit; font-size: 13.5px; background: var(--cz-well); color: var(--cz-ink); outline: 0; }
72
+ .tkc .tkc-new input:focus { box-shadow: 0 0 0 1.5px var(--cz-blue); }
73
+ .tkc .tkc-dp { width: 300px; padding: 12px; }
74
+ .tkc .tkc-dp .two { display: flex; gap: 6px; margin-bottom: 10px; }
75
+ .tkc .tkc-dp .two button { flex: 1; height: 52px; border-radius: 12px; background: var(--cz-well); padding: 6px 10px; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
76
+ .tkc .tkc-dp .two button.on { background: var(--cz-bluebg); box-shadow: inset 0 0 0 1.5px var(--cz-blue); }
77
+ .tkc .tkc-dp .two small { font-size: 11.5px; color: var(--cz-ink3); font-weight: 700; }
78
+ .tkc .tkc-dp .two b { font-size: 14px; }
79
+ .tkc .tkc-dp .qk { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
80
+ .tkc .tkc-dp .qk button { height: 30px; padding: 0 10px; border-radius: 999px; background: var(--cz-well); font-size: 12.5px; font-weight: 700; color: var(--cz-ink2); display: inline-flex; align-items: center; }
81
+ .tkc .tkc-dp .mh { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 800; padding: 0 4px 6px; }
82
+ .tkc .tkc-dp .g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 12.5px; }
83
+ .tkc .tkc-dp .g .h { color: var(--cz-ink3); font-size: 11px; font-weight: 700; height: 22px; display: flex; align-items: center; justify-content: center; }
84
+ .tkc .tkc-dp .g button { height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 999px; font-weight: 600; text-align: center; }
85
+ .tkc .tkc-dp .g button:hover { background: var(--cz-well); }
86
+ .tkc .tkc-dp .g .m { color: var(--cz-ink3); opacity: .6; }
87
+ .tkc .tkc-dp .g .rg { background: var(--cz-bluebg); border-radius: 0; }
88
+ .tkc .tkc-dp .g .td { box-shadow: inset 0 0 0 1.5px var(--cz-ink3); }
89
+ .tkc .tkc-dp .g .a { background: var(--cz-solid); color: var(--cz-onsolid); font-weight: 800; }
90
+
91
+ /* the header's check box in the tile's place (cozy-viewer.js `check`) */
92
+ .cz-vw-chk { border: 0; padding: 0; cursor: pointer; background: transparent !important; }
93
+ .cz-vw-chk:disabled { cursor: default; }
94
+ .cz-vw-chk .bx { display: block; width: 20px; height: 20px; border-radius: 7px; border: 2px solid var(--cz-ink3); background: var(--cz-card); position: relative; box-sizing: border-box; }
95
+ .cz-vw-chk.s-prog .bx { border-color: var(--cz-blue); background: linear-gradient(90deg, var(--cz-card) 50%, var(--cz-bluebg) 50%); }
96
+ .cz-vw-chk.s-done .bx { background: var(--cz-solid); border-color: var(--cz-solid); }
97
+ .cz-vw-chk.s-done .bx::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid var(--cz-onsolid); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
98
+ .cz-vw-chk.s-wont .bx, .cz-vw-chk.s-arch .bx { border-color: var(--cz-hair); background: var(--cz-well); }
99
+ .cz-vw-chk:not(:disabled):hover .bx { border-color: var(--cz-blue); }
100
+ /* Done, Won't do and Archived: the title goes quiet (canvas XetX1Done) */
101
+ #czViewer:has(.cz-vw-chk.s-done) .cz-vw-title, #czViewer:has(.cz-vw-chk.s-done) .cz-vw-rn { color: var(--cz-ink3); text-decoration: line-through; text-decoration-color: var(--cz-ink3); }
102
+
103
+ /* phone: the same card; chips wrap under it (canvas XetX1Phone) */
104
+ @media (max-width: 760px) {
105
+ .tkc .chips, .tkc .nt, .tkc .tk-ini, .tkc .tkc-msg { margin-left: 0; padding-left: 0; }
106
+ .tkc .nt { padding: 10px 12px; }
107
+ .tkc .tkc-dp { width: min(300px, calc(100vw - 48px)); }
108
+ }