create-pmos 0.320.0 → 0.321.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.
@@ -0,0 +1,184 @@
1
+ /* premium-vw-doc-model.js — the pure half of the document page in the premium viewer (initiative premium-viewer, S2; planning/prd/premium-viewer-prd.md R2).
2
+ * No DOM and no fetch. It draws a markdown file as a page (title, byline, properties from the front matter, panels, tables, task lists, status labels,
3
+ * expand blocks, code blocks), lays an open proposal from GET /api/doc-sheet/proposals over the current text with each changed section marked, and
4
+ * merges an edited page back into the file so that sections nobody touched keep their exact text. Every value comes from the file, its log or the route. */
5
+ const esc = (s) => String(s == null ? '' : s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
6
+ const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
7
+
8
+ /** "2026-10-19" or an ISO time → "19 Oct 2026". Anything else → ''. */
9
+ export function dayOf(s) { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(s || '')); return m && +m[2] >= 1 && +m[2] <= 12 ? +m[3] + ' ' + MON[+m[2] - 1] + ' ' + m[1] : ''; }
10
+ /** The colour of a status label, by its words. */
11
+ export function toneOf(t) { return /done|complete|passed|shipped|approved|accepted|current/i.test(t) ? 'g' : /progress|review|build/i.test(t) ? 'b' : /not started|blocked|late|fail|risk|stale/i.test(t) ? 'r' : /draft|waiting|paused|proposed/i.test(t) ? 'y' : 'n'; }
12
+
13
+ const lz = (t) => `<span class="lz ${toneOf(t)}" contenteditable="false" data-st>${esc(t)}</span>`;
14
+ const dtp = (d) => `<span class="dt" contenteditable="false" data-dt="${esc(d)}">${esc(dayOf(d))}</span>`;
15
+ export const PANELS = ['info', 'note', 'tip', 'success', 'warning', 'caution', 'important', 'decision'];
16
+ const panel = (k, inner) => `<div class="pnl ${k}" data-k="${k}"><span class="pi pidot" contenteditable="false" aria-hidden="true"></span><div class="pc">${inner}</div></div>`;
17
+ const codeBlock = (lang, code) => `<div class="cb" data-lang="${esc(lang)}"><div class="cbh" contenteditable="false"><span>${esc(lang || 'text')}</span></div><pre>${esc(code)}</pre></div>`;
18
+
19
+ /** One line of markdown inline text → html. Code spans first, so nothing inside them is read as markup. */
20
+ export function inl(s) {
21
+ const codes = [];
22
+ let h = esc(s).replace(/`([^`]+)`/g, (m, c) => { codes.push(c); return `\u0000${codes.length - 1}\u0000`; });
23
+ h = h.replace(/:status\[([^\]]+)\]/g, (m, t) => lz(t))
24
+ .replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>')
25
+ .replace(/(^|[\s(])[_*]([^_*\s][^_*]*)[_*](?=[\s.,;:)!?]|$)/g, '$1<em>$2</em>')
26
+ .replace(/~~([^~]+)~~/g, '<s>$1</s>')
27
+ .replace(/\[([^\]]+)\]\(([^)\s]+)\)/g, (m, t, u) => `<a href="${/^(https?:|mailto:|#|\/)/i.test(u.replace(/&amp;/g, '&')) ? u : '#'}"${/^https?:/i.test(u) ? ' target="_blank" rel="noopener"' : ''}>${t}</a>`)
28
+ .replace(/(^|[\s(])(\d{4}-\d{2}-\d{2})(?=$|[\s.,;:)])/g, (m, a, d) => (dayOf(d) ? a + dtp(d) : m));
29
+ return h.replace(/\u0000(\d+)\u0000/g, (m, i) => `<code>${codes[i]}</code>`);
30
+ }
31
+
32
+ /** The front matter (the YAML block at the top) as [key, value] rows, and where the body starts. Only `key: value` lines are read; a list or a block is shown as written. */
33
+ export function frontOf(text) {
34
+ const t = String(text || '').replace(/\r/g, '');
35
+ const m = /^---\n([\s\S]*?)\n---(?:\n|$)/.exec(t);
36
+ if (!m) return { fm: [], raw: '', body: t };
37
+ const fm = [];
38
+ for (const l of m[1].split('\n')) { const r = /^([A-Za-z_][\w-]*):\s*(.*)$/.exec(l); if (r) fm.push([r[1], r[2].replace(/^"(.*)"$/, '$1').replace(/^'(.*)'$/, '$1')]); else if (fm.length && /^\s+\S/.test(l)) fm[fm.length - 1][1] += (fm[fm.length - 1][1] ? ', ' : '') + l.trim().replace(/^-\s*/, ''); }
39
+ return { fm, raw: m[0], body: t.slice(m[0].length) };
40
+ }
41
+
42
+ /** Markdown body → page html. Standard GitHub markdown: headings, lists, task lists, tables, quotes, `> [!NOTE]` panels, `<details>` expand blocks, code fences and rules.
43
+ * One extra, as the prototype has it: `:status[Done]` is a status label. `heads` lists [level, text, id]; ids run on from `o.start` so several bodies can share one page. */
44
+ export function bodyHtml(src, o = {}) {
45
+ const L = String(src || '').replace(/\r/g, '').split('\n'), out = [], heads = []; let i = 0;
46
+ const start = o.start || 0;
47
+ const isList = (l) => /^\s*([-*+]|\d+[.)])\s/.test(l);
48
+ while (i < L.length) {
49
+ const l = L[i];
50
+ if (!l.trim()) { i++; continue; }
51
+ if (/^```/.test(l)) { const lang = l.slice(3).trim(), buf = []; i++; while (i < L.length && !/^```/.test(L[i])) buf.push(L[i++]); i++; out.push(codeBlock(lang, buf.join('\n'))); continue; }
52
+ const h = /^(#{1,6})\s+(.*)$/.exec(l);
53
+ if (h) { const lv = Math.min(4, Math.max(2, h[1].length)), id = 'vwh' + (start + heads.length); heads.push([lv, h[2].replace(/[*_`]/g, ''), id]); out.push(`<h${lv} id="${id}" data-md="${h[1].length}">${inl(h[2])}</h${lv}>`); i++; continue; }
54
+ if (/^(-{3,}|\*{3,}|_{3,})\s*$/.test(l)) { out.push('<hr>'); i++; continue; }
55
+ if (/^>/.test(l)) {
56
+ const buf = []; while (i < L.length && /^>/.test(L[i])) buf.push(L[i++].replace(/^>\s?/, ''));
57
+ const a = /^\[!(\w+)\]\s*(.*)$/.exec(buf[0]);
58
+ if (a && PANELS.includes(a[1].toLowerCase())) out.push(panel(a[1].toLowerCase(), `<p>${inl([a[2], ...buf.slice(1)].filter((x) => x.trim()).join(' '))}</p>`));
59
+ else out.push(`<blockquote><p>${inl(buf.join(' '))}</p></blockquote>`);
60
+ continue;
61
+ }
62
+ if (/^\s*\|/.test(l)) {
63
+ const rows = []; while (i < L.length && /^\s*\|/.test(L[i])) rows.push(L[i++]);
64
+ const cells = (r) => r.trim().replace(/^\||\|$/g, '').split('|').map((c) => c.trim());
65
+ if (rows.length >= 2 && /^\s*\|?\s*:?-{2,}/.test(rows[1])) {
66
+ const hd = cells(rows[0]);
67
+ out.push(`<div class="tw"><table><thead><tr>${hd.map((c) => `<th>${inl(c)}</th>`).join('')}</tr></thead><tbody>${rows.slice(2).map((r) => { const c = cells(r); return `<tr>${hd.map((_, k) => `<td>${inl(c[k] || '')}</td>`).join('')}</tr>`; }).join('')}</tbody></table></div>`);
68
+ } else out.push(`<p>${inl(rows.join(' '))}</p>`);
69
+ continue;
70
+ }
71
+ if (isList(l)) {
72
+ const ord = /^\s*\d+[.)]/.test(l), items = [];
73
+ while (i < L.length && (isList(L[i]) || (/^\s{2,}\S/.test(L[i]) && items.length))) { if (isList(L[i])) items.push(L[i].replace(/^\s*([-*+]|\d+[.)])\s+/, '')); else items[items.length - 1] += ' ' + L[i].trim(); i++; }
74
+ if (items.every((t) => /^\[[ xX]\]\s/.test(t))) out.push(`<ul class="tasks">${items.map((t) => { const d = /^\[[xX]\]/.test(t); return `<li data-done="${d}"><span class="chk" contenteditable="false" role="checkbox" aria-checked="${d}" aria-label="Done"></span><span>${inl(t.slice(4))}</span></li>`; }).join('')}</ul>`);
75
+ else out.push(`<${ord ? 'ol' : 'ul'}>${items.map((t) => `<li>${inl(t)}</li>`).join('')}</${ord ? 'ol' : 'ul'}>`);
76
+ continue;
77
+ }
78
+ if (/^<details/.test(l)) {
79
+ const sm = /<summary>(.*?)<\/summary>/.exec(l), buf = []; i++;
80
+ if (!sm && i < L.length && /<summary>/.test(L[i])) { const s2 = /<summary>(.*?)<\/summary>/.exec(L[i]); i++; buf.length = 0; const inner = []; while (i < L.length && !/^<\/details>/.test(L[i])) inner.push(L[i++]); i++; const b = bodyHtml(inner.join('\n'), { start: start + heads.length }); heads.push(...b.heads); out.push(`<details class="xp"><summary>${inl(s2 ? s2[1] : 'Details')}</summary><div>${b.html}</div></details>`); continue; }
81
+ while (i < L.length && !/^<\/details>/.test(L[i])) buf.push(L[i++]); i++;
82
+ const b = bodyHtml(buf.join('\n'), { start: start + heads.length }); heads.push(...b.heads);
83
+ out.push(`<details class="xp"><summary>${inl(sm ? sm[1] : 'Details')}</summary><div>${b.html}</div></details>`); continue;
84
+ }
85
+ const buf = []; while (i < L.length && L[i].trim() && !/^(#{1,6}\s|>|\s*\||```|<details|(-{3,}|\*{3,}|_{3,})\s*$)/.test(L[i]) && !isList(L[i])) buf.push(L[i++].trim());
86
+ if (!buf.length) buf.push(L[i++]);
87
+ out.push(`<p>${inl(buf.join(' '))}</p>`);
88
+ }
89
+ return { html: out.join(''), heads };
90
+ }
91
+
92
+ /** The text split at its headings: the front matter, the part before the first heading, then each section as { name, head, body } where `head` is the heading
93
+ * line and `body` the lines up to the next heading of any level. A name used twice carries its count, as sectionsOf() in premium-doc-edit.js and the route name them. */
94
+ export function splitDoc(text) {
95
+ const f = frontOf(text), lines = f.body.split('\n'), secs = [], seen = {};
96
+ let pre = [], cur = null, fence = false;
97
+ for (const l of lines) {
98
+ if (/^```/.test(l)) fence = !fence;
99
+ const h = !fence && /^(#{1,4})\s+(.*)$/.exec(l);
100
+ if (h) { const nm = h[2].replace(/[*`]/g, ''); seen[nm] = (seen[nm] || 0) + 1; cur = { name: nm + (seen[nm] > 1 ? '#' + seen[nm] : ''), head: l, level: h[1].length, lines: [] }; secs.push(cur); } else if (cur) cur.lines.push(l); else pre.push(l);
101
+ }
102
+ return { fmRaw: f.raw, fm: f.fm, pre: pre.join('\n'), sections: secs.map((s) => ({ name: s.name, head: s.head, level: s.level, body: s.lines.join('\n') })) };
103
+ }
104
+ const joinDoc = (d) => d.fmRaw + [d.pre, ...d.sections.map((s) => s.head + '\n' + s.body)].join('\n').replace(/^\n+/, d.fmRaw ? '\n' : '');
105
+
106
+ /** The page's head: title, the first-level heading it came from (kept so a save writes it back), properties and labels, all from the text.
107
+ * The title is typed into only when it is that heading; a title from the front matter stays as the file has it. */
108
+ export function pageHead(text) {
109
+ const d = splitDoc(text), get = (k) => (d.fm.find((r) => r[0].toLowerCase() === k) || [])[1] || '';
110
+ const first = d.sections[0], h1 = first && first.level === 1 && !d.pre.trim() ? first : null;
111
+ const title = get('title') || (h1 ? h1.head.replace(/^#\s+/, '').replace(/[*`]/g, '') : '') || '';
112
+ const labels = (get('tags') || get('labels')).replace(/[[\]]/g, '').split(',').map((x) => x.trim().replace(/^"(.*)"$/, '$1')).filter(Boolean);
113
+ const SKIP = new Set(['title', 'tags', 'labels']);
114
+ const props = d.fm.filter((r) => !SKIP.has(r[0].toLowerCase()) && String(r[1]).trim()).slice(0, 12);
115
+ return { title, h1: h1 ? h1.name : null, h1Head: h1 ? h1.head : null, titleEdits: !!h1 && !get('title'), labels, props };
116
+ }
117
+ /** One property's value as the table draws it: a date as a date, a status word as a label, an id in mono. */
118
+ export function propHtml(k, v) {
119
+ const s = String(v);
120
+ if (/^(status|state)$/i.test(k)) return lz(s);
121
+ if (/^(timestamp|date|updated|created|target|due)$/i.test(k) && dayOf(s)) return dtp(s.slice(0, 10));
122
+ if (/(_id|_slug|_kr|kr|lane|type|path|id)$/i.test(k) || /^[\w:./-]+$/.test(s) && /[:/_]/.test(s)) return `<code>${esc(s)}</code>`;
123
+ return inl(s);
124
+ }
125
+
126
+ /** An open proposal laid over the current text. `p` is a row of GET /api/doc-sheet/proposals; `kept` the names of the sections still applied (all live ones
127
+ * when null). Returns the blocks to draw in order — { md, chg } where chg is null for text that stays, or { name, kind, before, on } for a changed section — and
128
+ * the counts the bar says. A stale section (the route marks it) is never applied: the file changed there since the proposal was made. */
129
+ export function overlay(current, p, kept) {
130
+ const cur = splitDoc(current), aft = splitDoc((p && p.after) || ''), secs = (p && p.sections) || [];
131
+ const live = secs.filter((s) => !s.stale), stale = secs.filter((s) => s.stale);
132
+ const on = (n) => (kept ? kept.includes(n) : true);
133
+ const by = new Map(live.map((s) => [s.name, s]));
134
+ const blocks = [];
135
+ if (cur.pre.trim()) blocks.push({ md: cur.pre, chg: null });
136
+ const added = live.filter((s) => s.kind === 'added');
137
+ const placed = new Set();
138
+ const addAfter = (name) => { // added sections go after the section that precedes them in the proposal's text
139
+ const ai = aft.sections.findIndex((s) => s.name === name);
140
+ for (let k = ai + 1; k < aft.sections.length; k++) {
141
+ const n = aft.sections[k].name, a = added.find((x) => x.name === n);
142
+ if (!a) break;
143
+ if (placed.has(n)) continue; placed.add(n);
144
+ blocks.push({ md: aft.sections[k].head + '\n' + (a.after || ''), chg: { name: n, kind: 'added', before: '', on: on(n) }, hide: !on(n) });
145
+ }
146
+ };
147
+ addAfter(null);
148
+ for (const s of cur.sections) {
149
+ const c = by.get(s.name);
150
+ if (c && c.kind === 'changed') blocks.push({ md: s.head + '\n' + (on(s.name) ? c.after : s.body), chg: { name: s.name, kind: 'changed', before: s.head + '\n' + (c.before != null ? c.before : s.body), on: on(s.name) } });
151
+ else if (c && c.kind === 'removed') blocks.push({ md: s.head + '\n' + s.body, chg: { name: s.name, kind: 'removed', before: s.head + '\n' + s.body, on: on(s.name) } });
152
+ else blocks.push({ md: s.head + '\n' + s.body, chg: null });
153
+ addAfter(s.name);
154
+ }
155
+ for (const a of added) if (!placed.has(a.name)) { const as = aft.sections.find((x) => x.name === a.name); blocks.push({ md: (as ? as.head : '## ' + a.name) + '\n' + (a.after || ''), chg: { name: a.name, kind: 'added', before: '', on: on(a.name) }, hide: !on(a.name) }); }
156
+ const n = live.filter((s) => on(s.name)).length;
157
+ return { blocks, live: live.map((s) => s.name), stale: stale.map((s) => s.name), applied: n, total: live.length };
158
+ }
159
+ /** The bar's words over an agent edit. */
160
+ export function overlayLine(o, v) {
161
+ if (!o.total) return o.stale.length ? `The document changed where the agent proposed ${o.stale.length === 1 ? 'its change' : 'its changes'}, so nothing can be applied. Undo all closes it; ask again for a new one.` : '';
162
+ if (!o.applied) return `Everything is back to v${v}. Undo all closes the agent's edit.`;
163
+ return `The agent changed ${o.applied} ${o.applied === 1 ? 'place' : 'places'}. Click a highlight to see what it said before.` + (o.stale.length ? ` ${o.stale.length} more ${o.stale.length === 1 ? 'change does' : 'changes do'} not apply, because the document changed there since.` : '');
164
+ }
165
+
166
+ /** An edited page back into the file. `orig` is the file as read; `base` the page serialized as it was drawn (before any typing); `now` the page serialized now.
167
+ * Sections whose serialized text did not change keep the file's exact text; the front matter always does. So a save changes only what was typed. */
168
+ export function mergeEdit(orig, base, now) {
169
+ if (base === now) return orig;
170
+ const O = splitDoc(orig), B = splitDoc(base), N = splitDoc(now);
171
+ const bOf = new Map(B.sections.map((s) => [s.name, s])), oOf = new Map(O.sections.map((s) => [s.name, s]));
172
+ const same = (a, b) => a && b && a.head.trim() === b.head.trim() && a.body.trim() === b.body.trim();
173
+ const out = { fmRaw: O.fmRaw, pre: B.pre.trim() === N.pre.trim() ? O.pre : N.pre, sections: [] };
174
+ for (const s of N.sections) {
175
+ const b = bOf.get(s.name), o = oOf.get(s.name);
176
+ out.sections.push(same(s, b) && o ? o : { name: s.name, head: s.head, body: '\n' + s.body.trim() + '\n' });
177
+ }
178
+ let t = joinDoc(out);
179
+ if (/\n$/.test(orig) && !/\n$/.test(t)) t += '\n';
180
+ return t.replace(/\n{3,}/g, '\n\n');
181
+ }
182
+
183
+ /** Words → minutes to read, at 220 words a minute. */
184
+ export function readMinutes(text) { return Math.max(1, Math.round(String(text || '').split(/\s+/).filter(Boolean).length / 220)); }
@@ -0,0 +1,171 @@
1
+ :root{--fs-1:11px;--fs-2:12px;--fs-3:14px;--fs-4:16px;--fs-5:20px;--fs-6:28px}
2
+ /* premium-vw-doc.css — the document page in the premium viewer (initiative premium-viewer, S2). Loaded once by vwStyle('doc'). Sizes are the console's
3
+ * six steps only (var(--fs-1..6)), weights 400/500/600, the page's own tokens otherwise. Checked by premium-console-type.test.js. */
4
+ :root{--vw-lnk:rgb(36,92,190);--vw-pur:rgb(110,72,190)}
5
+ :root[data-theme="dark"]{--vw-lnk:rgb(130,170,250);--vw-pur:rgb(186,160,250)}
6
+ @media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--vw-lnk:rgb(130,170,250);--vw-pur:rgb(186,160,250)}}
7
+ .vwdoc{max-width:780px;margin:0 auto;padding:2px 0 24px;position:relative}
8
+ .vwdoc .gap{flex:1}
9
+ .vwmut{color:var(--ink-3);font-size:var(--fs-2);margin:0}
10
+ .vwline{margin:0 0 10px}
11
+ .vwempty{color:var(--ink-3);font-size:var(--fs-3);padding:24px 4px}
12
+ .vwrow{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}
13
+ .vwrow .vwmut{flex:1;min-width:160px}
14
+ .vwbtn{min-height:34px;padding:0 13px;border-radius:6px;border:1px solid var(--hair);background:var(--card-solid);color:var(--ink);font:500 var(--fs-2) var(--sans);display:inline-flex;align-items:center;gap:6px;cursor:pointer}
15
+ .vwbtn.pri{background:var(--solid);color:var(--on-solid);border-color:var(--solid)}
16
+ .vwbtn[disabled]{opacity:.45;cursor:default}
17
+ .vwbtn .i,.vwseg .i,.vwtb .i,.vwcl .i,.vwagt>.i{width:15px;height:15px;flex:none}
18
+ .vwin{flex:1;min-width:0;min-height:34px;padding:0 11px;border-radius:6px;border:1px solid var(--hair);background:var(--card-solid);color:var(--ink);font:400 var(--fs-3) var(--sans)}
19
+ .vwdoc :focus-visible{outline:2px solid var(--ember);outline-offset:2px}
20
+ /* the document's own bar: Page, Edit, Markdown, and Ask the agent */
21
+ .vwdt{display:flex;align-items:center;gap:8px;margin:0 0 12px;flex-wrap:wrap}
22
+ .vwsg{display:inline-flex;padding:3px;border-radius:8px;background:var(--well);gap:2px}
23
+ .vwseg{min-height:30px;padding:0 11px;border-radius:6px;border:0;background:transparent;color:var(--ink-2);font:500 var(--fs-2) var(--sans);display:inline-flex;align-items:center;gap:6px;cursor:pointer}
24
+ .vwseg[aria-pressed="true"]{background:var(--card-solid);color:var(--ink);box-shadow:var(--card-shadow)}
25
+ .vwseg[disabled]{opacity:.45;cursor:default}
26
+ .vwask{margin:0 0 14px;padding:10px 12px;border:1px solid var(--hair);border-radius:8px;background:var(--card-solid)}
27
+ .vwask textarea{width:100%;box-sizing:border-box;border:0;background:transparent;color:var(--ink);font:400 var(--fs-3)/1.5 var(--sans);resize:vertical;outline:0}
28
+ /* an agent's edit: one bar, then the changed sections highlighted in the page */
29
+ .vwag{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 12px;padding:8px 8px 8px 14px;border-radius:8px;background:var(--card-solid);border:1px solid var(--hair);box-shadow:var(--card-shadow);font-size:var(--fs-2);color:var(--ink-2)}
30
+ .vwagt{display:flex;gap:9px;align-items:flex-start;flex:1;min-width:200px}
31
+ .vwagt>.i{color:var(--ember-ink);margin-top:2px}
32
+ .vwagt b{display:block;color:var(--ink);font-weight:500}
33
+ .vwaga{display:flex;gap:6px}
34
+ .vwchg{position:relative;margin:0 -12px 6px;padding:2px 12px 2px;border-left:3px solid var(--ok);background:color-mix(in oklab,var(--ok) 8%,transparent);border-top-right-radius:6px;border-bottom-right-radius:6px}
35
+ .vwchg.removed{border-left-color:var(--bad);background:color-mix(in oklab,var(--bad) 7%,transparent)}
36
+ .vwchg.removed .vwcb{text-decoration:line-through;color:var(--ink-3)}
37
+ .vwchg.off{border-left-color:var(--hair);background:transparent}
38
+ .vwchg.off.removed .vwcb{text-decoration:none;color:inherit}
39
+ .vwcl{display:flex;align-items:center;gap:6px;width:100%;min-height:30px;margin:4px 0 0;padding:0;border:0;background:transparent;color:var(--ok);font:500 var(--fs-1) var(--mono);letter-spacing:.04em;text-transform:uppercase;cursor:pointer;text-align:left}
40
+ .vwchg.removed .vwcl{color:var(--bad)}
41
+ .vwchg.off .vwcl{color:var(--ink-3)}
42
+ .vwcl em{margin-left:auto;font-style:normal;text-transform:none;letter-spacing:0;font-family:var(--sans);color:var(--ink-3);text-decoration:underline}
43
+ .vwbefore{margin:6px 0 10px;padding:10px 12px;border-radius:6px;background:var(--well);border:1px dashed var(--hair)}
44
+ .vwlab{margin:0 0 6px;font:500 var(--fs-1) var(--mono);letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3)}
45
+ /* the page itself, drawn like a Confluence page */
46
+ .cf{background:var(--card-solid);border:1px solid var(--hair);border-radius:8px;padding:26px 36px 20px;box-shadow:var(--card-shadow);font-size:var(--fs-3);line-height:1.65;color:var(--ink);transition:box-shadow .25s}
47
+ .cf.editing{box-shadow:0 0 0 2px color-mix(in oklab,var(--ember) 35%,transparent)}
48
+ .cft{font:600 var(--fs-6)/1.25 var(--sans);letter-spacing:-.015em;margin:0 0 10px;outline:0}
49
+ .cfby{display:flex;align-items:center;gap:8px;font-size:var(--fs-2);color:var(--ink-3);flex-wrap:wrap}
50
+ .cfby .avdot{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:var(--solid);color:var(--on-solid);font:600 var(--fs-1) var(--sans)}
51
+ .cflb{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}
52
+ .cflb span{font-size:var(--fs-1);padding:1px 8px;border-radius:6px;background:var(--well);color:var(--ink-2)}
53
+ .cfpr{width:100%;border-collapse:collapse;margin:16px 0 0;font-size:var(--fs-2)}
54
+ .cfpr th{width:150px;text-align:left;font-weight:500;background:var(--well);color:var(--ink-2)}
55
+ .cfpr th,.cfpr td{border:1px solid var(--hair);padding:6px 11px;vertical-align:top;overflow-wrap:anywhere}
56
+ .cfb{outline:0;min-height:80px}
57
+ .cfb>:first-child{margin-top:18px}
58
+ .cfb h2{font:600 var(--fs-5)/1.3 var(--sans);letter-spacing:-.01em;margin:26px 0 8px}
59
+ .cfb h3{font:600 var(--fs-4)/1.35 var(--sans);margin:20px 0 6px}
60
+ .cfb h4{font:600 var(--fs-3)/1.4 var(--sans);margin:16px 0 4px}
61
+ .cfb p{margin:0 0 10px}
62
+ .cfb ul,.cfb ol{margin:0 0 10px;padding-left:24px}
63
+ .cfb li{margin:3px 0}
64
+ .cf a{color:var(--vw-lnk);text-decoration:none}
65
+ .cfb blockquote{margin:0 0 12px;padding:1px 0 1px 16px;border-left:3px solid var(--hair);color:var(--ink-2)}
66
+ .cfb blockquote p:last-child{margin:0}
67
+ .cfb code{font:400 var(--fs-2) var(--mono);background:var(--well);padding:1px 5px;border-radius:6px}
68
+ .cfb hr{border:0;border-top:1px solid var(--hair);margin:22px 0}
69
+ .cfb .tw{overflow-x:auto;margin:0 0 14px}
70
+ .cfb table{border-collapse:collapse;min-width:60%;font-size:var(--fs-2)}
71
+ .cfb th,.cfb td{border:1px solid var(--hair);padding:6px 11px;text-align:left;vertical-align:top;min-width:60px}
72
+ .cfb thead th{background:var(--well);font-weight:500}
73
+ .pnl{display:grid;grid-template-columns:18px minmax(0,1fr);gap:10px;padding:11px 14px;border-radius:6px;margin:0 0 14px;background:var(--pb,var(--well))}
74
+ .pnl .pidot{width:14px;height:14px;margin-top:4px;border-radius:50%;border:2px solid var(--pc,var(--ink-3));box-sizing:border-box;user-select:none}
75
+ .pnl .pc>:last-child{margin-bottom:0}
76
+ .pnl.info{--pb:color-mix(in oklab,var(--vw-lnk) 9%,transparent);--pc:var(--vw-lnk)}
77
+ .pnl.note,.pnl.important{--pb:color-mix(in oklab,var(--vw-pur) 10%,transparent);--pc:var(--vw-pur)}
78
+ .pnl.tip,.pnl.success{--pb:color-mix(in oklab,var(--ok) 10%,transparent);--pc:var(--ok)}
79
+ .pnl.warning{--pb:color-mix(in oklab,var(--ember) 14%,transparent);--pc:var(--ember-ink)}
80
+ .pnl.caution{--pb:color-mix(in oklab,var(--bad) 10%,transparent);--pc:var(--bad)}
81
+ .pnl.decision{--pb:color-mix(in oklab,var(--ok) 7%,transparent);--pc:var(--ok)}
82
+ .pnl.decision .pc::before{content:"Decision";display:block;font:600 var(--fs-1) var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--ok);margin-bottom:2px}
83
+ .lz{display:inline-block;padding:0 6px;border-radius:6px;font:600 var(--fs-1)/19px var(--sans);text-transform:uppercase;letter-spacing:.03em;vertical-align:1px;background:var(--well);color:var(--ink-2);white-space:nowrap;user-select:none}
84
+ .lz.g{background:color-mix(in oklab,var(--ok) 14%,transparent);color:var(--ok)}
85
+ .lz.b{background:color-mix(in oklab,var(--vw-lnk) 13%,transparent);color:var(--vw-lnk)}
86
+ .lz.r{background:color-mix(in oklab,var(--bad) 13%,transparent);color:var(--bad)}
87
+ .lz.y{background:color-mix(in oklab,var(--ember) 18%,transparent);color:var(--ember-ink)}
88
+ .dt{display:inline-block;padding:0 6px;border-radius:6px;background:var(--well);line-height:20px;user-select:none}
89
+ .cfb .tasks{list-style:none;padding-left:2px}
90
+ .cfb .tasks li{display:flex;gap:9px;align-items:flex-start}
91
+ .chk{width:16px;height:16px;border:1.5px solid var(--ink-3);border-radius:6px;flex:none;margin-top:4px;display:grid;place-items:center;background:var(--card-solid)}
92
+ .cf.editing .chk{cursor:pointer}
93
+ .chk[aria-checked="true"]{background:var(--vw-lnk);border-color:var(--vw-lnk)}
94
+ .chk[aria-checked="true"]::after{content:"";width:8px;height:4px;border:2px solid var(--card-solid);border-top:0;border-right:0;transform:rotate(-45deg) translate(1px,-1px)}
95
+ .tasks li[data-done="true"]>span:last-child{text-decoration:line-through;color:var(--ink-3)}
96
+ .xp{border:1px solid var(--hair);border-radius:6px;margin:0 0 14px}
97
+ .xp summary{cursor:pointer;padding:7px 12px;font-weight:500;list-style:none;display:flex;gap:8px;align-items:center}
98
+ .xp summary::-webkit-details-marker{display:none}
99
+ .xp summary::before{content:"";width:6px;height:6px;border:solid var(--ink-3);border-width:0 1.5px 1.5px 0;transform:rotate(-45deg);transition:transform .2s}
100
+ .xp[open] summary::before{transform:rotate(45deg)}
101
+ .xp>div{padding:0 14px 4px 26px}
102
+ .cb{border:1px solid var(--hair);border-radius:8px;overflow:hidden;margin:0 0 14px}
103
+ .cbh{display:flex;align-items:center;padding:4px 12px;background:var(--well);font:500 var(--fs-1) var(--mono);color:var(--ink-3);user-select:none}
104
+ .cb pre{margin:0;padding:12px 14px;font:400 var(--fs-2)/1.6 var(--mono);overflow-x:auto;outline:0}
105
+ .cff{display:flex;gap:16px;align-items:center;flex-wrap:wrap;border-top:1px solid var(--hair);margin-top:24px;padding-top:12px;font-size:var(--fs-2);color:var(--ink-3)}
106
+ .cff code{font:400 var(--fs-1) var(--mono);overflow-wrap:anywhere}
107
+ /* editing: a toolbar over the page, a / menu, and the save row */
108
+ .vwetb{position:sticky;top:0;z-index:4;display:flex;align-items:center;gap:1px;overflow-x:auto;scrollbar-width:none;margin:0 0 12px;padding:4px;border-radius:8px;background:var(--card-solid);border:1px solid var(--hair);box-shadow:var(--card-shadow)}
109
+ .vwetb::-webkit-scrollbar{display:none}
110
+ .vwetb .sp{width:1px;height:18px;background:var(--hair);margin:0 4px;flex:none}
111
+ .vwtb{height:32px;min-width:32px;padding:0 7px;border:0;border-radius:6px;background:transparent;display:inline-flex;align-items:center;justify-content:center;gap:5px;font:400 var(--fs-2) var(--sans);color:var(--ink-2);white-space:nowrap;flex:none;cursor:pointer}
112
+ .vwtb[aria-pressed="true"]{background:var(--well);color:var(--ink)}
113
+ .vwtb.fx{font-size:var(--fs-3)}
114
+ .vwtb.dd::after{content:"";width:5px;height:5px;border:solid currentColor;border-width:0 1.4px 1.4px 0;transform:rotate(45deg) translateY(-2px);margin-left:2px;opacity:.6}
115
+ .vwtb .styL{min-width:84px;text-align:left}
116
+ .vwpop{position:absolute;left:var(--rp-px,8px);top:var(--rp-py,0);z-index:20;min-width:220px;max-width:300px;max-height:320px;overflow:auto;padding:5px;border-radius:8px;background:var(--card-solid);border:1px solid var(--hair);box-shadow:var(--card-shadow)}
117
+ .vwpop button{display:grid;grid-template-columns:26px minmax(0,1fr) auto;gap:8px;align-items:center;width:100%;min-height:34px;padding:3px 8px;border:0;border-radius:6px;background:transparent;color:var(--ink);font:400 var(--fs-2) var(--sans);text-align:left;cursor:pointer}
118
+ .vwpop button[aria-current="true"],.vwpop button:focus-visible{background:var(--well)}
119
+ .vwpop .ki{width:24px;height:24px;border-radius:6px;display:grid;place-items:center;background:var(--well);color:var(--ink-2);font:500 var(--fs-1) var(--sans)}
120
+ .vwpop kbd{font:400 var(--fs-1) var(--mono);color:var(--ink-3)}
121
+ .vwpop .vwmut{padding:8px}
122
+ .vwsave{margin:12px 0 0;padding:12px;border:1px solid var(--hair);border-radius:8px;background:var(--card-solid)}
123
+ .vwsave .vwin{width:100%;box-sizing:border-box}
124
+ .vwerr{margin:6px 0 0;font-size:var(--fs-2);color:var(--ember-ink)}
125
+ .vwerr:empty{display:none}
126
+ .vwmd{width:100%;box-sizing:border-box;min-height:420px;padding:16px 18px;border-radius:8px;border:1px solid var(--hair);background:var(--card-solid);color:var(--ink);font:400 var(--fs-2)/1.6 var(--mono);resize:vertical;outline:0}
127
+ @media (max-width:640px){
128
+ .cf{padding:18px 16px 14px;border-radius:6px}
129
+ .cft{font-size:var(--fs-5)}
130
+ .cfpr th{width:110px}
131
+ .vwchg{margin:0 -8px 6px;padding:2px 8px}
132
+ .vwbtn,.vwseg,.vwtb,.vwcl,.vwpop button{min-height:44px}
133
+ .vwtb{min-width:44px}
134
+ .vwin{min-height:44px}
135
+ .vwaga{width:100%}.vwaga .vwbtn{flex:1;justify-content:center}
136
+ }
137
+ @media (prefers-reduced-motion:reduce){.cf,.xp summary::before{transition:none}}
138
+ /* the opener's own buttons on the read bar (a report's Present, Print and Download) */
139
+ .vwxm{position:relative;display:inline-flex}
140
+ .vwxmn{top:calc(100% + 6px);right:0;min-width:260px}
141
+ .vwxmn a{display:grid;grid-template-columns:26px minmax(0,1fr) auto;gap:8px;align-items:center;min-height:34px;padding:3px 8px;border-radius:6px;color:var(--ink);font:400 var(--fs-2) var(--sans);text-decoration:none}
142
+ .vwxmn a:focus-visible{background:var(--well)}
143
+ .vwxmn small{display:block;color:var(--ink-3);font-size:var(--fs-1)}
144
+ .vwxmn .vwmut{padding:6px 8px 4px}
145
+ @media (max-width:640px){.vwxmn{right:auto;left:0;min-width:240px}.vwxmn a{min-height:44px}}
146
+ /* Health, Links and Copies: three chips under the bar, each opening its panel */
147
+ .vwmore{display:flex;gap:6px;flex-wrap:wrap;margin:-4px 0 12px}
148
+ .vwchip{min-height:30px;padding:0 11px;border-radius:6px;border:1px solid var(--hair);background:var(--card-solid);color:var(--ink-2);font:500 var(--fs-2) var(--sans);display:inline-flex;align-items:center;gap:6px;cursor:pointer}
149
+ .vwchip em{font-style:normal;font-family:var(--mono);color:var(--ink-3)}
150
+ .vwchip.ok em{color:var(--ok)}.vwchip.warn em{color:var(--ember-ink)}
151
+ .vwchip[aria-expanded="true"]{background:var(--well);color:var(--ink)}
152
+ .vwmp{margin:0 0 14px;padding:12px 14px;border:1px solid var(--hair);border-radius:8px;background:var(--card-solid);display:grid;gap:8px}
153
+ .vwck{display:grid;gap:4px}
154
+ .vwckr{display:grid;grid-template-columns:12px minmax(0,1fr) auto;gap:4px 10px;align-items:center;padding:6px 0;border-top:1px solid var(--hair);font-size:var(--fs-2)}
155
+ .vwckr .ckdot{width:8px;height:8px;border-radius:50%;background:var(--ink-3)}
156
+ .vwckr.ok i{background:var(--ok)}.vwckr.no i{background:var(--bad)}
157
+ .vwckr b{font-weight:500;font-family:var(--mono);overflow-wrap:anywhere}
158
+ .vwckr span{color:var(--ink-3)}
159
+ .vwckr small{grid-column:2/-1;color:var(--ink-3);font-size:var(--fs-1)}
160
+ .vwlinks{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px}
161
+ .vwli{display:flex;align-items:center;gap:8px;justify-content:space-between}
162
+ .vwli>button,.vwli>span:first-child{display:flex;align-items:center;gap:8px;min-width:0;min-height:36px;padding:2px 6px;border:0;border-radius:6px;background:transparent;color:var(--ink);font:400 var(--fs-2) var(--sans);text-align:left}
163
+ .vwli>button{cursor:pointer}
164
+ .vwli b{font-weight:500;display:block;overflow-wrap:anywhere}.vwli small{display:block;color:var(--ink-3);font-size:var(--fs-1)}
165
+ .vwli .i{width:15px;height:15px;flex:none;color:var(--ink-3)}
166
+ .vwcp{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 10px;align-items:center;padding:8px 0;border-top:1px solid var(--hair)}
167
+ .vwcp b{font-weight:500;display:block}.vwcp small{display:block;color:var(--ink-3);font-size:var(--fs-1);overflow-wrap:anywhere}
168
+ .vwcp .vwmut,.vwcp a{grid-column:1/-1}
169
+ .vwcp a{color:var(--vw-lnk);font-size:var(--fs-2)}
170
+ @media (max-width:640px){.vwchip,.vwli>button{min-height:44px}}
171
+ @media (hover:hover){.vwbtn:hover{background:var(--well)}.cf a:hover{text-decoration:underline}.vwtb:hover{background:var(--well);color:var(--ink)}.vwpop button:hover{background:var(--well)}.vwxmn a:hover{background:var(--well)}.vwli>button:hover{background:var(--well)}}