SeaWolf-AI commited on
Commit
e75bcbc
·
verified ·
1 Parent(s): f4f4513

Load reel pictures eagerly and fade them in

Browse files
Files changed (3) hide show
  1. app.js +1 -1
  2. index.html +301 -301
  3. style.css +282 -281
app.js CHANGED
@@ -204,7 +204,7 @@ const samplesReady = fetch("examples/samples.json")
204
  list.forEach((s, i) => $("sampleSelect").insertAdjacentHTML("beforeend", `<option value="${i}">${i + 1}. ${esc(s.name)}</option>`));
205
  demoFiles = [...new Set(list.flatMap((s) => s.files))];
206
  const reelFiles = [...demoFiles, ...EGG_PHOTOS.map((p) => p.file)];
207
- $("reel").innerHTML = [...reelFiles, ...reelFiles].map((f) => `<img src="${f}" alt="" loading="lazy" />`).join("");
208
  return list;
209
  })
210
  .catch((e) => console.warn("samples.json", e));
 
204
  list.forEach((s, i) => $("sampleSelect").insertAdjacentHTML("beforeend", `<option value="${i}">${i + 1}. ${esc(s.name)}</option>`));
205
  demoFiles = [...new Set(list.flatMap((s) => s.files))];
206
  const reelFiles = [...demoFiles, ...EGG_PHOTOS.map((p) => p.file)];
207
+ $("reel").innerHTML = [...reelFiles, ...reelFiles].map((f) => `<img src="${f}" alt="" decoding="async" onload="this.classList.add('in')" />`).join("");
208
  return list;
209
  })
210
  .catch((e) => console.warn("samples.json", e));
