create-pmos 0.408.0 → 0.409.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 (75) hide show
  1. package/package.json +13 -13
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/board-programs-test.js +1 -1
  7. package/workspace/board-wf-shot.js +45 -0
  8. package/workspace/board-workflows-test.js +186 -0
  9. package/workspace/briefing-premium-board-test.js +2 -2
  10. package/workspace/briefing-premium-initiative-test.js +1 -1
  11. package/workspace/changelog.json +12 -0
  12. package/workspace/fixtures/board-workflows-facts.js +49 -0
  13. package/workspace/fixtures/workflows-facts.js +53 -0
  14. package/workspace/guide/index.md +1 -0
  15. package/workspace/guide/workflows.md +58 -0
  16. package/workspace/ini-workflow-test.js +177 -0
  17. package/workspace/lib/board-premium.js +30 -5
  18. package/workspace/lib/board-trail.js +24 -7
  19. package/workspace/lib/briefing-premium-agent.js +3 -0
  20. package/workspace/lib/engine/boards.js +30 -2
  21. package/workspace/lib/engine/workflows.js +204 -0
  22. package/workspace/lib/pmos-verbs.js +3 -0
  23. package/workspace/lib/programs.js +22 -7
  24. package/workspace/lib/route-modules.js +1 -0
  25. package/workspace/lib/routes-boards.js +157 -7
  26. package/workspace/lib/routes-programs.js +5 -0
  27. package/workspace/lib/routes-workflows.js +105 -0
  28. package/workspace/lib/workflow-chat.js +26 -0
  29. package/workspace/lib/workflow-cli.js +141 -0
  30. package/workspace/lib/workflows-store.js +108 -0
  31. package/workspace/package-lock.json +2 -2
  32. package/workspace/package.json +1 -1
  33. package/workspace/program-charter-test.js +243 -0
  34. package/workspace/program-panel-test.js +1 -1
  35. package/workspace/public/pm/bd-acts.js +10 -5
  36. package/workspace/public/pm/bd-asks.js +2 -2
  37. package/workspace/public/pm/bd-prog-panel.js +33 -14
  38. package/workspace/public/pm/bd-prog.js +11 -3
  39. package/workspace/public/pm/bd-views.js +128 -45
  40. package/workspace/public/pm/bd-wf.js +99 -0
  41. package/workspace/public/pm/cozy-board.css +67 -6
  42. package/workspace/public/pm/cozy-evmodel.js +1 -1
  43. package/workspace/public/pm/cozy-panel.css +12 -6
  44. package/workspace/public/pm/cozy-settings.js +4 -2
  45. package/workspace/public/pm/cozy-viewer.js +36 -9
  46. package/workspace/public/pm/cozy-vw-shell.css +8 -0
  47. package/workspace/public/pm/goal-chat.js +1 -1
  48. package/workspace/public/pm/home-app.js +14 -9
  49. package/workspace/public/pm/home-ini-model.js +2 -2
  50. package/workspace/public/pm/home-ini.css +30 -0
  51. package/workspace/public/pm/home-ini.js +52 -9
  52. package/workspace/public/pm/home-list.js +5 -3
  53. package/workspace/public/pm/home-today.js +4 -4
  54. package/workspace/public/pm/ini-wf-model.js +91 -0
  55. package/workspace/public/pm/ini-wf.js +160 -0
  56. package/workspace/public/pm/premium-board.js +98 -30
  57. package/workspace/public/pm/premium-initiative-head.js +18 -8
  58. package/workspace/public/pm/program-charter.css +135 -0
  59. package/workspace/public/pm/program-charter.js +333 -0
  60. package/workspace/public/pm/program-model.js +44 -4
  61. package/workspace/public/pm/wf-edit.js +119 -0
  62. package/workspace/public/pm/wf-model.js +48 -0
  63. package/workspace/public/pm/wf-page.css +162 -0
  64. package/workspace/public/pm/wf-page.js +398 -0
  65. package/workspace/public/pm/wf-stage.js +187 -0
  66. package/workspace/public/premium-workflows.html +31 -0
  67. package/workspace/public/premium.html +1 -0
  68. package/workspace/server.js +1 -1
  69. package/workspace/skills/workflow-setup.skill +57 -0
  70. package/workspace/test-lists/ini-workflow.json +6 -0
  71. package/workspace/test-lists/program-charter.json +9 -0
  72. package/workspace/test-lists/workflows-board.json +13 -0
  73. package/workspace/test-lists/workflows-setup.json +13 -0
  74. package/workspace/test-lists/workflows.json +5 -0
  75. package/workspace/workflows-setup-test.js +346 -0
