create-pmos 0.396.0 → 0.398.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 (177) hide show
  1. package/package.json +25 -25
  2. package/payload/KIT-VERSION +2 -2
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/scripts/nine-stages.js +49 -20
  6. package/payload/state/discoveries.md +1 -1
  7. package/payload/state/log.md +1 -1
  8. package/workspace/briefing-premium-adddoc-test.js +103 -74
  9. package/workspace/briefing-premium-board-test.js +316 -154
  10. package/workspace/briefing-premium-calendar-2-test.js +135 -195
  11. package/workspace/briefing-premium-calendar-3-test.js +143 -413
  12. package/workspace/briefing-premium-calendar-test.js +86 -185
  13. package/workspace/briefing-premium-doc-edit-test.js +95 -83
  14. package/workspace/briefing-premium-initiative-test.js +166 -294
  15. package/workspace/briefing-premium-insights-test.js +351 -214
  16. package/workspace/briefing-premium-metrics-test.js +53 -118
  17. package/workspace/briefing-premium-products-test.js +40 -27
  18. package/workspace/briefing-premium-sources-test.js +91 -52
  19. package/workspace/briefing-premium-test.js +150 -633
  20. package/workspace/briefing-premium-work-test.js +88 -269
  21. package/workspace/changelog.json +24 -0
  22. package/workspace/fixtures/board-premium-facts.js +2 -1
  23. package/workspace/fixtures/board-premium-jira.js +28 -0
  24. package/workspace/fixtures/board-premium-trail.js +32 -0
  25. package/workspace/fixtures/initiative-premium-facts.js +2 -1
  26. package/workspace/fixtures/initiatives-api/list.json +30 -42
  27. package/workspace/fixtures/initiatives-api/roadmap.json +40 -56
  28. package/workspace/fixtures/initiatives-api/sheet.json +10 -14
  29. package/workspace/fixtures/insights-premium-facts.js +11 -2
  30. package/workspace/fixtures/premium-viewer-fixtures.js +182 -0
  31. package/workspace/guide/briefing-premium.md +3 -1
  32. package/workspace/guide/home.md +47 -0
  33. package/workspace/guide/index.md +2 -0
  34. package/workspace/guide/lifecycle.md +51 -0
  35. package/workspace/home-shot.js +38 -0
  36. package/workspace/lib/agent-roles.js +71 -0
  37. package/workspace/lib/board-premium.js +160 -3
  38. package/workspace/lib/board-trail.js +223 -0
  39. package/workspace/lib/engine/boards.js +15 -14
  40. package/workspace/lib/engine/nine-stages.js +49 -20
  41. package/workspace/lib/engine/signals/detectors.js +13 -11
  42. package/workspace/lib/home-work-item.js +58 -0
  43. package/workspace/lib/insights-goals.js +196 -0
  44. package/workspace/lib/insights-premium.js +126 -1
  45. package/workspace/lib/insights-records.js +101 -0
  46. package/workspace/lib/jira-tickets.js +1 -1
  47. package/workspace/lib/route-modules.js +4 -0
  48. package/workspace/lib/routes-board-premium.js +3 -2
  49. package/workspace/lib/routes-board-trail.js +33 -0
  50. package/workspace/lib/routes-home-desk.js +176 -0
  51. package/workspace/lib/routes-initiatives.js +1 -1
  52. package/workspace/lib/routes-insights-premium.js +19 -3
  53. package/workspace/lib/routes-insights-records.js +129 -0
  54. package/workspace/lib/routes-notes.js +1 -0
  55. package/workspace/lib/routes-viewer.js +108 -0
  56. package/workspace/lib/transcript-steps.js +123 -0
  57. package/workspace/lib/vendor/scripts/nine-stages.js +49 -20
  58. package/workspace/lib/viewer-meeting.js +205 -0
  59. package/workspace/lib/viewer-report.js +89 -0
  60. package/workspace/package-lock.json +2 -2
  61. package/workspace/package.json +1 -1
  62. package/workspace/premium-agreed-viewer-shots.js +76 -0
  63. package/workspace/premium-board-actions-test.js +85 -73
  64. package/workspace/premium-briefing-depth-test.js +66 -53
  65. package/workspace/premium-chat-attach-test.js +54 -63
  66. package/workspace/premium-chat-chart-tab-test.js +35 -36
  67. package/workspace/premium-chat-context-test.js +22 -19
  68. package/workspace/premium-chat-goal-view-test.js +28 -26
  69. package/workspace/premium-chat-notes-test.js +29 -33
  70. package/workspace/premium-chat-report-tab-test.js +35 -25
  71. package/workspace/premium-chat-term-test.js +16 -14
  72. package/workspace/premium-chat-viewer-test.js +60 -53
  73. package/workspace/premium-core-doc-issue-test.js +50 -41
  74. package/workspace/premium-html-viewer-test.js +17 -18
  75. package/workspace/premium-phone-card-test.js +8 -2
  76. package/workspace/premium-phone-room-test.js +42 -31
  77. package/workspace/premium-report-read-test.js +115 -197
  78. package/workspace/premium-viewer-download-test.js +19 -22
  79. package/workspace/premium-viewer-flicker-test.js +11 -16
  80. package/workspace/premium-viewer-share-test.js +6 -9
  81. package/workspace/premium-viewer-test.js +41 -60
  82. package/workspace/premium-vw-backlog-test.js +53 -31
  83. package/workspace/premium-vw-cal-test.js +82 -123
  84. package/workspace/premium-vw-copy-test.js +17 -33
  85. package/workspace/premium-vw-doc-test.js +12 -11
  86. package/workspace/premium-vw-item-test.js +50 -48
  87. package/workspace/premium-vw-jira-test.js +55 -26
  88. package/workspace/premium-vw-meet-test.js +118 -187
  89. package/workspace/premium-vw-notes-test.js +85 -107
  90. package/workspace/premium-vw-rec-test.js +72 -193
  91. package/workspace/premium-vw-slides-test.js +46 -50
  92. package/workspace/premium-welcome-test.js +3 -2
  93. package/workspace/premium-work-depth-test.js +63 -51
  94. package/workspace/public/pm/bd-acts.js +305 -0
  95. package/workspace/public/pm/bd-span.js +224 -0
  96. package/workspace/public/pm/bd-stages.js +47 -0
  97. package/workspace/public/pm/c3-doc-sheet.js +1 -1
  98. package/workspace/public/pm/c3-md.js +3 -395
  99. package/workspace/public/pm/c3-phone-detail.js +1 -1
  100. package/workspace/public/pm/c3-phone-model.js +3 -68
  101. package/workspace/public/pm/chat-term.js +3 -3
  102. package/workspace/public/pm/cozy-board.css +640 -0
  103. package/workspace/public/pm/cozy-home.css +580 -0
  104. package/workspace/public/pm/cozy-home.js +172 -0
  105. package/workspace/public/pm/cozy-initiative.css +138 -0
  106. package/workspace/public/pm/cozy-insights.css +421 -0
  107. package/workspace/public/pm/cozy-md.js +396 -0
  108. package/workspace/public/pm/cozy-nav.js +65 -0
  109. package/workspace/public/pm/cozy-placeholder.js +26 -0
  110. package/workspace/public/pm/cozy-viewer.css +143 -0
  111. package/workspace/public/pm/cozy-viewer.js +144 -0
  112. package/workspace/public/pm/cozy-vw.css +485 -0
  113. package/workspace/public/pm/cozy.css +254 -0
  114. package/workspace/public/pm/home-adddoc.js +48 -0
  115. package/workspace/public/pm/home-app.js +905 -0
  116. package/workspace/public/pm/home-around.js +515 -0
  117. package/workspace/public/pm/home-chat.js +459 -0
  118. package/workspace/public/pm/home-data.js +312 -0
  119. package/workspace/public/pm/home-draft.js +68 -0
  120. package/workspace/public/pm/home-more.js +249 -0
  121. package/workspace/public/pm/home-phone-card.js +109 -0
  122. package/workspace/public/pm/home-work.js +519 -0
  123. package/workspace/public/pm/lifecycle-lens-model.js +45 -27
  124. package/workspace/public/pm/lifecycle-lens.js +22 -11
  125. package/workspace/public/pm/phone-moment.js +69 -0
  126. package/workspace/public/pm/pm-work-view.js +1 -1
  127. package/workspace/public/pm/premium-attach.js +4 -0
  128. package/workspace/public/pm/premium-board.js +544 -253
  129. package/workspace/public/pm/premium-brief.js +1 -1
  130. package/workspace/public/pm/premium-chart-tab.js +110 -62
  131. package/workspace/public/pm/premium-chat.js +17 -10
  132. package/workspace/public/pm/premium-deck.js +3 -3
  133. package/workspace/public/pm/premium-first.js +25 -21
  134. package/workspace/public/pm/premium-initiative-head.js +138 -0
  135. package/workspace/public/pm/premium-initiative.js +28 -4
  136. package/workspace/public/pm/premium-insights.js +950 -440
  137. package/workspace/public/pm/premium-meeting.js +61 -549
  138. package/workspace/public/pm/premium-notes.js +1 -1
  139. package/workspace/public/pm/premium-report-frame.css +20 -0
  140. package/workspace/public/pm/premium-report-read.js +509 -480
  141. package/workspace/public/pm/premium-report-tab.js +87 -63
  142. package/workspace/public/pm/premium-shell.js +107 -124
  143. package/workspace/public/pm/premium-viewer.js +27 -1
  144. package/workspace/public/pm/premium-vw-cal.js +187 -48
  145. package/workspace/public/pm/premium-vw-doc.css +6 -0
  146. package/workspace/public/pm/premium-vw-doc.js +40 -2
  147. package/workspace/public/pm/premium-vw-file.js +2 -2
  148. package/workspace/public/pm/premium-vw-jira-model.js +22 -5
  149. package/workspace/public/pm/premium-vw-jira.css +11 -0
  150. package/workspace/public/pm/premium-vw-jira.js +11 -4
  151. package/workspace/public/pm/premium-vw-meet.js +6 -83
  152. package/workspace/public/pm/premium-vw-mtg.js +731 -0
  153. package/workspace/public/pm/premium-vw-notes.js +56 -69
  154. package/workspace/public/pm/premium-vw-open.js +35 -0
  155. package/workspace/public/pm/premium-vw-page.js +16 -0
  156. package/workspace/public/pm/premium-vw-rec.js +11 -215
  157. package/workspace/public/pm/premium-vw-slides.css +5 -0
  158. package/workspace/public/pm/premium-vw-slides.js +44 -8
  159. package/workspace/public/pm/term-view.js +22 -0
  160. package/workspace/public/premium-board.html +57 -64
  161. package/workspace/public/premium-chat.html +7 -33
  162. package/workspace/public/premium-initiative.html +8 -41
  163. package/workspace/public/premium-insights.html +63 -62
  164. package/workspace/public/premium-viewer.html +20 -0
  165. package/workspace/public/premium-work.html +6 -72
  166. package/workspace/public/premium.html +21 -66
  167. package/workspace/public/vendor/nunito-var.woff2 +0 -0
  168. package/workspace/server.js +25 -3
  169. package/workspace/test-files.json +1 -0
  170. package/workspace/test-lists/home-libs.json +9 -0
  171. package/workspace/test-lists/premium-agreed-viewer.json +9 -0
  172. package/workspace/test-lists/premium-report-read.json +1 -1
  173. package/workspace/test-lists/premium-vw-agreed.json +9 -0
  174. package/workspace/test-lists/premium-vw-notes.json +1 -1
  175. package/workspace/third-party/README.md +1 -0
  176. package/workspace/public/pm/premium-work.js +0 -719
  177. package/workspace/public/pm/premium.js +0 -1133
