@vitrinka/web 0.6.0 → 0.7.1

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 (60) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +127 -4
  3. package/build/hud.iife.js +7 -7
  4. package/build/index.d.ts +1 -0
  5. package/build/recorder/RecorderProvider.js +5 -18
  6. package/build/recorder/api.d.ts +20 -0
  7. package/build/recorder/api.js +21 -9
  8. package/build/recorder/capture/console.d.ts +6 -1
  9. package/build/recorder/capture/console.js +28 -5
  10. package/build/recorder/capture/net.d.ts +10 -1
  11. package/build/recorder/capture/net.js +14 -1
  12. package/build/recorder/capture/redact.d.ts +1 -0
  13. package/build/recorder/capture/redact.js +6 -1
  14. package/build/recorder/capture/rrweb-lane.d.ts +19 -0
  15. package/build/recorder/capture/rrweb-lane.js +109 -0
  16. package/build/recorder/capture/rrweb.d.ts +2 -9
  17. package/build/recorder/capture/rrweb.js +11 -86
  18. package/build/recorder/config.d.ts +3 -1
  19. package/build/recorder/config.js +15 -2
  20. package/build/recorder/flight.d.ts +141 -22
  21. package/build/recorder/flight.js +312 -27
  22. package/build/recorder/hud/host-style.d.ts +14 -0
  23. package/build/recorder/hud/host-style.js +15 -0
  24. package/build/recorder/hud/host.js +1 -1
  25. package/build/recorder/hud/styles.d.ts +1 -11
  26. package/build/recorder/hud/styles.js +1 -12
  27. package/build/recorder/state.d.ts +18 -1
  28. package/build/recorder/state.js +40 -1
  29. package/build/recorder/storage/capture.d.ts +44 -0
  30. package/build/recorder/storage/capture.js +136 -0
  31. package/build/recorder/version.d.ts +2 -2
  32. package/build/recorder/version.js +1 -1
  33. package/build/report/bundle.d.ts +4 -0
  34. package/build/report/bundle.js +30 -0
  35. package/build/report/element.d.ts +86 -0
  36. package/build/report/element.js +146 -0
  37. package/build/report/engine.d.ts +144 -0
  38. package/build/report/engine.js +402 -0
  39. package/build/report/i18n.d.ts +78 -0
  40. package/build/report/i18n.js +151 -0
  41. package/build/report/identity.d.ts +26 -0
  42. package/build/report/identity.js +36 -0
  43. package/build/report/index.d.ts +12 -0
  44. package/build/report/index.js +15 -0
  45. package/build/report/keybind.d.ts +29 -0
  46. package/build/report/keybind.js +99 -0
  47. package/build/report/markers.d.ts +77 -0
  48. package/build/report/markers.js +162 -0
  49. package/build/report/profile.d.ts +62 -0
  50. package/build/report/profile.js +115 -0
  51. package/build/report/recorder-face.d.ts +2 -0
  52. package/build/report/recorder-face.js +20 -0
  53. package/build/report/styles.d.ts +7 -0
  54. package/build/report/styles.js +226 -0
  55. package/build/report/widget.d.ts +111 -0
  56. package/build/report/widget.js +927 -0
  57. package/build/report/wire.d.ts +68 -0
  58. package/build/report/wire.js +96 -0
  59. package/build/report-widget.mjs +229 -0
  60. package/package.json +11 -4