index.html CHANGED
@@ -1,301 +1,301 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
6
- <meta name="referrer" content="no-referrer" />
7
- <meta name="theme-color" content="#f5f7fb" />
8
- <title>Decide Live</title>
9
- <meta name="description" content="Decide Live: on-device decisions from camera and microphone. A multimodal embedding model runs in your browser and turns every frame into calibrated probabilities." />
10
- <link rel="preconnect" href="https://fonts.googleapis.com" />
11
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
12
- <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;700&display=swap" />
13
- <link rel="stylesheet" href="./style.css?v=6" />
14
- </head>
15
- <body>
16
- <header class="top">
17
- <span class="glow a" aria-hidden="true"></span><span class="glow b" aria-hidden="true"></span><span class="glow c" aria-hidden="true"></span>
18
- <div class="wrap topbar">
19
- <div class="brand">
20
- <span class="eyebrow"><span class="pulse"></span>Decide Live</span>
21
- <h1>See it. <span class="lit">Decide it.</span><br />Right in your browser.</h1>
22
- <p class="sub">On-device decisions from camera and microphone. Every frame is embedded in your browser by EmbeddingGemma 2, fine-tuned for decisions, and scored against the options you write. No text generation, no tokens, no server.</p>
23
- <div class="stats">
24
- <span class="stat"><b>95%</b> on 100 held-out egg photos</span>
25
- <span class="stat"><b>0</b> bytes uploaded</span>
26
- <span class="stat"><b>744M</b> parameters, 4-bit</span>
27
- <span class="stat"><b>0</b> tokens generated</span>
28
- </div>
29
- </div>
30
- <div class="statusbox">
31
- <div class="status" id="status"><span class="dot"></span><span id="statusText">Model not loaded</span></div>
32
- <div class="chips"><span id="backend" class="chip"></span><span class="chip safe">0 bytes uploaded</span></div>
33
- <div class="progress" id="progressWrap" hidden><div id="progressBar"></div></div>
34
- <p class="warn" id="wasmNote" hidden>WebGPU is not available here, so the model runs on the CPU (WASM). The live rate is lowered automatically.</p>
35
- </div>
36
- </div>
37
- <div class="reel" aria-hidden="true"><div class="reel-track" id="reel"></div></div>
38
- <nav class="wrap tabs" role="tablist">
39
- <button class="tab active" data-tab="live" role="tab">Live</button>
40
- <button class="tab" data-tab="single" role="tab">Single input</button>
41
- <button class="tab" data-tab="egg" role="tab">Egg check</button>
42
- <button class="tab" data-tab="samples" role="tab">Sample tests</button>
43
- <button class="tab" data-tab="about" role="tab">How it works</button>
44
- </nav>
45
- </header>
46
-
47
- <!-- LIVE -->
48
- <main class="wrap view" data-view="live">
49
- <div class="livegrid">
50
- <section class="stagecol">
51
- <div class="sources">
52
- <button class="src active" data-src="demo">Demo feed</button>
53
- <button class="src" data-src="camera">Camera</button>
54
- <button class="src" data-src="mic">Microphone</button>
55
- <button class="ghost" id="flipBtn" hidden title="Switch front and back camera">Flip camera</button>
56
- </div>
57
- <div class="stage" id="stage">
58
- <video id="cam" playsinline muted autoplay></video>
59
- <canvas id="feed"></canvas>
60
- <div class="scan" aria-hidden="true"></div>
61
- <div class="badge"><span class="pulse"></span>Runs on your device. 0 bytes uploaded.</div>
62
- <div class="hud" id="hud"><span id="fpsVal">0.0</span> fps <span class="sep">|</span> <span id="latVal">0</span> <span id="latUnit" class="unit">ms / frame</span></div>
63
- <div class="overlay" id="overlay" hidden>
64
- <svg class="ring" viewBox="0 0 120 120" aria-hidden="true">
65
- <circle class="ring-bg" cx="60" cy="60" r="52" />
66
- <circle class="ring-fg" id="ringFg" cx="60" cy="60" r="52" />
67
- </svg>
68
- <div class="ovtext">
69
- <div class="ovq" id="ovQuestion"></div>
70
- <div class="ovlabel" id="ovLabel">...</div>
71
- <div class="ovpct" id="ovPct"></div>
72
- </div>
73
- </div>
74
- <div class="idle" id="idle">
75
- <button class="big" id="startBtn">Start live decisions</button>
76
- <p>Loads the model on first start (about 260 to 290 MB at 4 bits, cached afterwards).</p>
77
- </div>
78
- </div>
79
- <div class="controls">
80
- <button id="stopBtn" class="ghost" disabled>Stop</button>
81
- <label>Speed
82
- <select id="rateSel">
83
- <option value="auto">Auto</option>
84
- <option value="5">up to 5 per second</option>
85
- <option value="2">up to 2 per second</option>
86
- <option value="1">1 per second</option>
87
- </select>
88
- </label>
89
- <label>Detail
90
- <select id="budgetSel">
91
- <option value="70" selected>fast (70 image tokens)</option>
92
- <option value="140">balanced (140)</option>
93
- <option value="280">fine (280)</option>
94
- </select>
95
- </label>
96
- <label>Prompt
97
- <select id="livePrompt">
98
- <option value="trained" selected>question + frame, as trained (one pass per card)</option>
99
- <option value="alone">frame alone (one pass for all cards)</option>
100
- </select>
101
- </label>
102
- <label>Smoothing
103
- <select id="smoothSel">
104
- <option value="0">off</option>
105
- <option value="0.5" selected>light</option>
106
- <option value="0.8">strong</option>
107
- </select>
108
- </label>
109
- </div>
110
- <div class="gate">
111
- <div><span class="gnum" id="gOnDevice">0</span><span class="glab">decided on device</span></div>
112
- <div><span class="gnum warnc" id="gEscalate">0</span><span class="glab">would escalate</span></div>
113
- <div><span class="gnum accent" id="gRate">-</span><span class="glab">on-device rate</span></div>
114
- <button class="ghost small" id="resetGate">Reset</button>
115
- </div>
116
- <div class="stream">
117
- <div class="streamhead"><h3>Decision stream</h3><span class="note">Each row is a real decision made in this browser just now.</span></div>
118
- <ol class="streamlist" id="stream"></ol>
119
- </div>
120
- <p class="note">When a card's top probability is below its threshold the frame is marked uncertain: in a production system it would go to a larger model. Here nothing is sent anywhere; it is only counted.</p>
121
- </section>
122
-
123
- <section class="cardcol">
124
- <div class="cardhead">
125
- <h2 id="cardsTitle">Decisions on every frame</h2>
126
- <span class="note" id="cardsCount"></span>
127
- </div>
128
- <div id="cards" class="cards"></div>
129
- <div class="templates">
130
- <h3>Add a decision (up to 4)</h3>
131
- <div id="templates" class="tpls"></div>
132
- <button class="ghost small" id="customBtn">+ Custom decision</button>
133
- </div>
134
- </section>
135
- </div>
136
- </main>
137
-
138
- <!-- SINGLE -->
139
- <main class="wrap view grid2" data-view="single" hidden>
140
- <section class="panel">
141
- <h2>1. Input</h2>
142
- <div class="subtabs" role="tablist">
143
- <button class="subtab active" data-kind="image">Image</button>
144
- <button class="subtab" data-kind="text">Text</button>
145
- <button class="subtab" data-kind="audio">Audio</button>
146
- <button class="subtab" data-kind="video">Video</button>
147
- </div>
148
- <div class="pane" data-pane="image">
149
- <label class="col">Sample
150
- <select id="sampleSelect"><option value="">(choose one of the 18 sample tests)</option></select>
151
- </label>
152
- <label class="drop"><input type="file" id="imageFile" accept="image/*" /><span>or upload an image (stays on this device)</span></label>
153
- <img id="imagePreview" alt="" hidden />
154
- </div>
155
- <div class="pane" data-pane="text" hidden>
156
- <textarea id="textInput" rows="6" placeholder="Paste the text to decide about"></textarea>
157
- </div>
158
- <div class="pane" data-pane="audio" hidden>
159
- <label class="drop"><input type="file" id="audioFile" accept="audio/*" /><span>Upload an audio clip (up to 60 s, resampled to mono 16 kHz)</span></label>
160
- <audio id="audioPreview" controls hidden></audio>
161
- <p class="note">Audio needs the extra audio encoder (about 190 MB at q4), loaded on first use.</p>
162
- </div>
163
- <div class="pane" data-pane="video" hidden>
164
- <label class="drop"><input type="file" id="videoFile" accept="video/*" /><span>Upload a short video (up to 16 frames are sampled evenly)</span></label>
165
- <video id="videoPreview" controls muted playsinline hidden></video>
166
- </div>
167
- </section>
168
-
169
- <section class="panel">
170
- <h2>2. Question and options</h2>
171
- <div class="seg" role="radiogroup">
172
- <label><input type="radio" name="mode" value="choice" checked /> Options</label>
173
- <label><input type="radio" name="mode" value="yesno" /> Yes / no</label>
174
- </div>
175
- <label class="col">Context (optional)
176
- <input id="contextInput" type="text" placeholder="e.g. Candling photo: a light is shone through the egg" />
177
- </label>
178
- <label class="col"><span id="questionLabel">Question</span>
179
- <input id="questionInput" type="text" placeholder="e.g. Is this egg good or bad?" />
180
- </label>
181
- <label class="col" id="optionsWrap">Options, 2 to 8, one per line as <code>key: description</code>
182
- <textarea id="optionsInput" rows="6" placeholder="good: Normal, healthy egg&#10;bad: Defective, spoiled or damaged egg"></textarea>
183
- </label>
184
- <p class="note" id="yesnoNote" hidden>In the trained format (default), the question stays in the query and the two options are "Yes" and "No". The older formats build two options from the statement: the statement and its negation, or for a question, the question followed by "Yes." and by "No.".</p>
185
- <details class="adv">
186
- <summary>Settings</summary>
187
- <label class="col">Temperature <span id="tempVal">0.0501</span> <button type="button" class="ghost small" id="resetTemp">Use trained value</button>
188
- <input type="range" id="temp" min="0.005" max="0.5" step="0.0001" value="0.0501" />
189
- </label>
190
- <label class="col">Prompt format
191
- <select id="preset"></select>
192
- </label>
193
- <label class="col">Image detail (also used by the sample tests)
194
- <select id="budgetSingle">
195
- <option value="auto">Auto: 280 image tokens on WebGPU, 70 on CPU</option>
196
- <option value="70">70 (fast)</option>
197
- <option value="140">140</option>
198
- <option value="280">280 (model default)</option>
199
- </select>
200
- </label>
201
- <label class="col">Precision (applies on next load)
202
- <select id="dtype">
203
- <option value="auto">Auto: 4-bit (q4f16 on WebGPU with fp16 support, else q4)</option>
204
- <option value="q4">q4 (4-bit, works everywhere, also on the CPU)</option>
205
- <option value="q4f16">q4f16 (4-bit weights, fp16 math; WebGPU with fp16 only)</option>
206
- </select>
207
- </label>
208
- <label class="col">Backend (applies on next load)
209
- <select id="device">
210
- <option value="auto">Auto (WebGPU, else WASM)</option>
211
- <option value="webgpu">WebGPU</option>
212
- <option value="wasm">WASM (CPU)</option>
213
- </select>
214
- </label>
215
- </details>
216
- <button id="decideBtn" class="primary">Decide</button>
217
- </section>
218
-
219
- <section class="panel wide" id="resultCard" hidden>
220
- <h2>3. Decision</h2>
221
- <div id="result"></div>
222
- </section>
223
- </main>
224
-
225
- <!-- EGG CHECK -->
226
- <main class="wrap view" data-view="egg" hidden>
227
- <section class="panel">
228
- <h2>Egg check</h2>
229
- <p class="note">Candling photos (a light shone through the egg in a dark room). The decision uses the format the model was trained with:
230
- the photo with <code>Is this egg good or bad?</code> and the candling context, scored against <code>Normal, healthy egg</code> and
231
- <code>Defective, spoiled or damaged egg</code>. The 8 photos below are held out: they were not used in training. Pick one, run all 8, or use your own photo.</p>
232
- <div class="egggrid" id="eggGrid"></div>
233
- <div class="btnrow">
234
- <button id="eggRunAll" class="primary inline">Check all 8</button>
235
- <label class="drop inline"><input type="file" id="eggFile" accept="image/*" /><span>Use your own candling photo (stays on this device)</span></label>
236
- </div>
237
- <div id="eggSummary" class="summary"></div>
238
- <div class="eggresult" id="eggResult" hidden>
239
- <img id="eggPreview" alt="Selected egg photo" />
240
- <div id="eggOut"></div>
241
- </div>
242
- <div class="tablewrap"><table id="eggTable" hidden>
243
- <thead><tr><th>Photo</th><th>Gold</th><th>Decision</th><th>p(good)</th><th>p(bad)</th><th>OK</th><th>ms</th></tr></thead>
244
- <tbody></tbody>
245
- </table></div>
246
- <p class="note">Photos: Good and Bad Eggs Identification Image Dataset (Mendeley Data, doi:10.17632/mdty358x8m.1), CC BY 4.0. See <a href="./CREDITS.md" target="_blank">CREDITS.md</a>.</p>
247
- </section>
248
- </main>
249
-
250
- <!-- SAMPLES -->
251
- <main class="wrap view" data-view="samples" hidden>
252
- <section class="panel">
253
- <h2>Sample tests (18)</h2>
254
- <p class="note">Counting, yes / no, spatial relations, a chart, a receipt, app screens, scene text, common sense and egg candling (the egg photos are held out from training; the other images may come from datasets the training mix drew on). Each test runs in this browser with the prompt format, image detail and temperature chosen under Single input &gt; Settings. In the trained format, yes / no tests keep the question in the query and score the options "Yes" and "No"; the older formats use the yes / no mode (the question followed by "Yes." or "No.").</p>
255
- <div class="btnrow">
256
- <button id="runAllBtn" class="primary inline">Run all samples</button>
257
- <button id="compareBtn" class="ghost">Compare all prompt formats</button>
258
- </div>
259
- <div id="runAllSummary" class="summary"></div>
260
- <div class="tablewrap"><table id="compareTable" hidden>
261
- <thead><tr><th>Prompt format</th><th>Accuracy</th><th>Mean ms / test</th></tr></thead><tbody></tbody>
262
- </table></div>
263
- <div class="tablewrap"><table id="runAllTable" hidden>
264
- <thead><tr><th>#</th><th>Test</th><th>Type</th><th>Gold</th><th>Decision</th><th>p</th><th>OK</th><th>ms</th></tr></thead>
265
- <tbody></tbody>
266
- </table></div>
267
- </section>
268
- </main>
269
-
270
- <!-- ABOUT -->
271
- <main class="wrap view" data-view="about" hidden>
272
- <section class="panel prose">
273
- <h2>How it works</h2>
274
- <ol>
275
- <li>The input (a camera frame, an image, a text, a 2 second sound window or a short video) and the question are turned into one 768-number vector (mean pooling, then L2 normalization) by <a href="https://huggingface.co/google/embeddinggemma-2" target="_blank" rel="noopener">EmbeddingGemma 2</a> (Apache-2.0), fine-tuned for decisions: the question and the media go into one embedding and each option into another, and training pushes the right option closest. It runs as ONNX (same file layout as <a href="https://huggingface.co/onnx-community/embeddinggemma-2-ONNX" target="_blank" rel="noopener">onnx-community/embeddinggemma-2-ONNX</a>, with the fine-tuned weights) with <a href="https://github.com/huggingface/transformers.js" target="_blank" rel="noopener">transformers.js</a> 4.3.1 on WebGPU (or WASM on the CPU). The model files are served with this page.</li>
276
- <li>Each option description is embedded once and cached.</li>
277
- <li>The probabilities are softmax(scale &times; cosine) over the options. The scale was learned in training (about 19.96), so the default temperature is 1 / scale, about 0.050.</li>
278
- <li>In Live mode each card embeds the frame together with its own question (one pass per card). The alternative "frame alone" setting embeds the frame once and scores all cards from that vector, which is faster but is not the format the model was trained with.</li>
279
- <li>A card whose top probability is below its threshold is marked uncertain. That is where a larger model would take over; this page only counts it.</li>
280
- </ol>
281
- <h3>Privacy</h3>
282
- <p>The page is static. The model weights are downloaded from the Hugging Face Hub and cached by the browser. Camera frames, microphone audio, images and text are processed on this device and are never uploaded. You can check this in the browser's network panel: after the model is cached, decisions make no requests.</p>
283
- <h3>Prompts</h3>
284
- <div id="promptDoc"></div>
285
- <h3>Limits</h3>
286
- <ul>
287
- <li>An embedding model compares meanings; it does not read, count or reason step by step. Questions about exact counts, small text or negation are hard for it.</li>
288
- <li>Probabilities depend on the temperature. They are comparable between options of one card, not calibrated against ground truth.</li>
289
- <li>WebGPU needs a recent Chrome, Edge or Safari. Without it the page falls back to the CPU (WASM): it works with the same 4-bit files (about 340 MB), but it takes several seconds per image (about 6 s at 70 image tokens, about 30 s at 280 in our test), so the live rate drops to a frame every few seconds.</li>
290
- <li>The fine-tuning targeted image decisions (including egg candling). The audio encoder is the unchanged base one, so sound decisions are not tuned.</li>
291
- </ul>
292
- <p class="note">Sample image credits: <a href="./CREDITS.md" target="_blank">CREDITS.md</a>. Code: Apache-2.0.</p>
293
- </section>
294
- </main>
295
-
296
- <footer class="wrap foot">
297
- <p>Based on EmbeddingGemma 2 by Google DeepMind (Apache-2.0), fine-tuned for decisions, run with transformers.js. This page sends no data anywhere.</p>
298
- </footer>
299
- <script type="module" src="./app.js?v=6"></script>
300
- </body>
301
- </html>
 
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
6
+ <meta name="referrer" content="no-referrer" />
7
+ <meta name="theme-color" content="#f5f7fb" />
8
+ <title>Decide Live</title>
9
+ <meta name="description" content="Decide Live: on-device decisions from camera and microphone. A multimodal embedding model runs in your browser and turns every frame into calibrated probabilities." />
10
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
11
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
12
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;700&display=swap" />
13
+ <link rel="stylesheet" href="./style.css?v=7" />
14
+ </head>
15
+ <body>
16
+ <header class="top">
17
+ <span class="glow a" aria-hidden="true"></span><span class="glow b" aria-hidden="true"></span><span class="glow c" aria-hidden="true"></span>
18
+ <div class="wrap topbar">
19
+ <div class="brand">
20
+ <span class="eyebrow"><span class="pulse"></span>Decide Live</span>
21
+ <h1>See it. <span class="lit">Decide it.</span><br />Right in your browser.</h1>
22
+ <p class="sub">On-device decisions from camera and microphone. Every frame is embedded in your browser by EmbeddingGemma 2, fine-tuned for decisions, and scored against the options you write. No text generation, no tokens, no server.</p>
23
+ <div class="stats">
24
+ <span class="stat"><b>95%</b> on 100 held-out egg photos</span>
25
+ <span class="stat"><b>0</b> bytes uploaded</span>
26
+ <span class="stat"><b>744M</b> parameters, 4-bit</span>
27
+ <span class="stat"><b>0</b> tokens generated</span>
28
+ </div>
29
+ </div>
30
+ <div class="statusbox">
31
+ <div class="status" id="status"><span class="dot"></span><span id="statusText">Model not loaded</span></div>
32
+ <div class="chips"><span id="backend" class="chip"></span><span class="chip safe">0 bytes uploaded</span></div>
33
+ <div class="progress" id="progressWrap" hidden><div id="progressBar"></div></div>
34
+ <p class="warn" id="wasmNote" hidden>WebGPU is not available here, so the model runs on the CPU (WASM). The live rate is lowered automatically.</p>
35
+ </div>
36
+ </div>
37
+ <div class="reel" aria-hidden="true"><div class="reel-track" id="reel"></div></div>
38
+ <nav class="wrap tabs" role="tablist">
39
+ <button class="tab active" data-tab="live" role="tab">Live</button>
40
+ <button class="tab" data-tab="single" role="tab">Single input</button>
41
+ <button class="tab" data-tab="egg" role="tab">Egg check</button>
42
+ <button class="tab" data-tab="samples" role="tab">Sample tests</button>
43
+ <button class="tab" data-tab="about" role="tab">How it works</button>
44
+ </nav>
45
+ </header>
46
+
47
+ <!-- LIVE -->
48
+ <main class="wrap view" data-view="live">
49
+ <div class="livegrid">
50
+ <section class="stagecol">
51
+ <div class="sources">
52
+ <button class="src active" data-src="demo">Demo feed</button>
53
+ <button class="src" data-src="camera">Camera</button>
54
+ <button class="src" data-src="mic">Microphone</button>
55
+ <button class="ghost" id="flipBtn" hidden title="Switch front and back camera">Flip camera</button>
56
+ </div>
57
+ <div class="stage" id="stage">
58
+ <video id="cam" playsinline muted autoplay></video>
59
+ <canvas id="feed"></canvas>
60
+ <div class="scan" aria-hidden="true"></div>
61
+ <div class="badge"><span class="pulse"></span>Runs on your device. 0 bytes uploaded.</div>
62
+ <div class="hud" id="hud"><span id="fpsVal">0.0</span> fps <span class="sep">|</span> <span id="latVal">0</span> <span id="latUnit" class="unit">ms / frame</span></div>
63
+ <div class="overlay" id="overlay" hidden>
64
+ <svg class="ring" viewBox="0 0 120 120" aria-hidden="true">
65
+ <circle class="ring-bg" cx="60" cy="60" r="52" />
66
+ <circle class="ring-fg" id="ringFg" cx="60" cy="60" r="52" />
67
+ </svg>
68
+ <div class="ovtext">
69
+ <div class="ovq" id="ovQuestion"></div>
70
+ <div class="ovlabel" id="ovLabel">...</div>
71
+ <div class="ovpct" id="ovPct"></div>
72
+ </div>
73
+ </div>
74
+ <div class="idle" id="idle">
75
+ <button class="big" id="startBtn">Start live decisions</button>
76
+ <p>Loads the model on first start (about 260 to 290 MB at 4 bits, cached afterwards).</p>
77
+ </div>
78
+ </div>
79
+ <div class="controls">
80
+ <button id="stopBtn" class="ghost" disabled>Stop</button>
81
+ <label>Speed
82
+ <select id="rateSel">
83
+ <option value="auto">Auto</option>
84
+ <option value="5">up to 5 per second</option>
85
+ <option value="2">up to 2 per second</option>
86
+ <option value="1">1 per second</option>
87
+ </select>
88
+ </label>
89
+ <label>Detail
90
+ <select id="budgetSel">
91
+ <option value="70" selected>fast (70 image tokens)</option>
92
+ <option value="140">balanced (140)</option>
93
+ <option value="280">fine (280)</option>
94
+ </select>
95
+ </label>
96
+ <label>Prompt
97
+ <select id="livePrompt">
98
+ <option value="trained" selected>question + frame, as trained (one pass per card)</option>
99
+ <option value="alone">frame alone (one pass for all cards)</option>
100
+ </select>
101
+ </label>
102
+ <label>Smoothing
103
+ <select id="smoothSel">
104
+ <option value="0">off</option>
105
+ <option value="0.5" selected>light</option>
106
+ <option value="0.8">strong</option>
107
+ </select>
108
+ </label>
109
+ </div>
110
+ <div class="gate">
111
+ <div><span class="gnum" id="gOnDevice">0</span><span class="glab">decided on device</span></div>
112
+ <div><span class="gnum warnc" id="gEscalate">0</span><span class="glab">would escalate</span></div>
113
+ <div><span class="gnum accent" id="gRate">-</span><span class="glab">on-device rate</span></div>
114
+ <button class="ghost small" id="resetGate">Reset</button>
115
+ </div>
116
+ <div class="stream">
117
+ <div class="streamhead"><h3>Decision stream</h3><span class="note">Each row is a real decision made in this browser just now.</span></div>
118
+ <ol class="streamlist" id="stream"></ol>
119
+ </div>
120
+ <p class="note">When a card's top probability is below its threshold the frame is marked uncertain: in a production system it would go to a larger model. Here nothing is sent anywhere; it is only counted.</p>
121
+ </section>
122
+
123
+ <section class="cardcol">
124
+ <div class="cardhead">
125
+ <h2 id="cardsTitle">Decisions on every frame</h2>
126
+ <span class="note" id="cardsCount"></span>
127
+ </div>
128
+ <div id="cards" class="cards"></div>
129
+ <div class="templates">
130
+ <h3>Add a decision (up to 4)</h3>
131
+ <div id="templates" class="tpls"></div>
132
+ <button class="ghost small" id="customBtn">+ Custom decision</button>
133
+ </div>
134
+ </section>
135
+ </div>
136
+ </main>
137
+
138
+ <!-- SINGLE -->
139
+ <main class="wrap view grid2" data-view="single" hidden>
140
+ <section class="panel">
141
+ <h2>1. Input</h2>
142
+ <div class="subtabs" role="tablist">
143
+ <button class="subtab active" data-kind="image">Image</button>
144
+ <button class="subtab" data-kind="text">Text</button>
145
+ <button class="subtab" data-kind="audio">Audio</button>
146
+ <button class="subtab" data-kind="video">Video</button>
147
+ </div>
148
+ <div class="pane" data-pane="image">
149
+ <label class="col">Sample
150
+ <select id="sampleSelect"><option value="">(choose one of the 18 sample tests)</option></select>
151
+ </label>
152
+ <label class="drop"><input type="file" id="imageFile" accept="image/*" /><span>or upload an image (stays on this device)</span></label>
153
+ <img id="imagePreview" alt="" hidden />
154
+ </div>
155
+ <div class="pane" data-pane="text" hidden>
156
+ <textarea id="textInput" rows="6" placeholder="Paste the text to decide about"></textarea>
157
+ </div>
158
+ <div class="pane" data-pane="audio" hidden>
159
+ <label class="drop"><input type="file" id="audioFile" accept="audio/*" /><span>Upload an audio clip (up to 60 s, resampled to mono 16 kHz)</span></label>
160
+ <audio id="audioPreview" controls hidden></audio>
161
+ <p class="note">Audio needs the extra audio encoder (about 190 MB at q4), loaded on first use.</p>
162
+ </div>
163
+ <div class="pane" data-pane="video" hidden>
164
+ <label class="drop"><input type="file" id="videoFile" accept="video/*" /><span>Upload a short video (up to 16 frames are sampled evenly)</span></label>
165
+ <video id="videoPreview" controls muted playsinline hidden></video>
166
+ </div>
167
+ </section>
168
+
169
+ <section class="panel">
170
+ <h2>2. Question and options</h2>
171
+ <div class="seg" role="radiogroup">
172
+ <label><input type="radio" name="mode" value="choice" checked /> Options</label>
173
+ <label><input type="radio" name="mode" value="yesno" /> Yes / no</label>
174
+ </div>
175
+ <label class="col">Context (optional)
176
+ <input id="contextInput" type="text" placeholder="e.g. Candling photo: a light is shone through the egg" />
177
+ </label>
178
+ <label class="col"><span id="questionLabel">Question</span>
179
+ <input id="questionInput" type="text" placeholder="e.g. Is this egg good or bad?" />
180
+ </label>
181
+ <label class="col" id="optionsWrap">Options, 2 to 8, one per line as <code>key: description</code>
182
+ <textarea id="optionsInput" rows="6" placeholder="good: Normal, healthy egg&#10;bad: Defective, spoiled or damaged egg"></textarea>
183
+ </label>
184
+ <p class="note" id="yesnoNote" hidden>In the trained format (default), the question stays in the query and the two options are "Yes" and "No". The older formats build two options from the statement: the statement and its negation, or for a question, the question followed by "Yes." and by "No.".</p>
185
+ <details class="adv">
186
+ <summary>Settings</summary>
187
+ <label class="col">Temperature <span id="tempVal">0.0501</span> <button type="button" class="ghost small" id="resetTemp">Use trained value</button>
188
+ <input type="range" id="temp" min="0.005" max="0.5" step="0.0001" value="0.0501" />
189
+ </label>
190
+ <label class="col">Prompt format
191
+ <select id="preset"></select>
192
+ </label>
193
+ <label class="col">Image detail (also used by the sample tests)
194
+ <select id="budgetSingle">
195
+ <option value="auto">Auto: 280 image tokens on WebGPU, 70 on CPU</option>
196
+ <option value="70">70 (fast)</option>
197
+ <option value="140">140</option>
198
+ <option value="280">280 (model default)</option>
199
+ </select>
200
+ </label>
201
+ <label class="col">Precision (applies on next load)
202
+ <select id="dtype">
203
+ <option value="auto">Auto: 4-bit (q4f16 on WebGPU with fp16 support, else q4)</option>
204
+ <option value="q4">q4 (4-bit, works everywhere, also on the CPU)</option>
205
+ <option value="q4f16">q4f16 (4-bit weights, fp16 math; WebGPU with fp16 only)</option>
206
+ </select>
207
+ </label>
208
+ <label class="col">Backend (applies on next load)
209
+ <select id="device">
210
+ <option value="auto">Auto (WebGPU, else WASM)</option>
211
+ <option value="webgpu">WebGPU</option>
212
+ <option value="wasm">WASM (CPU)</option>
213
+ </select>
214
+ </label>
215
+ </details>
216
+ <button id="decideBtn" class="primary">Decide</button>
217
+ </section>
218
+
219
+ <section class="panel wide" id="resultCard" hidden>
220
+ <h2>3. Decision</h2>
221
+ <div id="result"></div>
222
+ </section>
223
+ </main>
224
+
225
+ <!-- EGG CHECK -->
226
+ <main class="wrap view" data-view="egg" hidden>
227
+ <section class="panel">
228
+ <h2>Egg check</h2>
229
+ <p class="note">Candling photos (a light shone through the egg in a dark room). The decision uses the format the model was trained with:
230
+ the photo with <code>Is this egg good or bad?</code> and the candling context, scored against <code>Normal, healthy egg</code> and
231
+ <code>Defective, spoiled or damaged egg</code>. The 8 photos below are held out: they were not used in training. Pick one, run all 8, or use your own photo.</p>
232
+ <div class="egggrid" id="eggGrid"></div>
233
+ <div class="btnrow">
234
+ <button id="eggRunAll" class="primary inline">Check all 8</button>
235
+ <label class="drop inline"><input type="file" id="eggFile" accept="image/*" /><span>Use your own candling photo (stays on this device)</span></label>
236
+ </div>
237
+ <div id="eggSummary" class="summary"></div>
238
+ <div class="eggresult" id="eggResult" hidden>
239
+ <img id="eggPreview" alt="Selected egg photo" />
240
+ <div id="eggOut"></div>
241
+ </div>
242
+ <div class="tablewrap"><table id="eggTable" hidden>
243
+ <thead><tr><th>Photo</th><th>Gold</th><th>Decision</th><th>p(good)</th><th>p(bad)</th><th>OK</th><th>ms</th></tr></thead>
244
+ <tbody></tbody>
245
+ </table></div>
246
+ <p class="note">Photos: Good and Bad Eggs Identification Image Dataset (Mendeley Data, doi:10.17632/mdty358x8m.1), CC BY 4.0. See <a href="./CREDITS.md" target="_blank">CREDITS.md</a>.</p>
247
+ </section>
248
+ </main>
249
+
250
+ <!-- SAMPLES -->
251
+ <main class="wrap view" data-view="samples" hidden>
252
+ <section class="panel">
253
+ <h2>Sample tests (18)</h2>
254
+ <p class="note">Counting, yes / no, spatial relations, a chart, a receipt, app screens, scene text, common sense and egg candling (the egg photos are held out from training; the other images may come from datasets the training mix drew on). Each test runs in this browser with the prompt format, image detail and temperature chosen under Single input &gt; Settings. In the trained format, yes / no tests keep the question in the query and score the options "Yes" and "No"; the older formats use the yes / no mode (the question followed by "Yes." or "No.").</p>
255
+ <div class="btnrow">
256
+ <button id="runAllBtn" class="primary inline">Run all samples</button>
257
+ <button id="compareBtn" class="ghost">Compare all prompt formats</button>
258
+ </div>
259
+ <div id="runAllSummary" class="summary"></div>
260
+ <div class="tablewrap"><table id="compareTable" hidden>
261
+ <thead><tr><th>Prompt format</th><th>Accuracy</th><th>Mean ms / test</th></tr></thead><tbody></tbody>
262
+ </table></div>
263
+ <div class="tablewrap"><table id="runAllTable" hidden>
264
+ <thead><tr><th>#</th><th>Test</th><th>Type</th><th>Gold</th><th>Decision</th><th>p</th><th>OK</th><th>ms</th></tr></thead>
265
+ <tbody></tbody>
266
+ </table></div>
267
+ </section>
268
+ </main>
269
+
270
+ <!-- ABOUT -->
271
+ <main class="wrap view" data-view="about" hidden>
272
+ <section class="panel prose">
273
+ <h2>How it works</h2>
274
+ <ol>
275
+ <li>The input (a camera frame, an image, a text, a 2 second sound window or a short video) and the question are turned into one 768-number vector (mean pooling, then L2 normalization) by <a href="https://huggingface.co/google/embeddinggemma-2" target="_blank" rel="noopener">EmbeddingGemma 2</a> (Apache-2.0), fine-tuned for decisions: the question and the media go into one embedding and each option into another, and training pushes the right option closest. It runs as ONNX (same file layout as <a href="https://huggingface.co/onnx-community/embeddinggemma-2-ONNX" target="_blank" rel="noopener">onnx-community/embeddinggemma-2-ONNX</a>, with the fine-tuned weights) with <a href="https://github.com/huggingface/transformers.js" target="_blank" rel="noopener">transformers.js</a> 4.3.1 on WebGPU (or WASM on the CPU). The model files are served with this page.</li>
276
+ <li>Each option description is embedded once and cached.</li>
277
+ <li>The probabilities are softmax(scale &times; cosine) over the options. The scale was learned in training (about 19.96), so the default temperature is 1 / scale, about 0.050.</li>
278
+ <li>In Live mode each card embeds the frame together with its own question (one pass per card). The alternative "frame alone" setting embeds the frame once and scores all cards from that vector, which is faster but is not the format the model was trained with.</li>
279
+ <li>A card whose top probability is below its threshold is marked uncertain. That is where a larger model would take over; this page only counts it.</li>
280
+ </ol>
281
+ <h3>Privacy</h3>
282
+ <p>The page is static. The model weights are downloaded from the Hugging Face Hub and cached by the browser. Camera frames, microphone audio, images and text are processed on this device and are never uploaded. You can check this in the browser's network panel: after the model is cached, decisions make no requests.</p>
283
+ <h3>Prompts</h3>
284
+ <div id="promptDoc"></div>
285
+ <h3>Limits</h3>
286
+ <ul>
287
+ <li>An embedding model compares meanings; it does not read, count or reason step by step. Questions about exact counts, small text or negation are hard for it.</li>
288
+ <li>Probabilities depend on the temperature. They are comparable between options of one card, not calibrated against ground truth.</li>
289
+ <li>WebGPU needs a recent Chrome, Edge or Safari. Without it the page falls back to the CPU (WASM): it works with the same 4-bit files (about 340 MB), but it takes several seconds per image (about 6 s at 70 image tokens, about 30 s at 280 in our test), so the live rate drops to a frame every few seconds.</li>
290
+ <li>The fine-tuning targeted image decisions (including egg candling). The audio encoder is the unchanged base one, so sound decisions are not tuned.</li>
291
+ </ul>
292
+ <p class="note">Sample image credits: <a href="./CREDITS.md" target="_blank">CREDITS.md</a>. Code: Apache-2.0.</p>
293
+ </section>
294
+ </main>
295
+
296
+ <footer class="wrap foot">
297
+ <p>Based on EmbeddingGemma 2 by Google DeepMind (Apache-2.0), fine-tuned for decisions, run with transformers.js. This page sends no data anywhere.</p>
298
+ </footer>
299
+ <script type="module" src="./app.js?v=7"></script>
300
+ </body>
301
+ </html>
style.css CHANGED
@@ -1,281 +1,282 @@
1
- /* Decide Live: bright theme. Light shone through an egg is the motif: warm candle amber + clear teal on a cool white ground. */
2
- :root {
3
- --bg: #f5f7fb;
4
- --bg2: #eef2f8;
5
- --card: #ffffff;
6
- --card2: #f3f6fa;
7
- --ink: #0e1a2b;
8
- --muted: #5a6a80;
9
- --line: #dfe6ef;
10
- --accent: #0b9c94;
11
- --accent-strong: #08807a;
12
- --accent-ink: #ffffff;
13
- --accent-dim: rgba(11, 156, 148, 0.12);
14
- --amber: #f2a20c;
15
- --amber-dim: rgba(242, 162, 12, 0.14);
16
- --warn: #c97800;
17
- --bad: #e5484d;
18
- --good: #0b9c94;
19
- --radius: 18px;
20
- --shadow: 0 1px 2px rgba(14, 26, 43, 0.05), 0 8px 24px rgba(14, 26, 43, 0.06);
21
- --shadow-lift: 0 2px 4px rgba(14, 26, 43, 0.06), 0 18px 40px rgba(14, 26, 43, 0.10);
22
- --display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
23
- --body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
24
- --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
25
- color-scheme: light;
26
- }
27
- * { box-sizing: border-box; }
28
- html, body { margin: 0; background: var(--bg); color: var(--ink); }
29
- body { font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
30
- a { color: var(--accent-strong); }
31
- code { font: 0.86em var(--mono); background: var(--card2); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); }
32
- .wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
33
- [hidden] { display: none !important; }
34
- :focus-visible { outline: 3px solid rgba(11, 156, 148, 0.45); outline-offset: 2px; }
35
-
36
- /* ---------------------------------------------------------------- hero */
37
- .top { position: relative; overflow: hidden; background: #fbfcfe; border-bottom: 1px solid var(--line); isolation: isolate; }
38
- .glow { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.55; z-index: -1; pointer-events: none; }
39
- .glow.a { width: 520px; height: 520px; background: radial-gradient(circle, rgba(242, 162, 12, 0.55), rgba(242, 162, 12, 0) 70%); top: -240px; right: -80px; animation: drift-a 16s ease-in-out infinite alternate; }
40
- .glow.b { width: 460px; height: 460px; background: radial-gradient(circle, rgba(11, 156, 148, 0.45), rgba(11, 156, 148, 0) 70%); top: -160px; left: -140px; animation: drift-b 19s ease-in-out infinite alternate; }
41
- .glow.c { width: 380px; height: 380px; background: radial-gradient(circle, rgba(80, 160, 255, 0.35), rgba(80, 160, 255, 0) 70%); bottom: -220px; left: 40%; animation: drift-c 22s ease-in-out infinite alternate; }
42
- @keyframes drift-a { to { transform: translate(-120px, 60px) scale(1.15); } }
43
- @keyframes drift-b { to { transform: translate(160px, 40px) scale(0.9); } }
44
- @keyframes drift-c { to { transform: translate(-180px, -40px) scale(1.2); } }
45
- .topbar { display: flex; gap: 28px; justify-content: space-between; align-items: flex-end; padding-top: 28px; padding-bottom: 18px; }
46
- .brand { min-width: 0; }
47
- .eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 700 12px/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-strong); background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(11, 156, 148, 0.25); padding: 6px 11px; border-radius: 999px; backdrop-filter: blur(6px); }
48
- .eyebrow .pulse { width: 7px; height: 7px; }
49
- .brand h1 { margin: 14px 0 0; font: 800 clamp(34px, 5.4vw, 60px)/1.02 var(--display); letter-spacing: -0.035em; text-wrap: balance; }
50
- .brand h1 .lit { background: linear-gradient(100deg, var(--accent) 0%, #1fb7a8 40%, var(--amber) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: sheen 6s ease-in-out infinite alternate; }
51
- @keyframes sheen { to { background-position: 100% 0; } }
52
- .brand .sub { margin: 12px 0 0; color: var(--muted); max-width: 640px; font-size: 15.5px; }
53
- .stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
54
- .stat { display: inline-flex; align-items: baseline; gap: 6px; background: rgba(255, 255, 255, 0.78); border: 1px solid var(--line); border-radius: 12px; padding: 7px 12px; font-size: 13px; color: var(--muted); backdrop-filter: blur(6px); box-shadow: var(--shadow); }
55
- .stat b { font: 800 17px/1 var(--display); color: var(--ink); letter-spacing: -0.02em; }
56
- .statusbox { min-width: 270px; max-width: 360px; background: rgba(255, 255, 255, 0.82); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
57
- .status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
58
- .status .dot { width: 10px; height: 10px; border-radius: 50%; background: #b5c0cf; flex: none; }
59
- .status.ready .dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }
60
- .status.ready { color: var(--accent-strong); }
61
- .status.loading .dot { background: var(--amber); animation: blink 1s infinite; }
62
- .status.error .dot { background: var(--bad); }
63
- @keyframes blink { 50% { opacity: 0.3; } }
64
- .chips { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
65
- .chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--card2); color: var(--muted); border: 1px solid var(--line); font-weight: 600; }
66
- .chip:empty { display: none; }
67
- .chip.safe { color: var(--accent-strong); border-color: rgba(11, 156, 148, 0.3); background: var(--accent-dim); }
68
- .progress { height: 6px; background: var(--bg2); border-radius: 3px; margin-top: 10px; overflow: hidden; }
69
- .progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--amber)); transition: width 0.25s ease; }
70
- .warn { color: var(--warn); font-size: 12px; margin: 6px 0 0; }
71
-
72
- /* reel: the sample pictures drift past under the hero */
73
- .reel { position: relative; overflow: hidden; padding: 4px 0 14px; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
74
- .reel-track { display: flex; gap: 10px; width: max-content; animation: reel 60s linear infinite; }
75
- .reel:hover .reel-track { animation-play-state: paused; }
76
- .reel-track img { height: 74px; width: 104px; object-fit: cover; border-radius: 12px; border: 2px solid #fff; box-shadow: var(--shadow); background: var(--bg2); }
77
- @keyframes reel { to { transform: translateX(-50%); } }
78
-
79
- .tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 14px; }
80
- .tab { background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line); color: var(--muted); padding: 8px 16px; font: 700 14px/1.2 var(--body); cursor: pointer; border-radius: 999px; white-space: nowrap; }
81
- .tab:hover { color: var(--ink); }
82
- .tab.active { color: #fff; background: var(--ink); border-color: var(--ink); }
83
-
84
- /* ---------------------------------------------------------------- buttons and fields */
85
- button { font: inherit; cursor: pointer; border-radius: 12px; padding: 8px 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s; }
86
- button:hover:not(:disabled) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
87
- button:active:not(:disabled) { transform: scale(0.97); }
88
- button:disabled { opacity: 0.45; cursor: default; }
89
- button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; width: 100%; margin-top: 10px; }
90
- button.primary:hover:not(:disabled) { background: var(--accent-strong); }
91
- button.primary.inline { width: auto; margin-top: 0; }
92
- button.ghost { background: transparent; }
93
- button.small { padding: 4px 10px; font-size: 13px; }
94
- select, input[type=text], textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 11px; width: 100%; }
95
- select:focus, input:focus, textarea:focus { outline: 3px solid var(--accent-dim); border-color: var(--accent); }
96
- textarea { resize: vertical; font-family: var(--mono); font-size: 13px; }
97
- input[type=range] { accent-color: var(--accent); width: 100%; }
98
- .note { color: var(--muted); font-size: 13px; margin: 8px 0; }
99
-
100
- /* ---------------------------------------------------------------- live layout */
101
- .view { padding-top: 22px; padding-bottom: 18px; animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
102
- @keyframes rise { from { opacity: 0; transform: translateY(10px); } }
103
- .livegrid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; align-items: start; }
104
- @media (max-width: 900px) { .livegrid { grid-template-columns: 1fr; } }
105
- .sources { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
106
- .src { border-radius: 999px; font-weight: 600; }
107
- .src.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
108
- .stage { position: relative; aspect-ratio: 4 / 3; background: #e9eef5; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-lift); }
109
- .stage video, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
110
- .stage video { opacity: 0; }
111
- .stage.camera video { opacity: 1; }
112
- .stage.camera canvas { opacity: 0; }
113
- .stage.mirror video { transform: scaleX(-1); }
114
- /* a soft beam sweeps over the picture while decisions are running */
115
- .scan { position: absolute; left: 0; right: 0; height: 28%; top: -30%; pointer-events: none; background: linear-gradient(180deg, rgba(242, 162, 12, 0) 0%, rgba(242, 162, 12, 0.16) 70%, rgba(255, 214, 120, 0.55) 100%); border-bottom: 2px solid rgba(255, 200, 80, 0.85); opacity: 0; }
116
- .stage.running .scan { opacity: 1; animation: sweep 2.6s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
117
- @keyframes sweep { to { top: 102%; } }
118
- .badge { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.86); color: var(--ink); border: 1px solid rgba(11, 156, 148, 0.35); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; backdrop-filter: blur(8px); box-shadow: var(--shadow); }
119
- .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(11, 156, 148, 0.6); animation: pulse 1.6s infinite; flex: none; }
120
- @keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(11, 156, 148, 0); } 100% { box-shadow: 0 0 0 0 rgba(11, 156, 148, 0); } }
121
- .hud { position: absolute; top: 12px; right: 12px; background: rgba(255, 255, 255, 0.86); padding: 6px 11px; border-radius: 999px; font: 12.5px var(--mono); color: var(--muted); box-shadow: var(--shadow); backdrop-filter: blur(8px); }
122
- .hud span:not(.sep):not(.unit) { color: var(--ink); font-weight: 700; }
123
- .hud .sep { opacity: 0.4; margin: 0 4px; }
124
- .overlay { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 14px; background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 18px; padding: 10px 16px; backdrop-filter: blur(10px); box-shadow: var(--shadow-lift); }
125
- .ring { width: 76px; height: 76px; flex: none; transform: rotate(-90deg); }
126
- .ring circle { fill: none; stroke-width: 10; }
127
- .ring-bg { stroke: var(--bg2); }
128
- .ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 326.73; transition: stroke-dashoffset 0.35s ease, stroke 0.35s; }
129
- .overlay.uncertain .ring-fg { stroke: var(--amber); }
130
- .ovtext { min-width: 0; }
131
- .ovq { color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
132
- .ovlabel { font: 800 clamp(24px, 4.4vw, 40px)/1.08 var(--display); letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--accent-strong); }
133
- .ovlabel.pop { animation: pop 0.42s cubic-bezier(0.2, 1.4, 0.4, 1); }
134
- @keyframes pop { 0% { transform: scale(0.82); opacity: 0.3; } 100% { transform: none; opacity: 1; } }
135
- .overlay.uncertain .ovlabel { color: var(--warn); }
136
- .ovpct { font: 12.5px var(--mono); color: var(--muted); }
137
- .idle { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; background: radial-gradient(ellipse at 50% 45%, rgba(255, 236, 190, 0.85), rgba(245, 247, 251, 0.94) 65%); padding: 16px; }
138
- .idle p { color: var(--muted); font-size: 13px; margin: 0; max-width: 420px; }
139
- button.big { background: linear-gradient(100deg, var(--accent) 0%, #17b3a6 55%, #e7a015 130%); color: #fff; border: none; font: 800 18px/1 var(--display); letter-spacing: -0.01em; padding: 17px 30px; border-radius: 999px; box-shadow: 0 10px 30px rgba(11, 156, 148, 0.32); animation: breathe 2.4s ease-in-out infinite; }
140
- button.big:hover:not(:disabled) { box-shadow: 0 14px 36px rgba(11, 156, 148, 0.42); }
141
- @keyframes breathe { 50% { transform: scale(1.04); } }
142
- .controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-top: 12px; }
143
- .controls label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; flex: 1; min-width: 120px; font-weight: 600; }
144
- .gate { display: flex; gap: 10px; align-items: center; margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; flex-wrap: wrap; box-shadow: var(--shadow); }
145
- .gate > div { display: flex; flex-direction: column; flex: 1; min-width: 90px; }
146
- .gnum { font: 800 28px/1.1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
147
- .gnum.accent { color: var(--accent-strong); }
148
- .gnum.warnc { color: var(--warn); }
149
- .glab { font-size: 12px; color: var(--muted); font-weight: 600; }
150
-
151
- /* decision stream: one row per real decision on the primary card */
152
- .stream { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
153
- .streamhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
154
- .streamhead h3 { margin: 0; font: 800 16px/1.2 var(--display); letter-spacing: -0.01em; }
155
- .streamhead .note { margin: 0; font-size: 12px; }
156
- .streamlist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; min-height: 52px; }
157
- .streamlist:empty::before { content: "Start live decisions and each result appears here as it happens."; color: var(--muted); font-size: 13px; }
158
- .tick { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 12px; background: var(--card2); animation: slidein 0.45s cubic-bezier(0.2, 0.9, 0.2, 1); }
159
- .tick:first-child { background: linear-gradient(90deg, var(--accent-dim), var(--card2)); }
160
- .tick.uncertain:first-child { background: linear-gradient(90deg, var(--amber-dim), var(--card2)); }
161
- @keyframes slidein { from { opacity: 0; transform: translateY(-12px) scale(0.98); } }
162
- .tick img { width: 52px; height: 40px; object-fit: cover; border-radius: 8px; display: block; background: var(--bg2); }
163
- .tick .tl { min-width: 0; }
164
- .tick .tq { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
165
- .tick .tv { font: 800 16px/1.2 var(--display); color: var(--accent-strong); }
166
- .tick.uncertain .tv { color: var(--warn); }
167
- .tick .tm { font: 12px var(--mono); color: var(--muted); text-align: right; white-space: nowrap; }
168
- .tick .tm b { display: block; font-size: 14px; color: var(--ink); }
169
-
170
- /* ---------------------------------------------------------------- cards */
171
- .cardhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
172
- .cardhead h2 { margin: 0 0 12px; font: 800 20px/1.2 var(--display); letter-spacing: -0.02em; }
173
- .cards { display: grid; gap: 12px; }
174
- .dcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s; box-shadow: var(--shadow); animation: rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
175
- .dcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
176
- .dcard.primary { border-color: rgba(11, 156, 148, 0.55); box-shadow: 0 0 0 3px var(--accent-dim), var(--shadow); }
177
- .dcard.uncertain { border-color: rgba(242, 162, 12, 0.6); }
178
- .dtop { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
179
- .dtitle { font-weight: 700; font-size: 15px; }
180
- .dact { display: flex; gap: 4px; flex: none; }
181
- .dact button { padding: 2px 9px; font-size: 12px; border-radius: 8px; }
182
- .dverdict { margin: 6px 0 8px; font-size: 13px; color: var(--muted); min-height: 20px; }
183
- .dverdict b { color: var(--accent-strong); font: 800 17px/1.2 var(--display); }
184
- .dcard.uncertain .dverdict b { color: var(--warn); }
185
- .obar { display: grid; grid-template-columns: minmax(70px, 34%) 1fr 48px; gap: 8px; align-items: center; margin: 5px 0; font-size: 13px; }
186
- .obar .k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
187
- .obar.top .k { color: var(--ink); font-weight: 700; }
188
- .obar .track { height: 12px; background: var(--bg2); border-radius: 6px; overflow: hidden; position: relative; }
189
- .obar .fill { height: 100%; width: 0; background: #c3cddb; border-radius: 6px; transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s; }
190
- .obar.top .fill { background: linear-gradient(90deg, var(--accent), #2cc2b3); }
191
- .dcard.uncertain .obar.top .fill { background: linear-gradient(90deg, #e39410, var(--amber)); }
192
- .obar .p { text-align: right; font: 12.5px var(--mono); }
193
- .thr { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); }
194
- .thr input { flex: 1; }
195
- .thr .tv { width: 34px; text-align: right; color: var(--ink); font-family: var(--mono); }
196
- .dstats { font-size: 12px; color: var(--muted); margin-top: 4px; }
197
- .dedit { margin-top: 8px; display: grid; gap: 6px; }
198
- .templates { margin-top: 18px; }
199
- .templates h3 { font-size: 13px; margin: 0 0 8px; color: var(--muted); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
200
- .tpls { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
201
- .tpls button { font-size: 13px; padding: 6px 12px; border-radius: 999px; }
202
-
203
- /* ---------------------------------------------------------------- single / samples */
204
- .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
205
- @media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
206
- .panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; box-shadow: var(--shadow); }
207
- .panel h2 { margin: 0 0 12px; font: 800 21px/1.2 var(--display); letter-spacing: -0.02em; }
208
- .wide { grid-column: 1 / -1; }
209
- .subtabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
210
- .subtab { padding: 5px 13px; font-size: 13px; border-radius: 999px; }
211
- .subtab.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
212
- .col { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-size: 13px; color: var(--muted); font-weight: 600; }
213
- .drop { display: block; border: 2px dashed var(--line); border-radius: 14px; padding: 12px; color: var(--muted); cursor: pointer; margin: 8px 0; font-size: 13px; background: var(--card2); transition: border-color 0.15s; }
214
- .drop:hover { border-color: var(--accent); }
215
- .drop input { display: block; margin-bottom: 4px; max-width: 100%; color: var(--ink); }
216
- #imagePreview, #videoPreview { max-width: 100%; max-height: 300px; border-radius: 12px; display: block; margin-top: 8px; }
217
- #audioPreview { width: 100%; margin-top: 8px; }
218
- .seg { display: flex; gap: 16px; font-size: 14px; }
219
- .seg input { accent-color: var(--accent); }
220
- .adv { margin: 10px 0; border-top: 1px solid var(--line); padding-top: 8px; }
221
- .adv summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; }
222
- .decision { font: 800 24px/1.2 var(--display); margin: 0 0 10px; letter-spacing: -0.02em; animation: pop 0.42s cubic-bezier(0.2, 1.4, 0.4, 1); }
223
- .decision b { color: var(--accent-strong); }
224
- .meta { color: var(--muted); font-size: 13px; margin-top: 10px; }
225
- .prompts { margin-top: 8px; font-size: 12px; color: var(--muted); }
226
- .prompts pre { white-space: pre-wrap; word-break: break-word; background: var(--card2); border: 1px solid var(--line); padding: 8px; border-radius: 10px; color: var(--ink); font-family: var(--mono); }
227
- .btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
228
- .summary { margin: 12px 0; font-size: 16px; }
229
- .summary b { color: var(--accent-strong); font: 800 20px/1 var(--display); }
230
- .tablewrap { overflow-x: auto; margin-top: 8px; }
231
- table { border-collapse: collapse; width: 100%; font-size: 13px; }
232
- th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
233
- th { color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
234
- tbody tr { animation: slidein 0.35s ease; }
235
- td { font-variant-numeric: tabular-nums; }
236
- td.ok { color: var(--good); font-weight: 700; }
237
- td.no { color: var(--bad); font-weight: 700; }
238
- .prose { max-width: 860px; }
239
- .prose li { margin: 6px 0; }
240
- .prose h3 { margin: 20px 0 6px; font: 800 17px/1.2 var(--display); }
241
- .foot { color: var(--muted); font-size: 12.5px; padding-bottom: 28px; }
242
- @media (max-width: 760px) {
243
- .topbar { flex-direction: column; align-items: stretch; gap: 14px; padding-top: 20px; }
244
- .statusbox { min-width: 0; max-width: none; width: 100%; }
245
- .brand .sub { font-size: 14px; }
246
- .reel-track img { height: 56px; width: 80px; }
247
- }
248
- @media (max-width: 600px) {
249
- .ring { width: 58px; height: 58px; }
250
- .stage { aspect-ratio: 3 / 4; }
251
- .badge { font-size: 11.5px; padding: 4px 9px; left: 8px; top: 8px; }
252
- .hud { top: 44px; left: 8px; right: auto; font-size: 11.5px; }
253
- .overlay { left: 8px; right: 8px; bottom: 8px; gap: 10px; padding: 8px 10px; }
254
- }
255
-
256
- /* ---------------------------------------------------------------- egg check */
257
- .egggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; margin: 14px 0; }
258
- .eggthumb { position: relative; padding: 6px; display: flex; flex-direction: column; gap: 5px; align-items: stretch; font-size: 12px; color: var(--muted); border-radius: 16px; box-shadow: var(--shadow); }
259
- .eggthumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 11px; background: #1b1b1b; display: block; }
260
- .eggthumb.busy img { animation: candle 0.9s ease-in-out infinite alternate; }
261
- @keyframes candle { from { filter: brightness(1); } to { filter: brightness(1.45) saturate(1.2); } }
262
- .eggthumb .stamp { position: absolute; top: 12px; right: 12px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font: 800 12px/1 var(--body); color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); animation: stamp 0.45s cubic-bezier(0.2, 1.5, 0.4, 1); }
263
- .eggthumb .stamp.good { background: var(--good); }
264
- .eggthumb .stamp.bad { background: var(--bad); }
265
- .eggthumb .stamp.miss { outline: 3px solid var(--amber); }
266
- @keyframes stamp { from { transform: scale(2.2) rotate(-12deg); opacity: 0; } }
267
- .btnrow .drop.inline { display: inline-block; margin: 0; padding: 8px 12px; }
268
- .eggresult { display: grid; grid-template-columns: minmax(120px, 220px) 1fr; gap: 16px; align-items: start; margin: 12px 0; }
269
- .eggresult img { width: 100%; border-radius: 14px; background: #1b1b1b; box-shadow: var(--shadow); }
270
- @media (max-width: 560px) { .eggresult { grid-template-columns: 1fr; } }
271
- .okc { color: var(--good); font-weight: 700; margin-left: 6px; font-size: 15px; font-family: var(--body); }
272
- .noc { color: var(--bad); font-weight: 700; margin-left: 6px; font-size: 15px; font-family: var(--body); }
273
- img.mini { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-right: 6px; }
274
- .dctx { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
275
- .dedit input + input { margin-top: 6px; }
276
-
277
- @media (prefers-reduced-motion: reduce) {
278
- *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
279
- .reel-track { animation: none; }
280
- .stage.running .scan { opacity: 0; }
281
- }
 
 
1
+ /* Decide Live: bright theme. Light shone through an egg is the motif: warm candle amber + clear teal on a cool white ground. */
2
+ :root {
3
+ --bg: #f5f7fb;
4
+ --bg2: #eef2f8;
5
+ --card: #ffffff;
6
+ --card2: #f3f6fa;
7
+ --ink: #0e1a2b;
8
+ --muted: #5a6a80;
9
+ --line: #dfe6ef;
10
+ --accent: #0b9c94;
11
+ --accent-strong: #08807a;
12
+ --accent-ink: #ffffff;
13
+ --accent-dim: rgba(11, 156, 148, 0.12);
14
+ --amber: #f2a20c;
15
+ --amber-dim: rgba(242, 162, 12, 0.14);
16
+ --warn: #c97800;
17
+ --bad: #e5484d;
18
+ --good: #0b9c94;
19
+ --radius: 18px;
20
+ --shadow: 0 1px 2px rgba(14, 26, 43, 0.05), 0 8px 24px rgba(14, 26, 43, 0.06);
21
+ --shadow-lift: 0 2px 4px rgba(14, 26, 43, 0.06), 0 18px 40px rgba(14, 26, 43, 0.10);
22
+ --display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
23
+ --body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
24
+ --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
25
+ color-scheme: light;
26
+ }
27
+ * { box-sizing: border-box; }
28
+ html, body { margin: 0; background: var(--bg); color: var(--ink); }
29
+ body { font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
30
+ a { color: var(--accent-strong); }
31
+ code { font: 0.86em var(--mono); background: var(--card2); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); }
32
+ .wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
33
+ [hidden] { display: none !important; }
34
+ :focus-visible { outline: 3px solid rgba(11, 156, 148, 0.45); outline-offset: 2px; }
35
+
36
+ /* ---------------------------------------------------------------- hero */
37
+ .top { position: relative; overflow: hidden; background: #fbfcfe; border-bottom: 1px solid var(--line); isolation: isolate; }
38
+ .glow { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.55; z-index: -1; pointer-events: none; }
39
+ .glow.a { width: 520px; height: 520px; background: radial-gradient(circle, rgba(242, 162, 12, 0.55), rgba(242, 162, 12, 0) 70%); top: -240px; right: -80px; animation: drift-a 16s ease-in-out infinite alternate; }
40
+ .glow.b { width: 460px; height: 460px; background: radial-gradient(circle, rgba(11, 156, 148, 0.45), rgba(11, 156, 148, 0) 70%); top: -160px; left: -140px; animation: drift-b 19s ease-in-out infinite alternate; }
41
+ .glow.c { width: 380px; height: 380px; background: radial-gradient(circle, rgba(80, 160, 255, 0.35), rgba(80, 160, 255, 0) 70%); bottom: -220px; left: 40%; animation: drift-c 22s ease-in-out infinite alternate; }
42
+ @keyframes drift-a { to { transform: translate(-120px, 60px) scale(1.15); } }
43
+ @keyframes drift-b { to { transform: translate(160px, 40px) scale(0.9); } }
44
+ @keyframes drift-c { to { transform: translate(-180px, -40px) scale(1.2); } }
45
+ .topbar { display: flex; gap: 28px; justify-content: space-between; align-items: flex-end; padding-top: 28px; padding-bottom: 18px; }
46
+ .brand { min-width: 0; }
47
+ .eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 700 12px/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-strong); background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(11, 156, 148, 0.25); padding: 6px 11px; border-radius: 999px; backdrop-filter: blur(6px); }
48
+ .eyebrow .pulse { width: 7px; height: 7px; }
49
+ .brand h1 { margin: 14px 0 0; font: 800 clamp(34px, 5.4vw, 60px)/1.02 var(--display); letter-spacing: -0.035em; text-wrap: balance; }
50
+ .brand h1 .lit { background: linear-gradient(100deg, var(--accent) 0%, #1fb7a8 40%, var(--amber) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: sheen 6s ease-in-out infinite alternate; }
51
+ @keyframes sheen { to { background-position: 100% 0; } }
52
+ .brand .sub { margin: 12px 0 0; color: var(--muted); max-width: 640px; font-size: 15.5px; }
53
+ .stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
54
+ .stat { display: inline-flex; align-items: baseline; gap: 6px; background: rgba(255, 255, 255, 0.78); border: 1px solid var(--line); border-radius: 12px; padding: 7px 12px; font-size: 13px; color: var(--muted); backdrop-filter: blur(6px); box-shadow: var(--shadow); }
55
+ .stat b { font: 800 17px/1 var(--display); color: var(--ink); letter-spacing: -0.02em; }
56
+ .statusbox { min-width: 270px; max-width: 360px; background: rgba(255, 255, 255, 0.82); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
57
+ .status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
58
+ .status .dot { width: 10px; height: 10px; border-radius: 50%; background: #b5c0cf; flex: none; }
59
+ .status.ready .dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }
60
+ .status.ready { color: var(--accent-strong); }
61
+ .status.loading .dot { background: var(--amber); animation: blink 1s infinite; }
62
+ .status.error .dot { background: var(--bad); }
63
+ @keyframes blink { 50% { opacity: 0.3; } }
64
+ .chips { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
65
+ .chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--card2); color: var(--muted); border: 1px solid var(--line); font-weight: 600; }
66
+ .chip:empty { display: none; }
67
+ .chip.safe { color: var(--accent-strong); border-color: rgba(11, 156, 148, 0.3); background: var(--accent-dim); }
68
+ .progress { height: 6px; background: var(--bg2); border-radius: 3px; margin-top: 10px; overflow: hidden; }
69
+ .progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--amber)); transition: width 0.25s ease; }
70
+ .warn { color: var(--warn); font-size: 12px; margin: 6px 0 0; }
71
+
72
+ /* reel: the sample pictures drift past under the hero */
73
+ .reel { position: relative; overflow: hidden; padding: 4px 0 14px; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
74
+ .reel-track { display: flex; gap: 10px; width: max-content; animation: reel 60s linear infinite; }
75
+ .reel:hover .reel-track { animation-play-state: paused; }
76
+ .reel-track img { opacity: 0; transition: opacity 0.6s ease; height: 74px; width: 104px; object-fit: cover; border-radius: 12px; border: 2px solid #fff; box-shadow: var(--shadow); background: var(--bg2); }
77
+ .reel-track img.in { opacity: 1; }
78
+ @keyframes reel { to { transform: translateX(-50%); } }
79
+
80
+ .tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 14px; }
81
+ .tab { background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line); color: var(--muted); padding: 8px 16px; font: 700 14px/1.2 var(--body); cursor: pointer; border-radius: 999px; white-space: nowrap; }
82
+ .tab:hover { color: var(--ink); }
83
+ .tab.active { color: #fff; background: var(--ink); border-color: var(--ink); }
84
+
85
+ /* ---------------------------------------------------------------- buttons and fields */
86
+ button { font: inherit; cursor: pointer; border-radius: 12px; padding: 8px 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s; }
87
+ button:hover:not(:disabled) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
88
+ button:active:not(:disabled) { transform: scale(0.97); }
89
+ button:disabled { opacity: 0.45; cursor: default; }
90
+ button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; width: 100%; margin-top: 10px; }
91
+ button.primary:hover:not(:disabled) { background: var(--accent-strong); }
92
+ button.primary.inline { width: auto; margin-top: 0; }
93
+ button.ghost { background: transparent; }
94
+ button.small { padding: 4px 10px; font-size: 13px; }
95
+ select, input[type=text], textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 11px; width: 100%; }
96
+ select:focus, input:focus, textarea:focus { outline: 3px solid var(--accent-dim); border-color: var(--accent); }
97
+ textarea { resize: vertical; font-family: var(--mono); font-size: 13px; }
98
+ input[type=range] { accent-color: var(--accent); width: 100%; }
99
+ .note { color: var(--muted); font-size: 13px; margin: 8px 0; }
100
+
101
+ /* ---------------------------------------------------------------- live layout */
102
+ .view { padding-top: 22px; padding-bottom: 18px; animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
103
+ @keyframes rise { from { opacity: 0; transform: translateY(10px); } }
104
+ .livegrid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; align-items: start; }
105
+ @media (max-width: 900px) { .livegrid { grid-template-columns: 1fr; } }
106
+ .sources { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
107
+ .src { border-radius: 999px; font-weight: 600; }
108
+ .src.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
109
+ .stage { position: relative; aspect-ratio: 4 / 3; background: #e9eef5; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-lift); }
110
+ .stage video, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
111
+ .stage video { opacity: 0; }
112
+ .stage.camera video { opacity: 1; }
113
+ .stage.camera canvas { opacity: 0; }
114
+ .stage.mirror video { transform: scaleX(-1); }
115
+ /* a soft beam sweeps over the picture while decisions are running */
116
+ .scan { position: absolute; left: 0; right: 0; height: 28%; top: -30%; pointer-events: none; background: linear-gradient(180deg, rgba(242, 162, 12, 0) 0%, rgba(242, 162, 12, 0.16) 70%, rgba(255, 214, 120, 0.55) 100%); border-bottom: 2px solid rgba(255, 200, 80, 0.85); opacity: 0; }
117
+ .stage.running .scan { opacity: 1; animation: sweep 2.6s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
118
+ @keyframes sweep { to { top: 102%; } }
119
+ .badge { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.86); color: var(--ink); border: 1px solid rgba(11, 156, 148, 0.35); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; backdrop-filter: blur(8px); box-shadow: var(--shadow); }
120
+ .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(11, 156, 148, 0.6); animation: pulse 1.6s infinite; flex: none; }
121
+ @keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(11, 156, 148, 0); } 100% { box-shadow: 0 0 0 0 rgba(11, 156, 148, 0); } }
122
+ .hud { position: absolute; top: 12px; right: 12px; background: rgba(255, 255, 255, 0.86); padding: 6px 11px; border-radius: 999px; font: 12.5px var(--mono); color: var(--muted); box-shadow: var(--shadow); backdrop-filter: blur(8px); }
123
+ .hud span:not(.sep):not(.unit) { color: var(--ink); font-weight: 700; }
124
+ .hud .sep { opacity: 0.4; margin: 0 4px; }
125
+ .overlay { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 14px; background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 18px; padding: 10px 16px; backdrop-filter: blur(10px); box-shadow: var(--shadow-lift); }
126
+ .ring { width: 76px; height: 76px; flex: none; transform: rotate(-90deg); }
127
+ .ring circle { fill: none; stroke-width: 10; }
128
+ .ring-bg { stroke: var(--bg2); }
129
+ .ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 326.73; transition: stroke-dashoffset 0.35s ease, stroke 0.35s; }
130
+ .overlay.uncertain .ring-fg { stroke: var(--amber); }
131
+ .ovtext { min-width: 0; }
132
+ .ovq { color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
133
+ .ovlabel { font: 800 clamp(24px, 4.4vw, 40px)/1.08 var(--display); letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--accent-strong); }
134
+ .ovlabel.pop { animation: pop 0.42s cubic-bezier(0.2, 1.4, 0.4, 1); }
135
+ @keyframes pop { 0% { transform: scale(0.82); opacity: 0.3; } 100% { transform: none; opacity: 1; } }
136
+ .overlay.uncertain .ovlabel { color: var(--warn); }
137
+ .ovpct { font: 12.5px var(--mono); color: var(--muted); }
138
+ .idle { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; background: radial-gradient(ellipse at 50% 45%, rgba(255, 236, 190, 0.85), rgba(245, 247, 251, 0.94) 65%); padding: 16px; }
139
+ .idle p { color: var(--muted); font-size: 13px; margin: 0; max-width: 420px; }
140
+ button.big { background: linear-gradient(100deg, var(--accent) 0%, #17b3a6 55%, #e7a015 130%); color: #fff; border: none; font: 800 18px/1 var(--display); letter-spacing: -0.01em; padding: 17px 30px; border-radius: 999px; box-shadow: 0 10px 30px rgba(11, 156, 148, 0.32); animation: breathe 2.4s ease-in-out infinite; }
141
+ button.big:hover:not(:disabled) { box-shadow: 0 14px 36px rgba(11, 156, 148, 0.42); }
142
+ @keyframes breathe { 50% { transform: scale(1.04); } }
143
+ .controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-top: 12px; }
144
+ .controls label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; flex: 1; min-width: 120px; font-weight: 600; }
145
+ .gate { display: flex; gap: 10px; align-items: center; margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; flex-wrap: wrap; box-shadow: var(--shadow); }
146
+ .gate > div { display: flex; flex-direction: column; flex: 1; min-width: 90px; }
147
+ .gnum { font: 800 28px/1.1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
148
+ .gnum.accent { color: var(--accent-strong); }
149
+ .gnum.warnc { color: var(--warn); }
150
+ .glab { font-size: 12px; color: var(--muted); font-weight: 600; }
151
+
152
+ /* decision stream: one row per real decision on the primary card */
153
+ .stream { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
154
+ .streamhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
155
+ .streamhead h3 { margin: 0; font: 800 16px/1.2 var(--display); letter-spacing: -0.01em; }
156
+ .streamhead .note { margin: 0; font-size: 12px; }
157
+ .streamlist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; min-height: 52px; }
158
+ .streamlist:empty::before { content: "Start live decisions and each result appears here as it happens."; color: var(--muted); font-size: 13px; }
159
+ .tick { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 12px; background: var(--card2); animation: slidein 0.45s cubic-bezier(0.2, 0.9, 0.2, 1); }
160
+ .tick:first-child { background: linear-gradient(90deg, var(--accent-dim), var(--card2)); }
161
+ .tick.uncertain:first-child { background: linear-gradient(90deg, var(--amber-dim), var(--card2)); }
162
+ @keyframes slidein { from { opacity: 0; transform: translateY(-12px) scale(0.98); } }
163
+ .tick img { width: 52px; height: 40px; object-fit: cover; border-radius: 8px; display: block; background: var(--bg2); }
164
+ .tick .tl { min-width: 0; }
165
+ .tick .tq { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
166
+ .tick .tv { font: 800 16px/1.2 var(--display); color: var(--accent-strong); }
167
+ .tick.uncertain .tv { color: var(--warn); }
168
+ .tick .tm { font: 12px var(--mono); color: var(--muted); text-align: right; white-space: nowrap; }
169
+ .tick .tm b { display: block; font-size: 14px; color: var(--ink); }
170
+
171
+ /* ---------------------------------------------------------------- cards */
172
+ .cardhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
173
+ .cardhead h2 { margin: 0 0 12px; font: 800 20px/1.2 var(--display); letter-spacing: -0.02em; }
174
+ .cards { display: grid; gap: 12px; }
175
+ .dcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s; box-shadow: var(--shadow); animation: rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
176
+ .dcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
177
+ .dcard.primary { border-color: rgba(11, 156, 148, 0.55); box-shadow: 0 0 0 3px var(--accent-dim), var(--shadow); }
178
+ .dcard.uncertain { border-color: rgba(242, 162, 12, 0.6); }
179
+ .dtop { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
180
+ .dtitle { font-weight: 700; font-size: 15px; }
181
+ .dact { display: flex; gap: 4px; flex: none; }
182
+ .dact button { padding: 2px 9px; font-size: 12px; border-radius: 8px; }
183
+ .dverdict { margin: 6px 0 8px; font-size: 13px; color: var(--muted); min-height: 20px; }
184
+ .dverdict b { color: var(--accent-strong); font: 800 17px/1.2 var(--display); }
185
+ .dcard.uncertain .dverdict b { color: var(--warn); }
186
+ .obar { display: grid; grid-template-columns: minmax(70px, 34%) 1fr 48px; gap: 8px; align-items: center; margin: 5px 0; font-size: 13px; }
187
+ .obar .k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
188
+ .obar.top .k { color: var(--ink); font-weight: 700; }
189
+ .obar .track { height: 12px; background: var(--bg2); border-radius: 6px; overflow: hidden; position: relative; }
190
+ .obar .fill { height: 100%; width: 0; background: #c3cddb; border-radius: 6px; transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s; }
191
+ .obar.top .fill { background: linear-gradient(90deg, var(--accent), #2cc2b3); }
192
+ .dcard.uncertain .obar.top .fill { background: linear-gradient(90deg, #e39410, var(--amber)); }
193
+ .obar .p { text-align: right; font: 12.5px var(--mono); }
194
+ .thr { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); }
195
+ .thr input { flex: 1; }
196
+ .thr .tv { width: 34px; text-align: right; color: var(--ink); font-family: var(--mono); }
197
+ .dstats { font-size: 12px; color: var(--muted); margin-top: 4px; }
198
+ .dedit { margin-top: 8px; display: grid; gap: 6px; }
199
+ .templates { margin-top: 18px; }
200
+ .templates h3 { font-size: 13px; margin: 0 0 8px; color: var(--muted); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
201
+ .tpls { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
202
+ .tpls button { font-size: 13px; padding: 6px 12px; border-radius: 999px; }
203
+
204
+ /* ---------------------------------------------------------------- single / samples */
205
+ .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
206
+ @media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
207
+ .panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; box-shadow: var(--shadow); }
208
+ .panel h2 { margin: 0 0 12px; font: 800 21px/1.2 var(--display); letter-spacing: -0.02em; }
209
+ .wide { grid-column: 1 / -1; }
210
+ .subtabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
211
+ .subtab { padding: 5px 13px; font-size: 13px; border-radius: 999px; }
212
+ .subtab.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
213
+ .col { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-size: 13px; color: var(--muted); font-weight: 600; }
214
+ .drop { display: block; border: 2px dashed var(--line); border-radius: 14px; padding: 12px; color: var(--muted); cursor: pointer; margin: 8px 0; font-size: 13px; background: var(--card2); transition: border-color 0.15s; }
215
+ .drop:hover { border-color: var(--accent); }
216
+ .drop input { display: block; margin-bottom: 4px; max-width: 100%; color: var(--ink); }
217
+ #imagePreview, #videoPreview { max-width: 100%; max-height: 300px; border-radius: 12px; display: block; margin-top: 8px; }
218
+ #audioPreview { width: 100%; margin-top: 8px; }
219
+ .seg { display: flex; gap: 16px; font-size: 14px; }
220
+ .seg input { accent-color: var(--accent); }
221
+ .adv { margin: 10px 0; border-top: 1px solid var(--line); padding-top: 8px; }
222
+ .adv summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; }
223
+ .decision { font: 800 24px/1.2 var(--display); margin: 0 0 10px; letter-spacing: -0.02em; animation: pop 0.42s cubic-bezier(0.2, 1.4, 0.4, 1); }
224
+ .decision b { color: var(--accent-strong); }
225
+ .meta { color: var(--muted); font-size: 13px; margin-top: 10px; }
226
+ .prompts { margin-top: 8px; font-size: 12px; color: var(--muted); }
227
+ .prompts pre { white-space: pre-wrap; word-break: break-word; background: var(--card2); border: 1px solid var(--line); padding: 8px; border-radius: 10px; color: var(--ink); font-family: var(--mono); }
228
+ .btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
229
+ .summary { margin: 12px 0; font-size: 16px; }
230
+ .summary b { color: var(--accent-strong); font: 800 20px/1 var(--display); }
231
+ .tablewrap { overflow-x: auto; margin-top: 8px; }
232
+ table { border-collapse: collapse; width: 100%; font-size: 13px; }
233
+ th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
234
+ th { color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
235
+ tbody tr { animation: slidein 0.35s ease; }
236
+ td { font-variant-numeric: tabular-nums; }
237
+ td.ok { color: var(--good); font-weight: 700; }
238
+ td.no { color: var(--bad); font-weight: 700; }
239
+ .prose { max-width: 860px; }
240
+ .prose li { margin: 6px 0; }
241
+ .prose h3 { margin: 20px 0 6px; font: 800 17px/1.2 var(--display); }
242
+ .foot { color: var(--muted); font-size: 12.5px; padding-bottom: 28px; }
243
+ @media (max-width: 760px) {
244
+ .topbar { flex-direction: column; align-items: stretch; gap: 14px; padding-top: 20px; }
245
+ .statusbox { min-width: 0; max-width: none; width: 100%; }
246
+ .brand .sub { font-size: 14px; }
247
+ .reel-track img { height: 56px; width: 80px; }
248
+ }
249
+ @media (max-width: 600px) {
250
+ .ring { width: 58px; height: 58px; }
251
+ .stage { aspect-ratio: 3 / 4; }
252
+ .badge { font-size: 11.5px; padding: 4px 9px; left: 8px; top: 8px; }
253
+ .hud { top: 44px; left: 8px; right: auto; font-size: 11.5px; }
254
+ .overlay { left: 8px; right: 8px; bottom: 8px; gap: 10px; padding: 8px 10px; }
255
+ }
256
+
257
+ /* ---------------------------------------------------------------- egg check */
258
+ .egggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; margin: 14px 0; }
259
+ .eggthumb { position: relative; padding: 6px; display: flex; flex-direction: column; gap: 5px; align-items: stretch; font-size: 12px; color: var(--muted); border-radius: 16px; box-shadow: var(--shadow); }
260
+ .eggthumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 11px; background: #1b1b1b; display: block; }
261
+ .eggthumb.busy img { animation: candle 0.9s ease-in-out infinite alternate; }
262
+ @keyframes candle { from { filter: brightness(1); } to { filter: brightness(1.45) saturate(1.2); } }
263
+ .eggthumb .stamp { position: absolute; top: 12px; right: 12px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font: 800 12px/1 var(--body); color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); animation: stamp 0.45s cubic-bezier(0.2, 1.5, 0.4, 1); }
264
+ .eggthumb .stamp.good { background: var(--good); }
265
+ .eggthumb .stamp.bad { background: var(--bad); }
266
+ .eggthumb .stamp.miss { outline: 3px solid var(--amber); }
267
+ @keyframes stamp { from { transform: scale(2.2) rotate(-12deg); opacity: 0; } }
268
+ .btnrow .drop.inline { display: inline-block; margin: 0; padding: 8px 12px; }
269
+ .eggresult { display: grid; grid-template-columns: minmax(120px, 220px) 1fr; gap: 16px; align-items: start; margin: 12px 0; }
270
+ .eggresult img { width: 100%; border-radius: 14px; background: #1b1b1b; box-shadow: var(--shadow); }
271
+ @media (max-width: 560px) { .eggresult { grid-template-columns: 1fr; } }
272
+ .okc { color: var(--good); font-weight: 700; margin-left: 6px; font-size: 15px; font-family: var(--body); }
273
+ .noc { color: var(--bad); font-weight: 700; margin-left: 6px; font-size: 15px; font-family: var(--body); }
274
+ img.mini { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-right: 6px; }
275
+ .dctx { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
276
+ .dedit input + input { margin-top: 6px; }
277
+
278
+ @media (prefers-reduced-motion: reduce) {
279
+ *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
280
+ .reel-track { animation: none; }
281
+ .stage.running .scan { opacity: 0; }
282
+ }