create-heresay 0.1.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 (38) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -0
  3. package/bin/create-heresay.mjs +9 -0
  4. package/package.json +38 -0
  5. package/release/VERSION +1 -0
  6. package/release/firebase.json +111 -0
  7. package/release/firestore.indexes.json +11 -0
  8. package/release/firestore.rules +10 -0
  9. package/release/functions/lib/core/handler.js +366 -0
  10. package/release/functions/lib/core/store.js +66 -0
  11. package/release/functions/lib/core/types.js +23 -0
  12. package/release/functions/lib/core/version.js +3 -0
  13. package/release/functions/lib/index.js +7 -0
  14. package/release/functions/lib/providers/firebase/admin.js +13 -0
  15. package/release/functions/lib/providers/firebase/api.js +55 -0
  16. package/release/functions/lib/providers/firebase/firestore-store.js +106 -0
  17. package/release/functions/package-lock.json +2993 -0
  18. package/release/functions/package.json +23 -0
  19. package/release/public/app/index.html +57 -0
  20. package/release/public/app-icon.svg +1 -0
  21. package/release/public/apple-touch-icon.png +0 -0
  22. package/release/public/dashboard.css +152 -0
  23. package/release/public/dashboard.js +580 -0
  24. package/release/public/demo.html +30 -0
  25. package/release/public/docs.html +152 -0
  26. package/release/public/favicon.svg +1 -0
  27. package/release/public/icon-192.png +0 -0
  28. package/release/public/index.html +166 -0
  29. package/release/public/logo-white.svg +1 -0
  30. package/release/public/logo.svg +1 -0
  31. package/release/public/mark.svg +1 -0
  32. package/release/public/sdk.js +380 -0
  33. package/release/public/site.css +150 -0
  34. package/src/cli.mjs +382 -0
  35. package/src/firebase.mjs +61 -0
  36. package/src/google.mjs +106 -0
  37. package/src/state.mjs +43 -0
  38. package/src/steps.mjs +306 -0