@@ -0,0 +1,162 @@
1
+ /** The smallest stroke that counts as a marker; a click without moving is not one. */
2
+ export const MIN_MARK_PX = 8;
3
+ export function rectBetween(a, b) {
4
+ return { x: Math.min(a.x, b.x), y: Math.min(a.y, b.y), w: Math.abs(b.x - a.x), h: Math.abs(b.y - a.y) };
5
+ }
6
+ export function arrowHead(tail, head) {
7
+ return `${head.y < tail.y ? 'n' : 's'}${head.x < tail.x ? 'w' : 'e'}`;
8
+ }
9
+ /** The arrow's two ends from its rect and head corner. */
10
+ export function arrowEnds(rect, head) {
11
+ const left = rect.x;
12
+ const right = rect.x + rect.w;
13
+ const top = rect.y;
14
+ const bottom = rect.y + rect.h;
15
+ const tip = { x: head.endsWith('w') ? left : right, y: head.startsWith('n') ? top : bottom };
16
+ const tail = { x: head.endsWith('w') ? right : left, y: head.startsWith('n') ? bottom : top };
17
+ return { tail, tip };
18
+ }
19
+ /** Is the stroke from `a` to `b` big enough to be a `shape`? */
20
+ export function isMark(shape, a, b) {
21
+ if (shape === 'arrow')
22
+ return Math.hypot(b.x - a.x, b.y - a.y) >= MIN_MARK_PX * 2;
23
+ return Math.abs(b.x - a.x) >= MIN_MARK_PX && Math.abs(b.y - a.y) >= MIN_MARK_PX;
24
+ }
25
+ /** Numbered 1..n in drawing order (after a removal too). */
26
+ export function renumber(markers) {
27
+ return markers.map((m, i) => ({ ...m, n: i + 1 }));
28
+ }
29
+ export function toWire(markers) {
30
+ return markers.map((m) => ({
31
+ n: m.n,
32
+ shape: m.shape,
33
+ rect: { x: Math.round(m.rect.x), y: Math.round(m.rect.y), w: Math.round(m.rect.w), h: Math.round(m.rect.h) },
34
+ ...(m.note.trim() ? { note: m.note.trim() } : {}),
35
+ ...(m.shape === 'arrow' && m.head ? { head: m.head } : {}),
36
+ }));
37
+ }
38
+ // -- hide: blanking the capture ------------------------------------------------
39
+ /** rrweb's numeric codes (`@rrweb/types` is type-only here). */
40
+ const FULL_SNAPSHOT = 2;
41
+ const INCREMENTAL = 3;
42
+ const SOURCE_MUTATION = 0;
43
+ const SOURCE_INPUT = 5;
44
+ const NODE_ELEMENT = 2;
45
+ const NODE_TEXT = 3;
46
+ /** Far above any id rrweb hands out in one recording. */
47
+ export const HIDE_NODE_ID_BASE = 2_000_000_000;
48
+ export const HIDE_ATTR = 'data-vitrinka-hidden';
49
+ const HIDE_FILL = '#1b1b1f';
50
+ function hideBox(rect, i) {
51
+ const style = `position:fixed;left:${Math.round(rect.x)}px;top:${Math.round(rect.y)}px;` +
52
+ `width:${Math.round(rect.w)}px;height:${Math.round(rect.h)}px;` +
53
+ `background:${HIDE_FILL};z-index:2147483647;pointer-events:none;`;
54
+ return { type: NODE_ELEMENT, id: HIDE_NODE_ID_BASE + i, tagName: 'div', attributes: { [HIDE_ATTR]: '', style }, childNodes: [] };
55
+ }
56
+ /** A copy of the tree with hidden texts and values emptied and the boxes appended to <body>. */
57
+ function blankTree(node, ids, boxes, appended) {
58
+ const out = { ...node };
59
+ if (node.type === NODE_TEXT && ids.has(node.id))
60
+ out.textContent = '';
61
+ if (node.attributes && ids.has(node.id) && 'value' in node.attributes)
62
+ out.attributes = { ...node.attributes, value: '' };
63
+ if (node.childNodes) {
64
+ out.childNodes = node.childNodes.map((c) => blankTree(c, ids, boxes, appended));
65
+ if (!appended.done && node.type === NODE_ELEMENT && node.tagName === 'body') {
66
+ out.childNodes.push(...boxes);
67
+ appended.done = true;
68
+ }
69
+ }
70
+ return out;
71
+ }
72
+ /** The last <html>-ish element to hang the boxes on when a snapshot has no <body> (a frameset). */
73
+ function appendToRoot(root, boxes) {
74
+ const html = root.childNodes?.find((c) => c.type === NODE_ELEMENT);
75
+ (html ?? root).childNodes?.push(...boxes);
76
+ }
77
+ function blankAdded(node, ids) {
78
+ return blankTree(node, ids, [], { done: true });
79
+ }
80
+ /**
81
+ * The capture with every `hide` region blanked: the boxes join each full
82
+ * snapshot, and the nodes in `hiddenIds` lose their text and values in the
83
+ * snapshots, in mutations and in input events. Returns new events; the
84
+ * input is never mutated (the buffer still holds it).
85
+ */
86
+ export function applyHides(events, hides, hiddenIds) {
87
+ if (!hides.length && !hiddenIds.size)
88
+ return events.slice();
89
+ const boxes = hides.map(hideBox);
90
+ return events.map((ev) => {
91
+ // boundary: rrweb's serialized JSON, read through the fields above.
92
+ const data = ev.data;
93
+ if (ev.type === FULL_SNAPSHOT && data.node) {
94
+ const appended = { done: false };
95
+ const node = blankTree(data.node, hiddenIds, boxes, appended);
96
+ if (!appended.done)
97
+ appendToRoot(node, boxes);
98
+ return { ...ev, data: { ...ev.data, node } };
99
+ }
100
+ if (ev.type !== INCREMENTAL || !hiddenIds.size)
101
+ return ev;
102
+ if (data.source === SOURCE_MUTATION) {
103
+ const m = ev.data;
104
+ const blanked = {
105
+ ...m,
106
+ ...(m.texts ? { texts: m.texts.map((t) => (hiddenIds.has(t.id) ? { ...t, value: '' } : t)) } : {}),
107
+ ...(m.adds ? { adds: m.adds.map((a) => ({ ...a, node: blankAdded(a.node, hiddenIds) })) } : {}),
108
+ ...(m.attributes
109
+ ? {
110
+ attributes: m.attributes.map((a) => hiddenIds.has(a.id) && 'value' in a.attributes ? { ...a, attributes: { ...a.attributes, value: '' } } : a),
111
+ }
112
+ : {}),
113
+ };
114
+ return { ...ev, data: blanked };
115
+ }
116
+ if (data.source === SOURCE_INPUT) {
117
+ const input = ev.data;
118
+ if (hiddenIds.has(input.id))
119
+ return { ...ev, data: { ...input, text: '' } };
120
+ }
121
+ return ev;
122
+ });
123
+ }
124
+ function inside(p, r) {
125
+ return p.x >= r.x && p.x <= r.x + r.w && p.y >= r.y && p.y <= r.y + r.h;
126
+ }
127
+ function centerOf(r) {
128
+ return { x: r.left + r.width / 2, y: r.top + r.height / 2 };
129
+ }
130
+ /**
131
+ * The rrweb ids of the page's text nodes and form controls whose box is
132
+ * centred inside a hide region right now (the page is frozen while the
133
+ * reporter marks). Our own surfaces are skipped.
134
+ */
135
+ export function hiddenNodeIds(hides, mirror, doc = document) {
136
+ const ids = new Set();
137
+ if (!hides.length || !mirror || !doc.body)
138
+ return ids;
139
+ const within = (r) => r.width > 0 && r.height > 0 && hides.some((h) => inside(centerOf(r), h));
140
+ const take = (n) => {
141
+ const id = mirror.getId(n);
142
+ if (id > 0)
143
+ ids.add(id);
144
+ };
145
+ const walker = doc.createTreeWalker(doc.body, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT);
146
+ const range = doc.createRange();
147
+ for (let n = walker.nextNode(); n; n = walker.nextNode()) {
148
+ if (n.nodeType === Node.TEXT_NODE) {
149
+ if (!n.textContent?.trim())
150
+ continue;
151
+ range.selectNodeContents(n);
152
+ if (within(range.getBoundingClientRect()))
153
+ take(n);
154
+ }
155
+ else if (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement) {
156
+ if (within(n.getBoundingClientRect()))
157
+ take(n);
158
+ }
159
+ }
160
+ range.detach();
161
+ return ids;
162
+ }
@@ -0,0 +1,62 @@
1
+ /**
2
+ * The capture profile (QA Studio D7): what Report a problem keeps before a
3
+ * report, decided per project in vitrinka (`captureProfile` in
4
+ * `GET /api/v1/report-config`). A host's init options can only NARROW it.
5
+ *
6
+ * storage memory | browser (IndexedDB, masked, expiring with the window)
7
+ * windowSec how far back (default 300)
8
+ * maxBytes the replay's size cap
9
+ * classes ⊆ errors · interactions · full · console · network
10
+ *
11
+ * Classes: `interactions` = the masked DOM replay (clicks, scrolls, typing
12
+ * as masked input, each page's view); `errors` = uncaught errors, console
13
+ * errors and failed requests; `console` = every console level; `network` =
14
+ * every request's method, path, status and duration; `full` = all of them.
15
+ * Request and response bodies and headers are never part of a report.
16
+ */
17
+ import type { RedactionPolicy } from '@vitrinka/redact';
18
+ export type CaptureClass = 'errors' | 'interactions' | 'full' | 'console' | 'network';
19
+ export type CaptureStorage = 'memory' | 'browser';
20
+ export interface CaptureProfile {
21
+ storage: CaptureStorage;
22
+ windowSec: number;
23
+ maxBytes: number;
24
+ classes: CaptureClass[];
25
+ }
26
+ /** What a host may pass to narrow the project's profile; every field optional. */
27
+ export type CaptureNarrowing = Partial<CaptureProfile>;
28
+ /** What each class switches on, `full` expanded. */
29
+ export interface CaptureLanes {
30
+ replay: boolean;
31
+ errors: boolean;
32
+ console: boolean;
33
+ network: boolean;
34
+ }
35
+ /** The profile a project gets when its server names one without every field. */
36
+ export declare const PROFILE_DEFAULTS: CaptureProfile;
37
+ /**
38
+ * A server without a capture profile (or an unreachable one): memory, the
39
+ * last minute under 4 MiB, errors and the replay — errors only where the
40
+ * server says `flightRecorder: false`.
41
+ */
42
+ export declare function legacyProfile(flightRecorder?: boolean): CaptureProfile;
43
+ /** The server's `captureProfile`, field by field; anything missing or malformed takes its default. */
44
+ export declare function parseProfile(raw: unknown, flightRecorder?: boolean): CaptureProfile;
45
+ export declare function lanesOf(classes: readonly CaptureClass[]): CaptureLanes;
46
+ /**
47
+ * The project's profile as the host narrowed it: storage only down to
48
+ * memory, the window and the cap only shorter, the classes only fewer
49
+ * (compared lane by lane, so `full` on either side means all four).
50
+ */
51
+ export declare function narrowProfile(server: CaptureProfile, host: CaptureNarrowing | undefined): CaptureProfile;
52
+ /** The masking profile a project asked for (`profile` in report-config). */
53
+ export type MaskingProfile = 'strict' | 'balanced' | 'full';
54
+ export declare function maskingOf(raw: unknown): MaskingProfile;
55
+ /**
56
+ * The redaction rules a masking profile means for the shared engine:
57
+ * strict masks every text node and input (a `[data-vitrinka-unmask]`
58
+ * subtree keeps its text), balanced masks inputs, full masks nothing.
59
+ */
60
+ export declare function maskingPolicy(masking: MaskingProfile): RedactionPolicy;
61
+ /** The attribute a host puts on a subtree whose text a strict replay may keep. */
62
+ export declare const UNMASK_SELECTOR = "[data-vitrinka-unmask]";
@@ -0,0 +1,115 @@
1
+ const CLASSES = ['errors', 'interactions', 'full', 'console', 'network'];
2
+ const MIN_WINDOW_SEC = 10;
3
+ const MAX_WINDOW_SEC = 3600;
4
+ const MIN_BYTES = 256 * 1024;
5
+ const MAX_BYTES = 64 * 1024 * 1024;
6
+ /** The profile a project gets when its server names one without every field. */
7
+ export const PROFILE_DEFAULTS = {
8
+ storage: 'memory',
9
+ windowSec: 300,
10
+ maxBytes: 12 * 1024 * 1024,
11
+ classes: ['errors', 'interactions'],
12
+ };
13
+ /**
14
+ * A server without a capture profile (or an unreachable one): memory, the
15
+ * last minute under 4 MiB, errors and the replay — errors only where the
16
+ * server says `flightRecorder: false`.
17
+ */
18
+ export function legacyProfile(flightRecorder) {
19
+ return {
20
+ storage: 'memory',
21
+ windowSec: 60,
22
+ maxBytes: 4 * 1024 * 1024,
23
+ classes: flightRecorder === false ? ['errors'] : ['errors', 'interactions'],
24
+ };
25
+ }
26
+ function clamp(n, lo, hi) {
27
+ return Math.min(hi, Math.max(lo, n));
28
+ }
29
+ function classesOf(raw) {
30
+ if (!Array.isArray(raw))
31
+ return null;
32
+ return CLASSES.filter((c) => raw.includes(c));
33
+ }
34
+ /** The server's `captureProfile`, field by field; anything missing or malformed takes its default. */
35
+ export function parseProfile(raw, flightRecorder) {
36
+ if (typeof raw !== 'object' || raw === null)
37
+ return legacyProfile(flightRecorder);
38
+ const p = raw;
39
+ return {
40
+ storage: p.storage === 'browser' ? 'browser' : p.storage === 'memory' ? 'memory' : PROFILE_DEFAULTS.storage,
41
+ windowSec: typeof p.windowSec === 'number' && Number.isFinite(p.windowSec)
42
+ ? clamp(Math.round(p.windowSec), MIN_WINDOW_SEC, MAX_WINDOW_SEC)
43
+ : PROFILE_DEFAULTS.windowSec,
44
+ maxBytes: typeof p.maxBytes === 'number' && Number.isFinite(p.maxBytes)
45
+ ? clamp(Math.round(p.maxBytes), MIN_BYTES, MAX_BYTES)
46
+ : PROFILE_DEFAULTS.maxBytes,
47
+ classes: classesOf(p.classes) ?? PROFILE_DEFAULTS.classes,
48
+ };
49
+ }
50
+ export function lanesOf(classes) {
51
+ const full = classes.includes('full');
52
+ return {
53
+ replay: full || classes.includes('interactions'),
54
+ errors: full || classes.includes('errors'),
55
+ console: full || classes.includes('console'),
56
+ network: full || classes.includes('network'),
57
+ };
58
+ }
59
+ function classesFor(lanes) {
60
+ const out = [];
61
+ if (lanes.errors)
62
+ out.push('errors');
63
+ if (lanes.replay)
64
+ out.push('interactions');
65
+ if (lanes.console)
66
+ out.push('console');
67
+ if (lanes.network)
68
+ out.push('network');
69
+ return out;
70
+ }
71
+ /**
72
+ * The project's profile as the host narrowed it: storage only down to
73
+ * memory, the window and the cap only shorter, the classes only fewer
74
+ * (compared lane by lane, so `full` on either side means all four).
75
+ */
76
+ export function narrowProfile(server, host) {
77
+ if (!host)
78
+ return server;
79
+ const window = typeof host.windowSec === 'number' && host.windowSec > 0 ? Math.min(server.windowSec, host.windowSec) : server.windowSec;
80
+ const bytes = typeof host.maxBytes === 'number' && host.maxBytes > 0 ? Math.min(server.maxBytes, host.maxBytes) : server.maxBytes;
81
+ let classes = server.classes;
82
+ if (host.classes) {
83
+ const s = lanesOf(server.classes);
84
+ const h = lanesOf(host.classes);
85
+ classes = classesFor({
86
+ replay: s.replay && h.replay,
87
+ errors: s.errors && h.errors,
88
+ console: s.console && h.console,
89
+ network: s.network && h.network,
90
+ });
91
+ }
92
+ return {
93
+ storage: host.storage === 'memory' ? 'memory' : server.storage,
94
+ windowSec: clamp(window, MIN_WINDOW_SEC, MAX_WINDOW_SEC),
95
+ maxBytes: clamp(bytes, MIN_BYTES, MAX_BYTES),
96
+ classes,
97
+ };
98
+ }
99
+ export function maskingOf(raw) {
100
+ return raw === 'balanced' || raw === 'full' ? raw : 'strict';
101
+ }
102
+ /**
103
+ * The redaction rules a masking profile means for the shared engine:
104
+ * strict masks every text node and input (a `[data-vitrinka-unmask]`
105
+ * subtree keeps its text), balanced masks inputs, full masks nothing.
106
+ */
107
+ export function maskingPolicy(masking) {
108
+ if (masking === 'full')
109
+ return { fullFidelity: true };
110
+ if (masking === 'balanced')
111
+ return {};
112
+ return { maskAllText: true };
113
+ }
114
+ /** The attribute a host puts on a subtree whose text a strict replay may keep. */
115
+ export const UNMASK_SELECTOR = '[data-vitrinka-unmask]';
@@ -0,0 +1,2 @@
1
+ import type { RecorderFaceOptions } from './element';
2
+ export declare function mountRecorderFace(opts: RecorderFaceOptions): () => void;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `face: 'recorder'` (QA Studio D6): the same engine with the recorder pill
3
+ * as its face — `VitrinkaRecorderRoot` + `VitrinkaRecorderPill` rendered
4
+ * into a detached root of their own. Loaded lazily by the npm entry only, so
5
+ * a report-only host never pays for React or the recorder.
6
+ */
7
+ import { createElement } from 'react';
8
+ import { createRoot } from 'react-dom/client';
9
+ import { VitrinkaRecorderPill, VitrinkaRecorderRoot } from '../recorder';
10
+ export function mountRecorderFace(opts) {
11
+ const container = document.createElement('div');
12
+ container.hidden = true;
13
+ document.body.append(container);
14
+ const root = createRoot(container);
15
+ root.render(createElement(VitrinkaRecorderRoot, { url: opts.base, recorderKey: opts.key, appVersion: opts.appVersion, sanitizeUrl: opts.sanitizeUrl }, createElement(VitrinkaRecorderPill)));
16
+ return () => {
17
+ root.unmount();
18
+ container.remove();
19
+ };
20
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Report a problem's stylesheet — it lives in the widget's shadow root (the
3
+ * shared HUD host), so the page restyles nothing of it and it styles nothing
4
+ * of the page. A dark card on any page (the D12 / D21 mockups): one accent
5
+ * red for the act of sending and marking, everything else quiet.
6
+ */
7
+ export declare const REPORT_CSS = "\n:host { all: initial; }\n.vr {\n --ink: #f2f1ef;\n --dim: rgba(242, 241, 239, .62);\n --faint: rgba(242, 241, 239, .14);\n --bg: #1a191d;\n --bg-deep: #121115;\n --accent: #dc2f4c;\n --accent-soft: rgba(220, 47, 76, .28);\n font: 400 14px/1.45 -apple-system, BlinkMacSystemFont, \"Segoe UI\", Inter, Roboto, \"Helvetica Neue\", Arial, sans-serif;\n color: var(--ink);\n -webkit-font-smoothing: antialiased;\n letter-spacing: normal;\n text-align: left;\n}\n.vr *, .vr *::before, .vr *::after { box-sizing: border-box; }\n.vr [hidden] { display: none !important; }\nbutton { font: inherit; color: inherit; cursor: pointer; }\nbutton:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {\n outline: 2px solid #fff; outline-offset: 2px;\n}\n\n/* -- the floating button -------------------------------------------------- */\n.fab {\n position: fixed; right: 24px; bottom: 24px;\n display: inline-flex; align-items: center; gap: 12px;\n padding: 15px 22px; border: 0; border-radius: 999px;\n background: #131216; color: #fff;\n font-size: 17px; font-weight: 600; letter-spacing: -.005em;\n box-shadow: 0 12px 32px rgba(0, 0, 0, .28), 0 0 0 1px rgba(255, 255, 255, .08) inset;\n pointer-events: auto;\n transition: transform .14s ease, box-shadow .14s ease;\n}\n.fab:hover { transform: translateY(-1px); box-shadow: 0 16px 36px rgba(0, 0, 0, .32), 0 0 0 1px rgba(255, 255, 255, .12) inset; }\n.fab:active { transform: translateY(0); }\nkbd {\n font: 500 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n padding: 4px 7px; border-radius: 7px;\n border: 1px solid rgba(255, 255, 255, .26); color: rgba(255, 255, 255, .78);\n}\n\n/* -- the card --------------------------------------------------------------- */\n.card {\n position: fixed; right: 24px; bottom: 96px;\n width: min(420px, calc(100vw - 32px));\n max-height: calc(100vh - 120px); overflow: auto;\n background: var(--bg); color: var(--ink);\n border: 1px solid rgba(255, 255, 255, .08); border-radius: 16px;\n box-shadow: 0 28px 70px rgba(0, 0, 0, .38), 0 2px 8px rgba(0, 0, 0, .2);\n pointer-events: auto;\n animation: vr-in .16s ease-out;\n}\n.vr.nobutton .card { bottom: 24px; }\n@keyframes vr-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }\n.head {\n display: flex; align-items: center; gap: 4px;\n padding: 16px 14px 16px 20px; border-bottom: 1px solid rgba(255, 255, 255, .07);\n}\n.head h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }\n.icon {\n display: inline-grid; place-items: center; width: 32px; height: 32px;\n border: 0; border-radius: 8px; background: transparent; color: var(--dim);\n}\n.icon:hover { background: var(--faint); color: var(--ink); }\n.icon svg { width: 16px; height: 16px; }\n.pane { padding: 18px 20px 20px; }\n.prompt { display: block; margin: 0 0 8px; font-weight: 600; font-size: 14px; }\n.desc {\n display: block; width: 100%; min-height: 88px; resize: vertical;\n padding: 12px 14px; border-radius: 10px;\n border: 1px solid rgba(255, 255, 255, .2); background: var(--bg-deep); color: var(--ink);\n font-family: inherit; font-size: 15px; font-weight: 400; line-height: 1.45;\n}\n.desc::placeholder { color: rgba(242, 241, 239, .38); }\n.desc:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }\n.attached { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; color: var(--dim); font-size: 13px; }\n.attached svg { width: 14px; height: 14px; flex: none; }\n.link {\n display: inline-flex; align-items: center; gap: 3px; padding: 0; border: 0; background: none;\n color: rgba(242, 241, 239, .86); font-weight: 600; font-size: 13px;\n}\n.link:hover { color: #fff; text-decoration: underline; }\n.link svg { width: 12px; height: 12px; transition: transform .14s ease; }\n.link[aria-expanded=\"true\"] svg { transform: rotate(180deg); }\n.included { margin: 10px 0 0; padding: 10px 12px 10px 28px; border-radius: 10px; background: var(--bg-deep); color: var(--dim); font-size: 13px; }\n.included li { margin: 2px 0; }\n.marked { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--dim); }\n.chip {\n display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;\n border-radius: 11px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;\n}\n.chip.hide { background: #3a3940; }\n.notify { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--ink); cursor: pointer; }\n.notify input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }\n.error { margin: 12px 0 0; color: #ff9aa9; font-size: 13px; }\n.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }\n.where {\n display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 9px;\n border: 1px solid rgba(255, 255, 255, .2); background: transparent; color: var(--ink);\n font-size: 13px; font-weight: 600;\n}\n.where:hover:not(:disabled) { background: var(--faint); }\n.where svg { width: 14px; height: 14px; }\n.where:disabled { opacity: .45; cursor: default; }\n.send {\n padding: 10px 22px; border: 0; border-radius: 10px; background: var(--accent); color: #fff;\n font-size: 15px; font-weight: 650;\n}\n.send:hover:not(:disabled) { background: #e43a57; }\n.send:disabled { opacity: .45; cursor: default; }\n\n/* -- settings --------------------------------------------------------------- */\n.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }\n.row .label { font-weight: 600; }\n.bind {\n min-width: 120px; padding: 8px 12px; border-radius: 9px; text-align: center;\n border: 1px solid rgba(255, 255, 255, .2); background: var(--bg-deep);\n font: 500 13px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n}\n.bind[aria-pressed=\"true\"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); color: var(--dim); }\n.hint, .reason { margin: 10px 0 0; color: var(--dim); font-size: 13px; }\n.reason { color: #ffc1ca; }\n.settings-foot { display: flex; justify-content: space-between; margin-top: 16px; }\n\n/* -- sent ------------------------------------------------------------------- */\n.sent-head { display: flex; align-items: center; gap: 10px; }\n.sent-head h3 { margin: 0; font-size: 17px; font-weight: 650; }\n.sent-head svg { width: 22px; height: 22px; color: #4ade80; flex: none; }\n.sent-body { margin: 8px 0 0 32px; color: var(--dim); }\n.sent-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 0 32px; }\n.see {\n display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 9px;\n background: #fff; color: #131216; font-weight: 650; font-size: 13px; text-decoration: none;\n}\n\n/* -- marking: the frozen page ---------------------------------------------- */\n.mark {\n position: fixed; inset: 0; pointer-events: auto;\n background: rgba(14, 13, 16, .16); cursor: crosshair;\n touch-action: none; user-select: none; -webkit-user-select: none;\n}\n.ink { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }\n.ink .stroke { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }\n.ink .veil { fill: #1b1b1f; }\n.ink .veil-label { fill: rgba(255, 255, 255, .7); font: 600 12px -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif; }\n.ink .draft { opacity: .85; }\n.pin { position: absolute; display: flex; align-items: center; gap: 6px; cursor: default; }\n.pin .num {\n display: grid; place-items: center; width: 24px; height: 24px; border-radius: 12px;\n background: var(--accent); color: #fff; font-size: 12px; font-weight: 750;\n box-shadow: 0 2px 6px rgba(0, 0, 0, .3), 0 0 0 2px #fff;\n}\n.pin .note {\n width: 220px; padding: 6px 10px; border-radius: 9px;\n border: 1px solid rgba(255, 255, 255, .16); background: #151417; color: #fff;\n font-family: inherit; font-size: 13px; font-weight: 400; line-height: 1.3;\n box-shadow: 0 6px 18px rgba(0, 0, 0, .3);\n}\n.pin .note::placeholder { color: rgba(255, 255, 255, .45); }\n.pin .note:focus { outline: none; border-color: var(--accent); }\n.pin .rm {\n display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 12px;\n background: #151417; color: rgba(255, 255, 255, .7); box-shadow: 0 2px 6px rgba(0, 0, 0, .3);\n}\n.pin .rm:hover { color: #fff; }\n.pin .rm svg { width: 12px; height: 12px; }\n.toolbar {\n position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);\n display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 15px;\n background: #151417; box-shadow: 0 16px 40px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .08) inset;\n cursor: default;\n}\n.toolbar button {\n padding: 9px 15px; border: 0; border-radius: 10px; background: transparent; color: #f2f1ef;\n font-size: 15px; font-weight: 600;\n}\n.toolbar button:hover { background: rgba(255, 255, 255, .08); }\n.toolbar button[aria-pressed=\"true\"] { background: #e6455f; color: #fff; }\n.toolbar .sep { width: 1px; height: 22px; margin: 0 4px; background: rgba(255, 255, 255, .14); }\n.toolbar .done { background: var(--accent); color: #fff; }\n.toolbar .done:hover { background: #e43a57; }\n.toolbar button:disabled { opacity: .4; cursor: default; background: transparent; }\n\n/* -- the coach card (D21): stays beside the pointer until mark 1 exists --- */\n.coach {\n position: fixed; width: 300px; padding: 14px 16px 15px;\n background: #151417; color: #f2f1ef; border-radius: 14px;\n box-shadow: 0 18px 44px rgba(0, 0, 0, .38), 0 0 0 1px rgba(255, 255, 255, .1) inset;\n pointer-events: none;\n transition: opacity .12s ease;\n}\n.coach.pressing { opacity: .55; }\n.coach svg { display: block; width: 100%; height: 64px; border-radius: 9px; background: #222126; }\n.coach p { margin: 11px 0 0; font-size: 15px; line-height: 1.4; }\n.coach p + p { margin-top: 2px; color: rgba(242, 241, 239, .66); font-size: 13px; }\n.coach p.keys { margin-top: 8px; font-size: 12px; color: rgba(242, 241, 239, .5); }\n.mark:focus { outline: none; }\n.mark:focus-visible { outline: 3px solid rgba(230, 69, 95, .65); outline-offset: -3px; }\n.coach .bar { fill: #5b5a61; }\n.coach .loop { fill: none; stroke: #e6455f; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 200; stroke-dashoffset: 200; animation: vr-draw 2.8s ease-in-out infinite; }\n.coach .hold { fill: none; stroke: #fff; stroke-width: 1.5; opacity: 0; animation: vr-hold 2.8s ease-in-out infinite; }\n@keyframes vr-draw { 0%, 18% { stroke-dashoffset: 200; } 72%, 100% { stroke-dashoffset: 0; } 90% { opacity: 1; } 100% { opacity: 0; } }\n@keyframes vr-hold { 0%, 8% { opacity: 0; } 14%, 72% { opacity: .9; } 80%, 100% { opacity: 0; } }\n\n@media (max-width: 520px) {\n .fab { right: 16px; bottom: 16px; padding: 13px 18px; font-size: 16px; }\n .card { right: 16px; bottom: 84px; }\n .vr.nobutton .card { bottom: 16px; }\n .toolbar { bottom: 16px; max-width: calc(100vw - 24px); overflow-x: auto; }\n .toolbar button { padding: 8px 11px; font-size: 14px; }\n .coach { width: 260px; }\n}\n@media (prefers-reduced-motion: reduce) {\n .card { animation: none; }\n .fab { transition: none; }\n .coach .loop { animation: none; stroke-dashoffset: 0; }\n .coach .hold { animation: none; opacity: .9; }\n}\n";
@@ -0,0 +1,226 @@
1
+ /**
2
+ * Report a problem's stylesheet — it lives in the widget's shadow root (the
3
+ * shared HUD host), so the page restyles nothing of it and it styles nothing
4
+ * of the page. A dark card on any page (the D12 / D21 mockups): one accent
5
+ * red for the act of sending and marking, everything else quiet.
6
+ */
7
+ export const REPORT_CSS = `
8
+ :host { all: initial; }
9
+ .vr {
10
+ --ink: #f2f1ef;
11
+ --dim: rgba(242, 241, 239, .62);
12
+ --faint: rgba(242, 241, 239, .14);
13
+ --bg: #1a191d;
14
+ --bg-deep: #121115;
15
+ --accent: #dc2f4c;
16
+ --accent-soft: rgba(220, 47, 76, .28);
17
+ font: 400 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
18
+ color: var(--ink);
19
+ -webkit-font-smoothing: antialiased;
20
+ letter-spacing: normal;
21
+ text-align: left;
22
+ }
23
+ .vr *, .vr *::before, .vr *::after { box-sizing: border-box; }
24
+ .vr [hidden] { display: none !important; }
25
+ button { font: inherit; color: inherit; cursor: pointer; }
26
+ button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
27
+ outline: 2px solid #fff; outline-offset: 2px;
28
+ }
29
+
30
+ /* -- the floating button -------------------------------------------------- */
31
+ .fab {
32
+ position: fixed; right: 24px; bottom: 24px;
33
+ display: inline-flex; align-items: center; gap: 12px;
34
+ padding: 15px 22px; border: 0; border-radius: 999px;
35
+ background: #131216; color: #fff;
36
+ font-size: 17px; font-weight: 600; letter-spacing: -.005em;
37
+ box-shadow: 0 12px 32px rgba(0, 0, 0, .28), 0 0 0 1px rgba(255, 255, 255, .08) inset;
38
+ pointer-events: auto;
39
+ transition: transform .14s ease, box-shadow .14s ease;
40
+ }
41
+ .fab:hover { transform: translateY(-1px); box-shadow: 0 16px 36px rgba(0, 0, 0, .32), 0 0 0 1px rgba(255, 255, 255, .12) inset; }
42
+ .fab:active { transform: translateY(0); }
43
+ kbd {
44
+ font: 500 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
45
+ padding: 4px 7px; border-radius: 7px;
46
+ border: 1px solid rgba(255, 255, 255, .26); color: rgba(255, 255, 255, .78);
47
+ }
48
+
49
+ /* -- the card --------------------------------------------------------------- */
50
+ .card {
51
+ position: fixed; right: 24px; bottom: 96px;
52
+ width: min(420px, calc(100vw - 32px));
53
+ max-height: calc(100vh - 120px); overflow: auto;
54
+ background: var(--bg); color: var(--ink);
55
+ border: 1px solid rgba(255, 255, 255, .08); border-radius: 16px;
56
+ box-shadow: 0 28px 70px rgba(0, 0, 0, .38), 0 2px 8px rgba(0, 0, 0, .2);
57
+ pointer-events: auto;
58
+ animation: vr-in .16s ease-out;
59
+ }
60
+ .vr.nobutton .card { bottom: 24px; }
61
+ @keyframes vr-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
62
+ .head {
63
+ display: flex; align-items: center; gap: 4px;
64
+ padding: 16px 14px 16px 20px; border-bottom: 1px solid rgba(255, 255, 255, .07);
65
+ }
66
+ .head h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
67
+ .icon {
68
+ display: inline-grid; place-items: center; width: 32px; height: 32px;
69
+ border: 0; border-radius: 8px; background: transparent; color: var(--dim);
70
+ }
71
+ .icon:hover { background: var(--faint); color: var(--ink); }
72
+ .icon svg { width: 16px; height: 16px; }
73
+ .pane { padding: 18px 20px 20px; }
74
+ .prompt { display: block; margin: 0 0 8px; font-weight: 600; font-size: 14px; }
75
+ .desc {
76
+ display: block; width: 100%; min-height: 88px; resize: vertical;
77
+ padding: 12px 14px; border-radius: 10px;
78
+ border: 1px solid rgba(255, 255, 255, .2); background: var(--bg-deep); color: var(--ink);
79
+ font-family: inherit; font-size: 15px; font-weight: 400; line-height: 1.45;
80
+ }
81
+ .desc::placeholder { color: rgba(242, 241, 239, .38); }
82
+ .desc:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
83
+ .attached { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; color: var(--dim); font-size: 13px; }
84
+ .attached svg { width: 14px; height: 14px; flex: none; }
85
+ .link {
86
+ display: inline-flex; align-items: center; gap: 3px; padding: 0; border: 0; background: none;
87
+ color: rgba(242, 241, 239, .86); font-weight: 600; font-size: 13px;
88
+ }
89
+ .link:hover { color: #fff; text-decoration: underline; }
90
+ .link svg { width: 12px; height: 12px; transition: transform .14s ease; }
91
+ .link[aria-expanded="true"] svg { transform: rotate(180deg); }
92
+ .included { margin: 10px 0 0; padding: 10px 12px 10px 28px; border-radius: 10px; background: var(--bg-deep); color: var(--dim); font-size: 13px; }
93
+ .included li { margin: 2px 0; }
94
+ .marked { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--dim); }
95
+ .chip {
96
+ display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
97
+ border-radius: 11px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
98
+ }
99
+ .chip.hide { background: #3a3940; }
100
+ .notify { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--ink); cursor: pointer; }
101
+ .notify input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
102
+ .error { margin: 12px 0 0; color: #ff9aa9; font-size: 13px; }
103
+ .actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
104
+ .where {
105
+ display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 9px;
106
+ border: 1px solid rgba(255, 255, 255, .2); background: transparent; color: var(--ink);
107
+ font-size: 13px; font-weight: 600;
108
+ }
109
+ .where:hover:not(:disabled) { background: var(--faint); }
110
+ .where svg { width: 14px; height: 14px; }
111
+ .where:disabled { opacity: .45; cursor: default; }
112
+ .send {
113
+ padding: 10px 22px; border: 0; border-radius: 10px; background: var(--accent); color: #fff;
114
+ font-size: 15px; font-weight: 650;
115
+ }
116
+ .send:hover:not(:disabled) { background: #e43a57; }
117
+ .send:disabled { opacity: .45; cursor: default; }
118
+
119
+ /* -- settings --------------------------------------------------------------- */
120
+ .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
121
+ .row .label { font-weight: 600; }
122
+ .bind {
123
+ min-width: 120px; padding: 8px 12px; border-radius: 9px; text-align: center;
124
+ border: 1px solid rgba(255, 255, 255, .2); background: var(--bg-deep);
125
+ font: 500 13px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
126
+ }
127
+ .bind[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); color: var(--dim); }
128
+ .hint, .reason { margin: 10px 0 0; color: var(--dim); font-size: 13px; }
129
+ .reason { color: #ffc1ca; }
130
+ .settings-foot { display: flex; justify-content: space-between; margin-top: 16px; }
131
+
132
+ /* -- sent ------------------------------------------------------------------- */
133
+ .sent-head { display: flex; align-items: center; gap: 10px; }
134
+ .sent-head h3 { margin: 0; font-size: 17px; font-weight: 650; }
135
+ .sent-head svg { width: 22px; height: 22px; color: #4ade80; flex: none; }
136
+ .sent-body { margin: 8px 0 0 32px; color: var(--dim); }
137
+ .sent-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 0 32px; }
138
+ .see {
139
+ display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 9px;
140
+ background: #fff; color: #131216; font-weight: 650; font-size: 13px; text-decoration: none;
141
+ }
142
+
143
+ /* -- marking: the frozen page ---------------------------------------------- */
144
+ .mark {
145
+ position: fixed; inset: 0; pointer-events: auto;
146
+ background: rgba(14, 13, 16, .16); cursor: crosshair;
147
+ touch-action: none; user-select: none; -webkit-user-select: none;
148
+ }
149
+ .ink { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
150
+ .ink .stroke { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
151
+ .ink .veil { fill: #1b1b1f; }
152
+ .ink .veil-label { fill: rgba(255, 255, 255, .7); font: 600 12px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
153
+ .ink .draft { opacity: .85; }
154
+ .pin { position: absolute; display: flex; align-items: center; gap: 6px; cursor: default; }
155
+ .pin .num {
156
+ display: grid; place-items: center; width: 24px; height: 24px; border-radius: 12px;
157
+ background: var(--accent); color: #fff; font-size: 12px; font-weight: 750;
158
+ box-shadow: 0 2px 6px rgba(0, 0, 0, .3), 0 0 0 2px #fff;
159
+ }
160
+ .pin .note {
161
+ width: 220px; padding: 6px 10px; border-radius: 9px;
162
+ border: 1px solid rgba(255, 255, 255, .16); background: #151417; color: #fff;
163
+ font-family: inherit; font-size: 13px; font-weight: 400; line-height: 1.3;
164
+ box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
165
+ }
166
+ .pin .note::placeholder { color: rgba(255, 255, 255, .45); }
167
+ .pin .note:focus { outline: none; border-color: var(--accent); }
168
+ .pin .rm {
169
+ display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 12px;
170
+ background: #151417; color: rgba(255, 255, 255, .7); box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
171
+ }
172
+ .pin .rm:hover { color: #fff; }
173
+ .pin .rm svg { width: 12px; height: 12px; }
174
+ .toolbar {
175
+ position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
176
+ display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 15px;
177
+ background: #151417; box-shadow: 0 16px 40px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .08) inset;
178
+ cursor: default;
179
+ }
180
+ .toolbar button {
181
+ padding: 9px 15px; border: 0; border-radius: 10px; background: transparent; color: #f2f1ef;
182
+ font-size: 15px; font-weight: 600;
183
+ }
184
+ .toolbar button:hover { background: rgba(255, 255, 255, .08); }
185
+ .toolbar button[aria-pressed="true"] { background: #e6455f; color: #fff; }
186
+ .toolbar .sep { width: 1px; height: 22px; margin: 0 4px; background: rgba(255, 255, 255, .14); }
187
+ .toolbar .done { background: var(--accent); color: #fff; }
188
+ .toolbar .done:hover { background: #e43a57; }
189
+ .toolbar button:disabled { opacity: .4; cursor: default; background: transparent; }
190
+
191
+ /* -- the coach card (D21): stays beside the pointer until mark 1 exists --- */
192
+ .coach {
193
+ position: fixed; width: 300px; padding: 14px 16px 15px;
194
+ background: #151417; color: #f2f1ef; border-radius: 14px;
195
+ box-shadow: 0 18px 44px rgba(0, 0, 0, .38), 0 0 0 1px rgba(255, 255, 255, .1) inset;
196
+ pointer-events: none;
197
+ transition: opacity .12s ease;
198
+ }
199
+ .coach.pressing { opacity: .55; }
200
+ .coach svg { display: block; width: 100%; height: 64px; border-radius: 9px; background: #222126; }
201
+ .coach p { margin: 11px 0 0; font-size: 15px; line-height: 1.4; }
202
+ .coach p + p { margin-top: 2px; color: rgba(242, 241, 239, .66); font-size: 13px; }
203
+ .coach p.keys { margin-top: 8px; font-size: 12px; color: rgba(242, 241, 239, .5); }
204
+ .mark:focus { outline: none; }
205
+ .mark:focus-visible { outline: 3px solid rgba(230, 69, 95, .65); outline-offset: -3px; }
206
+ .coach .bar { fill: #5b5a61; }
207
+ .coach .loop { fill: none; stroke: #e6455f; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 200; stroke-dashoffset: 200; animation: vr-draw 2.8s ease-in-out infinite; }
208
+ .coach .hold { fill: none; stroke: #fff; stroke-width: 1.5; opacity: 0; animation: vr-hold 2.8s ease-in-out infinite; }
209
+ @keyframes vr-draw { 0%, 18% { stroke-dashoffset: 200; } 72%, 100% { stroke-dashoffset: 0; } 90% { opacity: 1; } 100% { opacity: 0; } }
210
+ @keyframes vr-hold { 0%, 8% { opacity: 0; } 14%, 72% { opacity: .9; } 80%, 100% { opacity: 0; } }
211
+
212
+ @media (max-width: 520px) {
213
+ .fab { right: 16px; bottom: 16px; padding: 13px 18px; font-size: 16px; }
214
+ .card { right: 16px; bottom: 84px; }
215
+ .vr.nobutton .card { bottom: 16px; }
216
+ .toolbar { bottom: 16px; max-width: calc(100vw - 24px); overflow-x: auto; }
217
+ .toolbar button { padding: 8px 11px; font-size: 14px; }
218
+ .coach { width: 260px; }
219
+ }
220
+ @media (prefers-reduced-motion: reduce) {
221
+ .card { animation: none; }
222
+ .fab { transition: none; }
223
+ .coach .loop { animation: none; stroke-dashoffset: 0; }
224
+ .coach .hold { animation: none; opacity: .9; }
225
+ }
226
+ `;