mobiler-web 0.37.0

Mobiler's web shell — renders any Mobiler app's Widget tree to the DOM (Leptos/WASM).
Documentation
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
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
/* mobiler-web default theme — injected by the shell on mount.
 *
 * The web twin of the concrete look the Android (Material 3) and SwiftUI shells
 * decide in code: each style-intent token (TextStyle, Tone, CardStyle, …) maps to
 * a class here. Colors are CSS variables so `Scaffold.dark_mode` flips the whole
 * theme by adding `.theme-dark`. A consuming app may override any of these classes
 * with its own later stylesheet. */

:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #eef0f8;
  --line: #e3e4ee;
  --ink: #1a1c2a;
  --muted: #6b6f86;
  --primary: #3f4a8a;
  --primary-ink: #ffffff;
  --accent: #3f4a8a;
  --accent2: #3f4a8a;
  --accent-soft: rgba(63, 74, 138, 0.16);
  --radius: 14px;
  /* Spacing + font are theme-overridable (set inline by an app Theme); these are the defaults. */
  --gap: 12px;
  --pad: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.theme-dark {
  --bg: #15171f;
  --surface: #1e212b;
  --surface-2: #262a36;
  --line: #333748;
  --ink: #eceef5;
  --muted: #9aa0b4;
  --primary: #8c9bff;
  --primary-ink: #15171f;
  --accent: #8c9bff;
  --accent2: #8c9bff;
  --accent-soft: rgba(140, 155, 255, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px;
  background: var(--bg);
  color: var(--ink);
}
/* A Scaffold owns its own bars + body padding, so let it bleed to the edges. */
.app:has(.scaffold) { padding: 0; max-width: 430px; }

/* ---- layout ---- */
.col { display: flex; flex-direction: column; gap: calc(var(--gap) * 0.66); }
.row { display: flex; flex-direction: row; align-items: center; gap: calc(var(--gap) * 0.66); }

/* Master-detail (Widget::Split). Narrow (phones) = one pane: primary by default, or detail (with a
   back chevron) when [data-detail]. Wide is handled in the 768px media query below (side-by-side). */
.split { display: flex; flex-direction: column; gap: var(--gap); }
.split-primary { display: block; min-width: 0; }
.split-detail { display: none; min-width: 0; }
.split[data-detail] .split-primary { display: none; }
.split[data-detail] .split-detail { display: block; }
.split-back {
  display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px;
  background: none; border: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 4px 0;
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Horizontal scroller / carousel — children lay out in a row that scrolls sideways. */
.scroller { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scroller::-webkit-scrollbar { display: none; }
.scroller > * { flex: 0 0 auto; }
.scroller-fade { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
.scroller > .scroller-end { flex: 0 0 32px; }

/* Search field — leading magnifier + pill input. */
.searchfield { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; }
.search-icon { color: var(--muted); }
.search-input { flex: 1; border: none; background: transparent; outline: none; font: inherit; color: var(--ink); }

/* Segmented control — exclusive options in a pill track. */
.segmented { display: flex; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.segment { flex: 1; border: none; background: transparent; border-radius: 999px; padding: 8px 12px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.segment.selected { background: var(--primary); color: #fff; }

/* Avatar — circular image with an optional status dot. */
.avatar { position: relative; display: inline-block; width: 48px; height: 48px; }
.avatar-img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.avatar-status { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bg); }

/* Star rating. */
.rating { display: inline-flex; gap: 2px; color: var(--accent); font-size: 16px; line-height: 1; }
.star { color: var(--accent); }
.star-tappable { border: none; background: transparent; cursor: pointer; font-size: 20px; color: var(--accent); padding: 0 1px; }

/* Modal bottom sheet — scrim + a panel rising from the bottom. */
.sheet-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  background: var(--surface); border-radius: 20px 20px 0 0; padding: 12px 18px 28px;
  box-shadow: 0 -8px 28px rgba(0,0,0,0.28); max-height: 80%; overflow-y: auto;
  animation: sheet-rise 0.24s ease;
}
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 12px; }
.sheet-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
@keyframes sheet-rise { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Confirm dialog (cx.confirm / cx.confirm_with) — the web twin of the native alert. Mounted on
   <body>; the scrim carries the scaffold's theme vars + theme-dark/density-large classes. */
.confirm-scrim { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,0.45); }
.confirm-card { width: 100%; max-width: 360px; background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 20px 20px 12px; box-shadow: 0 12px 32px rgba(0,0,0,0.3); font-family: var(--font); }
.confirm-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.confirm-message { margin: 0 0 16px; color: var(--muted); }
.confirm-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }

.card {
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
}
.card-elevated { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.card-outlined { background: transparent; border: 1px solid var(--line); }
.card-filled { background: var(--surface-2); }
/* Brand gradient card (promo banner) — fills seed → accent. */
.card-brand { background: linear-gradient(135deg, var(--primary), var(--accent2)); color: #fff; border: none; }
.card-brand .t-caption { color: rgba(255,255,255,0.85); }
/* A tappable card is a <button>; strip the native chrome so it reads as a card. */
.card-tappable {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  border: none;
  cursor: pointer;
}

/* Z-stack. Scrim variant: bg image sets the size; overlay + content layer on top. */
.box { position: relative; }
.box-scrim { border-radius: 16px; overflow: hidden; }
.box-scrim > .img { display: block; }
.box-scrim > .scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4); }
.box-scrim > .box-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  color: #fff;
}
.align-top-start    > .box-content { justify-content: flex-start; align-items: flex-start; }
.align-top-end      > .box-content { justify-content: flex-start; align-items: flex-end; }
.align-center       > .box-content { justify-content: center;     align-items: center; }
.align-bottom-start > .box-content { justify-content: flex-end;   align-items: flex-start; }
.align-bottom-center> .box-content { justify-content: flex-end;   align-items: center; }
.align-bottom-end   > .box-content { justify-content: flex-end;   align-items: flex-end; }

/* ---- map (Widget::Map, MapLibre-GL) ---- */
.mobiler-map-wrap { position: relative; width: 100%; }
.mobiler-map { width: 100%; height: 240px; border-radius: var(--corner, 12px); overflow: hidden; }
.mobiler-map-sink { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---- content ----
   Reading text is sized in `rem` so it honors the browser's default-font-size setting (the web
   equivalent of iOS Dynamic Type / Android fontScale). Controls + chart text stay px on purpose. */
.t-title    { font-size: 1.75rem; font-weight: 750; margin: 2px 0; letter-spacing: -0.01em; }
.t-subtitle { font-size: 1.125rem; font-weight: 650; margin: 0; }
.t-emphasis { font-size: 0.9375rem; font-weight: 650; margin: 0; }
.t-caption  { font-size: 0.8125rem; color: var(--muted); margin: 0; line-height: 1.4; }
.t-body     { font-size: 0.9375rem; margin: 0; }

.img { display: block; width: 100%; object-fit: cover; }
.ratio-wide   { aspect-ratio: 16 / 10; }
.ratio-square { aspect-ratio: 1 / 1; }
.ratio-tall   { aspect-ratio: 3 / 4; }
.img-rounded  { border-radius: 16px; }
.img-circle   { border-radius: 50%; }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
}
.tone-neutral { background: var(--surface-2); color: var(--muted); }
.tone-success { background: #e6f4ea; color: #1e7e34; }
.tone-warning { background: #fff4e5; color: #b66a00; }
.tone-danger  { background: #fde8e8; color: #c0392b; }
.tone-info    { background: var(--accent-soft); color: var(--accent); }

.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.dot-indigo { background: #5c6bc0; }
.dot-teal   { background: #26a69a; }
.dot-coral  { background: #ff7043; }
.dot-amber  { background: #ffb300; }
.dot-lime   { background: #9ccc65; }
.dot-pink   { background: #ec407a; }

.divider { border: none; border-top: 1px solid var(--line); margin: 8px 0; }

/* Progress bar (determinate) + indeterminate variant. */
.progress { width: 100%; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 6px 0; }
.progress-bar { height: 100%; background: var(--accent, #5C6BC0); border-radius: 3px; transition: width .25s ease; }
.progress-indeterminate .progress-bar { width: 40%; border-radius: 3px; animation: mobiler-indeterminate 1.1s ease-in-out infinite; }
@keyframes mobiler-indeterminate { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* Skeleton shimmer placeholder. */
.skeleton { height: 48px; border-radius: 8px; margin: 6px 0;
  background: linear-gradient(90deg, var(--line) 25%, rgba(127,127,127,.18) 37%, var(--line) 63%);
  background-size: 400% 100%; animation: mobiler-shimmer 1.4s ease infinite; }
@keyframes mobiler-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.pdfview { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.video { width: 100%; max-height: 480px; border-radius: 10px; background: #000; }
.webview { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; }

/* Chart — multi-series bar/line/stacked + circular pie/donut/rings/gauge, with optional
   y-axis gridlines/ticks and a series legend. */
.chart { margin: 8px 0; }
.chart-plot { display: flex; align-items: stretch; }
.chart-svg { width: 100%; height: 120px; display: block; flex: 1; min-width: 0; }
.chart-yaxis { display: flex; flex-direction: column; justify-content: space-between; padding-right: 6px; height: 120px; }
.chart-tick { font-size: 10px; color: var(--muted, #888); line-height: 1; }
.chart-gridline { stroke: var(--border, #e6e6e6); stroke-width: 0.5; vector-effect: non-scaling-stroke; }
.chart-labels { display: flex; justify-content: space-between; margin-top: 4px; }
.chart-label { font-size: 11px; color: var(--muted, #888); flex: 1; text-align: center; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; justify-content: center; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted, #888); }
.chart-swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* RegionChart — variable-width stacked-region / coverage-gap chart (absolute-positioned). */
/* A fixed left gutter (y-axis labels) + a right margin (value chips / bracket) are reserved, and
   the x-axis row is inset by the same amounts, so the irregular x-ticks line up with the bands. */
.rchart { margin: 8px 0; --rchart-gutter: 40px; --rchart-chip: 58px; }
.rchart-row { display: flex; }
.rchart-yaxis { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; width: var(--rchart-gutter); height: 300px; padding-right: 4px; box-sizing: border-box; }
.rchart-yaxis .chart-tick { font-size: 9px; }
.rchart-plotwrap { position: relative; flex: 1; height: 300px; min-width: 0; }
.rchart-plot { position: absolute; left: 0; top: 0; bottom: 0; right: var(--rchart-chip); border-left: 2px solid var(--ink, #222); border-bottom: 2px solid var(--ink, #222); }
.rchart-ytick { position: absolute; left: 0; width: 6px; height: 0; border-top: 2px solid var(--ink, #222); }
.rchart-xtickmark { position: absolute; bottom: 0; width: 0; height: 6px; border-left: 2px solid var(--ink, #222); }
.rchart-region { position: absolute; display: flex; align-items: center; justify-content: center; overflow: hidden; box-sizing: border-box; border: 0.5px solid rgba(255, 255, 255, 0.45); }
.rchart-label { font-size: 11px; font-weight: 600; color: #1a1a1a; text-align: center; padding: 2px; line-height: 1.2; white-space: pre-line; }
.rchart-label-v { transform: rotate(-90deg); white-space: pre; }
.rchart-refline { position: absolute; left: 0; right: 0; border-top: 2px solid #c0392b; }
.rchart-refline-dashed { border-top-style: dashed; }
.rchart-chip { position: absolute; right: 0; transform: translateY(50%); background: #ffffff; color: #1a1a1a; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 4px; padding: 1px 4px; font-size: 9px; font-weight: 600; white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.rchart-bracket { position: absolute; right: calc(var(--rchart-chip) - 6px); width: 6px; border: 1.5px solid var(--muted, #888); border-left: none; }
.rchart-bracket span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 60px; font-size: 9px; line-height: 1.25; color: var(--muted, #888); white-space: pre-line; text-align: center; }
.rchart-xaxis { position: relative; height: 16px; margin-top: 3px; margin-left: var(--rchart-gutter); margin-right: var(--rchart-chip); }
.rchart-xtick { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted, #888); white-space: nowrap; }

/* Inline month calendar. */
.calendar { margin: 8px 0; }
.cal-title { font-weight: 600; text-align: center; margin-bottom: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-head { text-align: center; font-size: 11px; color: var(--muted, #888); padding: 2px 0; }
.cal-blank { aspect-ratio: 1; }
.cal-day { aspect-ratio: 1; border: none; background: transparent; color: var(--fg, inherit);
  border-radius: 50%; cursor: pointer; font-size: 14px; }
.cal-day:hover { background: var(--line); }
.cal-sel { background: var(--accent, #5C6BC0); color: #fff; }
.cal-sel:hover { background: var(--accent, #5C6BC0); }
.cal-day { position: relative; }
.cal-dots { position: absolute; left: 0; right: 0; bottom: 12%; display: flex; justify-content: center; gap: 2px; pointer-events: none; }
.cal-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--primary); }
.cal-sel .cal-dot { background: var(--primary-ink); }

/* Pull-to-refresh — web fallback: a top-bar refresh button (the indeterminate bar reuses .progress). */
.refresh-btn { margin-left: auto; border: none; background: transparent; cursor: pointer;
  font-size: 18px; color: var(--fg, inherit); padding: 4px 8px; }

/* SwipeAction — web has no gesture, so actions render inline trailing the content. */
.swipe-row { display: flex; align-items: center; gap: 8px; }
.swipe-content { flex: 1; min-width: 0; }
.swipe-actions { display: flex; gap: 4px; flex-shrink: 0; }
.swipe-act { border: none; border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; }

.spacer { flex: none; }
.sp-xs { height: 4px; }
.sp-sm { height: 8px; }
.sp-md { height: 12px; }
.sp-lg { height: 16px; }
.sp-xl { height: 24px; }

/* ---- lazy list (paged feed: refresh on top, load-more at bottom) ---- */
.lazylist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 60vh;
  overflow-y: auto;
}
.lazylist .lazylist-more { align-self: center; margin: 8px 0; }
.lazylist .lazylist-end {
  text-align: center;
  color: var(--muted, #888);
  font-size: 0.85rem;
  padding: 10px 0;
}

/* ---- input / actions ---- */
.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.06); }
.btn-filled   { background: var(--primary); color: var(--primary-ink); }
.btn-outlined { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.btn-text     { background: transparent; color: var(--primary); padding: 10px 8px; }
.btn-tonal    { background: var(--accent-soft); color: var(--primary); }
.btn-wide     { width: 100%; }
.btn-icon     { margin-right: 8px; }
/* Toned buttons: --tone is the strong color, --tone-soft the container. */
.btn-danger  { --tone: #c0392b; --tone-soft: #fde8e8; }
.btn-success { --tone: #2e7d32; --tone-soft: #e3f3e4; }
.btn-warning { --tone: #b35c00; --tone-soft: #fdeede; }
.btn-info    { --tone: #1f6fb2; --tone-soft: #e3effa; }
.theme-dark .btn-danger  { --tone: #ff8a80; --tone-soft: rgba(255, 138, 128, 0.18); }
.theme-dark .btn-success { --tone: #81c784; --tone-soft: rgba(129, 199, 132, 0.18); }
.theme-dark .btn-warning { --tone: #ffb74d; --tone-soft: rgba(255, 183, 77, 0.18); }
.theme-dark .btn-info    { --tone: #64b5f6; --tone-soft: rgba(100, 181, 246, 0.18); }
.btn-filled:is(.btn-danger, .btn-success, .btn-warning, .btn-info)   { background: var(--tone); color: #fff; }
.theme-dark .btn-filled:is(.btn-danger, .btn-success, .btn-warning, .btn-info) { color: #15171f; }
.btn-outlined:is(.btn-danger, .btn-success, .btn-warning, .btn-info) { color: var(--tone); box-shadow: inset 0 0 0 1px var(--tone); }
.btn-text:is(.btn-danger, .btn-success, .btn-warning, .btn-info)     { color: var(--tone); }
.btn-tonal:is(.btn-danger, .btn-success, .btn-warning, .btn-info)    { background: var(--tone-soft); color: var(--tone); }

.iconbtn { background: transparent; border: none; cursor: pointer; font-size: 17px; padding: 4px; }

.chip {
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
}
.chip.selected { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.field {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  background: var(--surface);
  color: var(--ink);
  box-sizing: border-box;
}
textarea.field { resize: vertical; font-family: inherit; }
.field-wrap { display: flex; flex-direction: column; gap: 4px; }
.field-invalid { border-color: var(--danger, #d33); }
.field-error { font-size: 12px; color: var(--danger, #d33); padding-left: 2px; }

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* A checkbox styled as a switch (Toggle widget). */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 15px; }
.toggle input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
.toggle input:checked { background: var(--primary); }
.toggle input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.toggle input:checked::before { transform: translateX(18px); }

.slider { width: 100%; accent-color: var(--primary); }

.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
}
.stepper-value { font-size: 18px; min-width: 24px; text-align: center; }

/* ---- shell (Scaffold) ---- */
.scaffold { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); color: var(--ink); }
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--bg);
}
.topbar .title { flex: 1; text-align: center; font-size: 17px; font-weight: 650; }
.back { border: none; background: transparent; color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; }
.scaffold-body { flex: 1; padding: var(--pad); }
/* Navigation transitions — the web twin of the native shells' push/pop slide and
 * lateral crossfade. The shell alternates the -a/-b class each navigation so the
 * animation restarts; same-route data updates carry no class (re-render in place). */
@keyframes nav-push { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes nav-pop  { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes nav-fade { from { opacity: 0; } to { opacity: 1; } }
.nav-push-a, .nav-push-b { animation: nav-push 0.28s ease; }
.nav-pop-a,  .nav-pop-b  { animation: nav-pop 0.28s ease; }
.nav-fade-a, .nav-fade-b { animation: nav-fade 0.28s ease; }
.tabbar { display: flex; border-top: 1px solid var(--line); background: var(--bg); position: sticky; bottom: 0; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border: none; background: transparent; padding: 8px 12px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; }
.tab.selected { color: var(--accent); font-weight: 650; }
.tab-icon { font-size: 20px; line-height: 1; }
.tab-label { font-size: 12px; }

/* Floating action button — raised primary action, pinned bottom-right over the body. */
.fab {
  position: fixed; right: 18px; bottom: 84px; z-index: 5;
  width: 56px; height: 56px; border: none; border-radius: 18px;
  background: var(--primary); color: #fff; font-size: 24px; line-height: 1;
  box-shadow: 0 6px 18px rgba(0,0,0,0.28); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.scaffold { position: relative; }

/* Transient toast (cx.toast) — appended to <body>, auto-removed after a beat. */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  max-width: 80%;
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(26, 28, 42, 0.92);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  animation: toast-in 0.2s ease, toast-out 0.3s ease 2.3s forwards;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-out { to { opacity: 0; } }

/* ---- responsive: tablets / large viewports ---- */
/* Phone layouts (below the breakpoint) are deliberately left exactly as-is. Past it
 * we *use* the extra width instead of stretching the phone column: grids gain
 * columns, plain screens stop running edge-to-edge, and a Scaffold's bottom tab-bar
 * becomes a left navigation rail — the web twin of the native shells' NavigationRail.
 * The rail is pure layout: the same three Scaffold children (topbar, body, tabbar)
 * are re-placed via grid areas, so there's no DOM/markup change, only CSS. */
@media (min-width: 768px) {
  .app { max-width: 900px; }
  .app:has(.scaffold) { max-width: 1100px; }

  /* Fill the wider space with more columns rather than two stretched ones. */
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

  /* Don't let a plain (non-grid) screen's text/rows run the full width: cap + center. */
  .scaffold-body { max-width: 760px; margin: 0 auto; width: 100%; }

  /* Master-detail goes side-by-side: list (fixed) + detail (fills); both panes always visible, so
     the per-pane single-view rules + the back chevron are overridden. */
  .split { flex-direction: row; align-items: flex-start; gap: 20px; }
  .split-primary,
  .split[data-detail] .split-primary { display: block; flex: 0 0 320px; }
  .split-detail,
  .split[data-detail] .split-detail { display: block; flex: 1; }
  .split-back { display: none; }

  /* Tab-bar → left navigation rail, only when the Scaffold actually has tabs. */
  .scaffold:has(.tabbar) {
    display: grid;
    grid-template-columns: 224px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas: "rail topbar" "rail body";
  }
  .scaffold:has(.tabbar) > .topbar { grid-area: topbar; }
  .scaffold:has(.tabbar) > .scaffold-body { grid-area: body; }
  .scaffold:has(.tabbar) > .tabbar {
    grid-area: rail;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    border-top: none;
    border-right: 1px solid var(--line);
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 12px 8px;
  }
  .scaffold:has(.tabbar) > .tabbar .tab {
    flex: none;
    text-align: left;
    border-radius: 10px;
    padding: 12px 14px;
  }
  .scaffold:has(.tabbar) > .tabbar .tab.selected { background: var(--accent-soft); }
}

/* ---- Density::Large — bigger controls for busy hands (control sizes only; text follows the browser). ---- */
.density-large .row, .density-large .col { gap: 12px; }
.density-large .btn { min-height: 56px; padding: 0 24px; font-size: 16px; }
.density-large .chip { min-height: 48px; padding: 0 18px; font-size: 16px; }
.density-large .segment { min-height: 48px; font-size: 16px; }
.density-large .iconbtn { min-width: 56px; min-height: 56px; font-size: 24px; }
.density-large .cal-day { min-height: 48px; font-size: 16px; }
.density-large .tab-label { font-size: 14px; }