@@ -0,0 +1,380 @@
1
+ /*
2
+ * The feedback SDK for the web. One line in the host page:
3
+ *
4
+ * <script src="https://<sdk-host>/sdk.js" data-key="pk_..." defer></script>
5
+ *
6
+ * Optional attributes: data-version, data-user-id, data-user-label, data-position ("left"),
7
+ * data-accent ("#0f766e"; a hex colour, to match the host app. Defaults to Heresay peacock).
8
+ * Optional calls, any time after the script runs:
9
+ * Feedback.identify({ id, label }) who the host app says the user is
10
+ * Feedback.setVersion("1.4.0")
11
+ * Feedback.setScreen("Checkout") for apps whose URL does not change per screen
12
+ * Feedback.open()
13
+ *
14
+ * No account, no cookies. The reporter is a random per-device id kept in localStorage, and
15
+ * that id is also what lets them see what happened to their own reports.
16
+ */
17
+ (function () {
18
+ 'use strict';
19
+ if (window.Feedback && window.Feedback.__loaded) return;
20
+
21
+ var script = document.currentScript
22
+ || document.querySelector('script[data-key][src*="sdk"]');
23
+ if (!script) return;
24
+ var KEY = script.getAttribute('data-key');
25
+ // The API normally sits beside sdk.js. data-api points elsewhere, for backends that serve
26
+ // functions from a different address than static files.
27
+ var API = (script.getAttribute('data-api') || new URL(script.src, location.href).origin + '/v1').replace(/\/+$/, '');
28
+ if (!KEY) { console.warn('[feedback] missing data-key on the sdk.js script tag'); return; }
29
+
30
+ var state = {
31
+ version: script.getAttribute('data-version') || null,
32
+ userId: script.getAttribute('data-user-id') || null,
33
+ userLabel: script.getAttribute('data-user-label') || null,
34
+ screen: null,
35
+ type: null,
36
+ reports: [],
37
+ };
38
+
39
+ var TYPES = [
40
+ { id: 'broken', label: 'Broken', hint: 'Something does not work' },
41
+ { id: 'confusing', label: 'Confusing', hint: 'I could not tell how to do something' },
42
+ { id: 'improvement', label: 'Could be better', hint: 'It works, but it could be better' },
43
+ { id: 'idea', label: 'Idea', hint: 'Something that does not exist yet' },
44
+ ];
45
+ var STATUS = {
46
+ open: 'Waiting for the developer',
47
+ accepted: 'Accepted, being worked on',
48
+ fixed: 'Fixed',
49
+ declined: 'Declined',
50
+ };
51
+
52
+ // ---- storage ---------------------------------------------------------------------------
53
+
54
+ var mem = {};
55
+ function load(k) { try { return localStorage.getItem(k); } catch (e) { return mem[k] || null; } }
56
+ function save(k, v) { try { localStorage.setItem(k, v); } catch (e) { mem[k] = v; } }
57
+
58
+ function deviceId() {
59
+ var id = load('fbsdk.device');
60
+ if (!id || !/^[A-Za-z0-9_-]{16,64}$/.test(id)) {
61
+ var b = new Uint8Array(16);
62
+ crypto.getRandomValues(b);
63
+ id = 'd_' + Array.prototype.map.call(b, function (x) { return ('0' + x.toString(16)).slice(-2); }).join('');
64
+ save('fbsdk.device', id);
65
+ }
66
+ return id;
67
+ }
68
+
69
+ /** Statuses the reporter has already seen, so a new outcome can show a dot. */
70
+ function seen() { try { return JSON.parse(load('fbsdk.seen.' + KEY) || '{}'); } catch (e) { return {}; } }
71
+ function markSeen() {
72
+ var s = {};
73
+ state.reports.forEach(function (r) { s[r.id] = r.status; });
74
+ save('fbsdk.seen.' + KEY, JSON.stringify(s));
75
+ }
76
+ function unseen() {
77
+ var s = seen();
78
+ return state.reports.filter(function (r) { return r.status !== 'open' && s[r.id] !== r.status; }).length;
79
+ }
80
+
81
+ // ---- context ---------------------------------------------------------------------------
82
+
83
+ function platformInfo() {
84
+ var ua = navigator.userAgent;
85
+ var os = null, m;
86
+ if ((m = /iPhone OS ([\d_]+)|iPad.*OS ([\d_]+)/.exec(ua))) os = 'iOS ' + (m[1] || m[2]).replace(/_/g, '.');
87
+ else if ((m = /Android ([\d.]+)/.exec(ua))) os = 'Android ' + m[1];
88
+ else if ((m = /Mac OS X ([\d_]+)/.exec(ua))) os = 'macOS ' + m[1].replace(/_/g, '.');
89
+ else if (/Windows NT/.test(ua)) os = 'Windows';
90
+ else if (/Linux/.test(ua)) os = 'Linux';
91
+ var browser = null;
92
+ if ((m = /Edg\/([\d]+)/.exec(ua))) browser = 'Edge ' + m[1];
93
+ else if ((m = /Firefox\/([\d]+)/.exec(ua))) browser = 'Firefox ' + m[1];
94
+ else if ((m = /Chrome\/([\d]+)/.exec(ua))) browser = 'Chrome ' + m[1];
95
+ else if ((m = /Version\/([\d.]+).*Safari/.exec(ua))) browser = 'Safari ' + m[1];
96
+ return { os: os, browser: browser };
97
+ }
98
+
99
+ function context() {
100
+ var p = platformInfo();
101
+ return {
102
+ route: state.screen || (location.pathname + location.hash),
103
+ app_version: state.version,
104
+ platform: 'web',
105
+ os: p.os,
106
+ browser: p.browser,
107
+ user_id: state.userId,
108
+ user_label: state.userLabel,
109
+ };
110
+ }
111
+
112
+ // ---- network ---------------------------------------------------------------------------
113
+
114
+ function body(res) {
115
+ return res.json().catch(function () { return {}; }).then(function (b) {
116
+ if (!res.ok) throw new Error(b.error || ('HTTP ' + res.status));
117
+ return b;
118
+ });
119
+ }
120
+
121
+ function send(type, text) {
122
+ // text/plain keeps this a "simple" request: no CORS preflight round trip.
123
+ return fetch(API + '/reports', {
124
+ method: 'POST',
125
+ headers: { 'content-type': 'text/plain;charset=UTF-8' },
126
+ body: JSON.stringify({ key: KEY, device_id: deviceId(), type: type, text: text, context: context() }),
127
+ }).then(body);
128
+ }
129
+
130
+ function refresh() {
131
+ return fetch(API + '/reports/mine', {
132
+ method: 'POST',
133
+ headers: { 'content-type': 'text/plain;charset=UTF-8' },
134
+ body: JSON.stringify({ key: KEY, device_id: deviceId() }),
135
+ }).then(body).then(function (b) {
136
+ state.reports = b.reports || [];
137
+ renderBadge();
138
+ renderList();
139
+ }).catch(function () { /* offline or blocked: the button still works */ });
140
+ }
141
+
142
+ // ---- ui --------------------------------------------------------------------------------
143
+
144
+ var CSS = [
145
+ ':host{all:initial;--fb-bg:#fff;--fb-fg:#15171c;--fb-mute:#5b6472;--fb-line:#e3e6ea;--fb-acc:#0f766e;--fb-acc-fg:#fff;--fb-bad:#b42318;--fb-mark:#0b5e57;',
146
+ 'font:14px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--fb-fg)}',
147
+ '@media (prefers-color-scheme:dark){:host{--fb-bg:#16181d;--fb-fg:#eceef1;--fb-mute:#9aa1ad;--fb-line:#2c313a;--fb-acc:#2dd4bf;--fb-acc-fg:#0b1f1d;--fb-bad:#f2b8b5;--fb-mark:#2dd4bf}}',
148
+ '*{box-sizing:border-box;font:inherit;color:inherit}',
149
+ '.fab{position:fixed;bottom:20px;right:20px;z-index:2147483000;display:flex;align-items:center;gap:6px;',
150
+ 'padding:9px 14px;border-radius:999px;border:1px solid var(--fb-line);background:var(--fb-bg);color:var(--fb-fg);',
151
+ 'box-shadow:0 4px 14px rgba(0,0,0,.18);cursor:pointer;font-weight:600}',
152
+ '.fab.left{right:auto;left:20px}',
153
+ '.mark{display:inline-flex;color:var(--fb-mark)}.mark svg{display:block}',
154
+ '.dot{width:8px;height:8px;border-radius:50%;background:var(--fb-acc)}',
155
+ '.scrim{position:fixed;inset:0;z-index:2147483001;background:rgba(0,0,0,.35);display:flex;align-items:flex-end;justify-content:flex-end;padding:16px}',
156
+ '.panel{width:min(380px,100%);max-height:min(560px,calc(100vh - 32px));overflow:auto;background:var(--fb-bg);',
157
+ 'border:1px solid var(--fb-line);border-radius:14px;box-shadow:0 12px 40px rgba(0,0,0,.3);padding:16px}',
158
+ '.head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}',
159
+ '.tabs{display:flex;gap:4px}',
160
+ '.tab{border:0;background:none;padding:6px 10px;border-radius:8px;cursor:pointer;color:var(--fb-mute);font-weight:600}',
161
+ '.tab[aria-selected=true]{background:var(--fb-line);color:var(--fb-fg)}',
162
+ '.x{border:0;background:none;cursor:pointer;font-size:20px;line-height:1;padding:4px 8px;color:var(--fb-mute)}',
163
+ 'fieldset{border:0;padding:0;margin:0 0 12px;display:grid;grid-template-columns:1fr 1fr;gap:8px}',
164
+ 'legend{margin-bottom:8px;font-weight:600}',
165
+ '.type{text-align:left;padding:10px;border:1px solid var(--fb-line);border-radius:10px;background:none;cursor:pointer}',
166
+ '.type b{display:block;font-weight:600}',
167
+ '.type span{display:block;font-size:12px;color:var(--fb-mute)}',
168
+ '.type[aria-pressed=true]{border-color:var(--fb-acc);box-shadow:inset 0 0 0 1px var(--fb-acc)}',
169
+ 'textarea{width:100%;min-height:96px;resize:vertical;padding:10px;border:1px solid var(--fb-line);border-radius:10px;background:none}',
170
+ 'textarea:focus,.type:focus-visible,button:focus-visible{outline:2px solid var(--fb-acc);outline-offset:1px}',
171
+ '.row{display:flex;justify-content:space-between;align-items:center;margin-top:10px;gap:8px}',
172
+ '.small{font-size:12px;color:var(--fb-mute)}',
173
+ '.send{padding:9px 16px;border:0;border-radius:10px;background:var(--fb-acc);color:var(--fb-acc-fg);font-weight:600;cursor:pointer}',
174
+ '.send[disabled]{opacity:.5;cursor:default}',
175
+ '.err{color:var(--fb-bad);font-size:13px;margin-top:8px}',
176
+ '.item{border-top:1px solid var(--fb-line);padding:10px 0}',
177
+ '.item:first-child{border-top:0}',
178
+ '.status{font-size:12px;font-weight:600}',
179
+ '.status.fixed,.status.accepted{color:var(--fb-fg)}',
180
+ '.reason{margin-top:4px;padding:8px;border-radius:8px;background:var(--fb-line);font-size:13px}',
181
+ '.text{margin:2px 0;white-space:pre-wrap;word-break:break-word}',
182
+ '.empty{color:var(--fb-mute);padding:12px 0}',
183
+ ].join('');
184
+
185
+ /**
186
+ * The host app's own accent, if it gave one. Only a plain hex colour is accepted, so the
187
+ * attribute cannot inject CSS. The text on top of it is whichever of white or ink reads better.
188
+ */
189
+ function accentCss(v) {
190
+ var m = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec((v || '').trim());
191
+ if (!m) return '';
192
+ var hex = m[1].length === 3 ? m[1].replace(/(.)/g, '$1$1') : m[1];
193
+ var lin = [0, 2, 4].map(function (i) {
194
+ var c = parseInt(hex.slice(i, i + 2), 16) / 255;
195
+ return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
196
+ });
197
+ var L = 0.2126 * lin[0] + 0.7152 * lin[1] + 0.0722 * lin[2];
198
+ var fg = (1.05 / (L + 0.05)) >= ((L + 0.05) / 0.0598) ? '#fff' : '#15171c';
199
+ return ':host{--fb-acc:#' + hex + ';--fb-acc-fg:' + fg + '}';
200
+ }
201
+ CSS += accentCss(script.getAttribute('data-accent'));
202
+
203
+ var host = document.createElement('div');
204
+ host.setAttribute('data-feedback-sdk', '');
205
+ var root = host.attachShadow({ mode: 'open' });
206
+ var style = document.createElement('style');
207
+ style.textContent = CSS;
208
+ root.appendChild(style);
209
+
210
+ function el(tag, attrs, kids) {
211
+ var n = document.createElement(tag);
212
+ for (var k in attrs || {}) {
213
+ if (k === 'text') n.textContent = attrs[k];
214
+ else if (k.slice(0, 2) === 'on') n.addEventListener(k.slice(2), attrs[k]);
215
+ else n.setAttribute(k, attrs[k]);
216
+ }
217
+ (kids || []).forEach(function (c) { if (c) n.appendChild(c); });
218
+ return n;
219
+ }
220
+
221
+ /** The Heresay mark, compact: a soft wave with quote-mark eyes. Drawn from a constant string. */
222
+ function markEl() {
223
+ var s = document.createElement('span');
224
+ s.className = 'mark';
225
+ s.innerHTML = '<svg viewBox="0 0 200 200" width="18" height="18" aria-hidden="true"><path d="M174 100L177 105L180 110L181 116L180 121L178 126L174 131L169 134L164 137L159 139L154 141L149 143L146 146L143 149L141 154L139 159L137 164L134 169L131 174L126 178L121 180L116 181L110 180L105 177L100 174L95 170L91 167L87 164L83 163L79 162L74 162L69 163L63 164L57 164L51 164L46 162L41 159L38 154L36 149L36 143L36 137L37 131L38 126L38 121L37 117L36 113L33 109L30 105L26 100L23 95L20 90L19 84L20 79L22 74L26 69L31 66L36 63L41 61L46 59L51 57L54 54L57 51L59 46L61 41L63 36L66 31L69 26L74 22L79 20L84 19L90 20L95 23L100 26L105 30L109 33L113 36L117 37L121 38L126 38L131 37L137 36L143 36L149 36L154 38L159 41L162 46L164 51L164 57L164 63L163 69L162 74L162 79L163 83L164 87L167 91L170 95Z" fill="currentColor"/><path d="M-13 12 C-13 -8 -2 -24 17 -32 L20 -25 C8 -18 2 -9 3 -1 A13 13 0 1 1 -13 12 Z" fill="#fff" transform="translate(80 106) rotate(-24) scale(1.25)"/><path d="M-13 12 C-13 -8 -2 -24 17 -32 L20 -25 C8 -18 2 -9 3 -1 A13 13 0 1 1 -13 12 Z" fill="#fff" transform="translate(124 101) rotate(-24) scale(1.25)"/></svg>';
226
+ return s;
227
+ }
228
+ var fabDot = el('span', { class: 'dot', hidden: '' });
229
+ var fab = el('button', {
230
+ class: 'fab' + (script.getAttribute('data-position') === 'left' ? ' left' : ''),
231
+ type: 'button', 'aria-haspopup': 'dialog', onclick: function () { open(); },
232
+ }, [markEl(), el('span', { text: 'Report' }), fabDot]);
233
+ root.appendChild(fab);
234
+
235
+ var scrim = null, view = 'new', listBox = null, lastFocus = null;
236
+
237
+ function renderBadge() {
238
+ var n = unseen();
239
+ if (n) fabDot.removeAttribute('hidden'); else fabDot.setAttribute('hidden', '');
240
+ fab.setAttribute('aria-label', n ? 'Report a problem. ' + n + ' of your reports have an update' : 'Report a problem');
241
+ }
242
+
243
+ renderBadge();
244
+
245
+ function open(which) {
246
+ if (scrim) return;
247
+ lastFocus = document.activeElement;
248
+ view = which || (unseen() ? 'mine' : 'new');
249
+ scrim = el('div', { class: 'scrim', onclick: function (e) { if (e.target === scrim) close(); } });
250
+ scrim.addEventListener('keydown', function (e) { if (e.key === 'Escape') close(); });
251
+ root.appendChild(scrim);
252
+ renderPanel();
253
+ refresh();
254
+ }
255
+
256
+ function close() {
257
+ if (!scrim) return;
258
+ if (view === 'mine') markSeen();
259
+ scrim.remove();
260
+ scrim = null;
261
+ listBox = null;
262
+ renderBadge();
263
+ if (lastFocus && lastFocus.focus) lastFocus.focus();
264
+ }
265
+
266
+ function renderPanel() {
267
+ scrim.textContent = '';
268
+ var tab = function (id, label) {
269
+ return el('button', {
270
+ class: 'tab', type: 'button', role: 'tab', 'aria-selected': String(view === id),
271
+ onclick: function () { if (view === 'mine') markSeen(); view = id; renderPanel(); },
272
+ }, [document.createTextNode(label)]);
273
+ };
274
+ var panel = el('div', { class: 'panel', role: 'dialog', 'aria-modal': 'true', 'aria-label': 'Feedback' }, [
275
+ el('div', { class: 'head' }, [
276
+ el('div', { class: 'tabs', role: 'tablist' }, [tab('new', 'Report'), tab('mine', 'Your reports')]),
277
+ el('button', { class: 'x', type: 'button', 'aria-label': 'Close', text: '×', onclick: close }),
278
+ ]),
279
+ view === 'new' ? formView() : listView(),
280
+ ]);
281
+ scrim.appendChild(panel);
282
+ var first = panel.querySelector(view === 'new' ? '.type' : '.tab[aria-selected=true]');
283
+ if (first) first.focus();
284
+ }
285
+
286
+ function formView() {
287
+ var err = el('div', { class: 'err', role: 'alert' });
288
+ var text = el('textarea', {
289
+ 'aria-label': 'What happened?', maxlength: '2000',
290
+ placeholder: 'What happened, or what would you change?',
291
+ });
292
+ var sendBtn = el('button', { class: 'send', type: 'submit', text: 'Send' });
293
+ var types = TYPES.map(function (t) {
294
+ return el('button', {
295
+ class: 'type', type: 'button', 'aria-pressed': String(state.type === t.id), 'data-type': t.id,
296
+ onclick: function () {
297
+ state.type = t.id;
298
+ types.forEach(function (b) { b.setAttribute('aria-pressed', String(b.getAttribute('data-type') === t.id)); });
299
+ text.focus();
300
+ },
301
+ }, [el('b', { text: t.label }), el('span', { text: t.hint })]);
302
+ });
303
+ var form = el('form', {
304
+ onsubmit: function (e) {
305
+ e.preventDefault();
306
+ err.textContent = '';
307
+ if (!state.type) { err.textContent = 'Pick what kind of report this is.'; return; }
308
+ if (!text.value.trim()) { err.textContent = 'Say what happened.'; text.focus(); return; }
309
+ sendBtn.disabled = true;
310
+ sendBtn.textContent = 'Sending…';
311
+ send(state.type, text.value.trim()).then(function (b) {
312
+ state.type = null;
313
+ state.reports = [b.report].concat(state.reports);
314
+ markSeen();
315
+ view = 'mine';
316
+ renderPanel();
317
+ }).catch(function (x) {
318
+ err.textContent = x.message || 'Could not send. Try again.';
319
+ sendBtn.disabled = false;
320
+ sendBtn.textContent = 'Send';
321
+ });
322
+ },
323
+ }, [
324
+ el('fieldset', {}, [el('legend', { text: 'What is it?' })].concat(types)),
325
+ text,
326
+ el('div', { class: 'row' }, [
327
+ el('span', { class: 'small', text: 'The current screen and app version are attached.' }),
328
+ sendBtn,
329
+ ]),
330
+ err,
331
+ ]);
332
+ return form;
333
+ }
334
+
335
+ function listView() {
336
+ listBox = el('div', { role: 'tabpanel' });
337
+ renderList();
338
+ return listBox;
339
+ }
340
+
341
+ function renderList() {
342
+ if (!listBox) return;
343
+ listBox.textContent = '';
344
+ if (!state.reports.length) {
345
+ listBox.appendChild(el('div', { class: 'empty', text: 'Nothing sent from this device yet.' }));
346
+ return;
347
+ }
348
+ var s = seen();
349
+ state.reports.forEach(function (r) {
350
+ var label = (TYPES.filter(function (t) { return t.id === r.type; })[0] || {}).label || r.type;
351
+ var fresh = r.status !== 'open' && s[r.id] !== r.status;
352
+ listBox.appendChild(el('div', { class: 'item' }, [
353
+ el('div', { class: 'status ' + r.status, text: (fresh ? '● ' : '') + STATUS[r.status] }),
354
+ el('div', { class: 'text', text: r.text }),
355
+ el('div', { class: 'small', text: label + ' · ' + new Date(r.created_at).toLocaleDateString() }),
356
+ r.status === 'declined' && r.decline_reason
357
+ ? el('div', { class: 'reason', text: 'Why: ' + r.decline_reason }) : null,
358
+ ]));
359
+ });
360
+ }
361
+
362
+ function mount() {
363
+ if (!host.isConnected) document.body.appendChild(host);
364
+ refresh();
365
+ }
366
+ if (document.body) mount(); else document.addEventListener('DOMContentLoaded', mount);
367
+
368
+ window.Heresay = window.Feedback = {
369
+ __loaded: true,
370
+ identify: function (u) {
371
+ u = u || {};
372
+ state.userId = u.id != null ? String(u.id) : null;
373
+ state.userLabel = u.label != null ? String(u.label) : null;
374
+ },
375
+ setVersion: function (v) { state.version = v != null ? String(v) : null; },
376
+ setScreen: function (s) { state.screen = s != null ? String(s) : null; },
377
+ open: function () { open('new'); },
378
+ close: close,
379
+ };
380
+ })();
@@ -0,0 +1,150 @@
1
+ /* Heresay website. Colours, type and radii follow brand/heresay-brand-guidelines.pdf. */
2
+ :root {
3
+ --deep:#0b5e57; --peacock:#0f766e; --turq:#2dd4bf; --mist:#e6f4f2;
4
+ --ink:#15171c; --slate:#5b6472; --line:#e3e6ea; --paper:#f5f6f7; --white:#fff;
5
+ --head:"Bricolage Grotesque", system-ui, sans-serif; --body:Figtree, system-ui, sans-serif; --mono:"JetBrains Mono", ui-monospace, monospace;
6
+ }
7
+ * { box-sizing:border-box; }
8
+ html { scroll-behavior:smooth; }
9
+ body { margin:0; font:17px/1.6 var(--body); color:var(--ink); background:var(--white); }
10
+ a { color:inherit; }
11
+ img { display:block; }
12
+ .wrap { max-width:1160px; margin:0 auto; padding:0 32px; }
13
+ code, pre { font-family:var(--mono); }
14
+
15
+ /* nav */
16
+ .nav { display:flex; align-items:center; gap:28px; height:76px; }
17
+ .nav .links { display:flex; gap:26px; margin-left:auto; font-weight:500; font-size:16px; color:var(--slate); }
18
+ .nav .links a { text-decoration:none; }
19
+ .nav .links a:hover { color:var(--ink); }
20
+ .btn { display:inline-flex; align-items:center; justify-content:center; min-height:48px; padding:0 22px; border-radius:10px; font:700 16px/1 var(--body); text-decoration:none; }
21
+ .btn-p { background:var(--peacock); color:#fff; }
22
+ .btn-p:hover { background:var(--deep); }
23
+ .btn-s { border:1.5px solid #cfd3db; color:var(--ink); }
24
+ .btn-s:hover { border-color:var(--ink); }
25
+ .btn-sm { min-height:42px; padding:0 18px; font-size:15px; }
26
+
27
+ /* type */
28
+ h1, h2, h3 { font-family:var(--head); letter-spacing:-.03em; margin:0; }
29
+ h1 { font-weight:800; font-size:clamp(44px, 6vw, 76px); line-height:1.04; }
30
+ h2 { font-weight:800; font-size:clamp(32px, 4vw, 46px); line-height:1.1; }
31
+ h3 { font-weight:700; font-size:22px; line-height:1.3; letter-spacing:-.015em; }
32
+ .lede { font-size:20px; line-height:1.55; color:var(--slate); max-width:34ch; }
33
+ .muted { color:var(--slate); }
34
+
35
+ /* hero */
36
+ .hero { display:grid; grid-template-columns:1.05fr .95fr; gap:56px; align-items:center; padding:64px 0 96px; }
37
+ .hero h1 em { font-style:normal; color:var(--peacock); }
38
+ .hero .lede { margin:24px 0 30px; }
39
+ .ctas { display:flex; gap:12px; flex-wrap:wrap; }
40
+ .fine { margin-top:14px; font-size:14px; color:var(--slate); }
41
+ .snippet { margin-top:28px; background:var(--paper); border:1px solid var(--line); border-radius:12px; padding:14px 16px; font:14px/1.7 var(--mono); }
42
+ .snippet b { color:var(--peacock); font-weight:500; }
43
+ .nowrap { white-space:nowrap; }
44
+
45
+ /* widget mock */
46
+ .stage { position:relative; background:var(--paper); border:1px solid var(--line); border-radius:22px; padding:28px; min-height:470px; }
47
+ .stage .bar { height:12px; border-radius:6px; background:#e9ecf1; margin-bottom:12px; width:55%; }
48
+ .stage .bar.b { width:78%; } .stage .bar.c { width:40%; }
49
+ .panel { position:absolute; right:24px; bottom:84px; left:24px; max-width:380px; margin-left:auto; background:#fff; border:1px solid var(--line); border-radius:16px; padding:18px; box-shadow:0 1px 2px rgba(21,23,28,.06), 0 8px 18px rgba(21,23,28,.08); }
50
+ .tabs { display:flex; gap:4px; margin-bottom:12px; }
51
+ .tabs span { padding:6px 12px; border-radius:8px; font-weight:600; font-size:14px; color:var(--slate); }
52
+ .tabs .on { background:#eef0f3; color:var(--ink); }
53
+ .types { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
54
+ .type { border:1.5px solid var(--line); border-radius:10px; padding:9px 11px; font-size:13px; }
55
+ .type b { display:block; font-size:14px; }
56
+ .type span { color:var(--slate); }
57
+ .type.on { border-color:var(--peacock); background:var(--mist); }
58
+ .field { border:1.5px solid var(--line); border-radius:10px; padding:9px 11px; margin-top:10px; font-size:14px; min-height:56px; }
59
+ .wrow { display:flex; justify-content:space-between; align-items:center; margin-top:10px; }
60
+ .wrow small { color:var(--slate); font-size:12px; }
61
+ .send { background:var(--peacock); color:#fff; border-radius:10px; padding:8px 16px; font-weight:700; font-size:14px; }
62
+ .fab { position:absolute; right:24px; bottom:24px; display:flex; gap:8px; align-items:center; background:#fff; border:1px solid var(--line); border-radius:999px; padding:9px 16px 9px 11px; font-weight:700; font-size:15px; box-shadow:0 4px 14px rgba(0,0,0,.12); }
63
+
64
+ /* sections */
65
+ section { padding:96px 0; border-top:1px solid var(--line); }
66
+ .section-head { max-width:640px; margin-bottom:44px; }
67
+ .section-head p { color:var(--slate); font-size:19px; margin:12px 0 0; }
68
+ .steps { display:grid; grid-template-columns:repeat(4, 1fr); gap:20px; }
69
+ .step { background:var(--paper); border-radius:18px; padding:26px; }
70
+ .step .n { width:40px; height:40px; border-radius:12px; background:var(--mist); color:var(--deep); display:flex; align-items:center; justify-content:center; font:800 18px/1 var(--head); }
71
+ .step h3 { margin:18px 0 6px; }
72
+ .step p { margin:0; color:var(--slate); font-size:16px; }
73
+ .grid3 { display:grid; grid-template-columns:repeat(3, 1fr); gap:20px; }
74
+ .feature { border:1px solid var(--line); border-radius:18px; padding:26px; }
75
+ .feature .t { display:flex; align-items:center; gap:10px; }
76
+ .feature .t svg { flex:none; }
77
+ .feature p { margin:8px 0 0; color:var(--slate); font-size:16px; }
78
+
79
+ /* two sides */
80
+ .sides { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
81
+ .side { border-radius:22px; padding:30px; }
82
+ .side.them { background:var(--paper); }
83
+ .side.you { background:var(--deep); color:#fff; }
84
+ .side.you .muted { color:#b9dcd6; }
85
+ .row-card { background:#fff; color:var(--ink); border-radius:14px; padding:16px; margin-top:14px; }
86
+ .row-card .k { font:700 12px var(--body); letter-spacing:.08em; text-transform:uppercase; color:#8a4b0b; }
87
+ .row-card p { margin:4px 0 2px; }
88
+ .row-card .m { font:13px var(--mono); color:var(--slate); }
89
+ .acts { display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; }
90
+ .acts span { border-radius:9px; padding:7px 13px; font-weight:700; font-size:14px; border:1.5px solid var(--line); }
91
+ .acts .go { background:var(--peacock); border-color:var(--peacock); color:#fff; }
92
+ .reply { background:var(--mist); border-radius:12px; padding:12px 14px; margin-top:10px; font-size:15px; }
93
+ .reply b { color:var(--deep); }
94
+ .pills { display:flex; gap:8px; flex-wrap:wrap; margin-top:18px; }
95
+ .pill { display:inline-flex; gap:8px; align-items:center; border-radius:999px; padding:7px 14px; font-weight:600; font-size:14px; }
96
+ .pill i { width:8px; height:8px; border-radius:50%; background:currentColor; }
97
+
98
+ /* guarantee */
99
+ .promise { display:grid; grid-template-columns:140px 1fr; gap:40px; align-items:center; background:var(--mist); border-radius:24px; padding:48px; }
100
+ .promise h2 { font-size:clamp(28px, 3.4vw, 40px); }
101
+ .promise p { color:#2c4a46; margin:12px 0 0; font-size:18px; }
102
+
103
+ /* setup */
104
+ .setup { display:grid; grid-template-columns:repeat(3, 1fr); gap:20px; }
105
+ .setup .step { background:#fff; border:1px solid var(--line); }
106
+
107
+ /* faq */
108
+ .faq { display:grid; grid-template-columns:1fr 1fr; gap:0 48px; }
109
+ .faq details { border-top:1px solid var(--line); padding:18px 0; }
110
+ .faq summary { font:700 19px/1.4 var(--head); cursor:pointer; list-style:none; }
111
+ .faq summary::-webkit-details-marker { display:none; }
112
+ .faq summary::after { content:"+"; float:right; color:var(--peacock); font-weight:800; }
113
+ .faq details[open] summary::after { content:"–"; }
114
+ .faq p { color:var(--slate); margin:10px 0 0; font-size:16px; }
115
+
116
+ /* close + footer */
117
+ .close { text-align:center; }
118
+ .close h2 { max-width:18ch; margin:18px auto 0; }
119
+ .close .ctas { justify-content:center; margin-top:28px; }
120
+ footer.site { border-top:1px solid var(--line); padding:28px 0 40px; color:var(--slate); font-size:14px; }
121
+ footer.site .wrap { display:flex; justify-content:space-between; gap:20px; flex-wrap:wrap; }
122
+ footer.site a { text-decoration:none; }
123
+
124
+ /* docs */
125
+ .docs { display:grid; grid-template-columns:230px 1fr; gap:56px; padding:40px 0 96px; }
126
+ .toc { position:sticky; top:24px; align-self:start; font-size:15px; }
127
+ .toc a { display:block; padding:6px 0; color:var(--slate); text-decoration:none; }
128
+ .toc a:hover { color:var(--ink); }
129
+ .toc b { display:block; font:700 13px var(--mono); color:var(--peacock); margin:18px 0 4px; letter-spacing:.04em; }
130
+ .doc h1 { font-size:48px; }
131
+ .doc h2 { font-size:32px; margin:56px 0 12px; padding-top:8px; }
132
+ .doc h3 { margin:28px 0 8px; }
133
+ .doc p, .doc li { color:#2f343d; }
134
+ .doc pre { background:var(--ink); color:#e8ecf1; border-radius:12px; padding:18px 20px; overflow:auto; font-size:14px; line-height:1.7; }
135
+ .doc pre .k { color:var(--turq); }
136
+ .doc code { background:var(--mist); color:var(--deep); padding:2px 6px; border-radius:5px; font-size:14px; }
137
+ .doc pre code { background:none; color:inherit; padding:0; }
138
+ .doc table { width:100%; border-collapse:collapse; margin:12px 0; font-size:15px; }
139
+ .doc th, .doc td { text-align:left; padding:11px 12px; border-bottom:1px solid var(--line); vertical-align:top; }
140
+ .doc th { font-weight:700; background:var(--paper); }
141
+ .note { background:var(--mist); border-radius:12px; padding:14px 18px; color:#2c4a46; }
142
+
143
+ @media (max-width:900px) {
144
+ .hero, .sides, .promise, .faq, .docs { grid-template-columns:1fr; }
145
+ .steps, .grid3, .setup { grid-template-columns:1fr 1fr; }
146
+ .nav .links a:not(.keep) { display:none; }
147
+ .toc { position:static; }
148
+ .panel { left:24px; right:24px; }
149
+ }
150
+ @media (max-width:560px) { .steps, .grid3, .setup { grid-template-columns:1fr; } }