@saar-ai/web-widget 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/chunks/{chat-e1afSRBr.js → chat-CU9VPqVO.js} +260 -37
  2. package/dist/chunks/{host-widget-Ce-l1xu1.js → host-widget-BtiYIMwb.js} +5638 -350
  3. package/dist/chunks/{schemas-D-uDc-9q.js → schemas-YN3wGSGZ.js} +7 -4
  4. package/dist/chunks/{telemetry-CBblNC6C.js → telemetry-B1xBTk1s.js} +16 -1
  5. package/dist/dock/dock-drag.d.ts +5 -5
  6. package/dist/dock/dock-drag.d.ts.map +1 -1
  7. package/dist/dock/dock-float.d.ts +116 -0
  8. package/dist/dock/dock-float.d.ts.map +1 -0
  9. package/dist/dock/dock-motion.d.ts +61 -6
  10. package/dist/dock/dock-motion.d.ts.map +1 -1
  11. package/dist/dock/dock-pill.d.ts +18 -1
  12. package/dist/dock/dock-pill.d.ts.map +1 -1
  13. package/dist/dock/dock-row.d.ts +128 -10
  14. package/dist/dock/dock-row.d.ts.map +1 -1
  15. package/dist/dock/dock-sheet.d.ts.map +1 -1
  16. package/dist/dock/dock-state.d.ts +129 -9
  17. package/dist/dock/dock-state.d.ts.map +1 -1
  18. package/dist/dock/dock.d.ts +137 -25
  19. package/dist/dock/dock.d.ts.map +1 -1
  20. package/dist/dock/geometry.d.ts +129 -3
  21. package/dist/dock/geometry.d.ts.map +1 -1
  22. package/dist/generated/widget-css.d.ts.map +1 -1
  23. package/dist/host-routes.d.ts +187 -0
  24. package/dist/host-routes.d.ts.map +1 -0
  25. package/dist/host-widget.d.ts +78 -2
  26. package/dist/host-widget.d.ts.map +1 -1
  27. package/dist/index.d.ts +1 -1
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +4 -3889
  30. package/dist/messages.d.ts +88 -1
  31. package/dist/messages.d.ts.map +1 -1
  32. package/dist/mount.d.ts +10 -1
  33. package/dist/mount.d.ts.map +1 -1
  34. package/dist/next/index.js +1 -1
  35. package/dist/rope-knot.d.ts +67 -0
  36. package/dist/rope-knot.d.ts.map +1 -1
  37. package/dist/theme/derive.d.ts +1 -1
  38. package/dist/theme/derive.d.ts.map +1 -1
  39. package/dist/use-chat-session.d.ts +87 -33
  40. package/dist/use-chat-session.d.ts.map +1 -1
  41. package/dist/use-voice-session.d.ts +13 -8
  42. package/dist/use-voice-session.d.ts.map +1 -1
  43. package/dist/voice-widget.d.ts +22 -1
  44. package/dist/voice-widget.d.ts.map +1 -1
  45. package/dist/widget-cards.d.ts +21 -1
  46. package/dist/widget-cards.d.ts.map +1 -1
  47. package/dist/widget-cart-summary.d.ts +10 -1
  48. package/dist/widget-cart-summary.d.ts.map +1 -1
  49. package/dist/widget.css +1 -1
  50. package/package.json +7 -3
  51. package/src/styles/concierge.css +528 -65
  52. package/src/styles/dock-surface.css +284 -0
  53. package/src/styles/tokens.css +22 -6
  54. package/src/styles/widget-entry.css +3 -0