@@ -0,0 +1,396 @@
1
+ /* pm/cozy-md.js — markdown for the console3 document sheet (initiative c3-doc-sheet-rich): read it as rich text, edit it as rich
2
+ * text, and show a change as a rendered diff.
3
+ * Moved here from pm/c3-md.js (premium-agreed-design), so premium pages load no c3-* module; c3-md.js re-exports it.
4
+ *
5
+ * parseMd(md) → blocks the subset PMOS documents use: headings, paragraphs, quotes, bulleted, numbered and
6
+ * checklist lists, tables, dividers and fenced code; inline bold, italic, code and links
7
+ * toMd(blocks) → md the canonical markdown of blocks; toMd(parseMd(toMd(b))) === toMd(b)
8
+ * canonMd(md) → md toMd(parseMd(md)): two texts that read the same compare equal
9
+ * diffMd(before, after) → md `after`, with the words removed and added since `before` wrapped in markers that
10
+ * toDom draws as <del> and <ins>; a line or sentence rewritten in most of its words is
11
+ * shown whole, removed then added
12
+ * toDom(blocks, doc?) → Node[] the blocks as elements (no innerHTML: every text is a text node); links are http(s),
13
+ * mailto or relative only
14
+ * fromDom(root) → blocks what the rich-text editor holds, read back as blocks
15
+ *
16
+ * parseMd, toMd, canonMd and diffMd are pure (Node-testable: c3-md.test.js); toDom and fromDom need a document.
17
+ */
18
+
19
+ export const INS = '\uE000';
20
+ export const INS_END = '\uE001';
21
+ export const DEL = '\uE002';
22
+ export const DEL_END = '\uE003';
23
+ const MARK = /[\uE000-\uE003]/g;
24
+
25
+ /* ── inline ── */
26
+
27
+ /** Inline markdown → [{ t:'text', s } | { t:'b'|'i', c:[…] } | { t:'code', s } | { t:'a', href, c:[…] }]. */
28
+ export function parseInline(src) {
29
+ const s = String(src == null ? '' : src);
30
+ const out = [];
31
+ let buf = '';
32
+ const flush = () => { if (buf) { out.push({ t: 'text', s: buf }); buf = ''; } };
33
+ let i = 0;
34
+ while (i < s.length) {
35
+ const c = s[i];
36
+ if (c === '\\' && i + 1 < s.length && /[\\`*_[\]()#|>-]/.test(s[i + 1])) { buf += s[i + 1]; i += 2; continue; }
37
+ if (c === '`') {
38
+ const j = s.indexOf('`', i + 1);
39
+ if (j > i) { flush(); out.push({ t: 'code', s: s.slice(i + 1, j) }); i = j + 1; continue; }
40
+ }
41
+ if (c === '[') {
42
+ const m = /^\[((?:[^\]\\]|\\.)+)\]\(([^)\s]+)\)/.exec(s.slice(i));
43
+ if (m) { flush(); out.push({ t: 'a', href: m[2], c: parseInline(m[1]) }); i += m[0].length; continue; }
44
+ }
45
+ if ((c === '*' || c === '_') && s[i + 1] === c) {
46
+ const j = s.indexOf(c + c, i + 2);
47
+ if (j > i + 2) { flush(); out.push({ t: 'b', c: parseInline(s.slice(i + 2, j)) }); i = j + 2; continue; }
48
+ }
49
+ if ((c === '*' || c === '_') && s[i + 1] !== c && s[i + 1] !== ' ' && (c === '*' || !/\w/.test(s[i - 1] || ''))) {
50
+ let j = i + 1;
51
+ while (j < s.length && !(s[j] === c && s[j + 1] !== c && s[j - 1] !== ' ' && s[j - 1] !== c)) j++;
52
+ if (j < s.length && j > i + 1 && (c === '*' || !/\w/.test(s[j + 1] || ''))) { flush(); out.push({ t: 'i', c: parseInline(s.slice(i + 1, j)) }); i = j + 1; continue; }
53
+ }
54
+ buf += c; i++;
55
+ }
56
+ flush();
57
+ return out;
58
+ }
59
+
60
+ // Text is escaped only where markdown would read it as syntax: a backslash before punctuation, `, *, [ and ], and an _ that
61
+ // is not inside a word (snake_case stays as written).
62
+ const escText = (s) => String(s).replace(/\\(?=[\\`*_[\]()#|>-])/g, '\\\\').replace(/[`*[\]]/g, '\\$&').replace(/(^|\W)_|_(?=\W|$)/g, (m) => m.replace('_', '\\_'));
63
+ /** Inline nodes → markdown. `raw`: text as it is, unescaped (for a plain-text label). */
64
+ export function inlineMd(nodes, raw) {
65
+ return (nodes || []).map((n) => {
66
+ if (n.t === 'text') return raw ? n.s : escText(n.s);
67
+ if (n.t === 'code') return raw ? n.s : '`' + n.s + '`';
68
+ const inner = inlineMd(n.c, raw);
69
+ if (raw || !inner.trim()) return inner;
70
+ const lead = inner.match(/^\s*/)[0]; const tail = inner.match(/\s*$/)[0]; const core = inner.trim();
71
+ if (n.t === 'b') return lead + '**' + core + '**' + tail;
72
+ if (n.t === 'i') return lead + '*' + core + '*' + tail;
73
+ if (n.t === 'a') return lead + '[' + core + '](' + n.href + ')' + tail;
74
+ return inner;
75
+ }).join('');
76
+ }
77
+ // a paragraph or list item whose text would start a heading, quote, list or rule is escaped at its start
78
+ const lineSafe = (s) => s.replace(/^(#{1,6}\s|>|[-+]\s|\d+[.)]\s|-{3,}\s*$)/, '\\$1');
79
+
80
+ /* ── blocks ── */
81
+
82
+ const LIST = /^(\s*)([-*+]|\d+[.)])\s+/;
83
+ const TASK = /^\[( |x|X)\]\s+/;
84
+ const cells = (r) => {
85
+ const t = r.trim().replace(/^\|/, '').replace(/\|\s*$/, '');
86
+ const out = []; let cur = ''; for (let i = 0; i < t.length; i++) { if (t[i] === '\\' && t[i + 1] === '|') { cur += '|'; i++; } else if (t[i] === '|') { out.push(cur.trim()); cur = ''; } else cur += t[i]; }
87
+ out.push(cur.trim()); return out;
88
+ };
89
+ const isRule = (l) => /^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$/.test(l);
90
+ const startsBlock = (l) => /^(#{1,6}\s|>|```|~~~|\s*(-{3,}|\*{3,}|_{3,})\s*$)/.test(l) || LIST.test(l) || /^\s*\|/.test(l);
91
+
92
+ /** Markdown → blocks: { t:'h', level, c } · { t:'p', c } · { t:'quote', blocks } · { t:'list', ordered, items:[{ task, c }] } ·
93
+ * { t:'table', head:[c], rows:[[c]] } · { t:'hr' } · { t:'code', lang, s }. Marker characters (diffMd) pass through as text. */
94
+ export function parseMd(md) {
95
+ const L = String(md == null ? '' : md).replace(/\r\n?/g, '\n').split('\n');
96
+ const out = []; let i = 0;
97
+ const bare = (l) => l.replace(MARK, '');
98
+ while (i < L.length) {
99
+ const l = L[i]; const b = bare(l); let m;
100
+ if (!b.trim()) { i++; continue; }
101
+ if ((m = /^(```|~~~)\s*([\w-]*)/.exec(b))) {
102
+ const fence = m[1]; const body = []; i++;
103
+ while (i < L.length && !bare(L[i]).startsWith(fence)) body.push(L[i++]);
104
+ i++; out.push({ t: 'code', lang: m[2] || '', s: body.join('\n') }); continue;
105
+ }
106
+ if ((m = /^(#{1,6})\s+(.*?)\s*#*\s*$/.exec(l))) { out.push({ t: 'h', level: m[1].length, c: parseInline(m[2]) }); i++; continue; }
107
+ if (/^\s*(-{3,}|\*{3,}|_{3,})\s*$/.test(b)) { out.push({ t: 'hr' }); i++; continue; }
108
+ if (/^\s*>/.test(b)) {
109
+ const body = [];
110
+ while (i < L.length && /^\s*>/.test(bare(L[i]))) body.push(L[i++].replace(/^(\s*[\uE000-\uE003]*)\s*>\s?/, '$1'));
111
+ out.push({ t: 'quote', blocks: parseMd(body.join('\n')) }); continue;
112
+ }
113
+ if (/^\s*\|/.test(b) && i + 1 < L.length && isRule(bare(L[i + 1]))) {
114
+ const head = cells(l); i += 2; const rows = [];
115
+ while (i < L.length && /^\s*\|/.test(bare(L[i]))) rows.push(cells(L[i++]));
116
+ out.push({ t: 'table', head: head.map(parseInline), rows: rows.map((r) => head.map((_, k) => parseInline(r[k] || ''))) }); continue;
117
+ }
118
+ if (LIST.test(b)) {
119
+ const ordered = /^\s*\d/.test(b); const items = [];
120
+ while (i < L.length && LIST.test(bare(L[i])) && /^\s*\d/.test(bare(L[i])) === ordered) {
121
+ const lead = (/^[\uE000-\uE003]*/.exec(L[i]) || [''])[0];
122
+ let t = lead + L[i].slice(lead.length).replace(LIST, ''); i++;
123
+ while (i < L.length && /^\s{2,}\S/.test(L[i]) && !LIST.test(bare(L[i]))) t += ' ' + L[i++].trim();
124
+ const tk = TASK.exec(t.replace(MARK, ''));
125
+ if (tk) { const k = t.indexOf('['); t = t.slice(0, k) + t.slice(k).replace(TASK, ''); }
126
+ items.push({ task: tk ? tk[1] !== ' ' : null, c: parseInline(t) });
127
+ }
128
+ out.push({ t: 'list', ordered, items }); continue;
129
+ }
130
+ const body = [];
131
+ while (i < L.length && bare(L[i]).trim() && (!body.length || !startsBlock(bare(L[i])))) body.push(L[i++].trim());
132
+ out.push({ t: 'p', c: parseInline(body.join(' ')) });
133
+ }
134
+ return out;
135
+ }
136
+
137
+ /** Blocks → markdown, one blank line between blocks. */
138
+ export function toMd(blocks) {
139
+ return (blocks || []).map((b) => {
140
+ if (b.t === 'h') return '#'.repeat(b.level || 2) + ' ' + inlineMd(b.c).trim();
141
+ if (b.t === 'p') return lineSafe(inlineMd(b.c).trim());
142
+ if (b.t === 'hr') return '---';
143
+ if (b.t === 'code') return '```' + (b.lang || '') + '\n' + b.s + '\n```';
144
+ if (b.t === 'quote') return toMd(b.blocks).split('\n').map((x) => (x ? '> ' + x : '>')).join('\n');
145
+ if (b.t === 'list') return b.items.map((it, k) => (b.ordered ? (k + 1) + '. ' : '- ') + (it.task == null ? '' : it.task ? '[x] ' : '[ ] ') + inlineMd(it.c).trim()).join('\n');
146
+ if (b.t === 'table') {
147
+ const cell = (c) => inlineMd(c).trim().replace(/\|/g, '\\|');
148
+ const w = Math.max(b.head.length, ...b.rows.map((r) => r.length));
149
+ const line = (r) => '| ' + Array.from({ length: w }, (_, k) => (r[k] ? cell(r[k]) : '')).join(' | ') + ' |';
150
+ return [line(b.head), '|' + Array.from({ length: w }, () => '---').join('|') + '|', ...b.rows.map(line)].join('\n');
151
+ }
152
+ return '';
153
+ }).filter((x) => x !== '').join('\n\n');
154
+ }
155
+
156
+ export const canonMd = (md) => toMd(parseMd(md));
157
+
158
+ /* ── the rendered diff ── */
159
+
160
+ function lcs(a, b) {
161
+ const n = a.length, m = b.length;
162
+ if (n * m > 400000) return [...a.map((x) => ['-', x]), ...b.map((x) => ['+', x])];
163
+ const T = Array.from({ length: n + 1 }, () => new Int32Array(m + 1));
164
+ for (let i = n - 1; i >= 0; i--) for (let j = m - 1; j >= 0; j--) T[i][j] = a[i] === b[j] ? T[i + 1][j + 1] + 1 : Math.max(T[i + 1][j], T[i][j + 1]);
165
+ const ops = []; let i = 0, j = 0;
166
+ while (i < n && j < m) { if (a[i] === b[j]) { ops.push(['=', a[i]]); i++; j++; } else if (T[i + 1][j] >= T[i][j + 1]) ops.push(['-', a[i++]]); else ops.push(['+', b[j++]]); }
167
+ while (i < n) ops.push(['-', a[i++]]); while (j < m) ops.push(['+', b[j++]]);
168
+ return ops;
169
+ }
170
+ /** Runs of ops: [{ eq:true, items } | { eq:false, del:[…], add:[…] }]. */
171
+ function runs(ops) {
172
+ const out = [];
173
+ for (const [op, x] of ops) {
174
+ const last = out[out.length - 1];
175
+ if (op === '=') { if (last && last.eq) last.items.push(x); else out.push({ eq: true, items: [x] }); }
176
+ else { if (!last || last.eq) out.push({ eq: false, del: [], add: [] }); out[out.length - 1][op === '-' ? 'del' : 'add'].push(x); }
177
+ }
178
+ return out;
179
+ }
180
+ const wrap = (s, a, z) => (s && s.trim() ? a + s + z : s);
181
+ function words(a, b) {
182
+ const tok = (x) => x.match(/\s+|[^\s]+/g) || [];
183
+ const A = tok(a), B = tok(b); const ops = lcs(A, B);
184
+ const real = (x) => /\S/.test(x);
185
+ const same = ops.filter(([o, x]) => o === '=' && real(x)).length;
186
+ const tot = Math.max(A.filter(real).length, B.filter(real).length);
187
+ if (tot > 4 && same / tot < 0.6) return wrap(a, DEL, DEL_END) + ' ' + wrap(b, INS, INS_END);
188
+ return runs(ops).map((r) => (r.eq ? r.items.join('') : wrap(r.del.join(''), DEL, DEL_END) + (r.del.length && r.add.length ? ' ' : '') + wrap(r.add.join(''), INS, INS_END))).join('');
189
+ }
190
+ function sentences(a, b) {
191
+ const cut = (x) => x.split(/(?<=[.;!?])\s+/);
192
+ const A = cut(a), B = cut(b);
193
+ if (A.length < 2 && B.length < 2) return words(a, b);
194
+ return runs(lcs(A, B)).map((r) => {
195
+ if (r.eq) return r.items.join(' ');
196
+ const n = Math.min(r.del.length, r.add.length); const parts = [];
197
+ for (let k = 0; k < n; k++) parts.push(words(r.del[k], r.add[k]));
198
+ r.del.slice(n).forEach((x) => parts.push(wrap(x, DEL, DEL_END)));
199
+ r.add.slice(n).forEach((x) => parts.push(wrap(x, INS, INS_END)));
200
+ return parts.join(' ');
201
+ }).join(' ');
202
+ }
203
+ const PREFIX = /^(\s*(?:[-*+]|\d+[.)])\s+(?:\[[ xX]\]\s+)?|\s*>\s?|#{1,6}\s+)/;
204
+ function wrapLine(l, a, z) {
205
+ if (!l.trim() || isRule(l)) return l;
206
+ if (/^\s*\|/.test(l)) return '| ' + cells(l).map((c) => wrap(c, a, z)).join(' | ') + ' |';
207
+ if (/^(```|~~~)/.test(l) || /^\s*(-{3,}|\*{3,})\s*$/.test(l)) return l;
208
+ const p = (PREFIX.exec(l) || [''])[0];
209
+ return p + wrap(l.slice(p.length), a, z);
210
+ }
211
+ function lineDiff(a, b) {
212
+ const pa = (PREFIX.exec(a) || [''])[0], pb = (PREFIX.exec(b) || [''])[0];
213
+ if (/^\s*\|/.test(a) && /^\s*\|/.test(b) && !isRule(a) && !isRule(b)) {
214
+ const ca = cells(a), cb = cells(b);
215
+ return '| ' + cb.map((c, k) => (ca[k] === c ? c : sentences(ca[k] || '', c))).join(' | ') + ' |';
216
+ }
217
+ if (pa === pb) return pb + sentences(a.slice(pa.length), b.slice(pb.length));
218
+ return null;
219
+ }
220
+
221
+ /** `after` with the change since `before` marked. `before` null: the whole of `after` is new. */
222
+ export function diffMd(before, after) {
223
+ const B = String(after == null ? '' : after).split('\n');
224
+ if (before == null) return B.map((l) => wrapLine(l, INS, INS_END)).join('\n');
225
+ const A = String(before).split('\n');
226
+ const out = [];
227
+ for (const r of runs(lcs(A, B))) {
228
+ if (r.eq) { out.push(...r.items); continue; }
229
+ const n = Math.min(r.del.length, r.add.length);
230
+ const removed = []; const added = [];
231
+ for (let k = 0; k < n; k++) {
232
+ const d = lineDiff(r.del[k], r.add[k]);
233
+ if (d == null) { removed.push(wrapLine(r.del[k], DEL, DEL_END)); added.push(wrapLine(r.add[k], INS, INS_END)); } else added.push(d);
234
+ }
235
+ r.del.slice(n).forEach((l) => removed.push(wrapLine(l, DEL, DEL_END)));
236
+ r.add.slice(n).forEach((l) => added.push(wrapLine(l, INS, INS_END)));
237
+ // a removed table row or list item stays in its table or list: put it with the rows after it
238
+ out.push(...removed.filter((l) => l.trim()), ...added);
239
+ }
240
+ return out.join('\n');
241
+ }
242
+
243
+ /** Words added and removed between two texts: [added, removed]. */
244
+ export function wordCounts(before, after) {
245
+ const A = String(before || '').match(/\S+/g) || [], B = String(after || '').match(/\S+/g) || [];
246
+ let add = 0, del = 0;
247
+ for (const [o] of lcs(A, B)) { if (o === '+') add++; else if (o === '-') del++; }
248
+ return [add, del];
249
+ }
250
+
251
+ /* ── DOM ── */
252
+
253
+ /** A safe href: http(s), mailto, a fragment or a relative path; anything else (javascript:, data:) is dropped. */
254
+ export function safeHref(h) {
255
+ const s = String(h || '').trim();
256
+ if (/^(https?:|mailto:)/i.test(s)) return s;
257
+ if (/^[a-z][\w+.-]*:/i.test(s)) return null;
258
+ return s;
259
+ }
260
+
261
+ /** Text with diff markers → nodes: the marked runs inside <ins> and <del>. `st` carries an open marker across inline nodes. */
262
+ function textNodes(doc, s, st) {
263
+ const out = []; let buf = '';
264
+ const push = () => {
265
+ if (!buf) return;
266
+ const t = doc.createTextNode(buf); buf = '';
267
+ if (st.mode) { const w = doc.createElement(st.mode); w.appendChild(t); out.push(w); } else out.push(t);
268
+ };
269
+ for (const ch of String(s)) {
270
+ if (ch === INS || ch === DEL) { push(); st.mode = ch === INS ? 'ins' : 'del'; }
271
+ else if (ch === INS_END || ch === DEL_END) { push(); st.mode = null; }
272
+ else buf += ch;
273
+ }
274
+ push();
275
+ return out;
276
+ }
277
+ function inlineDom(doc, nodes, st) {
278
+ const out = [];
279
+ for (const n of nodes || []) {
280
+ if (n.t === 'text') { out.push(...textNodes(doc, n.s, st)); continue; }
281
+ if (n.t === 'code') { const c = doc.createElement('code'); c.append(...textNodes(doc, n.s, st)); out.push(c); continue; }
282
+ const tag = n.t === 'b' ? 'strong' : n.t === 'i' ? 'em' : 'a';
283
+ const e = doc.createElement(tag);
284
+ if (n.t === 'a') {
285
+ const h = safeHref(n.href);
286
+ if (h != null) { e.setAttribute('href', h); if (/^https?:/i.test(h)) { e.setAttribute('target', '_blank'); e.setAttribute('rel', 'noopener'); } }
287
+ }
288
+ e.append(...inlineDom(doc, n.c, st));
289
+ out.push(e);
290
+ }
291
+ return out;
292
+ }
293
+
294
+ /** Blocks → elements. `opts.editable` draws checklist boxes that can be ticked (the editor). */
295
+ export function toDom(blocks, doc, opts = {}) {
296
+ const d = doc || document;
297
+ const mk = (tag, cls) => { const e = d.createElement(tag); if (cls) e.className = cls; return e; };
298
+ return (blocks || []).map((b) => {
299
+ const st = { mode: null };
300
+ if (b.t === 'h') { const e = mk('h' + Math.min(6, Math.max(1, b.level || 2))); e.append(...inlineDom(d, b.c, st)); return e; }
301
+ if (b.t === 'p') { const e = mk('p'); e.append(...inlineDom(d, b.c, st)); return e; }
302
+ if (b.t === 'hr') return mk('hr');
303
+ if (b.t === 'code') { const p = mk('pre'); if (b.lang) p.setAttribute('data-lang', b.lang); const c = mk('code'); c.append(...textNodes(d, b.s, st)); p.appendChild(c); return p; }
304
+ if (b.t === 'quote') { const q = mk('blockquote'); q.append(...toDom(b.blocks, d, opts)); return q; }
305
+ if (b.t === 'list') {
306
+ const l = mk(b.ordered ? 'ol' : 'ul', b.items.some((it) => it.task != null) ? 'tasks' : '');
307
+ for (const it of b.items) {
308
+ const li = mk('li');
309
+ if (it.task != null) {
310
+ li.className = 'task' + (it.task ? ' done' : '');
311
+ const box = mk('input'); box.type = 'checkbox'; box.checked = !!it.task; box.setAttribute('aria-label', 'Done');
312
+ if (opts.editable) box.setAttribute('contenteditable', 'false'); else box.disabled = true;
313
+ const sp = mk('span'); sp.append(...inlineDom(d, it.c, st));
314
+ li.append(box, sp);
315
+ } else li.append(...inlineDom(d, it.c, st));
316
+ l.appendChild(li);
317
+ }
318
+ return l;
319
+ }
320
+ if (b.t === 'table') {
321
+ const w = mk('div', 'tw'); const t = mk('table'); const th = mk('thead'); const tr = mk('tr');
322
+ for (const c of b.head) { const x = mk('th'); x.append(...inlineDom(d, c, st)); tr.appendChild(x); }
323
+ th.appendChild(tr); const tb = mk('tbody');
324
+ for (const r of b.rows) { const row = mk('tr'); for (const c of r) { const x = mk('td'); x.append(...inlineDom(d, c, st)); row.appendChild(x); } tb.appendChild(row); }
325
+ t.append(th, tb); w.appendChild(t); return w;
326
+ }
327
+ return d.createTextNode('');
328
+ });
329
+ }
330
+
331
+ /* reading the editor back */
332
+ function inlineOf(n) {
333
+ const out = [];
334
+ const text = (s) => { if (!s) return; const last = out[out.length - 1]; if (last && last.t === 'text') last.s += s; else out.push({ t: 'text', s }); };
335
+ for (const c of Array.from(n.childNodes || [])) {
336
+ if (c.nodeType === 3) { text(c.textContent.replace(/\u00a0/g, ' ').replace(/\u200b/g, '').replace(/\s+/g, ' ')); continue; }
337
+ if (c.nodeType !== 1) continue;
338
+ const t = c.tagName;
339
+ if (t === 'BR') { text(' '); continue; }
340
+ if (t === 'INPUT' || t === 'UL' || t === 'OL') continue;
341
+ if (t === 'CODE') { out.push({ t: 'code', s: c.textContent.replace(/\u200b/g, '') }); continue; }
342
+ if (t === 'STRONG' || t === 'B') { out.push({ t: 'b', c: inlineOf(c) }); continue; }
343
+ if (t === 'EM' || t === 'I') { out.push({ t: 'i', c: inlineOf(c) }); continue; }
344
+ if (t === 'A') { out.push({ t: 'a', href: c.getAttribute('href') || '', c: inlineOf(c) }); continue; }
345
+ if (t === 'SPAN' && /font-weight:\s*(bold|[6-9]00)/.test(c.getAttribute('style') || '')) { out.push({ t: 'b', c: inlineOf(c) }); continue; }
346
+ if (t === 'SPAN' && /font-style:\s*italic/.test(c.getAttribute('style') || '')) { out.push({ t: 'i', c: inlineOf(c) }); continue; }
347
+ for (const x of inlineOf(c)) { if (x.t === 'text') text(x.s); else out.push(x); }
348
+ }
349
+ return out;
350
+ }
351
+ const trimInline = (c) => {
352
+ const a = c.slice();
353
+ while (a.length && a[0].t === 'text' && !a[0].s.trim()) a.shift();
354
+ while (a.length && a[a.length - 1].t === 'text' && !a[a.length - 1].s.trim()) a.pop();
355
+ if (a.length && a[0].t === 'text') a[0] = { ...a[0], s: a[0].s.replace(/^\s+/, '') };
356
+ if (a.length && a[a.length - 1].t === 'text') a[a.length - 1] = { ...a[a.length - 1], s: a[a.length - 1].s.replace(/\s+$/, '') };
357
+ return a;
358
+ };
359
+ const BLOCK = /^(P|DIV|H[1-6]|BLOCKQUOTE|UL|OL|TABLE|PRE|HR|SECTION)$/;
360
+ /** The editor's children → blocks. Loose text and inline nodes between blocks become a paragraph. */
361
+ export function fromDom(root) {
362
+ const out = []; let loose = null;
363
+ const endLoose = () => { if (loose) { const c = trimInline(inlineOf(loose)); if (c.length) out.push({ t: 'p', c }); loose = null; } };
364
+ for (const n of Array.from(root.childNodes || [])) {
365
+ if (n.nodeType === 1 && BLOCK.test(n.tagName)) { endLoose(); out.push(...blockOf(n)); continue; }
366
+ if (n.nodeType === 3 && !n.textContent.trim() && !loose) continue;
367
+ if (!loose) loose = (root.ownerDocument || document).createElement('p');
368
+ loose.appendChild(n.cloneNode(true));
369
+ }
370
+ endLoose();
371
+ return out;
372
+ }
373
+ function blockOf(n) {
374
+ const t = n.tagName;
375
+ if (/^H[1-6]$/.test(t)) return [{ t: 'h', level: +t[1], c: trimInline(inlineOf(n)) }];
376
+ if (t === 'HR') return [{ t: 'hr' }];
377
+ if (t === 'PRE') return [{ t: 'code', lang: n.getAttribute('data-lang') || '', s: n.textContent.replace(/\n$/, '') }];
378
+ if (t === 'BLOCKQUOTE') { const b = fromDom(n); return b.length ? [{ t: 'quote', blocks: b }] : []; }
379
+ if (t === 'UL' || t === 'OL') {
380
+ const items = Array.from(n.children).filter((li) => li.tagName === 'LI').map((li) => {
381
+ const box = li.querySelector(':scope > input[type=checkbox]');
382
+ return { task: box ? !!box.checked : null, c: trimInline(inlineOf(li)) };
383
+ });
384
+ const nested = Array.from(n.querySelectorAll(':scope > li > ul, :scope > li > ol')).flatMap(blockOf);
385
+ return [{ t: 'list', ordered: t === 'OL', items }, ...nested];
386
+ }
387
+ if (t === 'TABLE' || (t === 'DIV' && n.querySelector(':scope > table'))) {
388
+ const tb = t === 'TABLE' ? n : n.querySelector(':scope > table');
389
+ const rows = Array.from(tb.querySelectorAll('tr')).map((r) => Array.from(r.children).map((c) => trimInline(inlineOf(c))));
390
+ if (!rows.length) return [];
391
+ return [{ t: 'table', head: rows[0], rows: rows.slice(1) }];
392
+ }
393
+ if ((t === 'DIV' || t === 'SECTION') && Array.from(n.children).some((c) => BLOCK.test(c.tagName))) return fromDom(n);
394
+ const c = trimInline(inlineOf(n));
395
+ return c.length ? [{ t: 'p', c }] : [];
396
+ }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * cozy-nav.js — the floating place menu of the Agreed design (initiative premium-agreed-design).
3
+ *
4
+ * One button, bottom left on desktop and bottom right on a phone, opens Home, Board, Insights and Settings.
5
+ * It is the one way between places: the old five-place rail is gone (premium-shell.js takes it out of the page).
6
+ * Settings has no design yet, so it opens the Viewer on its placeholder (cozy-viewer.js). Nothing here leads to the console.
7
+ */
8
+ import { placeholder } from './cozy-viewer.js';
9
+
10
+ export const PLACES = [
11
+ { key: 'home', label: 'Home', href: '/premium.html', d: 'M4 11l8-7 8 7v9h-5v-6h-6v6H4z' },
12
+ { key: 'board', label: 'Board', href: '/premium-board.html', d: 'M12 3 3 8l9 5 9-5zM3 13l9 5 9-5' },
13
+ { key: 'insights', label: 'Insights', href: '/premium-insights.html', d: 'M4 20V10M10 20V4M16 20v-8M22 20H2' },
14
+ ];
15
+ const MENU = 'M4 7h16M4 12h16M4 17h16';
16
+ const CLOSE = 'M6 6l12 12M18 6L6 18';
17
+ const MORE = 'M5 12h.01M12 12h.01M19 12h.01';
18
+ const GEAR = 'M12 9a3 3 0 1 0 0 6a3 3 0 1 0 0-6M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M16.9 16.9l2.1 2.1M4.9 19.1l2.1-2.1M16.9 7.1l2.1-2.1';
19
+ const svg = (d) => `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
20
+
21
+ /** The label the button reads: "Open the menu. You are in Board". */
22
+ export function fabLabel(here, open) {
23
+ const p = PLACES.find((x) => x.key === here);
24
+ return open ? 'Close the menu' : 'Open the menu. You are in ' + (p ? p.label : 'PMOS');
25
+ }
26
+
27
+ /** The menu's markup for one place; pure, so a unit test can read it. */
28
+ export function menuHtml(here) {
29
+ return PLACES.map((p) => `<a href="${p.href}"${p.key === here ? ' aria-current="page"' : ''}>${svg(p.d)}<span>${p.label}</span></a>`).join('')
30
+ + `<button type="button" class="cz-set" data-cz-more>${svg(MORE)}<span>More</span></button>`
31
+ + `<button type="button" class="cz-set" data-cz-settings>${svg(GEAR)}<span>Settings</span></button>`;
32
+ }
33
+
34
+ /** Mount the menu once. `here` is home | board | insights. Returns the wrapper. */
35
+ export function mountNav(here, doc = document, opts = {}) {
36
+ const old = doc.getElementById('czNav'); if (old) return old;
37
+ doc.body.classList.add('cz');
38
+ const w = doc.createElement('div'); w.className = 'cz-fabw'; w.id = 'czNav';
39
+ w.innerHTML = `<nav class="cz-fabm" id="czMenu" aria-label="Places" hidden>${menuHtml(here)}</nav>`
40
+ + `<button type="button" class="cz-fab" id="czFab" aria-controls="czMenu" aria-expanded="false" aria-label="${fabLabel(here, false)}">${svg(MENU)}</button>`;
41
+ doc.body.appendChild(w);
42
+ const fab = w.querySelector('#czFab'), menu = w.querySelector('#czMenu');
43
+ const set = (open) => {
44
+ menu.hidden = !open; fab.setAttribute('aria-expanded', String(open));
45
+ fab.setAttribute('aria-label', fabLabel(here, open)); fab.innerHTML = svg(open ? CLOSE : MENU);
46
+ };
47
+ fab.addEventListener('click', () => set(menu.hidden));
48
+ doc.addEventListener('keydown', (e) => { if (e.key === 'Escape' && !menu.hidden) { set(false); fab.focus(); } });
49
+ // set() redraws the button's icon, so the pressed icon may be gone from the page by now: only a press still on the page closes the menu
50
+ doc.addEventListener('click', (e) => { if (!menu.hidden && e.target.isConnected && !w.contains(e.target)) set(false); });
51
+ // Settings and More: the minimal versions of the features the design does not draw yet (home-more.js), each with "Waiting for design"
52
+ menu.querySelector('[data-cz-settings]').addEventListener('click', () => { set(false); import('./home-more.js').then((M) => M.openSettings()).catch(() => placeholder('Settings', { icon: 'gear' })); });
53
+ menu.querySelector('[data-cz-more]').addEventListener('click', () => {
54
+ set(false);
55
+ if (opts.more) { opts.more()(fab); return; }
56
+ import('./home-more.js').then((M) => moreList(M, doc)).catch(() => placeholder('More', { icon: 'list' }));
57
+ });
58
+ return w;
59
+ }
60
+ /** The features with no design yet, as one list in the Viewer, on a page that has no menu of its own for them. */
61
+ function moreList(M, doc) {
62
+ const go = { work: M.openMyWork, around: M.openAround, inbox: () => M.openInbox(), eod: M.openEndOfDay, rec: M.openRecorder, search: () => M.openSearch(), products: M.openProducts, sources: M.openSources, settings: M.openSettings,
63
+ cal: () => (doc.defaultView.czViews && doc.defaultView.czViews.openCalendar ? doc.defaultView.czViews.openCalendar({ view: 'day' }) : placeholder('Calendar', { icon: 'cal' })) };
64
+ return M.listCard(M.moreItems.map(([k, l]) => [l, go[k]]));
65
+ }
@@ -0,0 +1,26 @@
1
+ /* pm/cozy-placeholder.js — the card for a feature the Agreed design does not draw yet (initiative premium-agreed-design).
2
+ *
3
+ * The rebuilt pages show only what the design draws. Where a feature has no design yet, a page draws this small calm card in its place,
4
+ * so the feature is named and nothing old is shown instead:
5
+ * czPlaceholder(el, featureName, note?) → el. It puts the card in el (it replaces what el held) and returns el.
6
+ * placeholderHtml(featureName, note?) → the same card as a string, for a page that builds its markup as text.
7
+ * The card reads "<featureName> · Waiting for design". note is one optional short line under it. The look is in cozy.css (.cz-ph). */
8
+ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"]/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]));
9
+ const ICON = 'M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18M12 7v5l3 2';
10
+
11
+ /** The words of the card's line; pure, for a unit test. */
12
+ export const placeholderText = (featureName) => (String(featureName || '').trim() || 'This part') + ' · Waiting for design';
13
+
14
+ export function placeholderHtml(featureName, note) {
15
+ return `<div class="cz-ph" role="note" data-cz-placeholder="${esc(String(featureName || '').trim())}">`
16
+ + `<span class="cz-ph-ic" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="${ICON}"/></svg></span>`
17
+ + `<div class="cz-ph-t"><p class="cz-ph-l">${esc(placeholderText(featureName))}</p>${note ? `<p class="cz-ph-n">${esc(note)}</p>` : ''}</div></div>`;
18
+ }
19
+
20
+ export function czPlaceholder(el, featureName, note) {
21
+ if (!el) return el;
22
+ el.innerHTML = placeholderHtml(featureName, note);
23
+ return el;
24
+ }
25
+
26
+ if (typeof window !== 'undefined') { window.czPlaceholder = czPlaceholder; window.czPlaceholderHtml = placeholderHtml; }
@@ -0,0 +1,143 @@
1
+ /* pm/cozy-viewer.css — the Agreed design's look for the shared dialog and the Viewer (initiative premium-agreed-design, area viewer).
2
+ * premium-viewer.js loads it once (it is not a premium-vw-* sheet: the Agreed design's Nunito and weights are not the console's type). It changes nothing on a page without <body class="cz"> (cozy-nav.js mountNav adds the class).
3
+ * The Viewer frame of the design (Viewer.dc.html) re-points the premium tokens (--ink, --ember, --spot, --solid ...) to the cozy palette;
4
+ * this file does the same for the dialog, its Viewer tabs, its menus and the toast, so every view (doc, slides, Jira, meeting, notes,
5
+ * calendar, report) takes the cozy look from the tokens it already reads. Motion: only the cz-dot levels move (cozy.css). */
6
+
7
+ .cz .dlg, .cz .veil, .cz .toast, .cz .vmenu, .cz .crmenu, .cz .tbmenu, .cz .czi-tok, .cz .cz-vw { /* .cz-vw: the Home Viewer (cozy-viewer.js), whose views read the same tokens */
8
+ --sans: 'Nunito', ui-sans-serif, system-ui, sans-serif;
9
+ --ink: var(--cz-c-2a2e35); --ink-2: var(--cz-c-4a4f58); --ink-3: var(--cz-c-646a74);
10
+ --card: var(--cz-c-ffffff); --card-solid: var(--cz-c-ffffff); --well: var(--cz-c-f4f3f0); --hair: rgba(42,46,53,.1);
11
+ --ember: var(--cz-c-4894ea); --ember-ink: var(--cz-c-2f5fb3); --solid: var(--cz-c-2f5fb3); --on-solid: var(--cz-c-ffffff); --spot: var(--cz-c-eef5fc);
12
+ --ok: var(--cz-c-1e6b45); --bad: var(--cz-c-a8322a); --warn: var(--cz-c-8a5a00); --warn-bg: var(--cz-c-fbf3e4); --ok-bg: var(--cz-c-e7f4ec); --live: var(--cz-c-9a3412); --live-bg: var(--cz-c-fdeee6);
13
+ --b3: rgba(42,46,53,.16);
14
+ --card-shadow: 0 1px 3px rgba(42,46,53,.08);
15
+ --glass: var(--cz-c-ffffff); --glass-edge: rgba(42,46,53,.08); --glass-shadow: 0 14px 34px -12px rgba(42,46,53,.35);
16
+ --r-card: 24px; --r-in: 16px;
17
+ font-family: var(--sans);
18
+ }
19
+ :root[data-theme="dark"] .cz .dlg, :root[data-theme="dark"] .cz .veil, :root[data-theme="dark"] .cz .toast, :root[data-theme="dark"] .cz .vmenu,
20
+ :root[data-theme="dark"] .cz .crmenu, :root[data-theme="dark"] .cz .tbmenu, :root[data-theme="dark"] .cz .czi-tok, :root[data-theme="dark"] .cz .cz-vw {
21
+ --ink: var(--cz-c-eceef1); --ink-2: var(--cz-c-c5c9d0); --ink-3: var(--cz-c-9ea4ad); --card: var(--cz-c-24262b); --card-solid: var(--cz-c-24262b); --well: var(--cz-c-1b1d21); --hair: rgba(236,238,241,.1);
22
+ --ember: var(--cz-c-6aaaf0); --ember-ink: var(--cz-c-9bc7f4); --solid: var(--cz-c-6aaaf0); --on-solid: var(--cz-c-17191c); --spot: rgba(106,170,240,.14);
23
+ --ok: var(--cz-c-7fc79a); --bad: var(--cz-c-f2948c); --warn: var(--cz-c-e8c27a); --warn-bg: rgba(212,161,58,.14); --ok-bg: rgba(94,156,106,.16); --live: var(--cz-c-f2a27a); --live-bg: rgba(217,119,63,.16);
24
+ --b3: rgba(236,238,241,.16); --glass: var(--cz-c-24262b); --glass-edge: rgba(236,238,241,.08); --card-shadow: 0 1px 3px rgba(0,0,0,.4);
25
+ }
26
+ @media (prefers-color-scheme: dark) {
27
+ :root:not([data-theme="light"]) .cz .dlg, :root:not([data-theme="light"]) .cz .veil, :root:not([data-theme="light"]) .cz .toast, :root:not([data-theme="light"]) .cz .vmenu,
28
+ :root:not([data-theme="light"]) .cz .crmenu, :root:not([data-theme="light"]) .cz .tbmenu, :root:not([data-theme="light"]) .cz .czi-tok, :root:not([data-theme="light"]) .cz .cz-vw {
29
+ --ink: var(--cz-c-eceef1); --ink-2: var(--cz-c-c5c9d0); --ink-3: var(--cz-c-9ea4ad); --card: var(--cz-c-24262b); --card-solid: var(--cz-c-24262b); --well: var(--cz-c-1b1d21); --hair: rgba(236,238,241,.1);
30
+ --ember: var(--cz-c-6aaaf0); --ember-ink: var(--cz-c-9bc7f4); --solid: var(--cz-c-6aaaf0); --on-solid: var(--cz-c-17191c); --spot: rgba(106,170,240,.14);
31
+ --ok: var(--cz-c-7fc79a); --bad: var(--cz-c-f2948c); --warn: var(--cz-c-e8c27a); --warn-bg: rgba(212,161,58,.14); --ok-bg: rgba(94,156,106,.16); --live: var(--cz-c-f2a27a); --live-bg: rgba(217,119,63,.16);
32
+ --b3: rgba(236,238,241,.16); --glass: var(--cz-c-24262b); --glass-edge: rgba(236,238,241,.08); --card-shadow: 0 1px 3px rgba(0,0,0,.4);
33
+ }
34
+ }
35
+
36
+ /* ── the dialog: one soft white panel, no glass, no blur ── */
37
+ .cz .veil { background: rgba(42,46,53,.22); -webkit-backdrop-filter: none; backdrop-filter: none; }
38
+ .cz .dlg { background: var(--card-solid); border: 1px solid var(--hair); border-radius: 28px; box-shadow: 0 30px 70px -36px rgba(42,46,53,.28), 0 2px 6px rgba(42,46,53,.06);
39
+ -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--ink); }
40
+ .cz .dlg .dhead h2 { font-size: 19px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
41
+ .cz .dlg .dsub { font-size: 12px; color: var(--ink-3); }
42
+ .cz .dlg .label, .cz .dlg #dEye { font: 700 12px var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink-3); }
43
+ .cz .dlg .dx2 { background: transparent; border-radius: 999px; color: var(--ink-2); }
44
+ .cz .dlg .dx2:hover { background: var(--well); }
45
+ .cz .dlg .dx2[aria-pressed="true"] { background: var(--spot); color: var(--ember-ink); }
46
+ .cz .dlg .p-out { background: var(--well); border-radius: 20px; }
47
+ .cz .dlg .otop { background: var(--well); }
48
+ .cz .dlg .ol { font-weight: 800; }
49
+ .cz .dlg .paper.doc { background: var(--card-solid); border: 1px solid var(--hair); border-radius: 16px; box-shadow: none; }
50
+ .cz .dlg .note, .cz .dlg .xn { color: var(--ink-3); }
51
+ .cz .dlg .lede { color: var(--ink-2); }
52
+
53
+ /* the Viewer tabs: the design's tab strip on the well, the current tab a white pill */
54
+ .cz .vtab { height: 34px; border-radius: 12px 12px 0 0; font-weight: 700; color: var(--ink-3); }
55
+ .cz .vtab:hover { background: var(--card-solid); }
56
+ .cz .vtab[aria-selected="true"] { background: var(--card-solid); color: var(--ink); font-weight: 800; box-shadow: none; }
57
+ .cz .vtab .vx { border-radius: 999px; }
58
+ /* a phone: every tab is a 44 px press (premium-viewer R7) */
59
+ @media (max-width: 640px) { .cz .vtab { height: 44px; } }
60
+ .cz .vmore { border-radius: 999px; font-weight: 800; }
61
+ .cz .vmenu, .cz .crmenu, .cz .tbmenu { background: var(--card-solid); border: 1px solid var(--hair); border-radius: 20px; box-shadow: 0 24px 60px -24px rgba(42,46,53,.45);
62
+ -webkit-backdrop-filter: none; backdrop-filter: none; font-family: var(--sans); }
63
+
64
+ /* presses: solid blue for the one primary, quiet wells for the rest; no lift on hover */
65
+ .cz .dlg .cta, .cz .dlg .btn { background: var(--solid); color: var(--on-solid); font-weight: 800; border-radius: 999px; }
66
+ .cz .dlg .cta.alt, .cz .dlg .btn.sec { background: var(--card-solid); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair); }
67
+ .cz .dlg .cta:hover, .cz .dlg .round:hover, .cz .dlg .lift:hover { transform: none; }
68
+ .cz .dlg .seg { background: var(--well); }
69
+ .cz .dlg .seg .pill { background: var(--card-solid); box-shadow: 0 1px 3px rgba(42,46,53,.12); }
70
+ .cz .dlg .seg button { font-weight: 700; color: var(--ink-3); }
71
+ .cz .dlg .seg button[aria-pressed="true"] { color: var(--ink); }
72
+ .cz .dlg input, .cz .dlg select, .cz .dlg textarea { font-family: var(--sans); }
73
+ .cz .dlg .vcf { border-radius: 16px; background: var(--spot); }
74
+
75
+ /* the toast: a white pill */
76
+ .cz .toast { background: var(--card-solid); color: var(--ink); border: 1px solid var(--hair); box-shadow: 0 14px 34px -12px rgba(42,46,53,.35); font-weight: 700;
77
+ -webkit-backdrop-filter: none; backdrop-filter: none; }
78
+
79
+ /* motion signals importance only: nothing in the dialog rises, blurs or springs */
80
+ .cz .dlg .rise { animation: none; opacity: 1; transform: none; filter: none; }
81
+ .cz .dlg *, .cz .dlg { transition-property: opacity, background-color, color, box-shadow; }
82
+
83
+ /* the dialog is modal: the floating place menu steps aside while it is open, so it never covers the chat box or the Viewer */
84
+ /* Home's docked chat (body.cz-dock) is not modal: it is always on, and the menu keeps its corner beside the left column (premium-agreed-design) */
85
+ .cz:not(.cz-dock):has(.dlg.on) .cz-fabw { display: none; }
86
+
87
+ /* ── the views: what the tokens cannot say (weights, radii) ── */
88
+ /* Jira ticket and sprint (premium-vw-jira) */
89
+ .cz .jbar{border-radius:14px}
90
+ .cz .jbtn{border-radius:999px;font-weight:700}
91
+ .cz .jtk{border-radius:20px;box-shadow:none}
92
+ .cz .jtk h1{font-size:19px;font-weight:800;letter-spacing:-.01em}
93
+ .cz .jtk h3{font-weight:800}
94
+ .cz .jst{border-radius:999px;text-transform:none;letter-spacing:0;font-weight:800;font-size:11.5px}
95
+ .cz .jst.doing{background:var(--spot);color:var(--ember-ink)}
96
+ .cz .jchip{border-radius:999px;font-weight:700}
97
+ .cz .jpts{border-radius:999px}
98
+ .cz .jempty{border-radius:16px}
99
+ .cz .jcrd{border-radius:14px}
100
+ .cz .jcol{border-radius:16px}
101
+
102
+ .cz .jfd dt { font-size: 11px; font-weight: 800; }
103
+ .cz .jfd dd { font-size: 13.5px; font-weight: 700; }
104
+
105
+ /* Every view: Nunito headings at 800, bold at 700, as Viewer.dc.html, Meeting.dc.html and ReportPanel.dc.html set them */
106
+ .cz .dlg .obody h1, .cz .dlg .obody h2, .cz .dlg .obody h3, .cz .dlg .obody h4 { font-family: var(--sans); font-weight: 800; letter-spacing: -.01em; }
107
+ .cz .dlg .obody b, .cz .dlg .obody strong { font-weight: 700; }
108
+
109
+ /* the small caps labels of the views read as the design's 12px labels, not mono capitals (times, keys and code stay mono) */
110
+ .cz .vm .vm-cap, .cz .vm .vm-ser, .cz .vm .vm-st, .cz .vm .vm-tg, .cz .vm .vm-tb th, .cz .vm .vm-shots figcaption,
111
+ .cz .vn-g h4, .cz .vn-t small, .cz .vc .vc-cap, .cz .vc .vc-mh span, .cz .vc .vc-more, .cz .vc .vc-none, .cz .vc .vc-hrs,
112
+ .cz .rt-eye, .cz .rt-tag, .cz .vwi .vwi-l, .cz .vwcl, .cz .vwlab, .cz .vwsh, .cz .lz {
113
+ font-family: var(--sans) !important; letter-spacing: 0 !important; text-transform: none !important; font-weight: 800; }
114
+ /* the calendar (AgCalendar): day heads, hours and event times in Nunito */
115
+ .cz .vc .vc-dn b, .cz .vc .vc-dn i, .cz .vc .vc-dl b, .cz .vc .vc-db, .cz .vc .vc-adl, .cz .vc .vc-gut i, .cz .vc .vc-ev small, .cz .vc .vc-ar time, .cz .vc .vc-me time {
116
+ font-family: var(--sans) !important; letter-spacing: 0 !important; text-transform: none !important; }
117
+ .cz .vc .vc-dn b { font-weight: 800; }
118
+ /* the dialog takes focus when it opens; its own frame shows no ring (its first control does when tabbed to) */
119
+ .cz .dlg:focus, .cz .dlg:focus-visible { outline: none; }
120
+
121
+ /* soft rounded parts: buttons and chips are pills, boxes are 12 to 16px */
122
+ .cz .vm .vm-ib, .cz .vc .vc-ib, .cz .vwib, .cz .vn-x { border-radius: 999px; }
123
+ .cz .vm .vm-lk, .cz .vm .vm-pill, .cz .vm .vm-k, .cz .vn-tg, .cz .vn-k, .cz .rt-chip, .cz .rt-tag, .cz .vwchip, .cz .vc .vc-tdy, .cz .rt .btn, .cz .vwbtn, .cz .vc-open, .cz .vn-open, .cz .rvask, .cz .vwask, .cz .rt-ask { border-radius: 999px; }
124
+ .cz .vm .vm-seg, .cz .vc .vc-seg, .cz .rt .rt-seg, .cz .sl-seg, .cz .vwseg, .cz .vwsg { border-radius: 999px; background: var(--well); }
125
+ .cz .vc .vc-seg button, .cz .sl-seg button, .cz .rt-seg .btn, .cz .vm .vm-mn button { border-radius: 999px; }
126
+ .cz .vm .vm-bx, .cz .vm .vm-none, .cz .vm .vm-part > summary.vm-sh, .cz .vn-q, .cz .vn-l, .cz .rvh, .cz .rvb, .cz .rvta, .cz .vc .vc-w, .cz .vc .vc-db, .cz .vc .vc-md, .cz .vc .vc-dn,
127
+ .cz .rt-msg, .cz .rt-secs, .cz .rt-frame, .cz .rt-cyc li, .cz .sl-ctx, .cz .sl-b, .cz .sl-msg, .cz .sl-stage, .cz .sl-pbox, .cz .vwi .vwi-r, .cz .vbl .bl-s, .cz .vbl .bl-st,
128
+ .cz .vwfnone, .cz .vwag, .cz .vwbefore, .cz .cf, .cz .pnl, .cz .dt, .cz .chk, .cz .xp, .cz .cb, .cz .vwmd, .cz .vwframe, .cz .vwshp, .cz .cpv-bar, .cz .cpv-empty, .cz .cpv-page { border-radius: 14px; }
129
+ .cz .ntmenu, .cz .recm, .cz .rt-menu, .cz .sl-pop, .cz .vwpop { border-radius: 16px; background: var(--card-solid); border: 1px solid var(--hair); box-shadow: 0 24px 60px -24px rgba(42,46,53,.45); }
130
+ .cz .ntmenu button, .cz .recm [role="menuitem"], .cz .rt-menu > button, .cz .sl-pop [role="menuitem"], .cz .vwpop button { border-radius: 10px; }
131
+ .cz .vm .vm-agl i, .cz .vn-k, .cz .vbl .bl-p { border-radius: 999px; }
132
+
133
+ /* the report panel (ReportPanel.dc.html): the paper is a white card on the well, the issue checks are soft wells */
134
+ .cz .rt-frame { box-shadow: none; border: 1px solid var(--hair); }
135
+ .cz .rt-cyc li { background: var(--well); border: 0; }
136
+ /* ReportPanel.dc.html: the primary and secondary presses are 12px rounded, the segmented control 12/9px, the menus 18px */
137
+ .cz .rt .btn, .cz .obody:has(> .rt) > .vcf .btn { border-radius: 12px; font-weight: 700; }
138
+ .cz .rt .rt-seg { border-radius: 12px; }
139
+ .cz .rt-seg .btn { border-radius: 9px; }
140
+ .cz .rt-menu { border-radius: 18px; padding: 8px; }
141
+ .cz .rt-menu > button { border-radius: 10px; min-height: 40px; }
142
+ .cz .rt-chip { font-weight: 700; }
143
+ /* the recording dot (.rvdot) keeps its pulse: a live recording is the critical level of motion (cozy.css m-crit) */