beatsheet 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +57 -2
  3. package/bin/beatsheet.js +12 -0
  4. package/package.json +44 -4
  5. package/player/env.d.ts +5 -0
  6. package/player/gallery-audio.ts +147 -0
  7. package/player/gallery-css.ts +144 -0
  8. package/player/gallery-detail.ts +385 -0
  9. package/player/gallery-music.ts +257 -0
  10. package/player/gallery-pick-state.ts +167 -0
  11. package/player/gallery-pick.ts +749 -0
  12. package/player/gallery-sounds.ts +137 -0
  13. package/player/gallery-state.ts +457 -0
  14. package/player/gallery.ts +612 -0
  15. package/player/index.html +49 -0
  16. package/player/main.ts +83 -0
  17. package/skill/SKILL.md +637 -0
  18. package/skill/examples/library/assets/tour/avatar-mk.svg +1 -0
  19. package/skill/examples/library/assets/tour/dashboard-insights.svg +1 -0
  20. package/skill/examples/library/assets/tour/dashboard.svg +1 -0
  21. package/skill/examples/library/assets/tour/settings.svg +1 -0
  22. package/skill/examples/library/library-tour.plan.md +32 -0
  23. package/skill/examples/library/library-tour.video.json +268 -0
  24. package/skill/reference/scene-techniques.md +304 -0
  25. package/skill/scripts/beats.ts +42 -0
  26. package/skill/scripts/catalogue.ts +118 -0
  27. package/skill/scripts/frames.ts +105 -0
  28. package/src/args.ts +339 -0
  29. package/src/cli.ts +101 -0
  30. package/src/commands.ts +812 -0
  31. package/src/index.ts +47 -0
  32. package/src/paths.ts +17 -0
  33. package/src/project.ts +165 -0
  34. package/src/render/browser.ts +101 -0
  35. package/src/render/capture.ts +320 -0
  36. package/src/render/ffmpeg.ts +229 -0
  37. package/src/render/gif-info.ts +61 -0
  38. package/src/render/render.ts +220 -0
  39. package/src/samples.ts +557 -0
  40. package/src/server/api.ts +463 -0
  41. package/src/server/jobs.ts +210 -0
  42. package/src/server/security.ts +47 -0
  43. package/src/server/server.ts +184 -0
  44. package/src/server/sse.ts +76 -0
  45. package/src/server/static.ts +127 -0
  46. package/src/server/vite.ts +72 -0
  47. package/src/skill.ts +75 -0
  48. package/src/snap.ts +212 -0
  49. package/src/speech.ts +689 -0
  50. package/src/svg-text.ts +136 -0
  51. package/src/voicefx.ts +311 -0
  52. package/studio/3rdpartylicenses.txt +287 -0
  53. package/studio/favicon.ico +0 -0
  54. package/studio/icons/apple-touch-icon.png +0 -0
  55. package/studio/icons/icon-192.png +0 -0
  56. package/studio/icons/icon-512.png +0 -0
  57. package/studio/icons/icon.svg +1 -0
  58. package/studio/icons/maskable-512.png +0 -0
  59. package/studio/index.html +18 -0
  60. package/studio/main-YAPVEB24.js +15 -0
  61. package/studio/manifest.webmanifest +17 -0
  62. package/studio/offline.html +92 -0
  63. package/studio/styles-TKESX5FY.css +1 -0
  64. package/studio/sw.js +71 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dominik Strasser
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,58 @@
1
- # Temporary Holding Version
1
+ # beatsheet
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Short launch and feature videos as structured data. A video is a JSON file of scenes with texts, durations and
4
+ timing points; a local editor changes it without code; the renderer turns it into frame-exact MP4s (16:9, 4:5, 1:1,
5
+ 9:16) with music and sound effects. Change one scene's length and everything after it moves along, picture and
6
+ sound together.
7
+
8
+ ## Start
9
+
10
+ ```bash
11
+ mkdir my-videos && cd my-videos && npm init -y
12
+ npm install -D beatsheet @beatsheet/core @beatsheet/scenes
13
+ npx playwright install chromium-headless-shell # once per machine, for check, stills and render
14
+ ```
15
+
16
+ `beatsheet.config.ts` in that folder:
17
+
18
+ ```ts
19
+ import { defineProject } from '@beatsheet/core';
20
+ import { builtinScenes, defaultTheme } from '@beatsheet/scenes';
21
+
22
+ export default defineProject({ name: 'my-videos', theme: defaultTheme, scenes: builtinScenes });
23
+ ```
24
+
25
+ A first video to open and change: the library tour that comes with beatsheet (a tour of the built-in scene types,
26
+ with its images):
27
+
28
+ ```bash
29
+ mkdir -p videos assets
30
+ cp node_modules/beatsheet/skill/examples/library/library-tour.video.json videos/
31
+ cp -R node_modules/beatsheet/skill/examples/library/assets/tour assets/
32
+ npx beatsheet check videos/library-tour.video.json
33
+ ```
34
+
35
+ ```bash
36
+ npx beatsheet studio --open # editor + gallery of every scene type at http://localhost:4321
37
+ npx beatsheet check videos/library-tour.video.json # validation, layout and read-time warnings
38
+ npx beatsheet render videos/library-tour.video.json --format 16:9,4:5
39
+ npx beatsheet --help # every command and flag
40
+ ```
41
+
42
+ ## With Claude Code
43
+
44
+ ```bash
45
+ npx beatsheet skill install # copies the skill to ~/.claude/skills/beatsheet (--dir for another folder)
46
+ ```
47
+
48
+ Then ask for a launch, release or feature video in the project folder, or type `/beatsheet`. The agent researches
49
+ the change, plans the story, writes the video file, checks stills and renders both formats; you fine-tune it in the
50
+ studio. Run `npx beatsheet skill install --force` after updating beatsheet.
51
+
52
+ ## Notes
53
+
54
+ - Node 20.19+ or 22.12+. ffmpeg comes with `ffmpeg-static`; npm 11 may ask you to approve the install scripts of
55
+ `ffmpeg-static` (it downloads ffmpeg) and `esbuild` (it runs TypeScript): `npm approve-scripts ffmpeg-static esbuild`.
56
+ - Voice-over (`beatsheet speak`) needs `@beatsheet/voice-kokoro`, which is not on npm yet.
57
+ - MIT licensed. The studio bundles Angular and rxjs; their licences are in `studio/3rdpartylicenses.txt`. The
58
+ `ffmpeg-static` binary it runs is a GPL build of ffmpeg, used as a separate program.
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ // Registers tsx so the TypeScript sources (and the project's beatsheet.config.ts) load in Node.
3
+ import { register } from 'tsx/esm/api';
4
+
5
+ register();
6
+ const { main } = await import('../src/cli.ts');
7
+ const code = await main(process.argv.slice(2));
8
+ // Exit when the event loop is empty rather than with process.exit(): onnxruntime-node (loaded by a
9
+ // speech engine plugin in `speak` and the studio) aborts in its teardown on an explicit exit on
10
+ // macOS ("mutex lock failed", exit 134). Whatever still holds the loop open gets 2 s, then we exit.
11
+ process.exitCode = code;
12
+ setTimeout(() => process.exit(code), 2000).unref();
package/package.json CHANGED
@@ -1,6 +1,46 @@
1
1
  {
2
2
  "name": "beatsheet",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Short launch and feature videos as structured data: a JSON file per video, a local editor, frame-exact MP4 renders",
5
+ "license": "MIT",
6
+ "author": "Dominik Strasser",
7
+ "keywords": [
8
+ "video",
9
+ "launch-video",
10
+ "motion",
11
+ "mp4",
12
+ "playwright"
13
+ ],
14
+ "type": "module",
15
+ "bin": {
16
+ "beatsheet": "./bin/beatsheet.js"
17
+ },
18
+ "exports": {
19
+ ".": "./src/index.ts"
20
+ },
21
+ "scripts": {
22
+ "test": "vitest run",
23
+ "typecheck": "tsc -p tsconfig.json",
24
+ "prepack": "node scripts/prepack.mjs",
25
+ "postpack": "node scripts/postpack.mjs"
26
+ },
27
+ "dependencies": {
28
+ "@beatsheet/core": "0.1.0",
29
+ "ffmpeg-static": "^5.3.0",
30
+ "playwright": "1.63.0",
31
+ "tsx": "^4.20.0",
32
+ "vite": "^8.3.8"
33
+ },
34
+ "engines": {
35
+ "node": "^20.19.0 || >=22.12.0"
36
+ },
37
+ "files": [
38
+ "bin",
39
+ "src",
40
+ "player",
41
+ "studio",
42
+ "skill",
43
+ "LICENSE",
44
+ "README.md"
45
+ ]
46
+ }
@@ -0,0 +1,5 @@
1
+ declare module 'virtual:beatsheet/project' {
2
+ import type { ProjectConfig } from '@beatsheet/core';
3
+ const project: ProjectConfig;
4
+ export default project;
5
+ }
@@ -0,0 +1,147 @@
1
+ /**
2
+ * Live audio of the gallery page: one AudioContext, created on the first click that plays
3
+ * something (browsers allow it only from a user gesture), a master gain into the speakers, and
4
+ * playback of a rendered buffer with a clock.
5
+ */
6
+ import { mulberry32, type FileSound, type SoundDef } from '@beatsheet/core';
7
+
8
+ function isFileSound(def: SoundDef): def is FileSound {
9
+ return typeof (def as Partial<FileSound>).url === 'string';
10
+ }
11
+
12
+ let ctx: AudioContext | null = null;
13
+ let master: GainNode | null = null;
14
+
15
+ /** The page's AudioContext. Call it from a click handler the first time. Null when the browser has none. */
16
+ export function liveContext(): AudioContext | null {
17
+ if (!ctx) {
18
+ const Ctor = (globalThis as { AudioContext?: typeof AudioContext }).AudioContext;
19
+ if (!Ctor) return null;
20
+ try {
21
+ ctx = new Ctor({ latencyHint: 'interactive' });
22
+ master = ctx.createGain();
23
+ master.gain.value = 0.9;
24
+ master.connect(ctx.destination);
25
+ } catch (err) {
26
+ console.warn(`[beatsheet gallery] no AudioContext: ${err instanceof Error ? err.message : String(err)}`);
27
+ ctx = null;
28
+ return null;
29
+ }
30
+ }
31
+ if (ctx.state === 'suspended') void ctx.resume();
32
+ return ctx;
33
+ }
34
+
35
+ function out(): AudioNode {
36
+ return master as GainNode;
37
+ }
38
+
39
+ /**
40
+ * Silences everything the page plays now (one-shot sounds, mixes): the master bus is swapped for a
41
+ * fresh one, so sources already scheduled on the old bus are cut off. Players keep their own stop().
42
+ */
43
+ export function silenceAll(): void {
44
+ if (!ctx || !master) return;
45
+ master.disconnect();
46
+ master = ctx.createGain();
47
+ master.gain.value = 0.9;
48
+ master.connect(ctx.destination);
49
+ }
50
+
51
+ const decoded = new Map<string, Promise<AudioBuffer>>();
52
+
53
+ /** Fetch and decode an audio file once per URL. */
54
+ export function decodeUrl(context: BaseAudioContext, url: string): Promise<AudioBuffer> {
55
+ let p = decoded.get(url);
56
+ if (!p) {
57
+ p = fetch(url)
58
+ .then((res) => {
59
+ if (!res.ok) throw new Error(`HTTP ${res.status} for ${url}`);
60
+ return res.arrayBuffer();
61
+ })
62
+ .then((bytes) => context.decodeAudioData(bytes));
63
+ decoded.set(url, p);
64
+ p.catch(() => decoded.delete(url));
65
+ }
66
+ return p;
67
+ }
68
+
69
+ /** A fixed seed per sound id, so a synth sounds the same on every click. */
70
+ export function soundSeed(id: string): number {
71
+ let h = 7;
72
+ for (let i = 0; i < id.length; i++) h = (Math.imul(h, 31) + id.charCodeAt(i)) >>> 0;
73
+ return h;
74
+ }
75
+
76
+ /** Plays a theme sound now. Resolves with its length in seconds (approximate for synths). */
77
+ export async function playSound(id: string, def: SoundDef): Promise<number> {
78
+ const context = liveContext();
79
+ if (!context) throw new Error('this browser has no AudioContext');
80
+ const when = context.currentTime + 0.05;
81
+ if (isFileSound(def)) {
82
+ const buffer = await decodeUrl(context, def.url);
83
+ const src = context.createBufferSource();
84
+ src.buffer = buffer;
85
+ src.connect(out());
86
+ src.start(Math.max(when, context.currentTime));
87
+ return buffer.duration;
88
+ }
89
+ def.synth(context, out(), when, 1, mulberry32(soundSeed(id)));
90
+ return 1;
91
+ }
92
+
93
+ /** A buffer playing from `offset`; `time()` follows the audio clock. */
94
+ export interface Playback {
95
+ time(): number;
96
+ stop(): void;
97
+ /** True when sound plays (false: a silent clock, e.g. without AudioContext or when the mix failed). */
98
+ audible: boolean;
99
+ }
100
+
101
+ /** Plays `buffer` (or, without one, a silent clock) from `offset` seconds. */
102
+ export function startPlayback(buffer: AudioBuffer | null, offset: number): Playback {
103
+ const context = buffer ? liveContext() : null;
104
+ if (!buffer || !context) {
105
+ const t0 = performance.now();
106
+ return { time: () => offset + (performance.now() - t0) / 1000, stop: () => undefined, audible: false };
107
+ }
108
+ const src = context.createBufferSource();
109
+ src.buffer = buffer;
110
+ src.connect(out());
111
+ const startAt = context.currentTime + 0.03;
112
+ src.start(startAt, Math.min(Math.max(0, offset), buffer.duration));
113
+ let stopped = false;
114
+ return {
115
+ audible: true,
116
+ time: () => offset + Math.max(0, context.currentTime - startAt),
117
+ stop: (): void => {
118
+ if (stopped) return;
119
+ stopped = true;
120
+ try {
121
+ src.stop();
122
+ } catch {
123
+ // already ended
124
+ }
125
+ src.disconnect();
126
+ },
127
+ };
128
+ }
129
+
130
+ /** Renders a sound offline (mono, 22.05 kHz) for its waveform. */
131
+ export async function renderSoundOffline(id: string, def: SoundDef, seconds = 3): Promise<Float32Array> {
132
+ const Ctor = (globalThis as { OfflineAudioContext?: typeof OfflineAudioContext }).OfflineAudioContext;
133
+ if (!Ctor) return new Float32Array(0);
134
+ const rate = 22050;
135
+ const off = new Ctor({ numberOfChannels: 1, length: Math.round(seconds * rate), sampleRate: rate });
136
+ if (isFileSound(def)) {
137
+ const buffer = await decodeUrl(off, def.url);
138
+ const src = off.createBufferSource();
139
+ src.buffer = buffer;
140
+ src.connect(off.destination);
141
+ src.start(0);
142
+ } else {
143
+ def.synth(off, off.destination, 0.01, 1, mulberry32(soundSeed(id)));
144
+ }
145
+ const rendered = await off.startRendering();
146
+ return rendered.getChannelData(0);
147
+ }
@@ -0,0 +1,144 @@
1
+ /** Styles of the gallery page (the studio's calm dark editor look). Scene previews keep their own theme. */
2
+ export const GALLERY_CSS = `
3
+ :root.bs-gallery {
4
+ --g-bg: #141518; --g-panel: #1b1c20; --g-panel-2: #22242a; --g-panel-3: #2a2d34;
5
+ --g-border: #30333b; --g-border-strong: #3d414b; --g-text: #e4e5e9; --g-muted: #959aa5; --g-faint: #6b707b;
6
+ --g-accent: #7aa2f7; --g-accent-soft: rgba(122, 162, 247, 0.16); --g-warn: #e0b85c; --g-error: #f07a7a; --g-ok: #7fcf96;
7
+ --g-radius: 6px; --g-font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
8
+ --g-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
9
+ color-scheme: dark;
10
+ }
11
+ /* The viewport scrolls (body must not be a scroll container, or the sticky header would not stick). */
12
+ html.bs-gallery { overflow: auto; background: var(--g-bg); }
13
+ html.bs-gallery body { overflow: visible; background: var(--g-bg); height: auto; }
14
+ html.bs-gallery body { color: var(--g-text); font: 13px/1.45 var(--g-font); min-height: 100vh; }
15
+ html.bs-gallery #beatsheet-player { display: none; }
16
+ .bs-gallery * { box-sizing: border-box; }
17
+ .bs-gallery button, .bs-gallery input { font: inherit; color: inherit; }
18
+ .bs-gallery button {
19
+ background: var(--g-panel-3); border: 1px solid var(--g-border-strong); border-radius: var(--g-radius);
20
+ padding: 3px 10px; cursor: pointer; min-height: 26px;
21
+ }
22
+ .bs-gallery button:hover:not(:disabled) { background: #333741; }
23
+ .bs-gallery button:disabled { opacity: 0.45; cursor: default; }
24
+ .bs-gallery button.g-primary { background: var(--g-accent); border-color: var(--g-accent); color: #0d1424; font-weight: 600; }
25
+ .bs-gallery button.g-primary:hover:not(:disabled) { background: #8fb2fa; }
26
+ .bs-gallery :focus-visible { outline: 2px solid var(--g-accent); outline-offset: 1px; }
27
+ .bs-gallery code { font-family: var(--g-mono); font-size: 11px; color: var(--g-muted); }
28
+ .bs-gallery input[type='search'] {
29
+ background: var(--g-bg); border: 1px solid var(--g-border); border-radius: var(--g-radius); padding: 3px 8px; min-height: 26px; width: 220px;
30
+ }
31
+ .bs-gallery input[type='search']:focus { border-color: var(--g-accent); outline: none; }
32
+ .bs-gallery input[type='checkbox'] { accent-color: var(--g-accent); margin: 0; }
33
+
34
+ .g-head { position: sticky; top: 0; z-index: 20; background: var(--g-panel); border-bottom: 1px solid var(--g-border); }
35
+ .g-row { display: flex; align-items: center; gap: 10px; padding: 7px 14px; flex-wrap: wrap; }
36
+ .g-row[hidden] { display: none; }
37
+ .g-row + .g-row { border-top: 1px solid var(--g-border); padding-top: 6px; }
38
+ .g-brand { font-weight: 700; color: var(--g-accent); letter-spacing: 0.02em; }
39
+ .g-sub { color: var(--g-muted); }
40
+ .g-spacer { flex: 1; }
41
+ .g-seg { display: inline-flex; border: 1px solid var(--g-border-strong); border-radius: var(--g-radius); overflow: hidden; }
42
+ .bs-gallery .g-seg button { border: 0; border-radius: 0; background: transparent; color: var(--g-muted); min-height: 24px; }
43
+ .bs-gallery .g-seg button + button { border-left: 1px solid var(--g-border); }
44
+ .bs-gallery .g-seg button[aria-pressed='true'] { background: var(--g-accent-soft); color: var(--g-text); }
45
+ .g-tabs { display: inline-flex; gap: 2px; }
46
+ .bs-gallery .g-tabs button { background: transparent; border-color: transparent; color: var(--g-muted); }
47
+ .bs-gallery .g-tabs button[aria-selected='true'] { color: var(--g-text); border-color: var(--g-border-strong); background: var(--g-panel-2); }
48
+ .g-count { color: var(--g-faint); font-size: 11px; margin-left: 4px; font-variant-numeric: tabular-nums; }
49
+ .g-label { color: var(--g-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
50
+ .g-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
51
+ .bs-gallery .g-chip { border-radius: 999px; padding: 1px 10px; min-height: 24px; background: transparent; color: var(--g-muted); }
52
+ .bs-gallery .g-chip[aria-pressed='true'] { background: var(--g-accent-soft); border-color: var(--g-accent); color: var(--g-text); }
53
+ .g-check { display: inline-flex; align-items: center; gap: 6px; color: var(--g-muted); cursor: pointer; }
54
+ .g-summary { color: var(--g-faint); font-size: 12px; font-variant-numeric: tabular-nums; }
55
+
56
+ .g-main { padding: 6px 14px 80px; }
57
+ .g-panel[hidden] { display: none; }
58
+ .g-empty { color: var(--g-muted); padding: 40px 0; text-align: center; }
59
+ .g-cat { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 6px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--g-muted); border-bottom: 1px solid var(--g-border); padding-bottom: 4px; }
60
+ .g-type { margin: 10px 0 18px; }
61
+ .g-type-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
62
+ .g-type-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
63
+ .g-type-head p { margin: 0; color: var(--g-muted); flex-basis: 100%; }
64
+ .g-tiles { display: flex; flex-wrap: wrap; gap: 10px; }
65
+ .g-tile { background: var(--g-panel); border: 1px solid var(--g-border); border-radius: var(--g-radius); padding: 6px; cursor: pointer; position: relative; }
66
+ .g-tile:hover { border-color: var(--g-faint); }
67
+ .g-tile:focus-visible { outline: 2px solid var(--g-accent); }
68
+ .g-previews { display: flex; gap: 6px; align-items: flex-start; }
69
+ .g-preview { position: relative; overflow: hidden; background: #0c0c0e; border-radius: 3px; box-shadow: 0 0 0 1px var(--g-border); }
70
+ .g-holder { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
71
+ .g-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 8px; text-align: center; font-size: 11px; color: var(--g-faint); background: linear-gradient(135deg, #131318, #0c0c0e); }
72
+ .g-tile.live .g-ph { display: none; }
73
+ .g-preview-label { position: absolute; right: 4px; bottom: 3px; font: 10px/1 var(--g-mono); color: rgba(255,255,255,0.75); background: rgba(0,0,0,0.45); padding: 2px 4px; border-radius: 3px; }
74
+ .g-tile-meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; min-height: 18px; }
75
+ .g-tile-title { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
76
+ .g-dur { color: var(--g-faint); font-size: 11px; font-variant-numeric: tabular-nums; }
77
+ .g-badge { font-size: 10px; line-height: 15px; padding: 0 5px; border-radius: 3px; border: 1px solid var(--g-border-strong); color: var(--g-muted); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
78
+ .g-badge.stress { color: var(--g-warn); border-color: rgba(224, 184, 92, 0.5); }
79
+ .g-badge.file { color: var(--g-ok); border-color: rgba(127, 207, 150, 0.45); }
80
+ .g-badge.library { color: var(--g-accent); border-color: rgba(122, 162, 247, 0.45); }
81
+ .g-progress { position: absolute; left: 6px; right: 6px; height: 2px; background: transparent; overflow: hidden; }
82
+ .g-progress i { display: block; height: 100%; background: var(--g-accent); transform-origin: 0 0; transform: scaleX(0); opacity: 0.8; }
83
+ .g-error { color: var(--g-error); font-size: 11px; padding: 6px; }
84
+
85
+ /* Large view */
86
+ .g-detail { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.6); display: flex; padding: 18px; }
87
+ .g-detail[hidden] { display: none; }
88
+ .g-detail-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--g-panel); border: 1px solid var(--g-border-strong); border-radius: 10px; overflow: hidden; }
89
+ .g-detail-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--g-border); }
90
+ .g-detail-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
91
+ .g-detail-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
92
+ .g-detail-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #0c0c0e; }
93
+ .g-detail-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px; overflow: hidden; }
94
+ .g-transport { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--g-panel); border-top: 1px solid var(--g-border); }
95
+ .g-time { font-family: var(--g-mono); font-variant-numeric: tabular-nums; min-width: 110px; }
96
+ .g-scrub { position: relative; flex: 1; display: flex; align-items: center; }
97
+ .g-scrub input { width: 100%; accent-color: var(--g-accent); margin: 0; }
98
+ .g-beat-marks { position: absolute; left: 8px; right: 8px; top: -6px; height: 5px; pointer-events: none; }
99
+ .g-beat-marks i { position: absolute; top: 0; width: 1px; height: 5px; background: var(--g-muted); }
100
+ .g-detail-side { overflow: auto; padding: 12px 14px 30px; border-left: 1px solid var(--g-border); }
101
+ .g-detail-side h4 { margin: 14px 0 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--g-muted); display: flex; align-items: center; gap: 6px; }
102
+ .g-detail-side h4:first-child { margin-top: 0; }
103
+ .g-detail-side p { margin: 0 0 8px; color: var(--g-muted); }
104
+ .g-json { margin: 0; padding: 8px 10px; background: var(--g-bg); border: 1px solid var(--g-border); border-radius: var(--g-radius); font: 11px/1.45 var(--g-mono); white-space: pre-wrap; word-break: break-word; max-height: 46vh; overflow: auto; user-select: text; }
105
+ .g-list { list-style: none; margin: 0; padding: 0; }
106
+ .g-list li { display: flex; gap: 8px; padding: 2px 0; font-size: 12px; }
107
+ .g-list li span:first-child { font-family: var(--g-mono); color: var(--g-faint); min-width: 52px; font-variant-numeric: tabular-nums; }
108
+ .bs-gallery .g-list button { background: none; border: 0; padding: 0; min-height: 0; color: var(--g-text); text-align: left; }
109
+ .bs-gallery .g-list button:hover { color: var(--g-accent); background: none; }
110
+ .g-copied { color: var(--g-ok); font-size: 11px; }
111
+
112
+ /* Sound board */
113
+ .g-sound-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
114
+ .bs-gallery .g-sound { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 2px 10px; text-align: left; padding: 8px 10px; background: var(--g-panel); border-color: var(--g-border); }
115
+ .bs-gallery .g-sound:hover { border-color: var(--g-faint); background: var(--g-panel-2); }
116
+ .bs-gallery .g-sound.playing { border-color: var(--g-accent); background: var(--g-accent-soft); }
117
+ .g-sound-icon { grid-row: span 3; align-self: center; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--g-panel-3); color: var(--g-accent); font-size: 11px; }
118
+ .g-sound-name { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
119
+ .g-sound-name strong { font-weight: 600; }
120
+ .g-sound p { margin: 0; color: var(--g-muted); font-size: 12px; }
121
+ .g-wave { width: 100%; height: 28px; display: block; }
122
+
123
+ /* Music browser */
124
+ .g-music-head { position: sticky; top: var(--g-head-h, 84px); z-index: 10; background: var(--g-bg); padding: 10px 0 8px; border-bottom: 1px solid var(--g-border); display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 8px 14px; align-items: start; }
125
+ .g-music-preview { grid-row: span 2; }
126
+ .g-music-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
127
+ .g-music-now { color: var(--g-muted); }
128
+ .g-music-now strong { color: var(--g-text); font-weight: 600; }
129
+ .g-tl { position: relative; height: 54px; background: var(--g-panel); border: 1px solid var(--g-border); border-radius: var(--g-radius); overflow: hidden; cursor: pointer; }
130
+ .g-tl-block { position: absolute; top: 6px; bottom: 6px; background: #2b3140; border: 1px solid var(--g-border-strong); border-radius: 4px; padding: 3px 6px; overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
131
+ .g-tl-block span { display: block; color: var(--g-faint); font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
132
+ .g-tl-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #f2f3f5; pointer-events: none; }
133
+ .g-tracks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
134
+ .g-track { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 8px 10px; background: var(--g-panel); border: 1px solid var(--g-border); border-radius: var(--g-radius); }
135
+ .g-track.playing { border-color: var(--g-accent); background: var(--g-accent-soft); }
136
+ .g-track p { margin: 0; color: var(--g-muted); font-size: 12px; grid-column: 2; }
137
+ .g-track-name { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
138
+ .g-track-name strong { font-weight: 600; }
139
+ .g-track .g-state { grid-row: span 2; color: var(--g-faint); font-size: 11px; }
140
+ .bs-gallery .g-play { grid-row: span 2; min-width: 64px; }
141
+ .g-parts { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
142
+ .bs-gallery .g-part { min-height: 0; padding: 1px 8px; font-size: 11px; border-radius: 10px; }
143
+ .bs-gallery .g-part[aria-pressed='true'] { text-decoration: line-through; color: var(--g-faint); border-style: dashed; }
144
+ `;