@@ -848,6 +848,9 @@ label[for] {
848
848
  background: var(--wgt-surface);
849
849
  color: var(--wgt-text);
850
850
  contain: layout style paint;
851
+ /* §3.3 (revised 2026-09-15) — over the visor, which tucks its rim behind
852
+ * this row. */
853
+ z-index: 1;
851
854
  /* `visibility` is in the list on purpose — see `.wgt-pill` below for the
852
855
  * whole of why, and for why it is a duration rather than a delay. Without
853
856
  * it the row disappears at frame 0 of its own fade and §7.2's cross-fade
@@ -914,22 +917,6 @@ label[for] {
914
917
  outline-offset: 2px;
915
918
  }
916
919
 
917
- /* §3.3 (revised 2026-09-11) — the sheet sits FLUSH on the row, so the two
918
- * corners they share are square.
919
- *
920
- * A STATIC swap, driven by `data-sheet`, and never a transition: §7.1 rule 1
921
- * allows `transform`, `opacity` and `clip-path` and nothing else, and
922
- * `border-radius` is a paint on every frame it changes. (The alternative
923
- * considered was overlaying the sheet's square bottom over the row's top half,
924
- * which is compositor-only too — and hides the top half of a 48 px row whose
925
- * caption, mark and controls all live there.) The radius therefore snaps in
926
- * the frame the sheet's own `clip-path` reveal begins, under the sheet's
927
- * leading edge, where there is nothing yet to see it move. */
928
- .wgt-row[data-sheet='open'] {
929
- border-start-start-radius: 0;
930
- border-start-end-radius: 0;
931
- }
932
-
933
920
  /* §9.1 `layout.draggable` — §7.1 rule 8's `touch-action: none` on the HANDLE
934
921
  * only. The handle is the mark cell; on the rest of the row it would kill the
935
922
  * caption's own text selection and the browser's scroll. */
@@ -995,12 +982,33 @@ label[for] {
995
982
 
996
983
  /* An `image` avatar cannot carry an animated treatment, so it gets a state
997
984
  * RING instead (§2). Drawn with `outline`, never `box-shadow`: it is static,
998
- * and nothing here ever animates it. */
999
- .wgt-mark-face[data-avatar='image'][data-mark='live'] {
985
+ * and nothing here ever animates it.
986
+ *
987
+ * `:not([data-handoff])` because a handoff replaces the image with the
988
+ * operator's disc (below) — a ring is the IMAGE avatar's state treatment, and
989
+ * there is no image under it any more. */
990
+ .wgt-mark-face[data-avatar='image'][data-mark='live']:not([data-handoff]) {
1000
991
  outline: 2px solid var(--wgt-primary);
1001
992
  outline-offset: 1px;
1002
993
  }
1003
994
 
995
+ /* §2 — the handoff disc: while a PERSON holds the conversation the mark is
996
+ * theirs, drawn in the tenant's own colours so a widget that has been skinned
997
+ * still looks like itself. Initials when the payload carried a name, a person
998
+ * glyph when it did not — the mark is `aria-hidden` either way and the row's
999
+ * accessible name carries the session state, never the name. Runtime state:
1000
+ * the attribute goes on de-escalation and the tenant's mark is back. */
1001
+ .wgt-mark-face[data-handoff] {
1002
+ background: var(--wgt-primary);
1003
+ color: var(--wgt-on-primary);
1004
+ }
1005
+
1006
+ .wgt-mark-initials {
1007
+ font-size: calc(var(--wgt-mark-size, 32px) * 0.4);
1008
+ font-weight: 600;
1009
+ line-height: 1;
1010
+ }
1011
+
1004
1012
  /* ── The activity slot (§2) ─────────────────────────────────────────────── */
1005
1013
 
1006
1014
  .wgt-activity {
@@ -1025,6 +1033,41 @@ label[for] {
1025
1033
  transform-origin: center;
1026
1034
  }
1027
1035
 
1036
+ /* §2 — three dots while the other side composes (`typing`). Text-coloured and
1037
+ * quiet rather than primary: this is somebody else's activity, not the
1038
+ * shopper's open channel, and §1 rule 5 keeps primary for that. The stagger
1039
+ * is what makes three dots read as composing instead of three things
1040
+ * blinking; the motion is opacity and a 1 px lift, both compositor-only. */
1041
+ .wgt-dot {
1042
+ width: 4px;
1043
+ height: 4px;
1044
+ border-radius: 9999px;
1045
+ background: var(--wgt-text);
1046
+ opacity: 0.35;
1047
+ animation: wgt-dot 1.2s ease-in-out infinite;
1048
+ }
1049
+
1050
+ .wgt-dot:nth-child(2) {
1051
+ animation-delay: 0.15s;
1052
+ }
1053
+
1054
+ .wgt-dot:nth-child(3) {
1055
+ animation-delay: 0.3s;
1056
+ }
1057
+
1058
+ @keyframes wgt-dot {
1059
+ 0%,
1060
+ 60%,
1061
+ 100% {
1062
+ opacity: 0.35;
1063
+ transform: none;
1064
+ }
1065
+ 30% {
1066
+ opacity: 0.85;
1067
+ transform: translateY(-1px);
1068
+ }
1069
+ }
1070
+
1028
1071
  .wgt-progress {
1029
1072
  width: 100%;
1030
1073
  height: 2px;
@@ -1205,6 +1248,12 @@ label[for] {
1205
1248
  * here. */
1206
1249
  left: var(--wgt-pill-left, auto);
1207
1250
  right: var(--wgt-pill-right, 16px);
1251
+ /* `center` is both insets at 0: auto inline margins then centre this
1252
+ * shrink-to-fit box under the row. With one inset `auto` they resolve to 0,
1253
+ * so the edge anchors are untouched. Not `left: 50%` + `translateX`, because
1254
+ * the form swap already owns this element's `transform`. */
1255
+ width: fit-content;
1256
+ margin-inline: auto;
1208
1257
  display: flex;
1209
1258
  align-items: center;
1210
1259
  gap: 8px;
@@ -1262,6 +1311,48 @@ label[for] {
1262
1311
  pointer-events: none;
1263
1312
  }
1264
1313
 
1314
+ /* The mark's own box, so the notification dot below can hang off its corner
1315
+ * (see `dock-pill.tsx`). Shrink-to-fit, the size of the face inside it. */
1316
+ .wgt-pill-mark {
1317
+ position: relative;
1318
+ display: flex;
1319
+ flex: 0 0 auto;
1320
+ }
1321
+
1322
+ /* §3.2 — the notification indicator. 8 px of primary on the avatar's top-END
1323
+ * corner (logical, so RTL mirrors it with the mark), ringed 2 px in the
1324
+ * surface so it reads over any avatar — a static ring, never transitioned.
1325
+ * No count and no pulse.
1326
+ *
1327
+ * Appears with a 160 ms scale-and-fade; LEAVES with a fade alone. The two
1328
+ * directions take the destination rule's list: this hidden rule fades
1329
+ * opacity and holds `transform` at full size until the fade is done (the
1330
+ * delay), so the dot does not visibly shrink as it goes. */
1331
+ .wgt-pill-unread {
1332
+ position: absolute;
1333
+ top: -1px;
1334
+ inset-inline-end: -1px;
1335
+ width: 8px;
1336
+ height: 8px;
1337
+ border-radius: 9999px;
1338
+ background: var(--wgt-primary);
1339
+ box-shadow: 0 0 0 2px var(--wgt-surface);
1340
+ opacity: 0;
1341
+ transform: scale(0.6);
1342
+ pointer-events: none;
1343
+ transition:
1344
+ opacity 160ms ease,
1345
+ transform 0ms linear 160ms;
1346
+ }
1347
+
1348
+ .wgt-pill-unread[data-visible='true'] {
1349
+ opacity: 1;
1350
+ transform: scale(1);
1351
+ transition:
1352
+ opacity 160ms ease-out,
1353
+ transform 160ms ease-out;
1354
+ }
1355
+
1265
1356
  .wgt-pill-label {
1266
1357
  font-size: 14px;
1267
1358
  font-weight: 500;
@@ -1274,19 +1365,51 @@ label[for] {
1274
1365
 
1275
1366
  .wgt-sheet {
1276
1367
  position: absolute;
1277
- /* §3.3 (revised 2026-09-11) — FLUSH on the row: `SHEET_GAP` is 0
1278
- * (`dock/geometry.ts`), and the 8 px that used to be here read as two
1279
- * unrelated boxes stacked on the merchant's page. */
1280
- bottom: var(--wgt-row-h, 48px);
1281
- inset-inline: var(--wgt-row-margin, 0px);
1368
+ /* §3.3 (revised 2026-09-15) — a VISOR tucked behind the row. Its floor sits
1369
+ * half a row down (`SHEET_TUCK` in `dock/geometry.ts`) and the row, one
1370
+ * layer up, paints over that rim, so the transcript slides out from behind
1371
+ * the dock like a head-up display. */
1372
+ z-index: 0;
1373
+ bottom: calc(var(--wgt-row-h, 48px) / 2);
1374
+ /* §3.3 (revised 2026-09-17) — a gutter narrower than the row on BOTH
1375
+ * viewports, where it used to be desktop only.
1376
+ *
1377
+ * The visor's floor is tucked half a row down (`SHEET_TUCK`) and the row is
1378
+ * a 24 px-radius pill, so between the tuck line and the row's top edge the
1379
+ * pill's own edge curves inward by up to its full radius. A visor at the
1380
+ * row's exact inset has square corners out there: measured, up to 24 px of
1381
+ * visor — with its border and its lit rim on it — stuck out beside the
1382
+ * pill's curve on mobile. Desktop never showed it because of this same
1383
+ * 16 px gutter.
1384
+ *
1385
+ * 16 px does not close the wedge completely: the pill's edge passes 16 px
1386
+ * only in the last ~1.4 px below its top, leaving an ~8 px sliver at the
1387
+ * extreme corner — which is exactly what desktop has always drawn. Closing
1388
+ * it entirely needs the row's whole 24 px radius, and that is 48 px off a
1389
+ * mobile visor's reading width (355 → 307 on a 375 px phone) to remove a
1390
+ * sliver a shopper cannot see. The curves cannot be matched instead: the
1391
+ * row's edge moves inward going UP and a bottom corner radius moves inward
1392
+ * going DOWN, so no radius on the visor traces the pill. */
1393
+ inset-inline: calc(var(--wgt-row-margin, 0px) + 16px);
1282
1394
  display: flex;
1283
1395
  flex-direction: column;
1284
1396
  max-height: var(--wgt-sheet-max-h);
1285
1397
  border: 1px solid var(--wgt-border);
1286
- /* §3.3 — the SHEET's own radius, capped at 20 px by `theme/derive.ts`. The
1287
- * tenant's `--wgt-radius` belongs to the row, the pill and the controls; a
1288
- * `pill` tenant's 9999px on a full-width sheet is an ellipse, not a corner. */
1289
- border-radius: var(--wgt-sheet-radius, 12px) var(--wgt-sheet-radius, 12px) 0 0;
1398
+ /* §3.3 — the SHEET's own radius, capped at 20 px by `theme/derive.ts`, on
1399
+ * all four corners now that nothing sits flush against it. The tenant's
1400
+ * `--wgt-radius` belongs to the row, the pill and the controls; a `pill`
1401
+ * tenant's 9999px on a full-width sheet is an ellipse, not a corner. */
1402
+ border-radius: var(--wgt-sheet-radius, 12px);
1403
+ /* STATIC Liquid Glass depth (§3.3, revised 2026-09-16, after iOS), on every
1404
+ * device: a lit 1 px inner top rim, the faintest inner lower edge, a wide
1405
+ * soft lift and a tight contact shadow. Never in a transition list (§7.1
1406
+ * rule 1); the clip's -48px side and top insets below are what keep the
1407
+ * outer layers visible, which is why no layer reaches further than that. */
1408
+ box-shadow:
1409
+ inset 0 1px 0 rgb(255 255 255 / 0.45),
1410
+ inset 0 -1px 0 rgb(0 0 0 / 0.04),
1411
+ 0 18px 44px -10px rgb(0 0 0 / 0.22),
1412
+ 0 4px 12px -4px rgb(0 0 0 / 0.08);
1290
1413
  /* §3.3 / §7.1 rule 11 (both revised 2026-09-11) — the sheet is TRANSLUCENT:
1291
1414
  * the tenant's surface at 92 %, over the hairline above. A token rather
1292
1415
  * than `opacity`, which would fade the shopper's own words and the prices
@@ -1312,9 +1435,14 @@ label[for] {
1312
1435
  visibility var(--wgt-dur-sheet, 240ms) linear;
1313
1436
  }
1314
1437
 
1438
+ /* §7.2 (revised 2026-09-15) — closed is tucked away behind the row: moved down
1439
+ * by its own height and clipped from the bottom by the same 100 %. Both run on
1440
+ * one easing, so the reveal slides the visor up out of the dock with the clip's
1441
+ * bottom edge pinned to its resting floor — nothing is ever painted below it.
1442
+ * `SHEET_END_STATE` in `dock/dock-motion.ts` mirrors these values. */
1315
1443
  .wgt-sheet[data-snap='closed'] {
1316
- clip-path: inset(100% 0 0 0);
1317
- transform: translateY(8px);
1444
+ clip-path: inset(-48px -48px 100% -48px);
1445
+ transform: translateY(100%);
1318
1446
  opacity: 0;
1319
1447
  visibility: hidden;
1320
1448
  pointer-events: none;
@@ -1322,9 +1450,11 @@ label[for] {
1322
1450
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
1323
1451
  }
1324
1452
 
1453
+ /* The bottom inset follows a downward drag (`--wgt-sheet-y` > 0), so a swipe
1454
+ * to dismiss sinks the visor behind the row instead of over the page. */
1325
1455
  .wgt-sheet[data-snap='peek'],
1326
1456
  .wgt-sheet[data-snap='expanded'] {
1327
- clip-path: inset(0 0 0 0);
1457
+ clip-path: inset(-48px -48px max(0px, var(--wgt-sheet-y, 0px)) -48px);
1328
1458
  opacity: 1;
1329
1459
  }
1330
1460
 
@@ -1332,27 +1462,241 @@ label[for] {
1332
1462
  max-height: min(var(--wgt-sheet-max-h), var(--wgt-sheet-peek, 260px));
1333
1463
  }
1334
1464
 
1465
+ /* ── The float (§3.5, added 2026-09-15) ───────────────────────────────────
1466
+ *
1467
+ * The last turn, on its own small surface above the expanded row. It is the
1468
+ * VISOR's width and wears the visor's glass tokens (97 %, or 66 % under the
1469
+ * blur below), so the two read as one material; it only ever moves with
1470
+ * `opacity` and `transform`, which §7.1 rule 1 and
1471
+ * `tools/check-widget-motion.mjs` allow. Hidden is `visibility: hidden`, so a
1472
+ * shopper tabbing through the merchant's page never lands on a line that is
1473
+ * not on screen — listed in the transition so the fade-out actually plays.
1474
+ *
1475
+ * A CONTAINER since 2026-09-16, not the button itself: §3.5's dismiss is a
1476
+ * second control on the same surface, and a button inside a button is not
1477
+ * representable. The surface and every hidden/visible rule stay here, on the
1478
+ * one element the whole float is keyed on by `data-visible`; `.wgt-float-open`
1479
+ * is the line, and carries the button reset that used to live here. */
1480
+ .wgt-float {
1481
+ position: absolute;
1482
+ z-index: 1;
1483
+ bottom: calc(var(--wgt-row-h, 48px) + 8px);
1484
+ /* The VISOR's width, on both viewports — see `.wgt-sheet` above, which owns
1485
+ * the reasoning for the gutter. The float clears the row entirely, so it
1486
+ * never had the pill-curve problem itself; it matches so that §3.5's "the
1487
+ * float is the visor's width" stays true. */
1488
+ inset-inline: calc(var(--wgt-row-margin, 0px) + 16px);
1489
+ display: block;
1490
+ margin: 0;
1491
+ border-radius: var(--wgt-sheet-radius, 12px);
1492
+ background: var(--wgt-surface-glass, var(--wgt-surface));
1493
+ /* STATIC, the visor's Liquid Glass depth at float scale. Never in a
1494
+ * transition list. */
1495
+ box-shadow:
1496
+ inset 0 1px 0 rgb(255 255 255 / 0.45),
1497
+ 0 10px 28px -8px rgb(0 0 0 / 0.2),
1498
+ 0 2px 8px -2px rgb(0 0 0 / 0.08);
1499
+ color: var(--wgt-text);
1500
+ font-size: 14px;
1501
+ line-height: 1.45;
1502
+ text-align: start;
1503
+ opacity: 0;
1504
+ transform: translateY(4px);
1505
+ visibility: hidden;
1506
+ pointer-events: none;
1507
+ transition:
1508
+ opacity 160ms ease-in,
1509
+ transform 160ms ease-in,
1510
+ visibility 160ms linear;
1511
+ }
1512
+
1513
+ /* The LINE — §11's "the whole surface is the control". It fills the float, so
1514
+ * a thumb anywhere on the words opens the visor, and keeps clear of the
1515
+ * dismiss on the end side so two lines of a long reply never run under it. */
1516
+ .wgt-float-open {
1517
+ display: block;
1518
+ width: 100%;
1519
+ margin: 0;
1520
+ padding-block: 9px;
1521
+ padding-inline: 14px 44px;
1522
+ border: 0;
1523
+ border-radius: inherit;
1524
+ background: none;
1525
+ color: inherit;
1526
+ font: inherit;
1527
+ text-align: start;
1528
+ appearance: none;
1529
+ cursor: pointer;
1530
+ }
1531
+
1532
+ /* §3.5's dismiss (added 2026-09-16). The float no longer times out and no
1533
+ * longer hides on a scroll, so the shopper needs a way out they chose rather
1534
+ * than one the dock guessed at. §11's 44 px target over the float's own end
1535
+ * corner, drawn as a glyph and named by `dock_float_dismiss`; faint at rest
1536
+ * and full under a pointer or focus, on `opacity` alone (§7.1 rule 1). */
1537
+ .wgt-float-dismiss {
1538
+ position: absolute;
1539
+ inset-block-start: 0;
1540
+ inset-inline-end: 0;
1541
+ display: flex;
1542
+ align-items: center;
1543
+ justify-content: center;
1544
+ width: 44px;
1545
+ height: 44px;
1546
+ margin: 0;
1547
+ padding: 0;
1548
+ border: 0;
1549
+ background: none;
1550
+ color: var(--wgt-text);
1551
+ appearance: none;
1552
+ cursor: pointer;
1553
+ opacity: 0.55;
1554
+ transition: opacity 160ms ease-out;
1555
+ }
1556
+
1557
+ .wgt-float-dismiss:hover,
1558
+ .wgt-float-dismiss:focus-visible {
1559
+ opacity: 1;
1560
+ }
1561
+
1562
+ .wgt-float[data-visible='true'] {
1563
+ opacity: 1;
1564
+ transform: translateY(0);
1565
+ visibility: visible;
1566
+ pointer-events: auto;
1567
+ transition:
1568
+ opacity 200ms ease-out,
1569
+ transform 200ms ease-out,
1570
+ visibility 200ms linear;
1571
+ }
1572
+
1573
+ /* §11 — `--wgt-ring`, like every other ring in this file, and NOT the raw
1574
+ * primary these two shipped with. `--wgt-ring` exists precisely because
1575
+ * `--wgt-primary` carries no contrast floor of its own: `deriveTheme` walks
1576
+ * the ring's OKLCH lightness until it clears §11's 3:1 against the surface,
1577
+ * and the untreated primary does not (the dark fallback's `#111827` is
1578
+ * 1.40:1 on `#141414`; §16's reference teal is 2.48:1 on white). A ring a
1579
+ * keyboard shopper cannot see is the one control state that has no second
1580
+ * copy anywhere. */
1581
+ .wgt-float-open:focus-visible,
1582
+ .wgt-float-dismiss:focus-visible {
1583
+ outline: 2px solid var(--wgt-ring);
1584
+ outline-offset: 2px;
1585
+ }
1586
+
1587
+ .wgt-float-speaker {
1588
+ display: block;
1589
+ font-size: 12px;
1590
+ font-weight: 600;
1591
+ line-height: 1.3;
1592
+ }
1593
+
1594
+ /* Two lines, then an ellipsis; never a scroll (§3.5). A new turn's words fade
1595
+ * in — the element is keyed per turn in `dock-float.tsx`, so a reply growing
1596
+ * token by token is not re-animated. */
1597
+ .wgt-float-text {
1598
+ display: -webkit-box;
1599
+ -webkit-box-orient: vertical;
1600
+ -webkit-line-clamp: 2;
1601
+ overflow: hidden;
1602
+ overflow-wrap: anywhere;
1603
+ animation: wgt-float-text-in 160ms ease-out;
1604
+ }
1605
+
1606
+ @keyframes wgt-float-text-in {
1607
+ from {
1608
+ opacity: 0;
1609
+ }
1610
+ to {
1611
+ opacity: 1;
1612
+ }
1613
+ }
1614
+
1335
1615
  .wgt-sheet[data-dragging='true'] {
1336
1616
  transition: none;
1337
1617
  }
1338
1618
 
1619
+ /* §3.3 (revised 2026-09-16) — the visor's ONE top bar.
1620
+ *
1621
+ * It replaced a 24 px handle row stacked on a separate header row, which
1622
+ * together took roughly 44 px off a ~260 px peek visor before any content.
1623
+ * The two never competed for the same pixels — the grip is centred and the
1624
+ * actions sit at the inline end — so they became one 32 px bar with the grip
1625
+ * taken out of flow.
1626
+ *
1627
+ * `justify-content: flex-end` is the INLINE end, not the right edge: it
1628
+ * follows the `dir` the dock's root sets, so an RTL storefront gets the
1629
+ * actions on the left with no second rule (§8.9).
1630
+ *
1631
+ * `z-index: 2` (added 2026-09-17) is what makes §11's 44 px targets on this
1632
+ * 32 px bar REAL, and it is the whole of the fix — see `.wgt-sheet-action`
1633
+ * below. The bar's grip and chips reach 44 px through `::before` strips that
1634
+ * overhang the bar by 12 px, and `.wgt-sheet-body` is `position: relative;
1635
+ * z-index: 1`. Paint order decides hit-testing, so with the bar at `auto` the
1636
+ * body won every point below the bar's own 32 px and both strips were dead:
1637
+ * `elementFromPoint` returned the body's text from 32 px down, and the real
1638
+ * target was 32 px, not 44 px. The bar taking a higher layer hands those
1639
+ * 12 px back to the control the shopper is aiming at.
1640
+ *
1641
+ * THE COST, stated plainly: the top 12 px of the scroll body now sits under
1642
+ * two strips — the grip's 56 px column (mobile only; desktop draws no grip)
1643
+ * and the close chip's 44 px column at the inline end. The body's own 4 px of
1644
+ * top padding absorbs a third of that, so what a press can actually miss is
1645
+ * the top ~8 px of the first card or line, in two narrow columns, at one
1646
+ * scroll position. That is the trade §11 asks for: a control that is 32 px to
1647
+ * every touch shopper fails WCAG 2.5.5 outright, and this is the same trade
1648
+ * iOS makes for a sheet's grabber. The body keeps `z-index: 1` so it still
1649
+ * wins against everything else. */
1650
+ .wgt-sheet-bar {
1651
+ position: relative;
1652
+ z-index: 2;
1653
+ flex: 0 0 auto;
1654
+ display: flex;
1655
+ align-items: center;
1656
+ justify-content: flex-end;
1657
+ gap: 4px;
1658
+ min-height: 32px;
1659
+ padding: 0 8px;
1660
+ }
1661
+
1339
1662
  /* §7.1 rule 8 — the drag uses pointer events, and `touch-action: none` is on
1340
1663
  * the HANDLE only. On the sheet body it would kill the internal scroll the
1341
- * shopper needs. */
1664
+ * shopper needs.
1665
+ *
1666
+ * Out of the bar's flow and centred on it, so the actions can own the inline
1667
+ * end of the same 32 px. `min-height` stays 24 px: it is the box the grip is
1668
+ * centred in, and the thumb target is the pseudo-element below. */
1342
1669
  .wgt-sheet-handle {
1343
- position: relative;
1344
- flex: 0 0 auto;
1670
+ position: absolute;
1671
+ inset-block: 0;
1672
+ left: 50%;
1673
+ transform: translateX(-50%);
1345
1674
  display: flex;
1346
1675
  align-items: center;
1347
1676
  justify-content: center;
1677
+ width: 56px;
1348
1678
  min-height: 24px;
1349
- padding: 8px 0 4px;
1679
+ padding: 0;
1350
1680
  border: none;
1351
1681
  background: transparent;
1352
1682
  cursor: grab;
1353
1683
  touch-action: none;
1354
1684
  }
1355
1685
 
1686
+ /* §3.3 — no grip on a DESKTOP visor.
1687
+ *
1688
+ * The grip is an affordance for a thumb: it says "drag me", and on a desktop
1689
+ * pointer there is nothing to drag it with that a shopper would try. Drawing
1690
+ * it there spends a third of the bar on a hint nobody acts on. Hidden rather
1691
+ * than unmounted so the decision stays in one place — the stylesheet already
1692
+ * answers "which viewport is this" through the dock's own attribute, and a
1693
+ * React prop for it would re-render the visor on every resize to reach the
1694
+ * same result. `display: none` also takes it out of hit-testing, so the
1695
+ * pseudo-element strip below goes with it. */
1696
+ .wgt-dock[data-viewport='desktop'] .wgt-sheet-handle {
1697
+ display: none;
1698
+ }
1699
+
1356
1700
  /* §2 — every control is ≥ 44 px to the thumb, and the handle IS a control:
1357
1701
  * it drags the sheet and a tap on it toggles the snap.
1358
1702
  *
@@ -1361,9 +1705,12 @@ label[for] {
1361
1705
  * content the sheet exists to show below the fold. The target is this
1362
1706
  * pseudo-element instead, and it grows DOWNWARDS: upwards it would be clipped
1363
1707
  * by `.wgt-sheet`'s own `contain: paint`, which is an overflow clip for
1364
- * hit-testing as much as for painting. The header and the body sit above it
1365
- * (below), so the strip it adds can never swallow a press meant for
1366
- * "Minimise" or for a card. */
1708
+ * hit-testing as much as for painting.
1709
+ *
1710
+ * The strip only WINS those 12 px because `.wgt-sheet-bar` carries
1711
+ * `z-index: 2` above the body's 1 — see that rule for the fix and its cost.
1712
+ * Without it this pseudo-element is decoration: the body paints over it and
1713
+ * the handle is a 24 px target. */
1367
1714
  .wgt-sheet-handle::before {
1368
1715
  content: '';
1369
1716
  position: absolute;
@@ -1380,21 +1727,11 @@ label[for] {
1380
1727
  background: var(--wgt-border);
1381
1728
  }
1382
1729
 
1383
- .wgt-sheet-header {
1384
- /* Above the handle's hit area (`.wgt-sheet-handle::before`) — a press on
1385
- * "Minimise" is a press on "Minimise". */
1386
- position: relative;
1387
- z-index: 1;
1388
- flex: 0 0 auto;
1389
- display: flex;
1390
- align-items: center;
1391
- justify-content: flex-end;
1392
- gap: 8px;
1393
- padding: 0 12px 4px;
1394
- }
1395
-
1396
1730
  .wgt-sheet-body {
1397
- /* As `.wgt-sheet-header` — above the handle's hit area. */
1731
+ /* Its own layer, above everything in the visor EXCEPT the top bar, which
1732
+ * takes `z-index: 2` so the bar's 44 px hit strips are not dead (see
1733
+ * `.wgt-sheet-bar`). A card inside the body still beats every other
1734
+ * overlapping box. */
1398
1735
  position: relative;
1399
1736
  z-index: 1;
1400
1737
  flex: 1 1 auto;
@@ -1404,10 +1741,27 @@ label[for] {
1404
1741
  * merchant's page underneath it. */
1405
1742
  overscroll-behavior: contain;
1406
1743
  scrollbar-gutter: stable;
1407
- padding: 0 12px 12px;
1744
+ /* The bottom half-row is behind the row (`SHEET_TUCK`); the last line has
1745
+ * to clear it — that term is load-bearing and does not change.
1746
+ *
1747
+ * The TOP is 4 px (revised 2026-09-16), which is the gap the retired
1748
+ * header's own `padding-bottom` used to draw. It sits under a 32 px bar
1749
+ * rather than under ~44 px of stacked chrome, so it is all the separation
1750
+ * the first card or line needs. */
1751
+ padding: 4px 12px calc(12px + var(--wgt-row-h, 48px) / 2);
1408
1752
  }
1409
1753
 
1410
1754
  .wgt-sheet-action {
1755
+ /* Above the handle's hit area (`.wgt-sheet-handle::before`) — a press on
1756
+ * the visor's close is a press on the visor's close. Both live inside
1757
+ * `.wgt-sheet-bar`'s `z-index: 2` layer, so this orders them against each
1758
+ * other and the pair against the body in one step. */
1759
+ position: relative;
1760
+ z-index: 1;
1761
+ display: flex;
1762
+ align-items: center;
1763
+ justify-content: center;
1764
+ flex: 0 0 auto;
1411
1765
  border: none;
1412
1766
  /* A chip inside the sheet takes the CARD radius, not the tenant's — see
1413
1767
  * `.wgt-sheet` above. It carries the focus ring's shape even though the
@@ -1420,14 +1774,35 @@ label[for] {
1420
1774
  font-size: 13px;
1421
1775
  /* §11 — "every control ≥ 44 px", and that is a BOX, not a height. A short
1422
1776
  * localised label ("סגור", "закрыть") makes a 30 px-wide target out of a
1423
- * 44 px-tall rule, which is the same miss the height was there to prevent. */
1424
- min-height: 44px;
1777
+ * 44 px-tall rule, which is the same miss the height was there to prevent.
1778
+ *
1779
+ * The HEIGHT is now the bar's 32 px and the target is the pseudo-element
1780
+ * below — the same trade the drag handle has made since it landed, and for
1781
+ * the same reason: 44 px of chrome at the top of a ~260 px peek visor
1782
+ * pushes the answer the visor exists to show below the fold. The width
1783
+ * stays a real 44 px, because nothing about a bar's height constrains it. */
1784
+ min-height: 32px;
1425
1785
  min-width: 44px;
1426
1786
  padding: 0 6px;
1427
1787
  text-transform: var(--wgt-caps);
1428
1788
  cursor: pointer;
1429
1789
  }
1430
1790
 
1791
+ /* §11's 44 px target on a 32 px box, exactly as `.wgt-sheet-handle::before`
1792
+ * does it: the strip grows DOWNWARDS, because upwards it would be clipped by
1793
+ * `.wgt-sheet`'s `contain: paint`, and it wins those 12 px over the body
1794
+ * because the bar is a layer above it (`.wgt-sheet-bar`, which states the
1795
+ * cost). Until 2026-09-17 the body won instead and this strip was dead: the
1796
+ * close control was a 32 px target, which is the WCAG 2.5.5 failure §11's
1797
+ * 44 px is there to prevent. */
1798
+ .wgt-sheet-action::before {
1799
+ content: '';
1800
+ position: absolute;
1801
+ inset-inline: 0;
1802
+ top: 0;
1803
+ height: 44px;
1804
+ }
1805
+
1431
1806
  /* ── Transcript rows (§7.1 rule 3) ─────────────────────────────────────── */
1432
1807
 
1433
1808
  /*
@@ -1610,7 +1985,12 @@ label[for] {
1610
1985
  * that was already blurred; the filter itself stands still. */
1611
1986
  @supports (backdrop-filter: blur(16px)) {
1612
1987
  @media (pointer: fine) {
1613
- .wgt-sheet {
1988
+ /* ONE RULE for the visor and the float (merged 2026-09-18). §3.5 always
1989
+ * said "the float is the same material as the visor"; it used to say it
1990
+ * twice, in two rules that had already drifted apart once — the float was
1991
+ * still on the old alpha when the visor moved. */
1992
+ .wgt-sheet,
1993
+ .wgt-float {
1614
1994
  /* STANDARD PROPERTY ONLY — do not add `-webkit-backdrop-filter` here.
1615
1995
  *
1616
1996
  * Lightning CSS (Tailwind v4's minifier) models the prefixed alias as
@@ -1624,19 +2004,96 @@ label[for] {
1624
2004
  *
1625
2005
  * Left alone, the pipeline prefixes this from its own browser targets
1626
2006
  * and emits both spellings. `concierge-css.test.ts` asserts that on the
1627
- * COMPILED output, which is the only place the difference shows. */
1628
- backdrop-filter: blur(16px);
1629
- /* Only NOW is 92 % safe. The `@supports` gate is doing real work: the
1630
- * alpha and the blur are one decision, so the surface may only get
1631
- * thinner where the blur is actually going to be painted. Anywhere else
1632
- * — a coarse pointer, a browser without the filter, a future refactor
1633
- * that moves this rule — the sheet keeps `--wgt-surface-glass`'s 97 %,
1634
- * which is legible unaided. See `theme/derive.ts`. */
1635
- background: var(--wgt-surface-glass-blurred, var(--wgt-surface-glass, var(--wgt-surface)));
2007
+ * COMPILED output, which is the only place the difference shows.
2008
+ *
2009
+ * `--wgt-glass-tune` is the TONE-AWARE tail — `contrast()` then
2010
+ * `brightness()` — and it is what makes a 25 % surface legal (§3.3,
2011
+ * added 2026-09-18). The blur was never what kept the text readable: a
2012
+ * blur destroys DETAIL and leaves LUMINANCE alone, so under it the
2013
+ * page's own black-to-white range still reached the caption and every
2014
+ * thin alpha this file tried failed §11. `contrast()` below 1 collapses
2015
+ * that range toward mid-grey and `brightness()` slides the collapsed
2016
+ * band onto the tenant's own tone, so the surface faces a narrow band
2017
+ * instead of the whole of 0–1. `theme/derive.ts` carries the values and
2018
+ * the reason they cannot live in `styles/tokens.css`.
2019
+ *
2020
+ * `saturate()` comes LAST, after the tune, and that order is not
2021
+ * cosmetic. Saturation preserves luma by construction, so it cannot
2022
+ * undo the bounding the tune just did; placed BEFORE it, its gain would
2023
+ * be multiplied straight back down by the tune's own `c·b` and the
2024
+ * vibrancy would be decoration that does nothing. Last, it is the one
2025
+ * knob that buys back appearance at no contrast cost — the measured
2026
+ * win of this whole change is 7.4x the chroma reach on a light tenant and
2027
+ * 7.5x the luminance, once §9.2 stopped capping it
2028
+ * (`theme/derive.test.ts` carries both numbers and the reversal).
2029
+ *
2030
+ * THE COST, stated plainly: four filter functions on a full-surface
2031
+ * `backdrop-filter` where there were two. §1 rule 8 makes the mid-range
2032
+ * phone the case this widget is designed for, and this whole block is
2033
+ * behind `pointer: fine` — the phone never pays it, and never did. It
2034
+ * is also STATIC: not in any transition list, not in any keyframe, and
2035
+ * `tools/check-widget-motion.mjs` keeps it that way (§7.1 rule 11). */
2036
+ backdrop-filter: blur(28px) var(--wgt-glass-tune) saturate(2.4);
2037
+ /* Only NOW is 25 % safe (§3.3, revised 2026-09-18 from 66 %, and from
2038
+ * 92 % before that). The `@supports` gate is doing real work: the alpha
2039
+ * and the filter are ONE decision, so the surface may only get thinner
2040
+ * where the filter is actually going to be painted. Anywhere else — a
2041
+ * coarse pointer, a browser without the filter, reduced transparency, a
2042
+ * future refactor that moves this rule — the sheet keeps
2043
+ * `--wgt-surface-glass`'s 97 %, which is legible unaided. See
2044
+ * `theme/derive.ts`.
2045
+ *
2046
+ * The sheen is a background LAYER over the surface rather than a
2047
+ * `::before`: one declaration, no stacking context to get wrong under
2048
+ * the header and body, and nothing a transition could attach to.
2049
+ *
2050
+ * It is the TENANT'S OWN SURFACE, not white (revised 2026-09-17). A
2051
+ * white wash is only a highlight on a light tenant; on a dark one it is
2052
+ * a grey haze under light text, and it was measured taking `--wgt-text`
2053
+ * on a dark tenant to 2.94:1 over a white storefront — below AA, across
2054
+ * the top 45 %, which is the whole of the float and where the visor's
2055
+ * bar and first lines sit. The SAME token on both layers makes the
2056
+ * sheen a THICKNESS ramp rather than a colour wash: the material is
2057
+ * denser at the top (0.25 → 0.44 effective) and thins back to 0.25 by
2058
+ * the 45 % stop, which is what a highlight in glass physically is,
2059
+ * reads the same way on either tone, and can only ever RAISE contrast —
2060
+ * so the guarantee is measured at the THIN end and the ramp is free.
2061
+ * The specular line is still the lit inner shadow on the base rule.
2062
+ *
2063
+ * The border is NOT overridden here. It used to become
2064
+ * `rgb(255 255 255 / 0.5)`, which composites to pure white over a white
2065
+ * page: 1.00:1, so the visor lost its edge on a white storefront for
2066
+ * every fine-pointer browser and was left with its shadow alone. The
2067
+ * base rule's `--wgt-border` hairline is tone-aware and is what both
2068
+ * paths now draw. */
2069
+ background:
2070
+ linear-gradient(160deg, var(--wgt-surface-glass-blurred), transparent 45%),
2071
+ var(--wgt-surface-glass-blurred, var(--wgt-surface-glass, var(--wgt-surface)));
1636
2072
  }
1637
2073
  }
1638
2074
  }
1639
2075
 
2076
+ /* §3.3 — `prefers-reduced-transparency`, as iOS itself honours it: the glass
2077
+ * becomes the solid surface and the blur goes. After the block above, so it
2078
+ * wins at equal specificity.
2079
+ *
2080
+ * `border-color` is restated because a reader looking for "what does reduced
2081
+ * transparency revert" should find the whole answer here, and because the
2082
+ * blur block reached for a white rim until 2026-09-17 and could again.
2083
+ *
2084
+ * §3.6's glass ROW is NOT in this list, and cannot be: its rules live in
2085
+ * `dock-surface.css`, which loads after this file at the same (0,2,0)
2086
+ * specificity, so a revert written here loses to them. It is in that file,
2087
+ * at the bottom, for exactly that reason. */
2088
+ @media (prefers-reduced-transparency: reduce) {
2089
+ .wgt-sheet,
2090
+ .wgt-float {
2091
+ backdrop-filter: none;
2092
+ background: var(--wgt-surface);
2093
+ border-color: var(--wgt-border);
2094
+ }
2095
+ }
2096
+
1640
2097
  /* §7.1 rule 10 — reduced motion wins. Durations are also zeroed in JS
1641
2098
  * (`dock-motion.ts`), so this is the belt to that braces: a stylesheet loaded
1642
2099
  * without the React dock still respects it. */
@@ -1644,12 +2101,18 @@ label[for] {
1644
2101
  .wgt-row,
1645
2102
  .wgt-pill,
1646
2103
  .wgt-sheet,
2104
+ .wgt-float,
2105
+ .wgt-float-dismiss,
1647
2106
  .wgt-control,
1648
- .wgt-mark-face {
2107
+ .wgt-mark-face,
2108
+ .wgt-pill-unread {
1649
2109
  transition-duration: 0ms !important;
2110
+ transition-delay: 0ms !important;
1650
2111
  }
1651
2112
 
1652
2113
  .wgt-line,
2114
+ .wgt-float-text,
2115
+ .wgt-dot,
1653
2116
  .wgt-progress::after {
1654
2117
  animation: none;
1655
2118
  }