@@ -0,0 +1,119 @@
1
+ /* pm/wf-edit.js — the edits of the Workflows page, as pure functions (initiative workflows per initiative, D99; canvas WfAModel, WfAStage,
2
+ * WfACond, WfARemove). No DOM, so Node tests it. Each edit takes a workflow ({ id, name, stages: [...] }, the shape of scripts/workflows.js)
3
+ * and returns a NEW workflow; the page saves it with POST /api/workflows/save. Nothing here writes.
4
+ *
5
+ * slug(name) → 'legal-review'
6
+ * newKey(wf, name) → a stage key no other stage of wf has ('new-stage', 'new-stage-2', …)
7
+ * blankStage(wf, cat, name?) → a stage in the shape of the model, Always, no output yet
8
+ * addStage(wf, cat, name?) → { wf, key }: the stage goes after the last stage of its category (one numbered list)
9
+ * moveStage(wf, key, cat, beforeKey|null) → the stage moved into cat, before beforeKey (null: the end of that category). Triage stays first.
10
+ * shiftStage(wf, key, by) → one place up (-1) or down (+1) in the list; its category is kept
11
+ * setStage(wf, key, patch) → the stage with patch merged (output and when merge one level deep)
12
+ * removeStage(wf, key) → the workflow without it; a Then or Unless that pointed at it goes to the next stage
13
+ * nextOf(wf, key) → the stage that follows (Then, else the next in the list) or null
14
+ * thenNote(wf, key) → "Legal review runs only when its condition holds; otherwise it goes on to 7 · ◆ Award." or ''
15
+ * numOf(wf, key) → 1-based place in the list
16
+ * label(wf, key) → '6 · Legal review' ('◆ ' before a milestone)
17
+ * blankWorkflow(name) → a workflow with only Triage, for "start blank"
18
+ * canMove(wf, key) · isTriage(stage) */
19
+
20
+ const CAT_ORDER = ['todo', 'doing', 'done'];
21
+ const clone = (o) => JSON.parse(JSON.stringify(o));
22
+
23
+ export function slug(name) {
24
+ return String(name || '').toLowerCase().normalize('NFKD').replace(/[̀-ͯ]/g, '').replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 48) || 'stage';
25
+ }
26
+ export function newKey(wf, name) {
27
+ const used = new Set(((wf && wf.stages) || []).map((s) => s.key));
28
+ const base = slug(name);
29
+ if (!used.has(base)) return base;
30
+ for (let i = 2; ; i++) if (!used.has(base + '-' + i)) return base + '-' + i;
31
+ }
32
+ export const isTriage = (s) => !!s && s.key === 'triage';
33
+ export const canMove = (wf, key) => key !== 'triage' && !!stageIn(wf, key);
34
+ const stageIn = (wf, key) => ((wf && wf.stages) || []).find((s) => s.key === key) || null;
35
+ export const numOf = (wf, key) => ((wf && wf.stages) || []).findIndex((s) => s.key === key) + 1;
36
+ export function label(wf, key) {
37
+ const s = stageIn(wf, key);
38
+ return s ? numOf(wf, key) + ' · ' + (s.milestone ? '◆ ' : '') + s.name : '';
39
+ }
40
+
41
+ export function blankStage(wf, cat, name = 'New stage') {
42
+ return { key: newKey(wf, name), name, cat: CAT_ORDER.includes(cat) ? cat : 'doing', output: { name: '', kind: 'checklist' }, finish: [], milestone: false, auto: false, when: { mode: 'always' }, then: null, unless: [] };
43
+ }
44
+ /** Where a stage of category cat goes when it is added at the end of its column: after the last stage of that category, else after the
45
+ * last stage of an earlier category, else after Triage. */
46
+ function endIndex(stages, cat) {
47
+ const ci = CAT_ORDER.indexOf(cat);
48
+ let at = -1;
49
+ stages.forEach((s, i) => { const k = CAT_ORDER.indexOf(s.cat); if (k <= ci) at = i; });
50
+ const t = stages.findIndex((s) => s.key === 'triage');
51
+ return Math.max(at, t) + 1;
52
+ }
53
+ export function addStage(wf, cat, name) {
54
+ const w = clone(wf);
55
+ const s = blankStage(w, cat, name);
56
+ w.stages.splice(endIndex(w.stages, s.cat), 0, s);
57
+ return { wf: w, key: s.key };
58
+ }
59
+ export function moveStage(wf, key, cat, beforeKey = null) {
60
+ if (!canMove(wf, key) || !CAT_ORDER.includes(cat)) return wf;
61
+ const w = clone(wf);
62
+ const i = w.stages.findIndex((s) => s.key === key);
63
+ const [s] = w.stages.splice(i, 1);
64
+ s.cat = cat;
65
+ let at = beforeKey ? w.stages.findIndex((x) => x.key === beforeKey) : -1;
66
+ if (at < 0) at = endIndex(w.stages, cat);
67
+ const t = w.stages.findIndex((x) => x.key === 'triage');
68
+ if (t >= 0 && at <= t) at = t + 1; // nothing goes before Triage
69
+ w.stages.splice(at, 0, s);
70
+ return w;
71
+ }
72
+ export function shiftStage(wf, key, by) {
73
+ if (!canMove(wf, key)) return wf;
74
+ const w = clone(wf);
75
+ const i = w.stages.findIndex((s) => s.key === key), j = i + (by < 0 ? -1 : 1);
76
+ if (j < 0 || j >= w.stages.length || w.stages[j].key === 'triage') return wf;
77
+ [w.stages[i], w.stages[j]] = [w.stages[j], w.stages[i]];
78
+ return w;
79
+ }
80
+ export function setStage(wf, key, patch) {
81
+ const w = clone(wf);
82
+ const s = w.stages.find((x) => x.key === key); if (!s) return wf;
83
+ for (const [k, v] of Object.entries(patch || {})) {
84
+ if ((k === 'output' || k === 'when') && v && typeof v === 'object') s[k] = { ...(s[k] || {}), ...v };
85
+ else s[k] = v;
86
+ }
87
+ if (s.when && s.when.mode !== 'only') delete s.when.text;
88
+ if (s.key === 'triage') s.cat = 'todo'; // Triage is always first, in To do
89
+ return w;
90
+ }
91
+ export function removeStage(wf, key) {
92
+ if (key === 'triage') return wf;
93
+ const w = clone(wf);
94
+ w.stages = w.stages.filter((s) => s.key !== key);
95
+ for (const s of w.stages) {
96
+ if (s.then === key) s.then = null;
97
+ s.unless = (s.unless || []).filter((u) => u.to !== key);
98
+ }
99
+ return w;
100
+ }
101
+ export function nextOf(wf, key) {
102
+ const st = (wf && wf.stages) || [], i = st.findIndex((s) => s.key === key);
103
+ if (i < 0) return null;
104
+ const s = st[i];
105
+ if (s.then) return stageIn(wf, s.then);
106
+ return st[i + 1] || null;
107
+ }
108
+ /** The fallback the panel shows when the stage that follows runs only sometimes (WfAStage "Then"). */
109
+ export function thenNote(wf, key) {
110
+ const n = nextOf(wf, key); if (!n) return '';
111
+ const mode = (n.when && n.when.mode) || 'always';
112
+ if (mode === 'always') return '';
113
+ const after = nextOf(wf, n.key);
114
+ const how = mode === 'only' ? 'runs only when its condition holds' : 'is optional';
115
+ return n.name + ' ' + how + '; otherwise it goes on to ' + (after ? label(wf, after.key) : 'the end') + '.';
116
+ }
117
+ export function blankWorkflow(name = 'New workflow') {
118
+ return { id: slug(name) + '-' + Date.now().toString(36), name, icon: 'doc', decide: 'pmos', stages: [{ key: 'triage', name: 'Triage', cat: 'todo', output: { name: 'BRD', kind: 'doc' }, finish: [], milestone: false, auto: false, when: { mode: 'always' }, then: null, unless: [] }] };
119
+ }
@@ -0,0 +1,48 @@
1
+ /* pm/wf-model.js — the workflows every page shares (D99, initiative workflows-per-initiative): the categories, the output kinds, the icons and
2
+ * the small helpers that turn a row's workflow fields into words. Pure: no reads, no DOM. The server side is scripts/workflows.js; the row
3
+ * fields are wf { id, name, icon }, wfStage { key, name, cat, milestone, n, of }, wfStages [...] and ended (lib/routes-boards.js workflowRowOf).
4
+ * Frames: WfABoard, WfABoardOne, WfATrack, WfAElse, WfAPhone, WfAModel, WfAStage, WfACond, WfTriage, WfAChange, WfAWontDo. */
5
+
6
+ export const PRODUCT_FEATURE_ID = 'product-feature';
7
+ export const CATS = [['todo', 'To do'], ['doing', 'In progress'], ['done', 'Done']];
8
+ export const ENDS = [['wontdo', "Won't do"], ['archived', 'Archived']];
9
+ export const OUTPUT_KINDS = [['doc', 'Document'], ['jira', 'Jira tickets'], ['signoff', 'Sign-off'], ['checklist', 'Checklist only']];
10
+ export const WHEN = [['always', 'Always'], ['optional', 'Optional'], ['only', 'Only when…']];
11
+ export const WONTDO_REASONS = [['budget', 'No budget'], ['scope', 'Out of scope'], ['another', 'Done another way'], ['other', 'Other']];
12
+
13
+ // 24-unit stroke icons (the frames' own paths). One per workflow; a PM-made workflow picks one, else flag.
14
+ export const ICONS = {
15
+ feature: 'M12 3l8 4.5v9L12 21l-8-4.5v-9zM12 12l8-4.5M12 12v9M12 12L4 7.5',
16
+ doc: 'M7 3h7l5 5v13H7zM14 3v5h5M10 13h6M10 17h4',
17
+ cart: 'M3 4h2l2.5 11h10L20 8H6.5M9 20h.01M17 20h.01',
18
+ swap: 'M4 8h13l-3-3M20 16H7l3 3',
19
+ people: 'M9 11a3 3 0 1 0 0-6a3 3 0 1 0 0 6M3 20a6 6 0 0 1 12 0M17 11a3 3 0 1 0 0-6M21 20a6 6 0 0 0-4-5.6',
20
+ shield: 'M12 3l7 3v6c0 4.4-3 7.7-7 9c-4-1.3-7-4.6-7-9V6z',
21
+ box: 'M4 7l8-4 8 4v10l-8 4-8-4zM4 7l8 4 8-4M12 11v10',
22
+ flag: 'M5 21V4M5 4h11l-2 4 2 4H5',
23
+ build: 'M14 6l4 4-9 9H5v-4zM13 7l4 4',
24
+ chart: 'M4 20V10M10 20V4M16 20v-7M22 20H2',
25
+ };
26
+ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
27
+
28
+ /** The workflow's icon tile: <span class="wfi" role="img" aria-label="<name> workflow" title="<name>">. */
29
+ export function wfIcon(wf, size = 16) {
30
+ const w = wf || { name: 'Product feature', icon: 'feature' };
31
+ const d = ICONS[w.icon] || ICONS.flag;
32
+ return `<span class="wfi" role="img" aria-label="${esc(w.name)} workflow" title="${esc(w.name)}" style="width:${size}px;height:${size}px"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg></span>`;
33
+ }
34
+ const LABEL = Object.fromEntries([...CATS, ...ENDS]);
35
+ /** 'To do' | 'In progress' | 'Done' | "Won't do" | 'Archived'. */
36
+ export const catLabel = (cat) => LABEL[cat] || '';
37
+ /** A row's category, Won't do and Archived first (they hold from any stage). */
38
+ export const rowCat = (row) => (row && row.ended ? 'wontdo' : row && row.archived ? 'archived' : (row && row.wfStage && row.wfStage.cat) || 'doing');
39
+ /** The stage of a workflow by key, or null. */
40
+ export const stageOf = (wf, key) => ((wf && wf.stages) || []).find((s) => s.key === key) || null;
41
+ /** "step 2 of 8": counts that workflow's stages (the Viewer header, HbC*). */
42
+ export const stepText = (row) => (row && row.wfStage ? `step ${row.wfStage.n} of ${row.wfStage.of}` : '');
43
+ /** "◆ Award" for a milestone, else the name. */
44
+ export const stageName = (s) => (s ? (s.milestone ? '◆ ' : '') + s.name : '');
45
+ /** A row with no workflow fields (an older server) reads as Product feature. */
46
+ export const wfOf = (row) => (row && row.wf) || { id: PRODUCT_FEATURE_ID, name: 'Product feature', icon: 'feature' };
47
+ /** The ◆ stages a program milestone may wait on, for one row (D99 point 7): Product feature → Deliver first. */
48
+ export const milestoneStages = (row) => ((row && row.wfStages) || []).filter((s) => s.milestone).map((s) => ({ key: s.key, name: s.name }));
@@ -0,0 +1,162 @@
1
+ /* pm/wf-page.css — Settings › Workflows (canvas WfAModel, WfAStage, WfACond, WfARemove, WfANew, WfADraft). Token vars only (cozy.css).
2
+ * The desk is Home's (cozy-home.css .hm-desk): the list well, the main column (the workflow or the New workflow chat), the Viewer. */
3
+ body.wf-page { min-height: 100vh; overflow: hidden; font-family: var(--cz-sans); color: var(--cz-ink); background: var(--cz-well2); }
4
+ .wf-page button { font-family: var(--cz-sans); }
5
+ .wf-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
6
+ .wf-small { font-size: 12.5px; line-height: 1.45; }
7
+ .wf-mut { color: var(--cz-ink3); }
8
+ .wf-err { color: var(--cz-red); font-size: 12.5px; margin: 0; }
9
+ .wf-err:empty { display: none; }
10
+ .wf-pad { padding: 8px 10px; }
11
+ .wf-page p { margin: 0; }
12
+
13
+ /* ── the list ── */
14
+ .wf-list { gap: 2px; overflow: auto; }
15
+ .wf-list .lhead { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px 10px; }
16
+ .wf-list h2 { margin: 0; font-size: 16px; font-weight: 800; }
17
+ .wf-page .ib { width: 36px; height: 36px; border-radius: 12px; display: inline-grid; place-items: center; border: 0; background: none; color: var(--cz-ink2); cursor: pointer; padding: 0; flex: none; }
18
+ .wf-page .ib.sm { width: 30px; height: 30px; border-radius: 10px; }
19
+ .wf-page .ib:hover { background: var(--cz-well2); }
20
+ .wfl { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px; width: 100%; border: 0; background: none; color: var(--cz-ink); cursor: pointer; text-align: left; }
21
+ .wfl:hover { background: var(--cz-well2); }
22
+ .wfl.sel { background: var(--cz-card); box-shadow: 0 6px 18px -10px rgba(42,46,53,.25); }
23
+ .wfl .t { font-size: 14px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
24
+ .wfl .n { font-size: 12px; color: var(--cz-ink3); font-weight: 600; }
25
+ .wfl.arch .t { color: var(--cz-ink3); }
26
+ .wf-sub { font-size: 11.5px; font-weight: 800; color: var(--cz-ink3); padding: 14px 10px 4px; }
27
+ .wf-page .wfi { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 6px; background: var(--cz-well); color: var(--cz-ink2); flex: none; }
28
+ .wfl .wfi, .wf-head .wfi { background: var(--cz-well2); }
29
+ .wfl.sel .wfi { background: var(--cz-well); }
30
+ .wf-page .wfi svg { width: 60%; height: 60%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
31
+ .wf-page .wfi.new { width: 22px; height: 22px; background: var(--cz-bluebg); color: var(--cz-blueink); }
32
+
33
+ /* ── the workflow ── */
34
+ .wf-main { flex: 1 1 auto; min-width: 0; min-height: 0; overflow: auto; padding: 6px 6px 0 4px; display: flex; flex-direction: column; gap: 14px; }
35
+ .wf-head { display: flex; align-items: center; gap: 10px; min-height: 40px; }
36
+ .wf-push { margin-left: auto; }
37
+ .wf-h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
38
+ .wf-h2 { margin: 0; font-size: 18px; font-weight: 800; flex: 1; }
39
+ .wf-h3 { font-size: 15px; font-weight: 800; }
40
+ .wf-rn { font: inherit; color: inherit; background: none; border: 0; padding: 2px 6px; margin: -2px -6px; border-radius: 10px; cursor: text; text-align: left; }
41
+ .wf-rn:hover { background: var(--cz-well); }
42
+ .wf-ren { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
43
+ .wf-ren input { font: 800 20px var(--cz-sans); color: var(--cz-ink); border: 1.5px solid var(--cz-blue); border-radius: 12px; padding: 4px 10px; min-width: 260px; background: var(--cz-card); }
44
+ .wf-sv { width: 32px; height: 32px; border-radius: 10px; border: 0; background: var(--cz-blueink); color: var(--cz-card); display: grid; place-items: center; cursor: pointer; }
45
+ .wf-ren .wf-err { flex-basis: 100%; }
46
+ .wf-cols { flex: none; display: flex; gap: 8px; min-height: 420px; }
47
+ .wf-col { flex: 1 1 0; min-width: 0; background: var(--cz-well); border-radius: 18px; padding: 10px 8px 8px; display: flex; flex-direction: column; gap: 6px; }
48
+ .wf-col h3 { margin: 0; padding: 2px 6px; font-size: 13px; font-weight: 800; }
49
+ .wf-col.wf-end { flex: .9 1 0; background: transparent; border: 1.5px dashed var(--cz-hair2, var(--cz-hair)); }
50
+ .wf-col.wf-end p { padding: 0 6px; }
51
+ .wf-drop { display: flex; flex-direction: column; gap: 6px; min-height: 40px; border-radius: 12px; }
52
+ .wf-drop.over { outline: 2px dashed var(--cz-blue); outline-offset: 2px; }
53
+ .wf-card { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 14px; background: var(--cz-card); border: 1px solid var(--cz-hair); box-shadow: 0 1px 2px rgba(42,46,53,.05); color: var(--cz-ink); cursor: pointer; text-align: left; font-size: 12.5px; }
54
+ .wf-card[draggable="true"] { cursor: grab; }
55
+ .wf-card:hover { border-color: var(--cz-blue); }
56
+ .wf-card.opt { border-style: dashed; box-shadow: none; }
57
+ .wf-card.drag { opacity: .45; }
58
+ .wf-grip { color: var(--cz-ink3); display: inline-flex; width: 14px; flex: none; }
59
+ .wf-num { width: 16px; font-weight: 800; color: var(--cz-ink3); flex: none; font-size: 12.5px; }
60
+ .wf-ct { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
61
+ .wf-pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--cz-well); color: var(--cz-ink2); flex: none; max-width: 52%; }
62
+ .wf-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
63
+ .wf-pill.dash { background: transparent; border: 1.5px dashed var(--cz-ink3); color: var(--cz-ink3); }
64
+ .wf-pill.y { background: var(--cz-riskbg); color: var(--cz-risk); }
65
+ .wf-box { background: var(--cz-well); border-radius: 14px; padding: 10px 12px; }
66
+ .wf-how { display: flex; flex-direction: column; gap: 4px; }
67
+ .wf-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 999px; border: 0; font-size: 13.5px; font-weight: 700; cursor: pointer; background: var(--cz-well); color: var(--cz-ink); }
68
+ .wf-btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
69
+ .wf-btn.dark { background: var(--cz-ink); color: var(--cz-card); }
70
+ .wf-btn.ghost { background: transparent; color: var(--cz-ink2); }
71
+ .wf-btn.ghost:hover { background: var(--cz-well2); }
72
+ .wf-col > .wf-btn { align-self: flex-start; }
73
+ .wf-link { border: 0; background: none; padding: 0; color: var(--cz-blueink); font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
74
+ .wf-acts { display: flex; gap: 8px; }
75
+
76
+ /* ── the stage panel and the condition (the Viewer) ── */
77
+ .wf-stage { padding: 4px 22px 22px; display: flex; flex-direction: column; gap: 12px; }
78
+ .wf-lbl { font-size: 12px; font-weight: 800; color: var(--cz-ink3); }
79
+ .wf-sgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; align-items: start; }
80
+ .wf-scol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
81
+ .wf-field { display: flex; flex-direction: column; gap: 6px; }
82
+ .wf-fl { font-size: 12.5px; font-weight: 800; color: var(--cz-ink2); }
83
+ .wf-inp { font: 600 13.5px var(--cz-sans); color: var(--cz-ink); background: var(--cz-card); border: 1px solid var(--cz-hair2, var(--cz-hair)); border-radius: 12px; padding: 8px 12px; min-width: 0; box-sizing: border-box; }
84
+ .wf-inp:focus { outline: 2px solid var(--cz-blue); outline-offset: 0; }
85
+ .wf-inp.bare { flex: 1; border-color: transparent; background: transparent; padding: 4px 6px; }
86
+ .wf-inp.bare:hover { border-color: var(--cz-hair); }
87
+ .wf-inp.ta { width: 100%; min-height: 72px; resize: vertical; line-height: 1.45; }
88
+ .wf-inp:disabled { color: var(--cz-ink2); background: var(--cz-well); }
89
+ .wf-seg { display: inline-flex; background: var(--cz-well); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; align-self: flex-start; }
90
+ .wf-seg .sb { border: 0; background: none; border-radius: 999px; height: 30px; padding: 0 12px; font-size: 12.5px; font-weight: 700; color: var(--cz-ink2); cursor: pointer; }
91
+ .wf-seg .sb[aria-checked="true"] { background: var(--cz-card); color: var(--cz-ink); box-shadow: 0 2px 6px -3px rgba(42,46,53,.3); }
92
+ .wf-seg .sb:disabled { cursor: default; opacity: .7; }
93
+ .wf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
94
+ .wf-chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--cz-hair2, var(--cz-hair)); background: var(--cz-card); font-size: 12.5px; font-weight: 700; color: var(--cz-ink2); cursor: pointer; }
95
+ .wf-chip.on { background: var(--cz-bluebg); border-color: var(--cz-blue); color: var(--cz-blueink); }
96
+ .wf-chip:disabled { cursor: default; }
97
+ .wf-fin { padding: 4px 8px 4px 10px; display: flex; flex-direction: column; }
98
+ .wf-fi { display: flex; align-items: center; gap: 6px; }
99
+ .wf-addi { padding: 6px 0; font-size: 12.5px; }
100
+ .wf-cond { display: flex; align-items: center; gap: 8px; }
101
+ .wf-cond span { flex: 1; }
102
+ .wf-then { display: flex; flex-direction: column; gap: 8px; }
103
+ .wf-row { display: flex; align-items: center; gap: 8px; }
104
+ .wf-wrap { flex-wrap: wrap; }
105
+ .wf-grow { flex: 1; min-width: 160px; }
106
+ .wf-stage select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
107
+ .wf-pick { font: 700 12.5px var(--cz-sans); color: var(--cz-ink); height: 32px; border-radius: 10px; border: 1px solid var(--cz-hair2, var(--cz-hair)); background: var(--cz-card); padding: 0 8px; max-width: 220px; }
108
+ .wf-swl { display: flex; align-items: center; gap: 10px; font-size: 12.5px; cursor: pointer; }
109
+ .wf-sw { width: 32px; height: 20px; border-radius: 999px; background: var(--cz-hair2, var(--cz-ink3)); position: relative; flex: none; border: 0; padding: 0; cursor: pointer; }
110
+ .wf-sw i { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--cz-card); transition: left .12s; }
111
+ .wf-sw[aria-checked="true"] { background: var(--cz-blue); }
112
+ .wf-sw[aria-checked="true"] i { left: 15px; }
113
+ .wf-reads { display: flex; flex-direction: column; gap: 6px; }
114
+ .wf-rd { display: flex; gap: 8px; align-items: flex-start; }
115
+ .wf-draft { padding: 4px 22px 22px; display: flex; flex-direction: column; gap: 4px; min-height: 100%; box-sizing: border-box; }
116
+ .wf-dh { display: flex; align-items: center; gap: 8px; }
117
+ .wf-draft .wf-lbl { margin: 10px 0 2px; }
118
+ .wf-trow { display: flex; gap: 8px; padding: 7px 2px; align-items: flex-start; border-bottom: 1px solid var(--cz-hair); font-size: 13.5px; }
119
+ .wf-trow .wf-pill { margin-top: 3px; }
120
+ .wf-dacts { margin-top: auto; padding-top: 12px; }
121
+
122
+ /* ── the chat of New workflow (Home's chat, cozy-home.css) ── */
123
+ .wf-chatw { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
124
+ .wf-chatw[hidden] { display: none; }
125
+ .wf-chatw .hm-chat { flex: 1; }
126
+ .wf-hint { text-align: center; padding: 6px 0 0; }
127
+
128
+ /* ── remove a stage in use (WfARemove), the menu, the toast ── */
129
+ .wf-scrim { position: fixed; inset: 0; background: rgba(20,22,26,.28); z-index: 80; }
130
+ .wf-pop { position: fixed; z-index: 81; left: 50%; top: 28%; transform: translateX(-50%); width: min(440px, calc(100vw - 32px)); box-sizing: border-box; background: var(--cz-card); border-radius: 20px; box-shadow: var(--cz-sheet); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
131
+ .wf-pop[hidden], .wf-scrim[hidden] { display: none; }
132
+ .wf-mv { display: flex; align-items: center; gap: 10px; }
133
+ .wf-mv b { flex: 1; }
134
+ .wf-mvl { display: flex; flex-direction: column; gap: 8px; }
135
+ .wf-menu { position: fixed; z-index: 90; min-width: 180px; background: var(--cz-card); border-radius: 14px; box-shadow: var(--cz-sheet); padding: 6px; display: flex; flex-direction: column; }
136
+ .wf-menu button { border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 10px; font: 700 13px var(--cz-sans); color: var(--cz-ink); cursor: pointer; }
137
+ .wf-menu button:hover, .wf-menu button:focus { background: var(--cz-well); outline: none; }
138
+ .wf-menu button.danger { color: var(--cz-red); }
139
+ .wf-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 95; background: var(--cz-ink); color: var(--cz-card); border-radius: 999px; padding: 10px 18px; font-size: 13px; font-weight: 700; display: flex; gap: 10px; align-items: center; }
140
+ .wf-toast[hidden] { display: none; }
141
+ .wf-undo { border: 0; background: none; color: var(--cz-bluebg); font: inherit; font-weight: 800; cursor: pointer; padding: 0; }
142
+
143
+ /* ── a phone: the list is the page; a workflow opens over it with ← (the columns stack) ── */
144
+ @media (max-width: 760px) {
145
+ body.wf-page { overflow: auto; background: var(--cz-card); }
146
+ .wf-page .hm-desk { position: static; display: block; padding: 12px 16px 96px; background: none; box-shadow: none; border-radius: 0; }
147
+ .wf-page .hm-list { display: flex; width: auto; padding: 12px 10px; }
148
+ .wf-page.wf-open .hm-list { display: none; }
149
+ .wf-page:not(.wf-open) .wf-main, .wf-page:not(.wf-open) .wf-chatw { display: none; }
150
+ .wf-main { padding: 0; overflow: visible; }
151
+ .wf-cols { flex-direction: column; min-height: 0; }
152
+ .wf-col.wf-end { flex: none; }
153
+ .wf-h1 { font-size: 20px; }
154
+ .wf-head { flex-wrap: wrap; }
155
+ .wf-head > .wf-small { flex-basis: 100%; order: 3; padding-left: 40px; }
156
+ .wf-ren input { min-width: 0; width: 100%; }
157
+ .wf-chatw { height: calc(100vh - 120px); }
158
+ .wf-card, .wfl { min-height: 44px; }
159
+ .wf-pill { max-width: 46%; }
160
+ .wf-stage .wf-row { flex-wrap: wrap; }
161
+ .wf-stage .wf-row > .wf-grow { min-width: 0; flex-basis: 100%; }
162
+ }