@vitrinka/web 0.1.5 → 0.2.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 (69) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +73 -21
  3. package/build/hud.d.ts +9 -0
  4. package/build/hud.iife.js +411 -0
  5. package/build/hud.js +8 -0
  6. package/build/recorder/api.d.ts +2 -0
  7. package/build/recorder/block.d.ts +7 -0
  8. package/build/recorder/block.js +7 -0
  9. package/build/recorder/capture/click.d.ts +2 -4
  10. package/build/recorder/capture/click.js +2 -31
  11. package/build/recorder/capture/rrweb.d.ts +2 -2
  12. package/build/recorder/capture/rrweb.js +2 -2
  13. package/build/recorder/capture/selector.d.ts +8 -0
  14. package/build/recorder/capture/selector.js +35 -0
  15. package/build/recorder/hud/AnnotateOverlay.d.ts +7 -1
  16. package/build/recorder/hud/AnnotateOverlay.js +58 -28
  17. package/build/recorder/hud/Hud.d.ts +16 -1
  18. package/build/recorder/hud/Hud.js +255 -87
  19. package/build/recorder/hud/LinkSheet.d.ts +3 -3
  20. package/build/recorder/hud/LinkSheet.js +1 -1
  21. package/build/recorder/hud/Menu.d.ts +30 -0
  22. package/build/recorder/hud/Menu.js +73 -0
  23. package/build/recorder/hud/RecorderPill.d.ts +36 -27
  24. package/build/recorder/hud/RecorderPill.js +212 -123
  25. package/build/recorder/hud/Sheet.d.ts +1 -1
  26. package/build/recorder/hud/Sheet.js +1 -1
  27. package/build/recorder/hud/Tooltip.d.ts +19 -0
  28. package/build/recorder/hud/Tooltip.js +94 -0
  29. package/build/recorder/hud/controller.d.ts +148 -0
  30. package/build/recorder/hud/controller.js +17 -0
  31. package/build/recorder/hud/flow.d.ts +54 -0
  32. package/build/recorder/hud/flow.js +39 -0
  33. package/build/recorder/hud/host.js +1 -1
  34. package/build/recorder/hud/icons.d.ts +7 -0
  35. package/build/recorder/hud/icons.js +19 -0
  36. package/build/recorder/hud/iife.d.ts +13 -0
  37. package/build/recorder/hud/iife.js +11 -0
  38. package/build/recorder/hud/layer.d.ts +29 -6
  39. package/build/recorder/hud/layer.js +67 -33
  40. package/build/recorder/hud/listen.d.ts +24 -0
  41. package/build/recorder/hud/listen.js +27 -0
  42. package/build/recorder/hud/mount.d.ts +13 -0
  43. package/build/recorder/hud/mount.js +27 -0
  44. package/build/recorder/hud/place.d.ts +43 -0
  45. package/build/recorder/hud/place.js +63 -0
  46. package/build/recorder/hud/spots.d.ts +45 -0
  47. package/build/recorder/hud/spots.js +107 -0
  48. package/build/recorder/hud/status.d.ts +31 -0
  49. package/build/recorder/hud/status.js +67 -0
  50. package/build/recorder/hud/styles.d.ts +28 -18
  51. package/build/recorder/hud/styles.js +295 -122
  52. package/build/recorder/hud/useDock.d.ts +9 -8
  53. package/build/recorder/hud/useDock.js +43 -22
  54. package/build/recorder/index.d.ts +2 -2
  55. package/build/recorder/index.js +9 -18
  56. package/build/recorder/link.d.ts +1 -1
  57. package/build/recorder/link.js +9 -3
  58. package/build/recorder/me.d.ts +34 -0
  59. package/build/recorder/me.js +172 -0
  60. package/build/recorder/page-controller.d.ts +12 -0
  61. package/build/recorder/page-controller.js +100 -0
  62. package/build/recorder/queue.d.ts +4 -0
  63. package/build/recorder/queue.js +2 -0
  64. package/build/recorder/recents.d.ts +23 -0
  65. package/build/recorder/recents.js +80 -0
  66. package/build/recorder/session.d.ts +2 -2
  67. package/build/recorder/session.js +15 -1
  68. package/build/recorder/storage/index.js +2 -1
  69. package/package.json +10 -4
