Repository navigation
Expand file tree
/
Copy pathcontrols.css
More file actions
504 lines (476 loc) · 33.6 KB
/
Copy pathcontrols.css
File metadata and controls
504 lines (476 loc) · 33.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
/* ============================================================
polarize-ui — CONTROLS layer
Hardware-style controls for audio and instrument interfaces: the knob, the
detented fader (horizontal, vertical, bipolar ribbon), a polar panner, an
automation lane, a scene timeline (blocks for holds, wedges for transitions),
the channel strip, level meters, a glide readout, linked-value and delta
chips, the sync-state pill, a hold-to-confirm button over a hazard surface,
a bottom sheet, a bottom tab bar, a low-luminance night view, a gauge, an
on-screen keyboard and a key lane.
Load AFTER design.css (zero-build) or after src/index.css (React). The
behaviour (drag, fine adjust, detents, the SVG views) is controls.js; every
control here still renders without it, and the faders and knobs fall back to
the native range input underneath.
Rules, the same as design.css and the other layers, checked by dev_check.py:
· every colour is a token — no hex, no rgb()
· the sans is never bold and never tracked
· uppercase is always the mono face
· the brand colour is read through --pub-accent
Inks. Under the Polarize theme the controls use its three spot inks, each
with one job: clay for signal and action (the value, the live scene, the
play button), ochre for what a person placed or owns (their own calibrated
mark, a value linked to it, a hand-drawn curve), lichen for machine state
(saved, met, replaced). Other themes have no validated values for those
inks, so there the controls fall back to the brand colour and plain ink.
A hard limit is drawn as a heavier end-stop in the foreground colour, never
in a tier colour: the epistemic palette is reserved.
============================================================ */
:where(.ui-control, .ui-fader, .ui-knob, .ui-panner, .ui-lane, .ui-timeline, .ui-strip,
.ui-meter, .ui-glide, .ui-tag--linked, .ui-delta, .ui-sync, .ui-hold, .ui-hazard,
.ui-sheet, .ui-tabbar, .ui-night, .ui-gauge, .ui-keyboard, .ui-keylane) {
--ctl-signal: var(--clay, var(--pub-accent, var(--accent)));
--ctl-signal-tint: var(--clay-tint, color-mix(in oklab, var(--pub-accent, var(--accent)) 14%, transparent));
--ctl-human: var(--ochre, var(--foreground));
--ctl-human-tint: var(--ochre-tint, var(--muted));
--ctl-machine: var(--lichen-text, var(--muted-foreground));
--ctl-machine-tint: var(--lichen-tint, var(--muted));
--ctl-row: var(--line-row, var(--border));
--ctl-ease: cubic-bezier(.2, .7, .3, 1);
}
/* ---------- Control shell: name, value, range ---------- */
.ui-control { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.ui-control__head { display: flex; align-items: center; gap: var(--space-2); min-height: 28px; }
/* The label is muted, not faint: at 10.5px it has to clear 4.5:1 on a card. */
.ui-control__name {
font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500;
letter-spacing: .12em; text-transform: uppercase; color: var(--muted-foreground); margin: 0;
}
.ui-control__value {
margin-left: auto; min-height: 28px; padding: 0 var(--space-2);
background: none; border: 1px solid transparent; border-radius: var(--radius-xs);
color: var(--foreground); font-family: var(--font-mono); font-size: var(--text-sm);
font-variant-numeric: tabular-nums; cursor: text;
}
.ui-control__value:hover { border-color: var(--border-strong); }
.ui-control__value:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.ui-control__entry {
margin-left: auto; width: 9ch; min-height: 28px; padding: 0 var(--space-2);
background: var(--muted); border: 1px solid var(--border-strong); border-radius: var(--radius-xs);
color: var(--foreground); font-family: var(--font-mono); font-size: var(--text-sm); text-align: right;
}
.ui-control__range {
display: flex; justify-content: space-between; gap: var(--space-2);
font-family: var(--font-mono); font-size: var(--text-xs); color: var(--faint-foreground);
font-variant-numeric: tabular-nums;
}
/* The ceiling is always printed. When a value reaches it, the print comes forward. */
.ui-control__max { color: var(--muted-foreground); }
.ui-control[data-at-limit] .ui-control__max { color: var(--foreground); }
.ui-control__note { font-size: var(--text-xs); color: var(--muted-foreground); }
/* ---------- Fader: horizontal, vertical, bipolar ribbon ---------- */
.ui-fader {
--frac: 0; --from: 0; --to: 0; --thumb: 22px;
position: relative; height: 44px; min-width: 120px; touch-action: none; user-select: none;
}
.ui-fader > input[type="range"] {
position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0;
opacity: 0; cursor: pointer; appearance: none; -webkit-appearance: none; background: none; border: 0;
}
.ui-fader__track {
position: absolute; left: calc(var(--thumb) / 2); right: calc(var(--thumb) / 2);
top: 50%; height: 4px; margin-top: -2px; border-radius: var(--radius-pill); background: var(--muted);
pointer-events: none;
}
.ui-fader__fill {
position: absolute; top: 0; bottom: 0; border-radius: inherit; background: var(--ctl-signal);
left: calc(var(--from) * 100%); width: calc((var(--to) - var(--from)) * 100%);
}
.ui-fader__tick, .ui-fader__stop, .ui-fader__mark, .ui-knob__tick { --at: 0; }
.ui-fader__tick {
position: absolute; top: 9px; width: 1px; height: 6px; margin-left: -.5px;
left: calc(var(--at) * 100%); background: var(--border-strong);
}
.ui-fader__tick--major { height: 10px; background: var(--muted-foreground); }
/* The end-stops: the hard limits, always drawn, heavier than any tick. */
.ui-fader__stop {
position: absolute; top: -8px; width: 2px; height: 20px; margin-left: -1px;
left: calc(var(--at) * 100%); background: var(--foreground); border-radius: 1px;
}
/* A person's own value (a calibrated centre, a preferred level): the human ink. */
.ui-fader__mark {
position: absolute; top: -10px; width: 2px; height: 24px; margin-left: -1px;
left: calc(var(--at) * 100%); background: var(--ctl-human);
}
.ui-fader__mark-label {
position: absolute; top: 16px; transform: translateX(-50%); white-space: nowrap;
font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ctl-human);
}
.ui-fader__thumb {
position: absolute; top: 50%; width: var(--thumb); height: var(--thumb);
left: calc(var(--frac) * 100%); transform: translate(-50%, -50%);
border-radius: 50%; background: var(--foreground); box-shadow: 0 1px 3px color-mix(in oklab, var(--background) 70%, transparent);
transition: box-shadow 120ms var(--ctl-ease);
}
.ui-fader:has(> input:focus-visible) .ui-fader__thumb { outline: 2px solid var(--ring); outline-offset: 3px; }
/* Fine adjust: drag away from the track and the gain drops; the ring shows it. */
.ui-fader[data-fine] .ui-fader__thumb { box-shadow: 0 0 0 6px var(--ctl-signal-tint); }
.ui-fader[data-hit] .ui-fader__thumb { box-shadow: 0 0 0 4px var(--ctl-signal); }
.ui-fader[aria-disabled="true"], .ui-knob[aria-disabled="true"] { opacity: .4; }
/* Bipolar ribbon (ITD, balance): a recessed well, no fill, a block thumb, a centre detent. */
.ui-fader--ribbon { --thumb: 16px; height: 52px; }
.ui-fader--ribbon .ui-fader__track {
height: 28px; margin-top: -14px; border-radius: var(--radius-sm);
background: var(--background); border: 1px solid var(--border-strong);
}
.ui-fader--ribbon .ui-fader__fill { display: none; }
.ui-fader--ribbon .ui-fader__tick { top: 0; height: 100%; background: var(--border); }
.ui-fader--ribbon .ui-fader__tick--major { background: var(--muted-foreground); width: 2px; margin-left: -1px; }
.ui-fader--ribbon .ui-fader__stop { top: -6px; height: 38px; }
.ui-fader--ribbon .ui-fader__mark { top: -6px; height: 38px; }
.ui-fader--ribbon .ui-fader__mark-label { top: 34px; }
.ui-fader--ribbon .ui-fader__thumb { width: 14px; height: 32px; border-radius: var(--radius-xs); }
/* Vertical (a channel strip). --frac runs bottom to top. */
.ui-fader--vertical { width: 44px; min-width: 44px; height: 220px; }
.ui-fader--vertical > input[type="range"] { writing-mode: vertical-lr; direction: rtl; }
.ui-fader--vertical .ui-fader__track {
left: 50%; right: auto; top: calc(var(--thumb) / 2); bottom: calc(var(--thumb) / 2);
width: 6px; height: auto; margin: 0 0 0 -3px;
}
.ui-fader--vertical .ui-fader__fill { left: 0; right: 0; width: auto; bottom: calc(var(--from) * 100%); height: calc((var(--to) - var(--from)) * 100%); top: auto; }
.ui-fader--vertical .ui-fader__tick { top: auto; left: -12px; width: 8px; height: 1px; margin: 0 0 -.5px; bottom: calc(var(--at) * 100%); }
.ui-fader--vertical .ui-fader__tick--major { width: 10px; left: -14px; }
.ui-fader--vertical .ui-fader__stop { top: auto; left: -14px; width: 34px; height: 2px; margin: 0 0 -1px; bottom: calc(var(--at) * 100%); }
.ui-fader--vertical .ui-fader__mark { top: auto; left: -14px; width: 34px; height: 2px; margin: 0 0 -1px; bottom: calc(var(--at) * 100%); }
.ui-fader--vertical .ui-fader__mark-label { top: -6px; left: 38px; transform: none; }
.ui-fader--vertical .ui-fader__thumb {
top: auto; left: 50%; bottom: calc(var(--frac) * 100%); transform: translate(-50%, 50%);
width: 30px; height: 22px; border-radius: var(--radius-sm);
}
/* ---------- Knob ---------- */
.ui-knob {
--frac: 0; --size: 88px; --sweep: 270deg;
position: relative; width: var(--size); height: var(--size); flex: none;
touch-action: none; user-select: none;
}
.ui-knob > input[type="range"] {
position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0;
cursor: ns-resize; appearance: none; -webkit-appearance: none;
}
.ui-knob__ring {
position: absolute; inset: 0; border-radius: 50%;
background: var(--background); border: 1px solid var(--border-strong); pointer-events: none;
}
.ui-knob__tick {
position: absolute; left: 50%; top: 50%; width: 1px; height: 6px; margin: -.5px;
background: var(--border-strong);
transform: rotate(calc(var(--at) * var(--sweep) - var(--sweep) / 2)) translateY(calc(var(--size) / -2 + 5px));
transform-origin: 50% 0;
}
.ui-knob__tick--major { height: 9px; background: var(--muted-foreground); }
.ui-knob__tick--stop { height: 10px; width: 2px; background: var(--foreground); }
.ui-knob__tick--mark { height: 11px; width: 2px; background: var(--ctl-human); }
.ui-knob__cap {
position: absolute; inset: 18%; border-radius: 50%; pointer-events: none;
background: var(--muted); border: 1px solid var(--border-strong);
transform: rotate(calc(var(--frac) * var(--sweep) - var(--sweep) / 2));
}
.ui-knob__pointer {
position: absolute; left: 50%; top: 8%; width: 3px; height: 34%; margin-left: -1.5px;
border-radius: 2px; background: var(--foreground);
}
.ui-knob:has(> input:focus-visible) .ui-knob__ring { outline: 2px solid var(--ring); outline-offset: 2px; }
.ui-knob[data-fine] .ui-knob__ring { box-shadow: 0 0 0 6px var(--ctl-signal-tint); }
.ui-knob[data-hit] .ui-knob__cap { border-color: var(--ctl-signal); }
.ui-knob--sm { --size: 56px; }
.ui-knob--lg { --size: 112px; }
/* ---------- Chips: linked value, delta, sync state ---------- */
/* A value resolved from what a person owns (their calibration). Dashed, so it reads as a
link in any theme; the resolved number always sits beside the formula. */
.ui-tag--linked {
display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 6px 0 7px;
border: 1px dashed var(--ctl-human); border-radius: var(--radius-sm);
background: var(--ctl-human-tint); color: var(--ctl-human);
font-family: var(--font-mono); font-size: var(--text-xs); white-space: nowrap;
}
.ui-tag--linked svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.ui-tag__resolved { color: var(--foreground); }
.ui-tag__unlink {
min-width: 24px; min-height: 24px; padding: 0 4px; margin-left: 2px;
background: none; border: 0; border-left: 1px solid var(--border-strong);
color: var(--muted-foreground); font: inherit; cursor: pointer;
}
.ui-tag__unlink:hover { color: var(--foreground); }
.ui-tag__unlink:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
/* What moves between two neighbouring states: name, from → to. */
.ui-delta {
display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 0 7px;
border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--muted);
font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted-foreground);
font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ui-delta__to { color: var(--foreground); }
.ui-delta[data-direction="up"] .ui-delta__to::after { content: " ↑"; color: var(--muted-foreground); }
.ui-delta[data-direction="down"] .ui-delta__to::after { content: " ↓"; color: var(--muted-foreground); }
.ui-deltas { display: flex; flex-wrap: wrap; gap: var(--space-1); align-items: center; }
/* Save state. A word always, a glyph always; colour only adds to them. */
.ui-sync {
display: inline-flex; align-items: center; gap: 5px; min-height: 20px; padding: 0 8px;
border: 1px solid transparent; border-radius: var(--radius-sm);
font-size: var(--text-xs); white-space: nowrap; color: var(--muted-foreground); background: var(--muted);
}
.ui-sync::before { font-family: var(--font-mono); font-size: 10px; line-height: 1; }
.ui-sync[data-state="saved"] { background: var(--ctl-machine-tint); color: var(--ctl-machine); }
.ui-sync[data-state="saved"]::before { content: "✓"; }
.ui-sync[data-state="saving"] { background: var(--ctl-human-tint); color: var(--ctl-human); }
.ui-sync[data-state="saving"]::before { content: "◌"; }
.ui-sync[data-state="offline"] { border-color: var(--border-strong); }
.ui-sync[data-state="offline"]::before { content: "⤓"; }
.ui-sync[data-state="conflict"] { background: var(--ctl-signal-tint); color: var(--foreground); border-color: var(--ctl-signal); }
.ui-sync[data-state="conflict"]::before { content: "!"; color: var(--ctl-signal); }
a.ui-sync, button.ui-sync { cursor: pointer; font: inherit; font-size: var(--text-xs); text-decoration: none; }
a.ui-sync:focus-visible, button.ui-sync:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
/* ---------- Glide readout: a value travelling from one state to the next ---------- */
.ui-glide { display: grid; grid-template-columns: minmax(4rem, auto) minmax(7rem, auto) 1fr minmax(4.5rem, auto); align-items: center; gap: var(--space-2) var(--space-3); }
.ui-glide__name { font-size: var(--text-sm); color: var(--muted-foreground); }
.ui-glide__span { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted-foreground); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ui-glide__bar { --progress: 0; position: relative; height: 3px; border-radius: var(--radius-pill); background: var(--muted); overflow: hidden; }
.ui-glide__bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--progress) * 100%); background: var(--ctl-signal); }
.ui-glide__now { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--foreground); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ui-glide__row[data-held] .ui-glide__bar { visibility: hidden; }
.ui-glide__row { display: contents; }
/* ---------- Level meter (L/R) ---------- */
.ui-meter-wrap { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.ui-meter { --meter-h: 40px; display: inline-flex; gap: 6px; align-items: flex-end; height: var(--meter-h); }
.ui-meter__ch { --level: 0; --peak: 0; position: relative; width: 10px; height: 100%; border-radius: 2px; background: var(--background); border: 1px solid var(--border-strong); overflow: hidden; }
.ui-meter__ch::before {
content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--level) * 100%);
background: var(--muted-foreground);
}
.ui-meter__ch::after {
content: ""; position: absolute; left: 0; right: 0; height: 2px; bottom: calc(var(--peak) * 100%);
background: var(--ctl-signal);
}
.ui-meter__label { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--faint-foreground); text-align: center; }
/* ---------- Gauge: one magnitude as a bar, with its number, unit and scale ---------- */
/* Not .ui-meter (the L/R level meter above). --value is 0…1 of the scale, set by the caller. */
.ui-gauge { --value: 0; display: grid; gap: var(--space-1); }
.ui-gauge__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.ui-gauge__num { font-family: var(--font-mono); font-size: var(--text-xl); font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; color: var(--foreground); }
.ui-gauge__num small { font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 400; color: var(--muted-foreground); }
.ui-gauge__track { position: relative; height: var(--space-3); background: var(--muted); border: 1px solid var(--border-strong); border-radius: var(--radius-xs); overflow: hidden; }
.ui-gauge__fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--value) * 100%); background: var(--seq-9); }
.ui-gauge__scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; line-height: 1; color: var(--faint-foreground); }
/* Empty: too little to read. The track is hatched and the fill hidden, so "no reading" never looks like zero. */
.ui-gauge[data-state="empty"] .ui-gauge__track { background-image: repeating-linear-gradient(135deg, var(--border-strong) 0 1px, transparent 1px 6px); }
.ui-gauge[data-state="empty"] .ui-gauge__fill, .ui-gauge[data-state="off"] .ui-gauge__fill { display: none; }
.ui-gauge[data-state="off"] { opacity: .5; }
/* ---------- Keyboard: an on-screen piano keyboard ---------- */
/* Keys are buttons placed by controls.js (mountKeyboard) in percent of the row. A held key is
aria-pressed; a key that cannot play is aria-disabled, hatched, and its reason is in its name
and in .ui-keyboard__reason, never in colour alone. */
.ui-keyboard { display: grid; gap: var(--space-2); }
.ui-keyboard__scroll { overflow-x: auto; padding-bottom: var(--space-1); }
.ui-keyboard__keys { position: relative; min-width: 58rem; height: 6.5rem; }
.ui-keyboard__key { position: absolute; top: 0; height: 100%; margin: 0; padding: 0 0 var(--space-1); box-sizing: border-box;
border: 1px solid var(--border-strong); background: var(--card); color: var(--faint-foreground);
border-radius: 0 0 var(--radius-xs) var(--radius-xs); display: flex; align-items: flex-end; justify-content: center;
font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; line-height: 1; cursor: pointer; touch-action: none; }
.ui-keyboard__key--black { height: 62%; background: var(--foreground); border-color: var(--foreground); z-index: 2; }
.ui-keyboard__key:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; z-index: 3; }
.ui-keyboard__key[aria-pressed="true"] { background: var(--ctl-signal); border-color: var(--ctl-signal); color: var(--background); }
.ui-keyboard__key[aria-disabled="true"] { cursor: not-allowed; background-color: var(--muted);
background-image: repeating-linear-gradient(135deg, var(--border-strong) 0 1px, transparent 1px 6px); color: var(--faint-foreground); }
.ui-keyboard__key--black[aria-disabled="true"] { background-color: var(--muted-foreground); border-color: var(--muted-foreground);
background-image: repeating-linear-gradient(135deg, var(--muted) 0 1px, transparent 1px 6px); }
.ui-keyboard[data-busy="true"] .ui-keyboard__key { opacity: .45; pointer-events: none; }
.ui-keyboard__reason { margin: 0; color: var(--muted-foreground); font-size: var(--text-sm); display: flex; gap: var(--space-2); align-items: baseline; }
.ui-keyboard__reason::before { content: "▨"; font-family: var(--font-mono); color: var(--faint-foreground); }
.ui-keyboard__reason:empty { display: none; }
/* ---------- Key lane: values per note (bars), per range (chips) and spans, under the keys ---------- */
/* Not .ui-lane (the automation lane). Placed with the same layout as the keyboard (keyLayout). */
.ui-keylane { position: relative; min-width: 58rem; height: 2.25rem; margin-top: var(--space-1); }
.ui-keylane--bars { height: 1.75rem; }
.ui-keylane__label { position: absolute; left: 0; top: -1px; z-index: 1; padding-right: var(--space-2); background: var(--background);
font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; line-height: 1; letter-spacing: .08em; text-transform: uppercase; color: var(--faint-foreground); }
.ui-keylane__bar { --value: 0; position: absolute; bottom: 0; height: calc(var(--value) * 100%); background: var(--seq-5); border-radius: var(--radius-xs) var(--radius-xs) 0 0; }
.ui-keylane__chip { position: absolute; top: var(--space-4); height: 1.25rem; box-sizing: border-box; border: 1px solid var(--border-strong); border-radius: var(--radius-xs);
font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; line-height: 1.2; color: var(--muted-foreground);
display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; }
.ui-keylane__chip[data-here="true"] { border-color: var(--ctl-signal); color: var(--foreground); }
.ui-keylane__chip[data-empty="true"] { border-style: dashed; color: var(--faint-foreground); }
.ui-keylane__span { position: absolute; top: 0; height: 1.25rem; box-sizing: border-box; border-bottom: 2px solid var(--ctl-human);
font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; line-height: 1; color: var(--foreground);
display: flex; align-items: flex-end; padding: 0 0 2px var(--space-1); white-space: nowrap; }
/* ---------- Channel strip ---------- */
.ui-strips { display: flex; gap: var(--space-2); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--space-2); }
.ui-strip {
flex: 0 0 104px; scroll-snap-align: start;
display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
padding: var(--space-3) var(--space-2); border-radius: var(--radius-base);
background: var(--card); border: 1px solid var(--border);
}
.ui-strip[data-focus] { border-color: var(--ctl-signal); }
.ui-strip[data-follows] { opacity: .5; }
.ui-strip__name {
font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500;
letter-spacing: .12em; text-transform: uppercase; color: var(--muted-foreground); text-align: center;
}
/* A fader in a strip: the strip names it, so the fader's own name is kept for screen readers only,
and its tap-to-type value becomes the strip's readout. */
.ui-strip .ui-control { align-items: center; }
.ui-strip .ui-control__head { justify-content: center; }
.ui-strip .ui-control__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ui-strip .ui-control__value { margin-left: 0; }
.ui-strip__value { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--foreground); font-variant-numeric: tabular-nums; }
.ui-strip__ms { display: flex; gap: 4px; }
.ui-strip__ms button {
width: 34px; height: 34px; border-radius: var(--radius-sm);
border: 1px solid var(--border-strong); background: var(--background);
color: var(--muted-foreground); font-family: var(--font-mono); font-size: var(--text-xs); cursor: pointer;
}
.ui-strip__ms button:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.ui-strip__mute[aria-pressed="true"] { background: var(--foreground); color: var(--background); border-color: var(--foreground); }
.ui-strip__solo[aria-pressed="true"] { background: var(--ctl-human-tint); color: var(--ctl-human); border-color: var(--ctl-human); }
/* ---------- Hazard surface + hold-to-confirm ---------- */
/* Something that is off by default and should feel harder to switch on. */
.ui-hazard {
border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
background: repeating-linear-gradient(135deg, var(--card) 0 10px, var(--muted) 10px 12px);
}
.ui-hold {
--hold: 0; --hold-ms: 700ms;
position: relative; overflow: hidden; min-height: 44px; min-width: 64px; padding: 0 14px;
border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--muted);
color: var(--foreground); font: inherit; font-size: var(--text-sm); cursor: pointer;
}
.ui-hold::before {
content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--hold) * 100%);
background: var(--ctl-signal-tint); transition: width var(--hold-ms) linear;
}
.ui-hold[data-holding] { --hold: 1; }
.ui-hold > * { position: relative; }
.ui-hold[aria-pressed="true"] { background: var(--ctl-signal); border-color: var(--ctl-signal); color: var(--background); }
.ui-hold:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
/* ---------- SVG views drawn by controls.js ---------- */
.ui-timeline, .ui-lane, .ui-panner { position: relative; user-select: none; }
.ui-timeline svg, .ui-lane svg, .ui-panner svg { display: block; width: 100%; height: auto; overflow: visible; }
.ui-timeline, .ui-lane { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--background); }
.ui-timeline text, .ui-lane text, .ui-panner text { font-family: var(--font-mono); font-size: 9px; fill: var(--muted-foreground); }
/* Scene timeline: a block per held state (width = hold), a wedge per transition (width = ramp). */
.ui-timeline__scene { fill: var(--ctl-human-tint); cursor: pointer; }
.ui-timeline__edge { stroke: var(--ctl-human); stroke-width: 1; }
.ui-timeline__scene[data-selected="true"] { fill: var(--ctl-signal-tint); }
.ui-timeline__edge[data-selected="true"] { stroke: var(--ctl-signal); }
.ui-timeline__ramp { fill: var(--card); }
.ui-timeline__slope { stroke: var(--muted-foreground); stroke-width: 1.2; }
.ui-timeline text.ui-timeline__label { font-family: var(--font-sans); font-size: 10px; fill: var(--ctl-human); }
.ui-timeline text.ui-timeline__label[data-selected="true"] { fill: var(--ctl-signal); }
/* SVG children take focus from a click too; only the keyboard gets the ring. */
.ui-timeline__scene:focus, .ui-timeline__handle:focus, .ui-lane__point:focus, .ui-panner__source:focus { outline: none; }
.ui-timeline__handle { fill: var(--ctl-signal); cursor: ew-resize; }
.ui-timeline__grip { stroke: var(--background); stroke-width: 1; pointer-events: none; }
.ui-timeline__handle:focus-visible { outline: none; stroke: var(--ring); stroke-width: 2; }
.ui-timeline__scene:focus-visible { outline: none; stroke: var(--ring); stroke-width: 2; }
.ui-timeline__bed { fill: var(--muted); stroke: var(--border-strong); stroke-width: 1; }
.ui-timeline__curve, .ui-lane__curve { fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.ui-timeline__curve[data-series="1"], .ui-lane__curve[data-series="1"] { stroke: var(--series-1); }
.ui-timeline__curve[data-series="2"], .ui-lane__curve[data-series="2"] { stroke: var(--series-2); }
.ui-timeline__curve[data-series="3"], .ui-lane__curve[data-series="3"] { stroke: var(--series-3); stroke-dasharray: 3 3; }
.ui-timeline__curve[data-series="4"], .ui-lane__curve[data-series="4"] { stroke: var(--series-4); stroke-dasharray: 6 3; }
.ui-timeline__played { fill: var(--ctl-signal-tint); opacity: .5; }
.ui-timeline__playhead, .ui-lane__playhead { stroke: var(--foreground); stroke-width: 1; }
.ui-timeline__cap, .ui-lane__cap { fill: var(--foreground); }
.ui-timeline__ending { stroke-width: 1; }
.ui-timeline__ending[data-ending="met"] { fill: var(--ctl-machine-tint); stroke: var(--ctl-machine); }
.ui-timeline__ending[data-ending="timeout"] { fill: var(--ctl-human-tint); stroke: var(--ctl-human); }
.ui-timeline__ending[data-ending="no_data"] { fill: var(--muted); stroke: var(--border-strong); stroke-dasharray: 2 2; }
.ui-timeline__ending[data-ending="open_loop"] { fill: none; stroke: var(--border-strong); }
.ui-timeline text.ui-timeline__ending-word { fill: var(--foreground); }
.ui-timeline__key { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); padding: var(--space-1) var(--space-2); font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted-foreground); }
.ui-timeline__key span { --swatch: currentColor; }
.ui-timeline__key span::before { content: "— "; color: var(--swatch); }
/* Automation lane: points on state edges, the glide between them, dropped notches. */
.ui-lane__band { fill: var(--card); }
.ui-lane__zero { stroke: var(--border-strong); stroke-width: 1; }
.ui-lane__notch-line { stroke: var(--border-strong); stroke-dasharray: 2 3; }
.ui-lane__notch { fill: var(--foreground); }
.ui-lane__linked { fill: none; stroke: var(--ctl-machine); stroke-width: 1.3; stroke-dasharray: 3 3; }
.ui-lane__drawn { fill: none; stroke: var(--ctl-human); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1 4; }
.ui-lane__point { fill: var(--foreground); cursor: ns-resize; }
.ui-lane__point:focus-visible { outline: none; stroke: var(--ring); stroke-width: 3; }
.ui-lane__point[data-hit] { fill: var(--ctl-signal); }
.ui-lane__mark { stroke: var(--ctl-human); stroke-width: 1; stroke-dasharray: 1 3; }
.ui-lane__head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-2) 0; }
/* Polar panner: a top-down head in a room, distance rings, a source and its motion path. */
.ui-panner__well { fill: var(--background); stroke: var(--border-strong); }
.ui-panner__ring { fill: none; stroke: var(--muted); }
.ui-panner__ring--near { stroke: var(--border-strong); stroke-dasharray: 2 3; }
.ui-panner__axis { stroke: var(--muted); }
.ui-panner__head { fill: var(--muted); stroke: var(--faint-foreground); }
.ui-panner__nose, .ui-panner__ear { fill: var(--faint-foreground); }
.ui-panner__path { fill: none; stroke: var(--ctl-signal); stroke-width: 1.2; stroke-dasharray: 4 4; opacity: .75; }
.ui-panner__source { fill: var(--ctl-signal); cursor: grab; }
.ui-panner__source:focus-visible { outline: none; stroke: var(--ring); stroke-width: 3; }
.ui-panner__halo { fill: none; stroke: var(--ctl-signal); opacity: .4; }
.ui-panner__phase { fill: var(--ctl-signal); opacity: .55; }
.ui-panner text.ui-panner__readout { fill: var(--ctl-signal); }
.ui-panner[aria-disabled="true"] svg { opacity: .35; }
/* ---------- Bottom sheet: a native <dialog> ---------- */
.ui-sheet {
margin: auto 0 0; width: 100%; max-width: none; max-height: min(88vh, 760px); padding: 0;
border: 0; border-top: 1px solid var(--border-strong); border-radius: 20px 20px 0 0;
background: var(--card); color: var(--foreground);
box-shadow: 0 -16px 48px color-mix(in oklab, black 45%, transparent);
padding-bottom: env(safe-area-inset-bottom);
}
.ui-sheet[open] { display: flex; flex-direction: column; animation: ui-sheet-in 320ms var(--ctl-ease); }
.ui-sheet::backdrop { background: color-mix(in oklab, var(--background) 72%, transparent); }
.ui-sheet__grip { width: 36px; height: 4px; margin: var(--space-2) auto 0; border-radius: 2px; background: var(--border-strong); flex: none; }
.ui-sheet__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4) 0; }
.ui-sheet__title { flex: 1; min-width: 0; margin: 0; font-size: var(--text-lg); font-weight: 400; }
.ui-sheet__close {
width: 44px; height: 44px; border: 0; border-radius: var(--radius-sm); background: none;
color: var(--muted-foreground); font: inherit; font-size: 18px; cursor: pointer;
}
.ui-sheet__close:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.ui-sheet__body { overflow-y: auto; padding: var(--space-3) var(--space-4) var(--space-4); }
@media (min-width: 720px) {
.ui-sheet { margin: auto; max-width: 560px; border-radius: 20px; border: 1px solid var(--border-strong); }
}
@keyframes ui-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
/* ---------- Bottom tab bar (phones) ---------- */
.ui-tabbar {
display: flex; border-top: 1px solid var(--border); background: var(--background);
padding: 0 var(--space-2) env(safe-area-inset-bottom);
}
.ui-tabbar__item {
flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
color: var(--muted-foreground); text-decoration: none; background: none; border: 0; cursor: pointer;
font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .08em; text-transform: uppercase;
}
.ui-tabbar__item svg { width: 20px; height: 20px; }
.ui-tabbar__item[aria-current="page"] { color: var(--ctl-signal); }
.ui-tabbar__item:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
/* ---------- Night view: very low luminance, large targets, nothing to read ---------- */
.ui-night {
--night-ink: color-mix(in oklab, var(--foreground) 34%, black);
--night-dim: color-mix(in oklab, var(--foreground) 18%, black);
--night-line: color-mix(in oklab, var(--foreground) 8%, black);
background: black; color: var(--night-ink);
display: flex; flex-direction: column; align-items: center; gap: var(--space-6); padding: var(--space-7) var(--space-4);
}
.ui-night__time { font-family: var(--font-mono); font-size: 64px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--night-ink); }
.ui-night__sub { font-family: var(--font-mono); font-size: var(--text-base); color: var(--night-dim); }
.ui-night__progress { --progress: 0; width: min(300px, 80%); height: 3px; border-radius: 2px; background: var(--night-line); position: relative; }
.ui-night__progress::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--progress) * 100%); border-radius: inherit; background: color-mix(in oklab, var(--ctl-signal) 45%, black); }
.ui-night__play {
width: 220px; height: 220px; border-radius: 50%; border: 1px solid var(--night-line);
background: none; color: var(--night-dim); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ui-night__play svg { width: 48px; height: 48px; fill: currentColor; }
.ui-night__play:focus-visible { outline: 2px solid var(--night-dim); outline-offset: 4px; }
.ui-night__hint { font-size: var(--text-sm); color: var(--night-dim); }
@media (prefers-reduced-motion: reduce) {
.ui-sheet[open] { animation: none; }
.ui-hold::before, .ui-fader__thumb { transition: none; }
}