Saidwire commited on
Commit
b56c7c1
·
verified ·
1 Parent(s): 2e92c25

Static speed test page

Browse files
Files changed (4) hide show
  1. README.md +62 -4
  2. app.js +221 -0
  3. index.html +55 -17
  4. style.css +65 -27
README.md CHANGED
@@ -1,10 +1,68 @@
1
  ---
2
- title: Stt Speed Test
3
- emoji: 🚀
4
- colorFrom: green
5
  colorTo: gray
6
  sdk: static
 
7
  pinned: false
 
 
 
 
 
 
 
 
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: How fast is your speech-to-text?
3
+ emoji: ⚡
4
+ colorFrom: indigo
5
  colorTo: gray
6
  sdk: static
7
+ app_file: index.html
8
  pinned: false
9
+ license: mit
10
+ short_description: Time end-of-speech to final transcript, live
11
+ tags:
12
+ - speech-to-text
13
+ - asr
14
+ - real-time
15
+ - streaming
16
+ - latency
17
+ - transcription
18
+ - voice-agents
19
  ---
20
 
21
+ # How fast is your speech-to-text?
22
+
23
+ Click **Talk** and say a sentence or two. The page streams your microphone to the
24
+ [Saidwire](https://saidwire.com) real-time speech-to-text API at normal speed, like a live call,
25
+ shows the words as they arrive, and times the last step: from the end of your speech to the final
26
+ transcript.
27
+
28
+ **35 ms median after Finalize, measured in US East; your network round trip adds to what you see.**
29
+
30
+ **How it's measured.** The page listens for a short pause (0.35 s) to decide you have finished, then
31
+ sends a `Finalize` message (the "user stopped talking" signal a voice agent sends). Our proxy server
32
+ starts the clock when it passes `Finalize` to the speech service and stops it when the final
33
+ transcript comes back. That is the big number. The page also measures your own round trip and shows
34
+ it under each sentence.
35
+
36
+ For comparison, other speech-to-text providers publish final-transcript times of about 300-350 ms.
37
+
38
+ ## Use it in your own app
39
+
40
+ - Get 120 free hours: **[saidwire.com/dev](https://saidwire.com/dev)** (no card)
41
+ - Docs: [saidwire.com/docs/api](https://saidwire.com/docs/api)
42
+ - English. $0.30 per audio hour.
43
+
44
+ ```python
45
+ # pip install websockets
46
+ import asyncio, json, os
47
+ from websockets.asyncio.client import connect
48
+
49
+ URL = "wss://api.saidwire.com/v1/listen?encoding=linear16&sample_rate=16000&interim_results=true&punctuate=true"
50
+
51
+ async def main(pcm: bytes): # 16 kHz mono 16-bit PCM
52
+ async with connect(URL, additional_headers={"Authorization": f"Token {os.environ['SAIDWIRE_API_KEY']}"}) as ws:
53
+ for i in range(0, len(pcm), 640): # 20 ms frames, real time
54
+ await ws.send(pcm[i:i + 640]); await asyncio.sleep(0.02)
55
+ await ws.send(json.dumps({"type": "Finalize"})) # user stopped talking
56
+ async for raw in ws:
57
+ m = json.loads(raw)
58
+ if m.get("type") == "Results" and m.get("from_finalize"):
59
+ print(m["channel"]["alternatives"][0]["transcript"]); break
60
+ ```
61
+
62
+ ## About this Space
63
+
64
+ This is a static page: no server code and no model run in the Space. The page talks to a small
65
+ Saidwire demo proxy at `saidwire.com`, which holds the API key, so no key is ever in your browser.
66
+ Your audio is streamed to the speech service and is not stored; only the time, length and speed
67
+ numbers of each try are kept, not what you said.
68
+ Limits: 30 seconds per try and 5 tries per hour per visitor, English only.
app.js ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Saidwire speed test (static Hugging Face Space). Mic -> 16 kHz 16-bit PCM over a WebSocket to our proxy (no API key in the page).
2
+ // A small energy detector decides when a sentence ends (0.35 s pause) and sends {"type":"finalize"}.
3
+ // The server times Finalize -> final transcript and sends the number back with the final.
4
+ (function () {
5
+ "use strict";
6
+ var WS_URL = "wss://saidwire.com/demo-api/stt/ws"; // Saidwire demo proxy: holds the key, times Finalize
7
+ var PAUSE_MS = 350, FRAME = 320; // 20 ms at 16 kHz
8
+ var $ = function (id) { return document.getElementById(id); };
9
+ var btn = $("sp-btn"), msEl = $("sp-ms"), numEl = msEl.parentNode, brk = $("sp-break"),
10
+ statusEl = $("sp-status"), logEl = $("sp-log"), sumEl = $("sp-sum"), level = $("sp-level"),
11
+ bar = $("sp-bar"), timeEl = $("sp-time");
12
+
13
+ var ws = null, ctx = null, stream = null, node = null, src = null, running = false, ready = false;
14
+ var maxS = 30, sentSamples = 0, pre = [], netMs = null;
15
+ var inBuf = [], ratio = 3, pos = 0, out = new Int16Array(FRAME), outN = 0;
16
+ var vad = { floor: -60, speech: false, above: 0, quiet: 0, voiced: 0 };
17
+ var fid = 0, sentAt = {}, interimEl = null, results = [];
18
+
19
+ function setStatus(t, err) { statusEl.textContent = t; statusEl.className = "sp-status" + (err ? " err" : ""); }
20
+ function esc(s) { var d = document.createElement("div"); d.textContent = s; return d.innerHTML; }
21
+
22
+ btn.addEventListener("click", function () { running ? stop(true) : start(); });
23
+
24
+ function start() {
25
+ if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {
26
+ setStatus("This browser cannot use the microphone here. Try a recent Chrome, Safari, Edge or Firefox.", true);
27
+ return;
28
+ }
29
+ btn.disabled = true;
30
+ setStatus("Asking for the microphone...");
31
+ var AC = window.AudioContext || window.webkitAudioContext;
32
+ ctx = new AC();
33
+ navigator.mediaDevices.getUserMedia({ audio: { channelCount: 1, echoCancellation: true,
34
+ noiseSuppression: true, autoGainControl: true } })
35
+ .then(function (s) { stream = s; return ctx.resume(); })
36
+ .then(setupAudio)
37
+ .then(openSocket)
38
+ .catch(function (e) {
39
+ cleanup();
40
+ btn.disabled = false;
41
+ setStatus(e && e.name === "NotAllowedError" ? "Microphone access was blocked. Allow it in your browser and try again" + (window.top !== window ? ", or open this page full screen: " + location.href : ".")
42
+ : "Could not start the microphone (" + (e && e.message || e) + ").", true);
43
+ });
44
+ }
45
+
46
+ function setupAudio() {
47
+ ratio = ctx.sampleRate / 16000; pos = 0; inBuf = []; outN = 0; sentSamples = 0; pre = [];
48
+ vad = { floor: -60, speech: false, above: 0, quiet: 0, voiced: 0 };
49
+ src = ctx.createMediaStreamSource(stream);
50
+ if (ctx.audioWorklet && window.AudioWorkletNode) {
51
+ var code = "class P extends AudioWorkletProcessor{process(i){if(i[0]&&i[0][0])this.port.postMessage(i[0][0].slice(0));return true}}registerProcessor('sw-cap',P);";
52
+ var url = URL.createObjectURL(new Blob([code], { type: "application/javascript" }));
53
+ return ctx.audioWorklet.addModule(url).then(function () {
54
+ node = new AudioWorkletNode(ctx, "sw-cap");
55
+ node.port.onmessage = function (e) { onAudio(e.data); };
56
+ src.connect(node);
57
+ });
58
+ }
59
+ node = ctx.createScriptProcessor(2048, 1, 1); // older browsers
60
+ node.onaudioprocess = function (e) { onAudio(e.inputBuffer.getChannelData(0).slice(0)); };
61
+ src.connect(node); node.connect(ctx.destination);
62
+ }
63
+
64
+ // Box-filter decimation to 16 kHz, then 20 ms frames.
65
+ function onAudio(f32) {
66
+ if (!running) return;
67
+ for (var i = 0; i < f32.length; i++) inBuf.push(f32[i]);
68
+ while (pos + ratio <= inBuf.length) {
69
+ var a = Math.floor(pos), b = Math.max(a + 1, Math.floor(pos + ratio)), s = 0;
70
+ for (var j = a; j < b; j++) s += inBuf[j];
71
+ var v = s / (b - a);
72
+ out[outN++] = Math.max(-32768, Math.min(32767, Math.round(v * 32767)));
73
+ pos += ratio;
74
+ if (outN === FRAME) { onFrame(out.slice(0)); outN = 0; }
75
+ }
76
+ var drop = Math.floor(pos);
77
+ if (drop > 0) { inBuf = inBuf.slice(drop); pos -= drop; }
78
+ }
79
+
80
+ function onFrame(fr) {
81
+ var e = 0;
82
+ for (var i = 0; i < fr.length; i++) { var x = fr[i] / 32768; e += x * x; }
83
+ var db = 10 * Math.log10(e / fr.length + 1e-12);
84
+ level.style.width = Math.max(0, Math.min(100, (db + 60) * 2)) + "%";
85
+ if (!ready) { if (pre.length < 150) pre.push(fr); runVad(db); return; }
86
+ send(fr);
87
+ runVad(db);
88
+ }
89
+
90
+ function send(fr) {
91
+ if (ws && ws.readyState === 1) {
92
+ ws.send(fr.buffer);
93
+ sentSamples += fr.length;
94
+ var t = sentSamples / 16000;
95
+ bar.style.width = Math.min(100, t / maxS * 100) + "%";
96
+ timeEl.textContent = Math.max(0, Math.ceil(maxS - t)) + " s left";
97
+ }
98
+ }
99
+
100
+ function runVad(db) {
101
+ var thr = Math.max(vad.floor + 10, -50);
102
+ if (!vad.speech) vad.floor = Math.min(-20, vad.floor * 0.97 + db * 0.03);
103
+ if (db > thr) {
104
+ vad.above++; vad.quiet = 0;
105
+ if (vad.above >= 2 && !vad.speech) { vad.speech = true; vad.voiced = 0; }
106
+ if (vad.speech) vad.voiced++;
107
+ } else {
108
+ vad.above = 0;
109
+ if (vad.speech) {
110
+ vad.quiet += 20;
111
+ if (vad.quiet >= PAUSE_MS) {
112
+ vad.speech = false; vad.quiet = 0;
113
+ if (vad.voiced >= 8 && ready) finalize(); // ignore clicks shorter than ~160 ms
114
+ }
115
+ }
116
+ }
117
+ }
118
+
119
+ function finalize() {
120
+ if (!ws || ws.readyState !== 1) return;
121
+ fid++;
122
+ sentAt[fid] = performance.now();
123
+ ws.send(JSON.stringify({ type: "finalize", id: fid }));
124
+ numEl.classList.add("wait");
125
+ msEl.textContent = "...";
126
+ }
127
+
128
+ function openSocket() {
129
+ running = true;
130
+ ws = new WebSocket(WS_URL);
131
+ ws.binaryType = "arraybuffer";
132
+ setStatus("Connecting...");
133
+ ws.onmessage = function (ev) {
134
+ var m; try { m = JSON.parse(ev.data); } catch (e) { return; }
135
+ if (m.type === "ready") {
136
+ ready = true; maxS = m.max_s || 30; netMs = m.net_ms;
137
+ btn.disabled = false; btn.textContent = "Stop"; btn.classList.add("live");
138
+ setStatus("Listening. Say a sentence, then pause.");
139
+ for (var i = 0; i < pre.length; i++) send(pre[i]);
140
+ pre = [];
141
+ } else if (m.type === "interim") {
142
+ if (!m.text) return;
143
+ if (!interimEl) { interimEl = document.createElement("div"); interimEl.className = "sp-line interim"; logEl.appendChild(interimEl); }
144
+ interimEl.innerHTML = '<span class="t">' + esc(m.text) + "</span>";
145
+ logEl.scrollTop = logEl.scrollHeight;
146
+ } else if (m.type === "final") {
147
+ onFinal(m);
148
+ } else if (m.type === "cap") {
149
+ setStatus("That's the 30-second limit for one try.");
150
+ } else if (m.type === "error") {
151
+ setStatus(m.msg || "Something went wrong.", true);
152
+ } else if (m.type === "end") {
153
+ if (m.tries_left !== undefined) setStatus(statusEl.className.indexOf("err") < 0 ?
154
+ ("Done. " + (m.tries_left > 0 ? m.tries_left + (m.tries_left === 1 ? " try" : " tries") + " left this hour." : "No tries left this hour.")) : statusEl.textContent,
155
+ statusEl.className.indexOf("err") >= 0);
156
+ stop(false);
157
+ }
158
+ };
159
+ ws.onclose = function () { if (running) stop(false); };
160
+ ws.onerror = function () { setStatus("Could not reach the demo server.", true); };
161
+ }
162
+
163
+ function onFinal(m) {
164
+ var rtt = (m.id && sentAt[m.id]) ? performance.now() - sentAt[m.id] : null;
165
+ if (!m.text) { if (interimEl) { interimEl.remove(); interimEl = null; } if (numEl.classList.contains("wait")) { numEl.classList.remove("wait"); msEl.textContent = results.length ? Math.round(results[results.length - 1]) : "–"; } return; }
166
+ var line = interimEl || document.createElement("div");
167
+ interimEl = null;
168
+ line.className = "sp-line";
169
+ var sub = "";
170
+ if (m.ms != null) {
171
+ results.push(m.ms);
172
+ numEl.classList.remove("wait"); numEl.classList.remove("flash"); void numEl.offsetWidth; numEl.classList.add("flash");
173
+ msEl.textContent = Math.round(m.ms);
174
+ sub = "measured on our server";
175
+ if (rtt != null) sub += " · with your internet round trip: " + Math.round(rtt) + " ms";
176
+ if (netMs != null) brk.textContent = "Includes about " + Math.round(netMs) + " ms of network between our web server and our speech servers (measured on this try).";
177
+ var sorted = results.slice().sort(function (a, b) { return a - b; });
178
+ var med = sorted.length % 2 ? sorted[(sorted.length - 1) / 2] : (sorted[sorted.length / 2 - 1] + sorted[sorted.length / 2]) / 2;
179
+ sumEl.textContent = results.length > 1 ? ("Your " + results.length + " sentences: fastest " + Math.round(sorted[0]) + " ms, median " + Math.round(med) + " ms.") : "";
180
+ } else {
181
+ sub = "final sent without a pause (long sentence or end of try)";
182
+ }
183
+ line.innerHTML = '<span class="t">' + esc(m.text) + '</span><span class="ms">' + (m.ms != null ? Math.round(m.ms) + " ms" : "") +
184
+ '</span><span class="sub">' + esc(sub) + "</span>";
185
+ if (!line.parentNode) logEl.appendChild(line);
186
+ logEl.scrollTop = logEl.scrollHeight;
187
+ }
188
+
189
+ function stop(byUser) {
190
+ if (byUser && ws && ws.readyState === 1) {
191
+ if (vad.speech && vad.voiced >= 8) finalize(); // tapping Stop also counts as "I'm done"
192
+ ws.send(JSON.stringify({ type: "stop" }));
193
+ setStatus("Finishing...");
194
+ running = false; // keep the socket for the last final + "end"
195
+ releaseMic();
196
+ btn.disabled = true;
197
+ setTimeout(function () { if (ws) { try { ws.close(); } catch (e) {} } finish(); }, 4000);
198
+ return;
199
+ }
200
+ finish();
201
+ }
202
+
203
+ function finish() {
204
+ running = false; ready = false;
205
+ releaseMic();
206
+ if (ws) { try { ws.onclose = null; if (ws.readyState <= 1) ws.close(); } catch (e) {} ws = null; }
207
+ if (numEl.classList.contains("wait")) { numEl.classList.remove("wait"); msEl.textContent = results.length ? Math.round(results[results.length - 1]) : "–"; }
208
+ btn.disabled = false; btn.textContent = "Talk again"; btn.classList.remove("live");
209
+ level.style.width = "0"; timeEl.textContent = "";
210
+ }
211
+
212
+ function releaseMic() {
213
+ try { if (src) src.disconnect(); } catch (e) {}
214
+ try { if (node) { node.disconnect(); if (node.port) node.port.onmessage = null; } } catch (e) {}
215
+ if (stream) stream.getTracks().forEach(function (t) { t.stop(); });
216
+ if (ctx && ctx.state !== "closed") { try { ctx.close(); } catch (e) {} }
217
+ src = node = stream = ctx = null;
218
+ }
219
+
220
+ function cleanup() { running = false; ready = false; releaseMic(); if (ws) { try { ws.close(); } catch (e) {} ws = null; } }
221
+ })();
index.html CHANGED
@@ -1,19 +1,57 @@
1
  <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </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,viewport-fit=cover">
6
+ <title>STT speed test</title>
7
+ <meta name="description" content="Talk into your microphone and see how fast Saidwire returns the final transcript after you stop.">
8
+ <link rel="stylesheet" href="style.css">
9
+ </head>
10
+ <body>
11
+ <main class="wrap" id="main">
12
+ <section class="hero">
13
+ <p class="kicker">Saidwire · Speed test</p>
14
+ <h1>How fast is your speech-to-text?</h1>
15
+ <p class="lead">Click Talk and say a sentence or two. Each time you pause, the stopwatch shows how long the final transcript took to come back.</p>
16
+ </section>
17
+
18
+ <section class="sp-card" aria-label="Speed test">
19
+ <div class="sp-watch" aria-live="polite">
20
+ <div class="sp-num"><span id="sp-ms">&ndash;</span><span class="sp-unit">ms</span></div>
21
+ <p class="sp-cap" id="sp-cap">end of speech to final transcript, timed on our server after <code>Finalize</code></p>
22
+ <p class="sp-break muted small" id="sp-break"></p>
23
+ </div>
24
+
25
+ <div class="sp-controls">
26
+ <button class="btn" id="sp-btn" type="button">Talk</button>
27
+ <div class="sp-meter" aria-hidden="true"><i id="sp-level"></i></div>
28
+ <span class="muted small" id="sp-time"></span>
29
+ </div>
30
+ <div class="sp-bar" aria-hidden="true"><i id="sp-bar"></i></div>
31
+ <p class="sp-status" id="sp-status" role="status">Your browser will ask to use the microphone. English only.</p>
32
+
33
+ <div class="sp-log" id="sp-log" aria-live="polite"></div>
34
+ <p class="sp-sum small" id="sp-sum"></p>
35
+ <p class="sp-claim">35&nbsp;ms median after Finalize, measured in US East; your network round trip adds to what you see.</p>
36
+ <p class="sp-others small">Other providers publish about 300&ndash;350&nbsp;ms for final transcripts.</p>
37
+ </section>
38
+
39
+ <section class="sp-cta">
40
+ <p><b>Get 120 free hours:</b> <a href="https://saidwire.com/dev" target="_blank" rel="noopener">https://saidwire.com/dev</a></p>
41
+ <p class="muted small">No card. English. $0.30 per audio hour after that. <a href="https://saidwire.com/docs/api" target="_blank" rel="noopener">API docs</a></p>
42
+ </section>
43
+
44
+ <section class="sp-how">
45
+ <h2>How the stopwatch works</h2>
46
+ <ol>
47
+ <li>The page listens for a short pause (0.35&nbsp;s) to decide you have finished. Voice agents choose this pause themselves, so it is not counted.</li>
48
+ <li>At that moment the page sends a <code>Finalize</code> message. Our proxy server starts the clock when it passes <code>Finalize</code> to the speech service, and stops it when the final transcript comes back. That is the big number.</li>
49
+ <li>The big number includes the network between our proxy and our speech servers. We measure that hop on every try and show it under the number.</li>
50
+ <li>Your own internet connection adds to what you see. The page measures your round trip too and shows it under each sentence.</li>
51
+ </ol>
52
+ <p class="muted small">This page is static: there is no API key in it. It talks to our demo proxy at saidwire.com. Limits: 5 tries an hour, up to 30 seconds each, English only. Your audio is streamed to the speech service and is not stored. We keep only the time of each try, its length and the speed numbers, not what you said.</p>
53
+ </section>
54
+ </main>
55
+ <script src="app.js"></script>
56
+ </body>
57
  </html>
style.css CHANGED
@@ -1,28 +1,66 @@
1
- body {
2
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
4
- }
5
-
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
9
- }
10
-
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
16
- }
17
-
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
24
- }
25
-
26
- .card p:last-child {
27
- margin-bottom: 0;
28
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import url("https://fonts.googleapis.com/css2?family=Archivo+Black&family=IBM+Plex+Mono&family=Inter:wght@400;700&display=swap");
2
+ /* Saidwire speed test: static Hugging Face Space. Dark brand look, always (matches saidwire.com). */
3
+ :root {
4
+ color-scheme: dark;
5
+ --bg: #0e1117; --surface: #151a23; --raise: #1b212c; --line: #262d3a;
6
+ --ink: #e8ebf0; --body: #c3c9d4; --muted: #8b93a1;
7
+ --sig: #f8c93a; --sig-ink: #0e1117; --bad: #ff6b6b;
8
+ --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
9
+ --display: "Archivo Black", "Arial Black", "Helvetica Neue", sans-serif;
10
+ --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  }
12
+ * { box-sizing: border-box; }
13
+ html, body { overflow-x: hidden; }
14
+ body { margin: 0; background: var(--bg); color: var(--body); font: 16px/1.55 var(--sans); }
15
+ h1, h2 { color: var(--ink); margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
16
+ a { color: var(--sig); }
17
+ .wrap { max-width: 860px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)) 40px; }
18
+ .hero { padding-block: 36px 18px; display: grid; gap: 12px; }
19
+ .hero h1 { font: 400 clamp(30px, 6vw, 54px)/1.04 var(--display); text-transform: uppercase; }
20
+ .hero .lead { font-size: 18px; margin: 0; max-width: 42em; }
21
+ .kicker { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
22
+ .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--sig); color: var(--sig-ink); font: 700 16px var(--sans); text-decoration: none; padding: 13px 20px; border-radius: 10px; border: 0; cursor: pointer; }
23
+ .btn:hover { filter: brightness(1.08); }
24
+ .btn:disabled { opacity: .5; cursor: default; }
25
+ .btn:focus-visible, a:focus-visible { outline: 2px solid var(--sig); outline-offset: 3px; }
26
+ .sp-claim { margin: 0; text-align: center; color: var(--ink); font-size: 15px; }
27
+ .sp-cta a { overflow-wrap: anywhere; }
28
+ code { font-family: var(--mono); font-size: .92em; }
29
+ .sp-card { background: var(--surface, #151a22); border: 1px solid var(--line, #262d38); border-radius: 16px; padding: 22px 18px; display: grid; gap: 14px; margin-bottom: 22px; }
30
+ .sp-watch { text-align: center; display: grid; gap: 4px; padding: 6px 0 4px; }
31
+ .sp-num { font: 400 clamp(64px, 16vw, 132px)/1 var(--display); color: var(--sig, #f8c93a); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
32
+ .sp-num.wait { color: var(--muted, #9aa3b2); }
33
+ .sp-num.flash { animation: sp-flash .45s ease-out; }
34
+ @keyframes sp-flash { from { transform: scale(1.06); } to { transform: scale(1); } }
35
+ .sp-unit { font-size: .32em; margin-left: .18em; color: var(--ink, #e8ebf0); }
36
+ .sp-cap { margin: 0; font-size: 16px; }
37
+ .sp-break { margin: 0; min-height: 1.4em; }
38
+ .sp-controls { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center; }
39
+ #sp-btn { min-width: 170px; font-size: 18px; }
40
+ #sp-btn.live { background: var(--bad, #ff6b6b); border-color: var(--bad, #ff6b6b); color: #111; }
41
+ .sp-meter { width: 120px; height: 10px; border-radius: 6px; background: var(--raise, #1d2430); overflow: hidden; }
42
+ .sp-meter i { display: block; height: 100%; width: 0; background: var(--sig, #f8c93a); transition: width .06s linear; }
43
+ .sp-bar { height: 4px; border-radius: 3px; background: var(--raise, #1d2430); overflow: hidden; }
44
+ .sp-bar i { display: block; height: 100%; width: 0; background: var(--muted, #9aa3b2); }
45
+ .sp-status { margin: 0; text-align: center; font-size: 15px; min-height: 1.4em; }
46
+ .sp-status.err { color: var(--bad, #ff6b6b); }
47
+ .sp-log { display: grid; gap: 8px; min-height: 60px; max-height: 340px; overflow-y: auto; align-content: start; }
48
+ .sp-line { background: var(--raise, #1d2430); border-radius: 12px; padding: 10px 13px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
49
+ .sp-line .t { font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
50
+ .sp-line .ms { font: 400 20px var(--display); color: var(--sig, #f8c93a); white-space: nowrap; }
51
+ .sp-line .sub { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted, #9aa3b2); }
52
+ .sp-line.interim .t { opacity: .6; font-style: italic; }
53
+ .sp-sum { margin: 0; text-align: center; }
54
+ .sp-others { margin: 0; text-align: center; color: var(--muted, #9aa3b2); }
55
+ .sp-how { margin-bottom: 22px; }
56
+ .sp-how h2 { font-size: 20px; }
57
+ .sp-how ol { padding-left: 1.2em; display: grid; gap: 6px; line-height: 1.5; }
58
+ .sp-how code { font-family: var(--mono); font-size: .92em; }
59
+ .sp-cta { background: var(--surface, #151a22); border: 1px solid var(--line, #262d38); border-radius: 16px; padding: 18px; margin-bottom: 18px; }
60
+ .sp-cta p { margin: 0 0 12px; line-height: 1.5; }
61
+ .sp-cta p:last-child { margin: 0; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
62
+ .sp-link { color: var(--ink, #e8ebf0); }
63
+ .sp-foot { padding-block: 10px 40px; }
64
+ .muted { color: var(--muted, #9aa3b2); }
65
+ .small { font-size: 13.5px; }
66
+ @media (max-width: 560px) { .sp-card { padding: 18px 14px; } .sp-meter { width: 90px; } }