@@ -0,0 +1,27 @@
1
+ /**
2
+ * `listen` — the ONE way the HUD registers a window/document listener that
3
+ * cancels its event (`preventDefault`). It is always `{ passive: false }` and
4
+ * always the browser's own registration, never a host's patched one.
5
+ *
6
+ * Why not plain `addEventListener(…, { passive: false })`: zone.js (every
7
+ * Angular host) patches `addEventListener` and funnels every listener of one
8
+ * target + type + phase through ONE native listener, registered with the
9
+ * options of whoever came FIRST. Angular CDK's InputModalityDetector registers
10
+ * `keydown`, `mousedown` and `touchstart` on document `{ passive: true,
11
+ * capture: true }` at boot, so the HUD's Esc handler ran inside a passive
12
+ * invocation: Chrome logged "Unable to preventDefault inside passive event
13
+ * listener invocation" and the default went ahead anyway. zone.js keeps the
14
+ * unpatched functions under `__zone_symbol__addEventListener` /
15
+ * `__zone_symbol__removeEventListener`; registering through them gives the
16
+ * handler its own native listener with its own options (and keeps the HUD's
17
+ * pointer traffic out of the host's change detection).
18
+ */
19
+ /** Register a cancelling listener natively and non-passive; returns its remover. */
20
+ export function listen(target, type, fn, opts = {}) {
21
+ const zone = target;
22
+ const add = zone.__zone_symbol__addEventListener ?? target.addEventListener;
23
+ const remove = zone.__zone_symbol__removeEventListener ?? target.removeEventListener;
24
+ const capture = opts.capture ?? false;
25
+ add.call(target, type, fn, { capture, passive: false });
26
+ return () => remove.call(target, type, fn, capture);
27
+ }
@@ -0,0 +1,13 @@
1
+ import { type RecorderStorage } from '../storage';
2
+ import type { HudController } from './controller';
3
+ export interface MountHudOptions {
4
+ /** Session title when the tester starts from the pill; defaults to `document.title`. */
5
+ title?: () => string;
6
+ /**
7
+ * Where the HUD keeps its own UI state (the dock spot); synchronous.
8
+ * Defaults to `localStorage` (`vitrinka.recorder.*`), memory where that is unavailable.
9
+ */
10
+ storage?: RecorderStorage;
11
+ }
12
+ /** Mount the HUD; returns the unmount (removes the host). */
13
+ export declare function mountRecorderHud(controller: HudController, opts?: MountHudOptions): () => void;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Mount the HUD for any `HudController` — the in-page recorder's
3
+ * (`VitrinkaRecorderPill` does this) or another host's, such as the browser
4
+ * extension's content script. The HUD renders into its own shadow host on
5
+ * `<html>` (top layer, rrweb-blocked) and never touches the page's DOM.
6
+ */
7
+ import { createElement } from 'react';
8
+ import { createRoot } from 'react-dom/client';
9
+ import { localRecorderStorage, memoryRecorderStorage } from '../storage';
10
+ import { createHudHost } from './host';
11
+ import { Hud } from './Hud';
12
+ /** Mount the HUD; returns the unmount (removes the host). */
13
+ export function mountRecorderHud(controller, opts = {}) {
14
+ const host = createHudHost();
15
+ const root = createRoot(host.mount);
16
+ const storage = opts.storage ?? localRecorderStorage() ?? memoryRecorderStorage();
17
+ root.render(createElement(Hud, {
18
+ controller,
19
+ hostMount: host.mount,
20
+ defaultTitle: opts.title ?? (() => document.title),
21
+ storage,
22
+ }));
23
+ return () => {
24
+ root.unmount();
25
+ host.destroy();
26
+ };
27
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Where a floating surface (tooltip, menu, sheet, details card) sits next to
3
+ * its anchor: on the preferred side when it fits, flipped to the opposite one
4
+ * when only that fits, and shifted along the other axis so it never leaves
5
+ * the viewport. The preferred side points from the dock toward the page
6
+ * centre — up from a bottom dock, down from a top one, sideways from a
7
+ * vertical (middle-row) or tucked one. Pure numbers.
8
+ */
9
+ import { type Place } from './spots';
10
+ export type FloatSide = 'top' | 'bottom' | 'left' | 'right';
11
+ export type FloatAlign = 'start' | 'center' | 'end';
12
+ export interface Box {
13
+ x: number;
14
+ y: number;
15
+ w: number;
16
+ h: number;
17
+ }
18
+ export interface Placed {
19
+ x: number;
20
+ y: number;
21
+ side: FloatSide;
22
+ /** CSS transform-origin: the point of the surface nearest the anchor. */
23
+ origin: string;
24
+ }
25
+ export interface PlaceOptions {
26
+ align?: FloatAlign;
27
+ /** Distance from the anchor. */
28
+ gap?: number;
29
+ /** Closest the surface may come to a viewport edge. */
30
+ margin?: number;
31
+ }
32
+ /** Place a `size` surface beside `anchor` within `view`. */
33
+ export declare function placeFloating(anchor: Box, size: {
34
+ w: number;
35
+ h: number;
36
+ }, view: {
37
+ w: number;
38
+ h: number;
39
+ }, side: FloatSide, opts?: PlaceOptions): Placed;
40
+ /** The side a surface opens on from the dock: toward the page centre. */
41
+ export declare function towardCentre(place: Place): FloatSide;
42
+ /** How a surface lines up with the dock along the other axis: flush with the dock's outer edge. */
43
+ export declare function alignFor(place: Place): FloatAlign;
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Where a floating surface (tooltip, menu, sheet, details card) sits next to
3
+ * its anchor: on the preferred side when it fits, flipped to the opposite one
4
+ * when only that fits, and shifted along the other axis so it never leaves
5
+ * the viewport. The preferred side points from the dock toward the page
6
+ * centre — up from a bottom dock, down from a top one, sideways from a
7
+ * vertical (middle-row) or tucked one. Pure numbers.
8
+ */
9
+ import { colOf, rowOf, untuck } from './spots';
10
+ const OPPOSITE = { top: 'bottom', bottom: 'top', left: 'right', right: 'left' };
11
+ function clamp(v, lo, hi) {
12
+ return hi < lo ? lo : Math.min(hi, Math.max(lo, v));
13
+ }
14
+ /** Place a `size` surface beside `anchor` within `view`. */
15
+ export function placeFloating(anchor, size, view, side, opts = {}) {
16
+ const gap = opts.gap ?? 8;
17
+ const m = opts.margin ?? 8;
18
+ const align = opts.align ?? 'center';
19
+ const main = (s) => s === 'top'
20
+ ? anchor.y - gap - size.h
21
+ : s === 'bottom'
22
+ ? anchor.y + anchor.h + gap
23
+ : s === 'left'
24
+ ? anchor.x - gap - size.w
25
+ : anchor.x + anchor.w + gap;
26
+ const room = (s) => {
27
+ const p = main(s);
28
+ return s === 'top' || s === 'left' ? p - m : (s === 'bottom' ? view.h : view.w) - m - (p + (s === 'bottom' ? size.h : size.w));
29
+ };
30
+ let chosen = side;
31
+ if (room(side) < 0 && room(OPPOSITE[side]) > room(side))
32
+ chosen = OPPOSITE[side];
33
+ const vertical = chosen === 'top' || chosen === 'bottom';
34
+ const [aStart, aLen, sLen, vLen] = vertical ? [anchor.x, anchor.w, size.w, view.w] : [anchor.y, anchor.h, size.h, view.h];
35
+ const cross = align === 'start' ? aStart : align === 'end' ? aStart + aLen - sLen : aStart + aLen / 2 - sLen / 2;
36
+ const c = clamp(cross, m, vLen - m - sLen);
37
+ const p = vertical ? clamp(main(chosen), m, view.h - m - size.h) : clamp(main(chosen), m, view.w - m - size.w);
38
+ const x = vertical ? c : p;
39
+ const y = vertical ? p : c;
40
+ // The grow origin: the anchor's centre, projected onto the facing edge.
41
+ const ox = vertical ? clamp(anchor.x + anchor.w / 2 - x, 0, size.w) : chosen === 'left' ? size.w : 0;
42
+ const oy = vertical ? (chosen === 'top' ? size.h : 0) : clamp(anchor.y + anchor.h / 2 - y, 0, size.h);
43
+ return { x, y, side: chosen, origin: `${Math.round(ox)}px ${Math.round(oy)}px` };
44
+ }
45
+ /** The side a surface opens on from the dock: toward the page centre. */
46
+ export function towardCentre(place) {
47
+ if ('tuck' in place)
48
+ return place.tuck === 'left' ? 'right' : 'left';
49
+ const row = rowOf(place.spot);
50
+ if (row === 't')
51
+ return 'bottom';
52
+ if (row === 'b')
53
+ return 'top';
54
+ return colOf(place.spot) === 'l' ? 'right' : 'left';
55
+ }
56
+ /** How a surface lines up with the dock along the other axis: flush with the dock's outer edge. */
57
+ export function alignFor(place) {
58
+ const spot = untuck(place);
59
+ if ('tuck' in place || rowOf(spot) === 'm')
60
+ return 'center';
61
+ const col = colOf(spot);
62
+ return col === 'l' ? 'start' : col === 'r' ? 'end' : 'center';
63
+ }
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Where the web HUD may rest: a 3×3 grid without its centre — the six spots
3
+ * of `@vitrinka/link/dock` (corners, top and bottom centre) plus middle-left
4
+ * and middle-right, where the recording capsule turns vertical. A throw obeys
5
+ * the shared dock's physics: its tuck verdict is taken as is, and a landing
6
+ * projects the release along its velocity to the nearest of the eight.
7
+ * Pure numbers: no DOM, no React.
8
+ */
9
+ import { type Insets, type Rect, type Side, type Size } from '@vitrinka/link/dock';
10
+ export type { Insets, Rect, Side, Size };
11
+ export type Row = 't' | 'm' | 'b';
12
+ export type Col = 'l' | 'c' | 'r';
13
+ export type Spot = 'tl' | 'tc' | 'tr' | 'ml' | 'mr' | 'bl' | 'bc' | 'br';
14
+ /** Where the HUD rests: a spot, or tucked into a side edge at `y` (0 top … 1 bottom). */
15
+ export type Place = {
16
+ spot: Spot;
17
+ } | {
18
+ tuck: Side;
19
+ y: number;
20
+ };
21
+ /** Row-major, the order the Move to grid lays them out (its centre cell is empty). */
22
+ export declare const SPOTS: readonly Spot[];
23
+ export declare const DEFAULT_PLACE: Place;
24
+ export declare const SPOT_NAMES: Record<Spot, string>;
25
+ export declare function rowOf(spot: Spot): Row;
26
+ export declare function colOf(spot: Spot): Col;
27
+ /** The middle row: the recording capsule stands up along the side edge. */
28
+ export declare function isVertical(spot: Spot): boolean;
29
+ /** The rect a HUD of `size` occupies when resting at `spot`. */
30
+ export declare function spotRect(spot: Spot, size: Size, view: Size, inset: Insets): Rect;
31
+ /**
32
+ * Where a released HUD settles. `rect` is where it was let go (viewport px),
33
+ * `velocity` the pointer's px/s at release.
34
+ */
35
+ export declare function settle(rect: Rect, velocity: {
36
+ x: number;
37
+ y: number;
38
+ }, view: Size, inset: Insets): Place;
39
+ /** The spot a tucked HUD returns to: the nearest third on its side. */
40
+ export declare function untuck(place: Place): Spot;
41
+ export type Arrow = 'ArrowLeft' | 'ArrowRight' | 'ArrowUp' | 'ArrowDown';
42
+ /** The spot an arrow key moves to; the empty centre is stepped over. */
43
+ export declare function neighbour(place: Place, arrow: Arrow): Place;
44
+ /** A stored place, validated; anything else is the default. */
45
+ export declare function parsePlace(raw: unknown): Place;
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Where the web HUD may rest: a 3×3 grid without its centre — the six spots
3
+ * of `@vitrinka/link/dock` (corners, top and bottom centre) plus middle-left
4
+ * and middle-right, where the recording capsule turns vertical. A throw obeys
5
+ * the shared dock's physics: its tuck verdict is taken as is, and a landing
6
+ * projects the release along its velocity to the nearest of the eight.
7
+ * Pure numbers: no DOM, no React.
8
+ */
9
+ import { FLICK_PROJECTION_S, settle as settleSix, } from '@vitrinka/link/dock';
10
+ /** Row-major, the order the Move to grid lays them out (its centre cell is empty). */
11
+ export const SPOTS = ['tl', 'tc', 'tr', 'ml', 'mr', 'bl', 'bc', 'br'];
12
+ export const DEFAULT_PLACE = { spot: 'br' };
13
+ export const SPOT_NAMES = {
14
+ tl: 'top left',
15
+ tc: 'top centre',
16
+ tr: 'top right',
17
+ ml: 'middle left',
18
+ mr: 'middle right',
19
+ bl: 'bottom left',
20
+ bc: 'bottom centre',
21
+ br: 'bottom right',
22
+ };
23
+ export function rowOf(spot) {
24
+ return spot[0];
25
+ }
26
+ export function colOf(spot) {
27
+ return spot[1];
28
+ }
29
+ /** The middle row: the recording capsule stands up along the side edge. */
30
+ export function isVertical(spot) {
31
+ return rowOf(spot) === 'm';
32
+ }
33
+ /** The rect a HUD of `size` occupies when resting at `spot`. */
34
+ export function spotRect(spot, size, view, inset) {
35
+ const col = colOf(spot);
36
+ const row = rowOf(spot);
37
+ const x = col === 'l' ? inset.left : col === 'r' ? view.w - inset.right - size.w : (view.w - size.w) / 2;
38
+ const y = row === 't' ? inset.top : row === 'b' ? view.h - inset.bottom - size.h : (view.h - size.h) / 2;
39
+ return { x, y, w: size.w, h: size.h };
40
+ }
41
+ /**
42
+ * Where a released HUD settles. `rect` is where it was let go (viewport px),
43
+ * `velocity` the pointer's px/s at release.
44
+ */
45
+ export function settle(rect, velocity, view, inset) {
46
+ const shared = settleSix(rect, velocity, view, inset);
47
+ if ('tuck' in shared)
48
+ return shared;
49
+ const px = rect.x + rect.w / 2 + velocity.x * FLICK_PROJECTION_S;
50
+ const py = rect.y + rect.h / 2 + velocity.y * FLICK_PROJECTION_S;
51
+ let best = 'br';
52
+ let bestD = Infinity;
53
+ for (const spot of SPOTS) {
54
+ const r = spotRect(spot, rect, view, inset);
55
+ const d = Math.hypot(r.x + r.w / 2 - px, r.y + r.h / 2 - py);
56
+ if (d < bestD) {
57
+ bestD = d;
58
+ best = spot;
59
+ }
60
+ }
61
+ return { spot: best };
62
+ }
63
+ /** The spot a tucked HUD returns to: the nearest third on its side. */
64
+ export function untuck(place) {
65
+ if ('spot' in place)
66
+ return place.spot;
67
+ const row = place.y < 1 / 3 ? 't' : place.y > 2 / 3 ? 'b' : 'm';
68
+ return `${row}${place.tuck === 'left' ? 'l' : 'r'}`;
69
+ }
70
+ const ROWS = ['t', 'm', 'b'];
71
+ const COLS = ['l', 'c', 'r'];
72
+ /** The spot an arrow key moves to; the empty centre is stepped over. */
73
+ export function neighbour(place, arrow) {
74
+ const spot = untuck(place);
75
+ if (!('spot' in place))
76
+ return { spot };
77
+ let ri = ROWS.indexOf(rowOf(spot));
78
+ let ci = COLS.indexOf(colOf(spot));
79
+ const step = (dr, dc) => {
80
+ ri = Math.min(2, Math.max(0, ri + dr));
81
+ ci = Math.min(2, Math.max(0, ci + dc));
82
+ };
83
+ const [dr, dc] = arrow === 'ArrowLeft' ? [0, -1] : arrow === 'ArrowRight' ? [0, 1] : arrow === 'ArrowUp' ? [-1, 0] : [1, 0];
84
+ step(dr, dc);
85
+ if (ri === 1 && ci === 1)
86
+ step(dr, dc);
87
+ return { spot: `${ROWS[ri]}${COLS[ci]}` };
88
+ }
89
+ /** A stored place, validated; anything else is the default. */
90
+ export function parsePlace(raw) {
91
+ if (typeof raw === 'string') {
92
+ try {
93
+ return parsePlace(JSON.parse(raw));
94
+ }
95
+ catch {
96
+ return DEFAULT_PLACE;
97
+ }
98
+ }
99
+ if (raw && typeof raw === 'object') {
100
+ const o = raw;
101
+ if (typeof o.spot === 'string' && SPOTS.includes(o.spot))
102
+ return { spot: o.spot };
103
+ if ((o.tuck === 'left' || o.tuck === 'right') && typeof o.y === 'number' && Number.isFinite(o.y))
104
+ return { tuck: o.tuck, y: Math.min(1, Math.max(0, o.y)) };
105
+ }
106
+ return DEFAULT_PLACE;
107
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * What the HUD says about a session, as plain strings: the sync chip, the
3
+ * health line, the clock, ages and durations. Pure, so the wording is tested
4
+ * without a DOM.
5
+ */
6
+ import type { HudRecording, HudSync } from './controller';
7
+ export type SyncKind = 'synced' | 'sending' | 'offline' | 'error';
8
+ export interface SyncChip {
9
+ kind: SyncKind;
10
+ /** Reads without hovering: `synced`, `sending 12`, `offline · 40`, `ended`. */
11
+ label: string;
12
+ /** The longer sentence for a tooltip and screen readers. */
13
+ title: string;
14
+ }
15
+ /**
16
+ * Anything undelivered for this long reads as sending; below it the chip
17
+ * stays on synced so a routine 2s flush never flickers it.
18
+ */
19
+ export declare const SENDING_AFTER_MS = 4000;
20
+ export declare function syncChip(sync: HudSync, now: number): SyncChip;
21
+ /** The one-line health detail that opens by itself when something is wrong ('' = nothing to say). */
22
+ export declare function healthLine(sync: HudSync, now: number): string;
23
+ export declare function elapsedOf(rec: HudRecording, now: number): number;
24
+ /** mm:ss, h:mm:ss past the hour. */
25
+ export declare function fmtClock(ms: number): string;
26
+ /** A compact duration: `42s`, `3m 12s`, `1h 04m`. */
27
+ export declare function fmtDuration(ms: number): string;
28
+ /** How long ago, compactly: `just now`, `12s`, `3m`, `2h`, `4d`. */
29
+ export declare function fmtAge(ms: number): string;
30
+ /** `fmtAge` as a phrase: `just now`, `3m ago`. */
31
+ export declare function fmtAgo(ms: number): string;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Anything undelivered for this long reads as sending; below it the chip
3
+ * stays on synced so a routine 2s flush never flickers it.
4
+ */
5
+ export const SENDING_AFTER_MS = 4000;
6
+ export function syncChip(sync, now) {
7
+ if (sync.state === 'dead')
8
+ return { kind: 'error', label: 'ended', title: sync.deadReason || 'this session ended on the server' };
9
+ if (sync.state === 'offline')
10
+ return {
11
+ kind: 'offline',
12
+ label: `offline · ${sync.queued}`,
13
+ title: `offline — ${sync.queued} held on this device, retrying; nothing is dropped`,
14
+ };
15
+ const stale = sync.lastSyncAt === null || now - sync.lastSyncAt > SENDING_AFTER_MS;
16
+ if (sync.state === 'backlog' || (!sync.synced && sync.queued > 0 && stale))
17
+ return { kind: 'sending', label: `sending ${sync.queued}`, title: `sending — ${sync.queued} not yet on vitrinka` };
18
+ return { kind: 'synced', label: 'synced', title: 'everything captured is on vitrinka' };
19
+ }
20
+ /** The one-line health detail that opens by itself when something is wrong ('' = nothing to say). */
21
+ export function healthLine(sync, now) {
22
+ if (sync.state === 'dead')
23
+ return sync.deadReason || 'this session ended on the server';
24
+ if (sync.state === 'offline') {
25
+ const age = sync.lastSyncAt === null ? '' : ` ${fmtAge(now - sync.lastSyncAt)}`;
26
+ return `offline${age} · ${sync.queued} held · retrying`;
27
+ }
28
+ return '';
29
+ }
30
+ export function elapsedOf(rec, now) {
31
+ return rec.activeMs + (rec.resumedAt === null ? 0 : Math.max(0, now - rec.resumedAt));
32
+ }
33
+ /** mm:ss, h:mm:ss past the hour. */
34
+ export function fmtClock(ms) {
35
+ const s = Math.max(0, Math.floor(ms / 1000));
36
+ const h = Math.floor(s / 3600);
37
+ const mm = String(Math.floor((s % 3600) / 60)).padStart(2, '0');
38
+ const ss = String(s % 60).padStart(2, '0');
39
+ return h ? `${h}:${mm}:${ss}` : `${mm}:${ss}`;
40
+ }
41
+ /** A compact duration: `42s`, `3m 12s`, `1h 04m`. */
42
+ export function fmtDuration(ms) {
43
+ const s = Math.max(0, Math.round(ms / 1000));
44
+ if (s < 60)
45
+ return `${s}s`;
46
+ const m = Math.floor(s / 60);
47
+ if (m < 60)
48
+ return `${m}m ${String(s % 60).padStart(2, '0')}s`;
49
+ return `${Math.floor(m / 60)}h ${String(m % 60).padStart(2, '0')}m`;
50
+ }
51
+ /** How long ago, compactly: `just now`, `12s`, `3m`, `2h`, `4d`. */
52
+ export function fmtAge(ms) {
53
+ if (ms < 5000)
54
+ return 'just now';
55
+ if (ms < 60_000)
56
+ return `${Math.round(ms / 1000)}s`;
57
+ if (ms < 3_600_000)
58
+ return `${Math.round(ms / 60_000)}m`;
59
+ if (ms < 86_400_000)
60
+ return `${Math.round(ms / 3_600_000)}h`;
61
+ return `${Math.round(ms / 86_400_000)}d`;
62
+ }
63
+ /** `fmtAge` as a phrase: `just now`, `3m ago`. */
64
+ export function fmtAgo(ms) {
65
+ const a = fmtAge(ms);
66
+ return a === 'just now' ? a : `${a} ago`;
67
+ }
@@ -2,36 +2,46 @@
2
2
  * The HUD's stylesheet. Lives inside the shadow root (a `<style>` element),
3
3
  * so it never touches host CSS and host CSS never touches it.
4
4
  *
5
- * Shapes (recorder-hud-subtle): the 28px glass PUCK at idle, the dot+timer
6
- * CAPSULE while recording that unfolds into the TRAY on intent, the 6px edge
7
- * TAB when tucked. The `.dock` rests on one of six spots (`data-row` t|b ×
8
- * `data-col` l|c|r) by viewport insets, so an unfolding tray always grows
9
- * toward the centre; a drag moves it by `transform` only. Motion follows
10
- * the transitions.dev token scale.
5
+ * Shapes: ONE glass PILL whose faces are collapsible SEGMENTS — the idle puck
6
+ * (+ ⋯), the recording handle (dot + clock), the tool tray, and the inline
7
+ * flows (confirm · saving · saved · failed). A face change opens one segment
8
+ * while another closes, so the pill's width tweens by itself; an orientation
9
+ * change (the middle row stands the recording pill up) is a measured morph
10
+ * (see useMorph). The 6px edge TAB when tucked. The `.dock` rests on one of
11
+ * eight spots (`data-row` t|m|b × `data-col` l|c|r, no centre) by viewport
12
+ * insets; a drag moves it by `transform` only. Tooltip, menu and details card
13
+ * are fixed floats placed in JS (place.ts) so they never clip.
14
+ *
15
+ * Sizes: `data-size` sm|md|lg on `.hud` rescales every dimension through the
16
+ * size tokens (`--h`, `--b`, `--fs`, … and `--s` for the rest).
17
+ * Motion: the transitions.dev token scale; reduced motion stills it all.
11
18
  */
12
- export declare const HUD_CSS_BASE = "\n* { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif; }\nsvg { width:1em; height:1em; vertical-align:-.125em; }\n.hud {\n --ink: rgba(26,22,23,.72); --ink-pop: rgba(26,22,23,.88); --ink-solid: #1d1a1b;\n --ink-2: rgba(255,255,255,.08); --edge: rgba(255,255,255,.11); --rim: rgba(0,0,0,.30);\n --fg: #f4efea; --fg-2: rgba(244,239,234,.66); --fg-3: rgba(244,239,234,.44);\n --rec: #ff3b57; --warn: #f0a63a;\n --m: 16px; --h: 28px; --b: 24px;\n --duration-quick: 150ms; --duration-fast: 250ms; --duration-resize: 300ms; --duration-medium: 350ms; --duration-snap: 500ms;\n --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1); --ease-in-out: ease-in-out; --ease-out: ease-out;\n --ease-spring: var(--ease-smooth-out);\n --scale-open: .97; --scale-closing: .99; --blur-small: 2px; --rise: 16px;\n color: var(--fg); font-size: 12px;\n}\n@supports (transition-timing-function: linear(0, 1)) {\n /* a damped spring, ~4% overshoot over 500ms \u2014 the settle after a throw */\n .hud { --ease-spring: linear(0, 0.042, 0.143, 0.274, 0.414, 0.549, 0.67, 0.773, 0.856, 0.921, 0.968, 1.001, 1.021, 1.033, 1.038, 1.038, 1.035, 1.031, 1.025, 1.02, 1.015, 1.011, 1.007, 1.004, 1); }\n}\n@media (pointer: coarse) { .hud { --m: 12px; --h: 32px; --b: 30px; } }\n/* scoped under .hud so a control's own `all:unset` reset cannot wipe the surface */\n.hud .glass, .hud .menu, .hud .pop, .hud .detail, .hud .hint {\n background: var(--ink);\n -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5);\n box-shadow: inset 0 0 0 1px var(--edge), 0 0 0 .5px var(--rim), 0 10px 28px -10px rgba(0,0,0,.5), 0 2px 6px -2px rgba(0,0,0,.28);\n color: var(--fg);\n}\n.hud .menu, .hud .pop { background: var(--ink-pop); }\n@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {\n .hud .glass, .hud .menu, .hud .pop, .hud .detail, .hud .hint { background: var(--ink-solid); }\n}\n.sr { position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }\n\n/* the dock: one of six spots, or tucked into a side edge */\n.dock { position:fixed; z-index:4; display:flex; pointer-events:auto; }\n.dock[data-row=\"b\"] { bottom: calc(var(--m) + env(safe-area-inset-bottom, 0px)); }\n.dock[data-row=\"t\"] { top: calc(var(--m) + env(safe-area-inset-top, 0px)); }\n.dock[data-col=\"l\"] { left: calc(var(--m) + env(safe-area-inset-left, 0px)); }\n.dock[data-col=\"r\"] { right: calc(var(--m) + env(safe-area-inset-right, 0px)); }\n.dock[data-col=\"c\"] { left: calc(50% - var(--hw, 36px) / 2); }\n.dock[data-tuck] { top: clamp(8px, calc(var(--ty, .5) * 100% - 28px), calc(100% - 64px)); }\n.dock[data-tuck=\"left\"] { left:0; }\n.dock[data-tuck=\"right\"] { right:0; }\n.dock.settling { transition: transform var(--duration-snap) var(--ease-spring); }\n.dock.dragging .glass { box-shadow: inset 0 0 0 1px var(--edge), 0 0 0 .5px var(--rim), 0 18px 40px -12px rgba(0,0,0,.55), 0 4px 10px -4px rgba(0,0,0,.3); }\n\n/* the recording dot: a soft ripple while recording, still otherwise */\n.dot { position:relative; width:8px; height:8px; flex:none; border-radius:50%; background:var(--rec); }\n.dot::after { content:\"\"; position:absolute; inset:0; border-radius:50%; box-shadow:0 0 0 0 rgba(255,59,87,.5); animation:ripple 2s var(--ease-out) infinite; }\n@keyframes ripple { 0% { box-shadow:0 0 0 0 rgba(255,59,87,.45); } 70%, 100% { box-shadow:0 0 0 7px rgba(255,59,87,0); } }\n.bar[data-state=\"paused\"] .dot { background:var(--fg-3); }\n.bar[data-state=\"bad\"] .dot { background:var(--warn); }\n.bar[data-state=\"paused\"] .dot::after, .bar[data-state=\"bad\"] .dot::after { animation:none; }\n\n/* idle: the puck \u2014 ring = not linked, dot = ready; the label slides out on intent */\n.puck { all:unset; box-sizing:border-box; display:inline-flex; align-items:center; height:var(--h); min-width:var(--h);\n padding:0 calc((var(--h) - 10px) / 2); border-radius:999px; cursor:pointer; touch-action:none; user-select:none; -webkit-user-select:none;\n font-weight:600; font-size:12px; color:var(--fg); }\n.dock[data-col=\"r\"] .puck { flex-direction:row-reverse; }\n.ring { width:10px; height:10px; flex:none; border-radius:50%; box-shadow:inset 0 0 0 1.5px var(--fg-2);\n transition: background-color var(--duration-quick) var(--ease-out), box-shadow var(--duration-quick) var(--ease-out); }\n.puck[data-state=\"ready\"] .ring { background:var(--fg-2); box-shadow:none; }\n.puck[data-state=\"busy\"] .ring { background:var(--fg-3); box-shadow:none; animation:breathe 1.2s var(--ease-in-out) infinite; }\n@keyframes breathe { 50% { opacity:.35; } }\n.lab { display:grid; grid-template-columns:0fr; opacity:0;\n transition: grid-template-columns var(--duration-resize) var(--ease-smooth-out), opacity var(--duration-quick) var(--ease-out); }\n/* the gap to the ring is a clipped pseudo-element: padding would keep a folded label 10px wide */\n.lab > span { min-width:0; overflow:hidden; white-space:nowrap; }\n.lab > span::before, .lab > span::after { content:\"\"; display:inline-block; }\n.lab > span::before { width:8px; }\n.lab > span::after { width:2px; }\n.dock[data-col=\"r\"] .lab > span::before { width:2px; }\n.dock[data-col=\"r\"] .lab > span::after { width:8px; }\n.puck:focus-visible .lab { grid-template-columns:1fr; opacity:1; }\n.puck:focus-visible { outline:2px solid var(--rec); outline-offset:2px; }\n@media (hover: hover) {\n .puck:hover .lab { grid-template-columns:1fr; opacity:1; }\n .puck[data-state=\"ready\"]:hover .ring { background:var(--rec); }\n .puck[data-state=\"unlinked\"]:hover .ring { box-shadow:inset 0 0 0 1.5px var(--fg); }\n}\n\n/* recording: the capsule (handle) + the tray it unfolds */\n.bar { position:relative; display:inline-flex; align-items:center; height:var(--h); border-radius:999px; }\n.dock[data-col=\"r\"] .bar, .dock[data-col=\"r\"] .tray-in { flex-direction:row-reverse; }\n.handle { all:unset; box-sizing:border-box; display:inline-flex; align-items:center; gap:7px; height:var(--h);\n padding:0 11px 0 10px; border-radius:999px; cursor:grab; touch-action:none; user-select:none; -webkit-user-select:none; }\n.dock.dragging .handle { cursor:grabbing; }\n.handle:focus-visible { outline:2px solid var(--rec); outline-offset:2px; }\n.time { font-weight:600; font-size:12px; line-height:1; font-variant-numeric:tabular-nums; letter-spacing:.01em; min-width:34px; }\n.tray { display:grid; grid-template-columns:0fr; transition: grid-template-columns var(--duration-resize) var(--ease-smooth-out); }\n.tray-in { min-width:0; overflow:hidden; display:flex; align-items:center; gap:1px; padding:34px 3px; margin:-34px 0;\n pointer-events:none; opacity:0; filter:blur(var(--blur-small));\n transition: opacity var(--duration-quick) var(--ease-in-out), filter var(--duration-quick) var(--ease-in-out); }\n.tray-in > * { pointer-events:auto; }\n.bar[data-open] .tray { grid-template-columns:1fr; }\n.bar[data-open] .tray-in { opacity:1; filter:none; transition-duration: var(--duration-fast); transition-delay: 60ms; }\n.sep { width:1px; height:14px; flex:none; margin:0 5px; background:var(--edge); }\n.sync { display:inline-grid; place-items:center; width:18px; flex:none; font-size:11px; color:var(--fg-3); }\n.sync.warn, .sync.bad { color:var(--warn); }\nbutton.tb { all:unset; pointer-events:auto; box-sizing:border-box; position:relative; flex:none; display:inline-grid; place-items:center;\n width:var(--b); height:var(--b); border-radius:999px; color:var(--fg-2); cursor:pointer; font-size:13px;\n transition: background-color var(--duration-quick) var(--ease-out), color var(--duration-quick) var(--ease-out); }\nbutton.tb.b-annotate { color:var(--rec); }\nbutton.tb.on { background:var(--rec); color:#fff; }\nbutton.tb:focus-visible { outline:2px solid var(--rec); outline-offset:-2px; }\n@media (hover: hover) { button.tb:hover { background:var(--ink-2); color:var(--fg); } button.tb.on:hover { background:var(--rec); color:#fff; } }\nkbd { position:absolute; left:50%; bottom:calc(100% + 8px); transform:translateX(-50%); padding:4px 6px; border-radius:6px;\n background:var(--ink-pop); box-shadow:inset 0 0 0 1px var(--edge); color:var(--fg-2); font:600 10px/1 -apple-system, BlinkMacSystemFont, sans-serif;\n letter-spacing:.02em; white-space:nowrap; opacity:0; pointer-events:none; transition:opacity var(--duration-quick) var(--ease-out); }\n.dock[data-row=\"t\"] kbd { bottom:auto; top:calc(100% + 8px); }\n@media (hover: hover) { button.tb:hover kbd { opacity:1; transition-delay:400ms; } }\nbutton.tb:focus-visible kbd { opacity:1; }\n.bar.composing kbd { opacity:0 !important; }\n\n/* the health line: only when something needs saying */\n.detail { position:absolute; width:max-content; max-width:260px; padding:6px 11px; border-radius:999px; color:var(--fg-2); font-size:11px; line-height:1.35;\n opacity:0; transform:translateY(4px); pointer-events:none;\n transition: opacity var(--duration-fast) var(--ease-smooth-out), transform var(--duration-fast) var(--ease-smooth-out); }\n.dock[data-row=\"b\"] .detail { bottom:calc(100% + 6px); }\n.dock[data-row=\"t\"] .detail { top:calc(100% + 6px); transform:translateY(-4px); }\n.dock[data-col=\"r\"] .detail { right:0; }\n.dock[data-col=\"l\"] .detail, .dock[data-col=\"c\"] .detail { left:0; }\n.detail.show { opacity:1; transform:none; }\n.detail.bad { color:var(--fg); box-shadow: inset 0 0 0 1px rgba(240,166,58,.55), 0 10px 28px -10px rgba(0,0,0,.5); }\n\n/* the edge tab a tucked HUD becomes */\n.tab { all:unset; box-sizing:border-box; position:relative; display:block; width:22px; height:56px; cursor:pointer; touch-action:none; }\n.tab::before { content:\"\"; position:absolute; top:0; bottom:0; width:6px; background:var(--ink);\n -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);\n box-shadow: inset 0 0 0 1px var(--edge), 0 0 0 .5px var(--rim), 0 6px 18px -6px rgba(0,0,0,.5);\n transition: width var(--duration-quick) var(--ease-out); }\n.tab::after { content:\"\"; position:absolute; top:16px; bottom:16px; width:2px; border-radius:1px; background:var(--fg-3); }\n.dock[data-tuck=\"left\"] .tab::before { left:0; border-radius:0 7px 7px 0; }\n.dock[data-tuck=\"right\"] .tab::before { right:0; border-radius:7px 0 0 7px; }\n.dock[data-tuck=\"left\"] .tab::after { left:2px; }\n.dock[data-tuck=\"right\"] .tab::after { right:2px; }\n.tab[data-state=\"rec\"]::after { background:var(--rec); }\n.tab[data-state=\"bad\"]::after { background:var(--warn); }\n.tab:focus-visible::before { width:10px; outline:2px solid var(--rec); outline-offset:1px; }\n@media (hover: hover) { .tab:hover::before { width:9px; } }\n\n/* the \u22EF menu \u2014 grows from the bar toward the viewport centre */\n.menu { position:absolute; min-width:188px; padding:5px; border-radius:12px; display:flex; flex-direction:column; gap:1px; z-index:5; }\n.dock[data-row=\"b\"] .menu { bottom:calc(100% + 8px); }\n.dock[data-row=\"t\"] .menu { top:calc(100% + 8px); }\n.dock[data-col=\"r\"] .menu { right:0; }\n.dock[data-col=\"l\"] .menu, .dock[data-col=\"c\"] .menu { left:0; }\n.menu > button { all:unset; box-sizing:border-box; cursor:pointer; padding:8px 10px; border-radius:7px; color:var(--fg);\n font-size:12.5px; line-height:1; display:flex; gap:9px; align-items:center; }\n.menu > button svg { color:var(--fg-2); }\n.menu > button:focus-visible { outline:2px solid var(--rec); outline-offset:-2px; }\n@media (hover: hover) { .menu > button:hover { background:var(--ink-2); } .menu > button.danger:hover, .menu > button.danger:hover svg { color:var(--rec); } }\n.moveto { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:6px 6px 6px 10px; margin-top:3px;\n border-top:1px solid var(--edge); color:var(--fg-2); font-size:12px; }\n.spots { display:grid; grid-template-columns:repeat(3, 24px); grid-template-rows:repeat(2, 24px); gap:0 2px; }\n.spots button { all:unset; box-sizing:border-box; position:relative; cursor:pointer; border-radius:5px; }\n.spots button::before { content:\"\"; position:absolute; inset:7px 5px; border-radius:3px; background:var(--ink-2); box-shadow:inset 0 0 0 1px var(--edge); }\n.spots button[aria-checked=\"true\"]::before { background:var(--rec); box-shadow:none; }\n.spots button:focus-visible { outline:2px solid var(--rec); outline-offset:-2px; }\n@media (hover: hover) { .spots button:hover::before { background:var(--fg-3); } .spots button[aria-checked=\"true\"]:hover::before { background:var(--rec); } }\n\n/* presence: dropdown-style grow from the anchor on open, a softer shrink on close */\n.grow { transform:scale(var(--scale-open)); opacity:0;\n transition: transform var(--duration-fast) var(--ease-smooth-out), opacity var(--duration-fast) var(--ease-smooth-out); }\n.grow[data-origin=\"bottom-right\"] { transform-origin:bottom right; }\n.grow[data-origin=\"bottom-left\"] { transform-origin:bottom left; }\n.grow[data-origin=\"bottom-center\"] { transform-origin:bottom center; }\n.grow[data-origin=\"top-right\"] { transform-origin:top right; }\n.grow[data-origin=\"top-left\"] { transform-origin:top left; }\n.grow[data-origin=\"top-center\"] { transform-origin:top center; }\n.grow.is-open { transform:scale(1); opacity:1; }\n.grow.is-closing { transform:scale(var(--scale-closing)); opacity:0; pointer-events:none;\n transition-duration: var(--duration-quick); }\n/* phone: the sheet rises from the bottom edge (toast motion) */\n.rise { transform:translateY(var(--rise)) scale(var(--scale-open)); opacity:0; filter:blur(var(--blur-small));\n transition: transform var(--duration-fast) var(--ease-smooth-out), opacity var(--duration-fast) var(--ease-smooth-out), filter var(--duration-fast) var(--ease-smooth-out); }\n.rise.is-open { transform:none; opacity:1; filter:none; transition-duration: var(--duration-medium); }\n.rise.is-closing { pointer-events:none; }\n\n/* pick chrome (annotate mode): dim, outline, hint \u2014 shadow-root children */\n.dim { position:fixed; inset:0; z-index:1; pointer-events:none; background:rgba(0,0,0,.18); }\n.outline { position:fixed; z-index:2; pointer-events:none; border:2px solid var(--rec); border-radius:6px;\n box-shadow:0 0 0 4px rgba(255,59,87,.15); }\n.hint { position:fixed; top:14px; left:50%; transform:translateX(-50%); z-index:3; padding:8px 14px;\n border-radius:999px; font-size:12px; font-weight:600; line-height:1; white-space:nowrap; display:flex; gap:8px; align-items:center; }\n.hint svg { color:var(--rec); }\n.hint .keys { color:var(--fg-3); font-weight:500; margin-left:-4px; }\n@media (pointer: coarse) { .hint .keys { display:none; } }\n.hud[data-spot=\"tc\"] .hint { top:auto; bottom:14px; }\n\n/* sheets: a popover anchored to the dock, or a phone bottom sheet */\n.anchor { position:fixed; z-index:6; pointer-events:none; }\n.anchor > * { pointer-events:auto; }\n.phone { position:fixed; z-index:6; display:flex; flex-direction:column; justify-content:flex-end;\n padding:0 8px calc(8px + env(safe-area-inset-bottom, 0px)); pointer-events:none; }\n.phone > * { pointer-events:auto; }\n.pop { width:min(288px, calc(100vw - 24px)); padding:12px; border-radius:14px; }\n.phone .pop { width:100%; border-radius:18px; padding:14px; }\n.pop-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }\n.title { display:flex; align-items:center; gap:7px; font-size:12.5px; font-weight:600; color:var(--fg); }\n.title i { width:3px; height:11px; border-radius:1px; background:var(--rec); }\n.closeb { all:unset; box-sizing:border-box; cursor:pointer; width:24px; height:24px; border-radius:7px; color:var(--fg-3);\n display:inline-grid; place-items:center; font-size:12px; }\n.closeb:focus-visible, .sendb:focus-visible, .retry:focus-visible, .dest button:focus-visible { outline:2px solid var(--rec); outline-offset:2px; }\n@media (hover: hover) { .closeb:hover { color:var(--fg); background:var(--ink-2); } }\ntextarea { width:100%; margin-top:10px; padding:9px 11px; min-height:64px; resize:vertical; background:rgba(0,0,0,.28);\n border:0; box-shadow:inset 0 0 0 1px var(--edge); border-radius:9px; color:var(--fg);\n font:400 14px/1.4 -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif; }\n@media (pointer: coarse) { textarea { font-size:16px; } .hints { display:none; } }\ntextarea::placeholder { color:var(--fg-3); }\ntextarea:focus { outline:none; box-shadow:inset 0 0 0 1px var(--fg-3); }\n.row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; margin-top:10px; }\n.row.nodest { grid-template-columns:minmax(0,1fr) auto; }\n.ctx { font-size:11px; line-height:1.35; color:var(--fg-3); text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.row.nodest .ctx { text-align:left; }\n.dest { display:inline-flex; padding:2px; border-radius:8px; background:rgba(0,0,0,.28); box-shadow:inset 0 0 0 1px var(--edge); }\n.dest button { all:unset; box-sizing:border-box; cursor:pointer; padding:5px 8px; min-height:24px; border-radius:6px; color:var(--fg-3);\n font-size:11.5px; font-weight:600; line-height:14px; transition: background-color var(--duration-quick) var(--ease-out), color var(--duration-quick) var(--ease-out); }\n.dest button[aria-pressed=\"true\"] { background:var(--ink-2); color:var(--fg); }\n.sendb { all:unset; box-sizing:border-box; cursor:pointer; display:inline-flex; align-items:center; gap:6px; height:28px; padding:0 12px;\n border-radius:8px; background:var(--rec); color:#fff; font-size:12.5px; font-weight:600; line-height:1; text-decoration:none; }\n@media (hover: hover) { .sendb:hover { background:#ff5670; } }\n.hints { margin-top:9px; font-size:11px; line-height:1; color:var(--fg-3); }\n";
19
+ export declare const HUD_CSS_BASE = "\n* { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif; }\nsvg { width:1em; height:1em; vertical-align:-.125em; flex:none; }\n.hud {\n --ink: rgba(26,22,23,.72); --ink-pop: rgba(26,22,23,.9); --ink-solid: #1d1a1b;\n --ink-2: rgba(255,255,255,.08); --ink-3: rgba(255,255,255,.14); --edge: rgba(255,255,255,.11); --rim: rgba(0,0,0,.30);\n --fg: #f4efea; --fg-2: rgba(244,239,234,.66); --fg-3: rgba(244,239,234,.44);\n --rec: #ff3b57; --rec-soft: rgba(255,59,87,.16); --warn: #f0a63a; --ok: #7fd6a4;\n --m: 16px;\n --s: 1; --h: 28px; --b: 24px; --vw: 36px; --fs: 12px; --fs-s: 10.5px; --ic: 13px;\n --duration-micro: 80ms; --duration-quick: 150ms; --duration-fast: 250ms; --duration-resize: 300ms;\n --duration-medium: 350ms; --duration-very-slow: 500ms; --duration-snap: 500ms;\n --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1); --ease-in-out: ease-in-out; --ease-out: ease-out; --ease-linear: linear;\n --ease-bounce: cubic-bezier(0.34, 1.36, 0.64, 1);\n --ease-spring: var(--ease-smooth-out);\n --distance-micro: 4px; --scale-medium: .97; --scale-small: .98; --scale-tiny: .99; --blur-small: 2px; --rise: 16px;\n color: var(--fg); font-size: var(--fs);\n user-select:none; -webkit-user-select:none;\n}\n.hud[data-size=\"sm\"] { --s: .88; --h: 24px; --b: 20px; --vw: 30px; --fs: 11px; --fs-s: 10px; --ic: 12px; }\n.hud[data-size=\"lg\"] { --s: 1.18; --h: 34px; --b: 30px; --vw: 44px; --fs: 13.5px; --fs-s: 11.5px; --ic: 15px; }\n@supports (transition-timing-function: linear(0, 1)) {\n /* a damped spring, ~4% overshoot over 500ms \u2014 the settle after a throw */\n .hud { --ease-spring: linear(0, 0.042, 0.143, 0.274, 0.414, 0.549, 0.67, 0.773, 0.856, 0.921, 0.968, 1.001, 1.021, 1.033, 1.038, 1.038, 1.035, 1.031, 1.025, 1.02, 1.015, 1.011, 1.007, 1.004, 1); }\n}\n@media (pointer: coarse) {\n .hud { --m: 12px; }\n .hud[data-size=\"sm\"] { --h: 28px; --b: 26px; --vw: 34px; }\n .hud[data-size=\"md\"] { --h: 32px; --b: 30px; --vw: 40px; }\n .hud[data-size=\"lg\"] { --h: 38px; --b: 34px; --vw: 46px; }\n}\n/* scoped under .hud so a control's own `all:unset` reset cannot wipe the surface */\n.hud .glass, .hud .menu, .hud .pop, .hud .detail, .hud .hint, .hud .tip {\n background: var(--ink);\n -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5);\n box-shadow: inset 0 0 0 1px var(--edge), 0 0 0 .5px var(--rim), 0 10px 28px -10px rgba(0,0,0,.5), 0 2px 6px -2px rgba(0,0,0,.28);\n color: var(--fg);\n}\n.hud .menu, .hud .pop, .hud .tip { background: var(--ink-pop); }\n@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {\n .hud .glass, .hud .menu, .hud .pop, .hud .detail, .hud .hint, .hud .tip { background: var(--ink-solid); }\n}\n.sr { position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }\ntextarea, .code { user-select:text; -webkit-user-select:text; }\n\n/* the dock: one of eight spots, or tucked into a side edge */\n.dock { position:fixed; z-index:4; display:flex; pointer-events:auto; }\n.dock[data-row=\"b\"] { bottom: calc(var(--m) + env(safe-area-inset-bottom, 0px)); }\n.dock[data-row=\"t\"] { top: calc(var(--m) + env(safe-area-inset-top, 0px)); }\n.dock[data-row=\"m\"] { top: calc(50% - var(--hh, 28px) / 2); }\n.dock[data-col=\"l\"] { left: calc(var(--m) + env(safe-area-inset-left, 0px)); }\n.dock[data-col=\"r\"] { right: calc(var(--m) + env(safe-area-inset-right, 0px)); }\n.dock[data-col=\"c\"] { left: calc(50% - var(--hw, 36px) / 2); }\n.dock[data-tuck] { top: clamp(8px, calc(var(--ty, .5) * 100% - 28px), calc(100% - 64px)); }\n.dock[data-tuck=\"left\"] { left:0; }\n.dock[data-tuck=\"right\"] { right:0; }\n.dock.settling { transition: transform var(--duration-snap) var(--ease-spring); }\n/* a throw carries the compact capsule: the tray folds at once, not on its tween */\n.dock.dragging .seg, .dock.dragging .seg-in { transition:none !important; }\n.dock.dragging .glass { box-shadow: inset 0 0 0 1px var(--edge), 0 0 0 .5px var(--rim), 0 18px 40px -12px rgba(0,0,0,.55), 0 4px 10px -4px rgba(0,0,0,.3); }\n\n/* the pill and its segments */\n.pill { position:relative; display:inline-flex; align-items:center; height:var(--h); border-radius:999px; }\n.dock[data-col=\"r\"] .pill[data-orient=\"h\"] { flex-direction:row-reverse; }\n.pill[data-orient=\"v\"] { flex-direction:column; height:auto; width:var(--vw); border-radius:calc(var(--vw) / 2); padding:2px 0 4px; }\n.pill.morphing, .pill.morphing * { transition:none !important; }\n.pill.morphing { overflow:hidden; }\n.seg { display:grid; grid-template-columns:0fr; visibility:hidden;\n transition: grid-template-columns var(--duration-resize) var(--ease-smooth-out), visibility 0s linear var(--duration-resize); }\n.seg-in { min-width:0; overflow:hidden; display:flex; align-items:center; padding:5px 0; margin:-5px 0;\n opacity:0; filter:blur(var(--blur-small));\n transition: opacity var(--duration-quick) var(--ease-in-out), filter var(--duration-quick) var(--ease-in-out); }\n.seg.on { grid-template-columns:1fr; visibility:visible;\n transition: grid-template-columns var(--duration-resize) var(--ease-smooth-out), visibility 0s; }\n.seg.on > .seg-in { opacity:1; filter:none; transition-duration: var(--duration-fast); transition-delay: var(--duration-micro); }\n.pill[data-orient=\"v\"] .seg { grid-template-columns:1fr; grid-template-rows:0fr;\n transition: grid-template-rows var(--duration-resize) var(--ease-smooth-out), visibility 0s linear var(--duration-resize); }\n.pill[data-orient=\"v\"] .seg.on { grid-template-rows:1fr; transition: grid-template-rows var(--duration-resize) var(--ease-smooth-out), visibility 0s; }\n.pill[data-orient=\"v\"] .seg-in { flex-direction:column; min-height:0; padding:0 5px; margin:0 -5px; }\n\n/* the recording dot: its ripple is a pseudo-element, outside layout */\n.dot { position:relative; width:8px; height:8px; flex:none; border-radius:50%; background:var(--rec); }\n.dot::after { content:\"\"; position:absolute; inset:0; border-radius:50%; background:var(--rec); opacity:0; pointer-events:none;\n animation:ripple 2s var(--ease-out) infinite; }\n@keyframes ripple { 0% { transform:scale(1); opacity:.45; } 70%, 100% { transform:scale(2.75); opacity:0; } }\n.pill[data-state=\"paused\"] .dot { background:var(--fg-3); }\n.pill[data-state=\"bad\"] .dot { background:var(--warn); }\n.pill[data-state=\"paused\"] .dot::after, .pill[data-state=\"bad\"] .dot::after { animation:none; }\n\n/* idle: the puck \u2014 ring = not linked, dot = ready; the label slides out on intent */\n.puck { all:unset; box-sizing:border-box; display:inline-flex; align-items:center; height:var(--h); min-width:var(--h);\n padding:0 calc((var(--h) - 10px) / 2); border-radius:999px; cursor:pointer; touch-action:none;\n font-weight:600; font-size:var(--fs); color:var(--fg); }\n.dock[data-col=\"r\"] .puck { flex-direction:row-reverse; }\n.ring { width:10px; height:10px; flex:none; border-radius:50%; box-shadow:inset 0 0 0 1.5px var(--fg-2);\n transition: background-color var(--duration-quick) var(--ease-out), box-shadow var(--duration-quick) var(--ease-out); }\n.puck[data-state=\"ready\"] .ring { background:var(--fg-2); box-shadow:none; }\n.puck[data-state=\"busy\"] .ring { background:var(--fg-3); box-shadow:none; animation:breathe 1.2s var(--ease-in-out) infinite; }\n@keyframes breathe { 50% { opacity:.35; } }\n.lab { display:grid; grid-template-columns:0fr; opacity:0;\n transition: grid-template-columns var(--duration-resize) var(--ease-smooth-out), opacity var(--duration-quick) var(--ease-out); }\n/* the gap to the ring is a clipped pseudo-element: padding would keep a folded label 10px wide */\n.lab > span { min-width:0; overflow:hidden; white-space:nowrap; }\n.lab > span::before, .lab > span::after { content:\"\"; display:inline-block; }\n.lab > span::before { width:8px; }\n.lab > span::after { width:2px; }\n.dock[data-col=\"r\"] .lab > span::before { width:2px; }\n.dock[data-col=\"r\"] .lab > span::after { width:8px; }\n.pill[data-open] .lab, .puck:focus-visible .lab { grid-template-columns:1fr; opacity:1; }\n.puck:focus-visible, .handle:focus-visible { outline:2px solid var(--rec); outline-offset:2px; }\n@media (hover: hover) {\n .puck[data-state=\"ready\"]:hover .ring { background:var(--rec); }\n .puck[data-state=\"unlinked\"]:hover .ring { box-shadow:inset 0 0 0 1.5px var(--fg); }\n}\n\n/* recording: the handle (dot + clock) \u2014 symmetric: the dot centres in the pill's round end */\n.handle { all:unset; box-sizing:border-box; display:inline-flex; align-items:center; gap:6px; height:var(--h);\n padding:0 calc((var(--h) - 8px) / 2); border-radius:999px; cursor:grab; touch-action:none; }\n.dock.dragging .handle { cursor:grabbing; }\n.pill[data-orient=\"v\"] .handle { flex-direction:column; height:auto; width:var(--vw); gap:5px; padding:calc((var(--vw) - 8px) / 2 - 2px) 0 6px; }\n.clock { display:inline-flex; align-items:center; }\n.clock .seg-in { padding:0; margin:0; }\n.time { font-weight:600; font-size:var(--fs); line-height:1; font-variant-numeric:tabular-nums; letter-spacing:.01em; white-space:nowrap; }\n.pill[data-orient=\"v\"] .time { font-size:var(--fs-s); letter-spacing:-.01em; }\n.pill[data-orient=\"v\"] .clock { flex-direction:column; }\n.flash { display:inline-flex; align-items:center; gap:4px; color:var(--ok); font-weight:600; font-size:var(--fs); line-height:1; white-space:nowrap; }\n.flash svg { font-size:var(--ic); }\n.pill[data-orient=\"v\"] .flash span { display:none; }\n\n/* the tool tray */\n.tools { display:flex; align-items:center; gap:calc(2px * var(--s)); padding-right:3px; }\n.dock[data-col=\"r\"] .pill[data-orient=\"h\"] .tools { flex-direction:row-reverse; padding-right:0; padding-left:3px; }\n.pill[data-orient=\"v\"] .tools { flex-direction:column; padding:0 0 2px; gap:calc(3px * var(--s)); }\n.sep { width:1px; height:14px; flex:none; margin:0 4px 0 0; background:var(--edge); }\n.dock[data-col=\"r\"] .pill[data-orient=\"h\"] .sep { margin:0 0 0 4px; }\n.pill[data-orient=\"v\"] .sep { width:14px; height:1px; margin:2px 0 4px; }\nbutton.tb { all:unset; pointer-events:auto; box-sizing:border-box; position:relative; flex:none; display:inline-grid; place-items:center;\n width:var(--b); height:var(--b); border-radius:999px; color:var(--fg-2); cursor:pointer; font-size:var(--ic);\n transition: background-color var(--duration-quick) var(--ease-out), color var(--duration-quick) var(--ease-out); }\nbutton.tb.b-annotate { color:var(--rec); }\nbutton.tb.on { background:var(--rec); color:#fff; }\nbutton.tb.b-stop svg { fill:currentColor; stroke:none; font-size:calc(var(--ic) * .82); }\nbutton.tb:focus-visible { outline:2px solid var(--rec); outline-offset:-2px; }\n@media (hover: hover) {\n button.tb:hover { background:var(--ink-2); color:var(--fg); }\n button.tb.on:hover { background:var(--rec); color:#fff; }\n button.tb.b-stop:hover { background:var(--rec-soft); color:var(--rec); }\n}\n\n/* the sync chip: legible at a glance \u2014 icon + word, colour by state */\n.sync { display:inline-flex; align-items:center; gap:4px; height:var(--b); padding:0 7px 0 5px; margin-right:2px; border-radius:999px;\n font-size:var(--fs-s); font-weight:600; line-height:1; white-space:nowrap; color:var(--fg-3); background:transparent;\n transition: color var(--duration-quick) var(--ease-out), background-color var(--duration-quick) var(--ease-out); }\n.sync svg { font-size:calc(var(--ic) * .95); }\n.sync[data-kind=\"synced\"] svg { color:var(--ok); }\n.sync[data-kind=\"sending\"] { color:var(--fg-2); }\n.sync[data-kind=\"offline\"] { color:var(--warn); background:rgba(240,166,58,.12); }\n.sync[data-kind=\"error\"] { color:var(--rec); background:var(--rec-soft); }\n.sync .swap { display:inline-flex; animation:swap-in var(--duration-quick) var(--ease-in-out) both; }\n.pill[data-orient=\"v\"] .sync { width:var(--b); padding:0; margin:0 0 2px; justify-content:center; }\n.pill[data-orient=\"v\"] .sync .word { display:none; }\n.dock[data-col=\"r\"] .pill[data-orient=\"h\"] .sync { margin:0 0 0 2px; }\n@keyframes swap-in { from { opacity:0; transform:translateY(var(--distance-micro)); filter:blur(var(--blur-small)); } }\n.spin { animation:spin .9s var(--ease-linear) infinite; transform-origin:50% 50%; }\n@keyframes spin { to { transform:rotate(360deg); } }\n\n/* inline flows: confirm \u00B7 saving \u00B7 saved \u00B7 failed */\n.flow { display:flex; align-items:center; gap:calc(6px * var(--s)); height:var(--h); padding:0 3px 0 calc(var(--h) * .42);\n white-space:nowrap; font-size:var(--fs); font-weight:600; line-height:1; color:var(--fg); }\n.pill[data-face=\"flow-rec\"] .flow { padding-left:2px; }\n.dock[data-col=\"r\"] .pill[data-face=\"flow-rec\"] .flow { padding-left:calc(var(--h) * .42); padding-right:0; }\n.flow .q { margin-right:calc(4px * var(--s)); }\n.flow .muted { color:var(--fg-3); font-weight:500; }\n.flow svg { font-size:var(--ic); }\n.fb { all:unset; box-sizing:border-box; cursor:pointer; display:inline-flex; align-items:center; gap:5px; height:calc(var(--h) - 6px);\n padding:0 calc(10px * var(--s)); border-radius:999px; font-size:calc(var(--fs) - .5px); font-weight:600; line-height:1; color:var(--fg);\n background:var(--ink-2); text-decoration:none;\n transition: background-color var(--duration-quick) var(--ease-out), color var(--duration-quick) var(--ease-out); }\n.fb.primary { background:var(--rec); color:#fff; }\n.fb.icon { width:calc(var(--h) - 6px); padding:0; justify-content:center; background:transparent; color:var(--fg-3); }\n.fb:focus-visible { outline:2px solid var(--rec); outline-offset:1px; }\n@media (hover: hover) {\n .fb:hover { background:var(--ink-3); }\n .fb.primary:hover { background:#ff5670; }\n .fb.icon:hover { color:var(--fg); background:var(--ink-2); }\n}\n.saving { position:relative; padding-right:calc(var(--h) * .42); }\n.saving .spinner { color:var(--fg-2); }\n.saving .spinner circle { stroke-dasharray:44 63; }\n.bar-track { position:absolute; left:calc(var(--h) * .42); right:calc(var(--h) * .42); bottom:3px; height:2px; border-radius:1px; background:var(--ink-2); overflow:hidden; }\n.bar-track > i { position:absolute; inset:0 auto 0 0; width:calc(var(--p, 0) * 100%); border-radius:1px; background:var(--fg-2);\n transition: width var(--duration-fast) var(--ease-smooth-out); }\n.bar-track[data-indeterminate] > i { width:35%; animation:slide 1.1s var(--ease-in-out) infinite; }\n@keyframes slide { from { transform:translateX(-100%); } to { transform:translateX(290%); } }\n.saved .ok { display:inline-flex; color:var(--ok); }\n.failed .warn { display:inline-flex; color:var(--warn); }\n.failed .msg { max-width:calc(220px * var(--s)); overflow:hidden; text-overflow:ellipsis; }\n\n/* the success check (transitions.dev 10, tuned to a 13px glyph) */\n.t-check { display:inline-block; transform-origin:center; opacity:0; will-change:transform, opacity, filter; }\n.t-check svg { display:block; overflow:visible; }\n.t-check svg path { stroke-dasharray:18; stroke-dashoffset:18; }\n.t-check[data-state=\"in\"] {\n animation: t-check-fade var(--duration-very-slow) var(--ease-smooth-out) forwards,\n t-check-rotate var(--duration-very-slow) var(--ease-smooth-out) forwards,\n t-check-blur var(--duration-very-slow) var(--ease-smooth-out) forwards,\n t-check-bob var(--duration-very-slow) cubic-bezier(0.34, 1.35, 0.64, 1) forwards; }\n.t-check[data-state=\"in\"] svg path { animation: t-check-draw var(--duration-very-slow) var(--ease-smooth-out) var(--duration-micro) forwards; }\n@keyframes t-check-fade { from { opacity:0; } to { opacity:1; } }\n@keyframes t-check-rotate { from { transform:rotate(80deg); } to { transform:rotate(0deg); } }\n@keyframes t-check-blur { from { filter:blur(8px); } to { filter:blur(0); } }\n@keyframes t-check-bob { from { translate:0 8px; } to { translate:0 0; } }\n@keyframes t-check-draw { to { stroke-dashoffset:0; } }\n\n/* the edge tab a tucked HUD becomes */\n.tab { all:unset; box-sizing:border-box; position:relative; display:block; width:22px; height:56px; cursor:pointer; touch-action:none; }\n.tab::before { content:\"\"; position:absolute; top:0; bottom:0; width:6px; background:var(--ink);\n -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);\n box-shadow: inset 0 0 0 1px var(--edge), 0 0 0 .5px var(--rim), 0 6px 18px -6px rgba(0,0,0,.5);\n transition: width var(--duration-quick) var(--ease-out); }\n.tab::after { content:\"\"; position:absolute; top:16px; bottom:16px; width:2px; border-radius:1px; background:var(--fg-3); }\n.dock[data-tuck=\"left\"] .tab::before { left:0; border-radius:0 7px 7px 0; }\n.dock[data-tuck=\"right\"] .tab::before { right:0; border-radius:7px 0 0 7px; }\n.dock[data-tuck=\"left\"] .tab::after { left:2px; }\n.dock[data-tuck=\"right\"] .tab::after { right:2px; }\n.tab[data-state=\"rec\"]::after { background:var(--rec); }\n.tab[data-state=\"bad\"]::after { background:var(--warn); }\n.tab:focus-visible::before { width:10px; outline:2px solid var(--rec); outline-offset:1px; }\n@media (hover: hover) { .tab:hover::before { width:9px; } }\n\n/* floats: fixed, placed in JS beside the dock (place.ts) */\n.float { position:fixed; left:0; top:0; z-index:5; pointer-events:auto; }\n\n/* the tooltip (transitions.dev 17): one bubble that travels between triggers */\n.tip { display:inline-flex; align-items:center; gap:7px; padding:calc(5px * var(--s)) calc(8px * var(--s)); border-radius:7px; white-space:nowrap;\n font-size:calc(var(--fs) - 1px); font-weight:600; line-height:1; color:var(--fg); pointer-events:none;\n opacity:0; scale:var(--scale-small); z-index:7;\n transition: opacity 50ms var(--ease-out), scale 50ms var(--ease-out), translate 160ms var(--ease-smooth-out); }\n.tip[data-show=\"true\"] { opacity:1; scale:1;\n transition: opacity var(--duration-quick) var(--ease-out) var(--duration-micro), scale var(--duration-quick) var(--ease-out) var(--duration-micro),\n translate 160ms var(--ease-smooth-out); }\n.tip.snap { transition:none !important; }\n.tip kbd { font:600 calc(var(--fs-s) - .5px)/1 ui-monospace, \"SF Mono\", Menlo, monospace; color:var(--fg-3); letter-spacing:.02em; }\n\n/* the \u22EF menu */\n.menu { width:calc(252px * var(--s)); max-height:calc(100vh - 16px); overflow:auto; overscroll-behavior:contain; scrollbar-width:thin;\n padding:calc(5px * var(--s)); border-radius:calc(13px * var(--s)); display:flex; flex-direction:column; gap:1px; font-size:var(--fs); }\n.m-head { display:flex; flex-direction:column; gap:3px; padding:calc(8px * var(--s)) calc(10px * var(--s)) calc(9px * var(--s)); }\n.m-who { display:flex; align-items:baseline; gap:5px; min-width:0; font-weight:600; color:var(--fg); line-height:1.2; }\n.m-who .email { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.m-who .ws { flex:none; color:var(--fg-2); font-weight:500; }\n.m-who.wraps .email { white-space:normal; overflow-wrap:anywhere; }\n.m-sub { font-size:var(--fs-s); color:var(--fg-3); line-height:1.25; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.m-sub .live { color:var(--ok); }\n.m-rule { height:1px; margin:3px 4px; background:var(--edge); flex:none; }\n.m-label { padding:calc(7px * var(--s)) calc(10px * var(--s)) 3px; font-size:var(--fs-s); font-weight:600; letter-spacing:.04em; text-transform:uppercase; color:var(--fg-3); }\n.mi { all:unset; box-sizing:border-box; cursor:pointer; display:flex; align-items:center; gap:9px; min-height:calc(30px * var(--s));\n padding:calc(7px * var(--s)) calc(10px * var(--s)); border-radius:8px; color:var(--fg); line-height:1.2; text-decoration:none;\n transition: background-color var(--duration-quick) var(--ease-out), color var(--duration-quick) var(--ease-out); }\n.mi > svg { color:var(--fg-2); font-size:var(--ic); }\n.mi .end { margin-left:auto; color:var(--fg-3); font-size:var(--ic); }\n.mi:focus-visible { outline:2px solid var(--rec); outline-offset:-2px; }\n.mi.danger { color:var(--fg-2); }\n@media (hover: hover) {\n .mi:hover { background:var(--ink-2); }\n .mi.danger:hover, .mi.danger:hover svg { color:var(--rec); }\n}\n.recent { align-items:flex-start; }\n.recent .r-main { display:flex; flex-direction:column; gap:3px; min-width:0; flex:1; }\n.recent .r-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.recent .r-meta { display:flex; align-items:center; gap:5px; font-size:var(--fs-s); color:var(--fg-3); white-space:nowrap; }\n.recent .r-meta i { width:5px; height:5px; border-radius:50%; flex:none; background:var(--fg-3); }\n.recent .r-meta i[data-status=\"saved\"] { background:var(--ok); }\n.recent .r-meta i[data-status=\"recording\"] { background:var(--rec); }\n.recent .r-meta i[data-status=\"unsaved\"] { background:var(--warn); }\n.recent[aria-disabled=\"true\"] { cursor:default; }\n.recent .end { margin-top:1px; }\n.m-empty { padding:4px 10px 8px; font-size:var(--fs-s); color:var(--fg-3); }\n.m-row { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:calc(32px * var(--s)); padding:2px calc(6px * var(--s)) 2px calc(10px * var(--s)); color:var(--fg-2); }\n.m-row > span:first-child { color:var(--fg); }\n.m-row.toggle { cursor:pointer; border-radius:8px; }\n@media (hover: hover) { .m-row.toggle:hover { background:var(--ink-2); } }\n.m-row.toggle:focus-visible { outline:2px solid var(--rec); outline-offset:-2px; }\n.m-foot { padding:6px 10px 4px; font:500 calc(var(--fs-s) - .5px)/1.3 ui-monospace, \"SF Mono\", Menlo, monospace; color:var(--fg-3); }\n\n/* size: a segmented control with a sliding pill (transitions.dev 16) */\n.sizes { position:relative; display:inline-grid; grid-template-columns:repeat(3, calc(30px * var(--s))); padding:2px; border-radius:999px;\n background:rgba(0,0,0,.28); box-shadow:inset 0 0 0 1px var(--edge); --i:1; }\n.sizes::before { content:\"\"; position:absolute; top:2px; bottom:2px; left:2px; width:calc(30px * var(--s)); border-radius:999px; background:var(--ink-3);\n transform:translateX(calc(var(--i) * 100%)); transition: transform var(--duration-fast) var(--ease-smooth-out); }\n.sizes button { all:unset; box-sizing:border-box; position:relative; z-index:1; cursor:pointer; display:grid; place-items:center;\n height:calc(22px * var(--s)); border-radius:999px; font-size:var(--fs-s); font-weight:700; color:var(--fg-3);\n transition: color var(--duration-fast) var(--ease-smooth-out); }\n.sizes button[aria-checked=\"true\"] { color:var(--fg); }\n.sizes button:focus-visible { outline:2px solid var(--rec); outline-offset:-1px; }\n@media (hover: hover) { .sizes button:hover { color:var(--fg-2); } .sizes button[aria-checked=\"true\"]:hover { color:var(--fg); } }\n\n/* verbose: a switch (transitions.dev 27, travel only) */\n.switch { position:relative; width:calc(30px * var(--s)); height:calc(18px * var(--s)); flex:none; border-radius:999px; background:var(--ink-3);\n transition: background-color var(--duration-fast) var(--ease-smooth-out); }\n.switch::after { content:\"\"; position:absolute; top:2px; left:2px; width:calc(14px * var(--s)); height:calc(14px * var(--s)); border-radius:50%;\n background:var(--fg-2); box-shadow:0 1px 3px rgba(0,0,0,.35);\n transition: translate var(--duration-fast) var(--ease-bounce), background-color var(--duration-fast) var(--ease-smooth-out); }\n.switch[data-on=\"true\"] { background:var(--rec); }\n.switch[data-on=\"true\"]::after { translate:calc(12px * var(--s)) 0; background:#fff; }\n\n/* Move to: a miniature screen, eight spots (no centre); middle-row marks stand up like the pill does */\n.screen { position:relative; display:grid; grid-template-columns:repeat(3, calc(22px * var(--s))); grid-template-rows:repeat(3, calc(15px * var(--s)));\n padding:calc(3px * var(--s)); border-radius:7px; box-shadow:inset 0 0 0 1px var(--edge); background:rgba(0,0,0,.22); }\n.screen button { all:unset; box-sizing:border-box; position:relative; cursor:pointer; border-radius:4px; display:grid; place-items:center; }\n.screen button::before { content:\"\"; width:calc(11px * var(--s)); height:calc(4px * var(--s)); border-radius:2px; background:var(--fg-3); opacity:.55;\n transition: background-color var(--duration-quick) var(--ease-out), opacity var(--duration-quick) var(--ease-out), transform var(--duration-quick) var(--ease-out); }\n.screen button[data-v]::before { width:calc(4px * var(--s)); height:calc(10px * var(--s)); }\n.screen button[aria-checked=\"true\"]::before { background:var(--rec); opacity:1; }\n.screen button:focus-visible { outline:2px solid var(--rec); outline-offset:-1px; }\n.screen .mid { grid-column:2; grid-row:2; }\n@media (hover: hover) { .screen button:hover::before { opacity:1; background:var(--fg-2); transform:scale(1.12); } .screen button[aria-checked=\"true\"]:hover::before { background:var(--rec); } }\n\n/* the details card: the health line when something is wrong, the technical details in verbose mode */\n.detail { width:max-content; max-width:calc(260px * var(--s)); padding:calc(6px * var(--s)) calc(11px * var(--s)); border-radius:calc(10px * var(--s));\n color:var(--fg-2); font-size:calc(var(--fs) - 1px); line-height:1.4; pointer-events:none; }\n.detail.line { border-radius:999px; }\n/* the tooltip and the card open on the same side: the card steps back while a tooltip speaks */\n.hud .tip[data-show=\"true\"] ~ .detail.is-open { opacity:0; transition: opacity var(--duration-quick) var(--ease-out); }\n.detail.bad { color:var(--fg); box-shadow: inset 0 0 0 1px rgba(240,166,58,.55), 0 10px 28px -10px rgba(0,0,0,.5); }\n.detail dl { display:grid; grid-template-columns:auto auto; gap:2px 12px; margin:0; font:500 var(--fs-s)/1.35 ui-monospace, \"SF Mono\", Menlo, monospace; }\n.detail dt { color:var(--fg-3); }\n.detail dd { margin:0; color:var(--fg); font-variant-numeric:tabular-nums; }\n.detail .warnline { margin-top:5px; color:var(--warn); font-size:var(--fs-s); }\n\n/* presence: dropdown-style grow from the anchor on open, a softer shrink on close */\n.grow { transform:scale(var(--scale-medium)); opacity:0;\n transition: transform var(--duration-fast) var(--ease-smooth-out), opacity var(--duration-fast) var(--ease-smooth-out); }\n.grow.is-open { transform:scale(1); opacity:1; }\n.grow.is-closing { transform:scale(var(--scale-tiny)); opacity:0; pointer-events:none; transition-duration: var(--duration-quick); }\n/* phone: the sheet rises from the bottom edge (toast motion) */\n.rise { transform:translateY(var(--rise)) scale(var(--scale-medium)); opacity:0; filter:blur(var(--blur-small));\n transition: transform var(--duration-fast) var(--ease-smooth-out), opacity var(--duration-fast) var(--ease-smooth-out), filter var(--duration-fast) var(--ease-smooth-out); }\n.rise.is-open { transform:none; opacity:1; filter:none; transition-duration: var(--duration-medium); }\n.rise.is-closing { pointer-events:none; }\n\n/* pick chrome (annotate mode): dim, outline, hint \u2014 shadow-root children */\n.dim { position:fixed; inset:0; z-index:1; pointer-events:none; background:rgba(0,0,0,.18); }\n.outline { position:fixed; z-index:2; pointer-events:none; border:2px solid var(--rec); border-radius:6px;\n box-shadow:0 0 0 4px rgba(255,59,87,.15); }\n.hint { position:fixed; top:14px; left:50%; transform:translateX(-50%); z-index:3; padding:calc(8px * var(--s)) calc(14px * var(--s));\n border-radius:999px; font-size:var(--fs); font-weight:600; line-height:1; white-space:nowrap; display:flex; gap:8px; align-items:center; }\n.hint svg { color:var(--rec); }\n.hint .keys { color:var(--fg-3); font-weight:500; margin-left:-4px; }\n@media (pointer: coarse) { .hint .keys { display:none; } }\n.hud[data-spot=\"tc\"] .hint { top:auto; bottom:14px; }\n\n/* sheets: a popover anchored to the dock, or a phone bottom sheet */\n.anchor { position:fixed; z-index:6; pointer-events:none; }\n.anchor > * { pointer-events:auto; }\n.phone { position:fixed; z-index:6; display:flex; flex-direction:column; justify-content:flex-end;\n padding:0 8px calc(8px + env(safe-area-inset-bottom, 0px)); pointer-events:none; }\n.phone > * { pointer-events:auto; }\n.pop { width:min(calc(288px * var(--s)), calc(100vw - 24px)); padding:calc(12px * var(--s)); border-radius:calc(14px * var(--s)); font-size:var(--fs); }\n.phone .pop { width:100%; border-radius:18px; padding:14px; }\n.pop-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }\n.title { display:flex; align-items:center; gap:7px; font-size:calc(var(--fs) + .5px); font-weight:600; color:var(--fg); }\n.title i { width:3px; height:11px; border-radius:1px; background:var(--rec); }\n.closeb { all:unset; box-sizing:border-box; cursor:pointer; width:24px; height:24px; border-radius:7px; color:var(--fg-3);\n display:inline-grid; place-items:center; font-size:12px; }\n.closeb:focus-visible, .sendb:focus-visible, .retry:focus-visible, .dest button:focus-visible { outline:2px solid var(--rec); outline-offset:2px; }\n@media (hover: hover) { .closeb:hover { color:var(--fg); background:var(--ink-2); } }\ntextarea { width:100%; margin-top:10px; padding:9px 11px; min-height:calc(64px * var(--s)); resize:vertical; background:rgba(0,0,0,.28);\n border:0; box-shadow:inset 0 0 0 1px var(--edge); border-radius:9px; color:var(--fg);\n font:400 calc(14px * var(--s))/1.4 -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif; }\n@media (pointer: coarse) { textarea { font-size:16px; } .hints { display:none; } }\ntextarea::placeholder { color:var(--fg-3); }\ntextarea:focus { outline:none; box-shadow:inset 0 0 0 1px var(--fg-3); }\n.row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; margin-top:10px; }\n.row.nodest { grid-template-columns:minmax(0,1fr) auto; }\n.ctx { font-size:var(--fs-s); line-height:1.35; color:var(--fg-3); text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.row.nodest .ctx { text-align:left; }\n.dest { display:inline-flex; padding:2px; border-radius:8px; background:rgba(0,0,0,.28); box-shadow:inset 0 0 0 1px var(--edge); }\n.dest button { all:unset; box-sizing:border-box; cursor:pointer; padding:5px 8px; min-height:24px; border-radius:6px; color:var(--fg-3);\n font-size:calc(var(--fs) - .5px); font-weight:600; line-height:14px; transition: background-color var(--duration-quick) var(--ease-out), color var(--duration-quick) var(--ease-out); }\n.dest button[aria-pressed=\"true\"] { background:var(--ink-2); color:var(--fg); }\n.sendb { all:unset; box-sizing:border-box; cursor:pointer; display:inline-flex; align-items:center; gap:6px; height:calc(28px * var(--s)); padding:0 12px;\n border-radius:8px; background:var(--rec); color:#fff; font-size:calc(var(--fs) + .5px); font-weight:600; line-height:1; text-decoration:none; }\n@media (hover: hover) { .sendb:hover { background:#ff5670; } }\n.hints { margin-top:9px; font-size:var(--fs-s); line-height:1; color:var(--fg-3); }\n";
13
20
  /**
14
21
  * Inline style of the HUD host: a 0×0 fixed box at the viewport origin (the
15
22
  * dock and sheets are fixed children of its shadow root). Zero-size keeps
16
- * rrweb's placeholder for this blocked node empty in every replay, and
17
- * `pointer-events:none` lets the page under the HUD's gaps take every
18
- * click. Overrides the [popover] UA sheet.
23
+ * rrweb's placeholder for this blocked node empty in every replay — rrweb 2
24
+ * has no "omit entirely" mode, a blocked node always leaves a sized
25
+ * placeholder — and `pointer-events:none` lets the page under the HUD's gaps
26
+ * take every click. Overrides the [popover] UA sheet.
19
27
  */
20
28
  export declare const HOST_STYLE: string;
21
29
  /** Inline style of a sheet host portaled into a dialog — the same 0×0 origin box. */
22
30
  export declare const SHEET_HOST_STYLE: string;
23
31
  /**
24
32
  * The PAGE (light-DOM) sheet while annotate mode owns the pointer — one
25
- * <style> in the page head, removed on exit. `touch-action:none` on every
26
- * element, not just the root: Chromium re-enables panning inside each inner
27
- * scroller, and it keeps a finger's drag a marquee even where a touchstart
28
- * cannot be cancelled (a tap that stops a fling). The rest (callout,
29
- * selection, tap flash) only matters to a finger, so a mouse-only desktop
30
- * renders exactly as before.
33
+ * <style> in the page head, removed on exit (it carries the rrweb block
34
+ * attribute, so the replay never sees it). The crosshair and no text
35
+ * selection apply to every pointer: a mouse drag over text must draw the
36
+ * marquee, never select the page. `touch-action:none` on every element, not
37
+ * just the root: Chromium re-enables panning inside each inner scroller, and
38
+ * it keeps a finger's drag a marquee even where a touchstart cannot be
39
+ * cancelled (a tap that stops a fling). The callout and tap flash only
40
+ * matter to a finger.
31
41
  */
32
42
  export declare const ANNOTATE_PAGE_CSS: string;
33
43
  /** Link-sheet additions (appended to HUD_CSS). */
34
- export declare const LINK_CSS = "\n.linkgrid { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 12px; align-items:center; margin-top:10px; }\n.linkgrid.noqr { grid-template-columns:minmax(0,1fr); }\n.code { font-size:22px; font-weight:700; line-height:1.2; letter-spacing:.08em; font-variant-numeric:tabular-nums; color:var(--fg); }\n.linkgrid .sendb { justify-self:start; margin-top:6px; }\n.qr { grid-column:2; grid-row:1 / span 3; width:76px; height:76px; border-radius:8px; background:#fff; padding:4px; }\n.linkline { margin-top:8px; font-size:11px; line-height:1.4; color:var(--fg-2); display:flex; gap:10px; align-items:center; }\n.linkline.bad { color:var(--warn); }\n.retry { all:unset; box-sizing:border-box; cursor:pointer; min-height:24px; padding:4px 9px; border-radius:7px; box-shadow:inset 0 0 0 1px var(--edge);\n color:var(--fg); font-size:11.5px; font-weight:600; line-height:1; }\n@media (hover: hover) { .retry:hover { background:var(--ink-2); } }\n";
44
+ export declare const LINK_CSS = "\n.linkgrid { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 12px; align-items:center; margin-top:10px; }\n.linkgrid.noqr { grid-template-columns:minmax(0,1fr); }\n.code { font-size:calc(22px * var(--s)); font-weight:700; line-height:1.2; letter-spacing:.08em; font-variant-numeric:tabular-nums; color:var(--fg); }\n.linkgrid .sendb { justify-self:start; margin-top:6px; }\n.qr { grid-column:2; grid-row:1 / span 3; width:76px; height:76px; border-radius:8px; background:#fff; padding:4px; }\n.linkline { margin-top:8px; font-size:var(--fs-s); line-height:1.4; color:var(--fg-2); display:flex; gap:10px; align-items:center; }\n.linkline.bad { color:var(--warn); }\n.retry { all:unset; box-sizing:border-box; cursor:pointer; min-height:24px; padding:4px 9px; border-radius:7px; box-shadow:inset 0 0 0 1px var(--edge);\n color:var(--fg); font-size:calc(var(--fs) - .5px); font-weight:600; line-height:1; }\n@media (hover: hover) { .retry:hover { background:var(--ink-2); } }\n";
35
45
  /** Reduced motion: no ripple, no springs, no slides — every state change is instant. */
36
- export declare const MOTION_CSS = "\n@media (prefers-reduced-motion: reduce) {\n .hud *, .hud *::before, .hud *::after { transition-duration:0ms !important; transition-delay:0ms !important; animation:none !important; }\n}\n";
46
+ export declare const MOTION_CSS = "\n@media (prefers-reduced-motion: reduce) {\n .hud *, .hud *::before, .hud *::after { transition-duration:0ms !important; transition-delay:0ms !important; animation:none !important; }\n .t-check { opacity:1; }\n .t-check svg path { stroke-dashoffset:0; }\n}\n";
37
47
  export declare const HUD_CSS: string;