@slotted/styles 0.1.0-beta.3 → 0.1.0-beta.30

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 (199) hide show
  1. package/package.json +13 -1
  2. package/src/accordion/accordion.css +11 -11
  3. package/src/action-bar/action-bar.css +47 -44
  4. package/src/action-bar/action-bar.tokens.json +1 -0
  5. package/src/action-sheet/action-sheet.css +39 -39
  6. package/src/alert/alert.css +96 -96
  7. package/src/alert/alert.tokens.json +5 -0
  8. package/src/app-shell/app-shell.css +455 -328
  9. package/src/app-shell/app-shell.tokens.json +5 -2
  10. package/src/aspect-ratio/aspect-ratio.css +9 -9
  11. package/src/attachment/attachment.css +118 -114
  12. package/src/avatar/avatar.css +96 -66
  13. package/src/avatar/avatar.tokens.json +7 -0
  14. package/src/avatar-group/avatar-group.css +22 -23
  15. package/src/badge/badge.css +54 -46
  16. package/src/badge/badge.tokens.json +5 -0
  17. package/src/breadcrumb/breadcrumb.css +52 -52
  18. package/src/button/button.css +137 -89
  19. package/src/button/button.tokens.json +5 -0
  20. package/src/button-group/button-group.css +80 -79
  21. package/src/button-group/button-group.tokens.json +1 -0
  22. package/src/calendar/calendar.css +139 -109
  23. package/src/calendar/calendar.tokens.json +5 -1
  24. package/src/card/card.css +68 -65
  25. package/src/carousel/carousel.css +158 -169
  26. package/src/cascader/cascader.css +158 -157
  27. package/src/cascader/cascader.tokens.json +1 -0
  28. package/src/chart/chart.css +288 -267
  29. package/src/chart/chart.tokens.json +4 -0
  30. package/src/checkbox/checkbox.css +143 -148
  31. package/src/checkbox-group/checkbox-group.css +7 -7
  32. package/src/code-block/code-block.css +85 -89
  33. package/src/collapsible/collapsible.css +76 -80
  34. package/src/color-picker/color-picker.css +106 -114
  35. package/src/column-manager/column-manager.css +111 -119
  36. package/src/combobox/combobox.css +203 -130
  37. package/src/combobox/combobox.tokens.json +3 -0
  38. package/src/command-palette/command-palette.css +155 -102
  39. package/src/command-palette/command-palette.tokens.json +2 -0
  40. package/src/container/container.css +27 -27
  41. package/src/context-menu/context-menu.css +9 -9
  42. package/src/currency-field/currency-field.css +119 -119
  43. package/src/currency-field/currency-field.tokens.json +1 -0
  44. package/src/dashboard-grid/dashboard-grid.css +185 -115
  45. package/src/data-grid/data-grid.css +598 -496
  46. package/src/data-grid/data-grid.tokens.json +5 -1
  47. package/src/data-list/data-list.css +82 -71
  48. package/src/data-list/data-list.tokens.json +2 -1
  49. package/src/date-field/date-field.css +62 -57
  50. package/src/date-field/date-field.tokens.json +1 -0
  51. package/src/date-picker/date-picker.css +117 -58
  52. package/src/date-picker/date-picker.tokens.json +5 -0
  53. package/src/date-range-picker/date-range-picker.css +157 -127
  54. package/src/date-range-picker/date-range-picker.tokens.json +4 -0
  55. package/src/datetime-field/datetime-field.css +90 -90
  56. package/src/datetime-field/datetime-field.tokens.json +1 -0
  57. package/src/datetime-picker/datetime-picker.css +123 -70
  58. package/src/datetime-picker/datetime-picker.tokens.json +4 -1
  59. package/src/datetime-range-picker/datetime-range-picker.css +191 -163
  60. package/src/datetime-range-picker/datetime-range-picker.tokens.json +4 -0
  61. package/src/description-list/description-list.css +105 -75
  62. package/src/description-list/description-list.tokens.json +1 -0
  63. package/src/detail-panel/detail-panel.css +86 -71
  64. package/src/detail-panel/detail-panel.tokens.json +2 -0
  65. package/src/dialog/dialog.css +434 -198
  66. package/src/dialog/dialog.tokens.json +7 -0
  67. package/src/divider/divider.css +20 -20
  68. package/src/drawer/drawer.css +597 -236
  69. package/src/drawer/drawer.tokens.json +13 -0
  70. package/src/entity-picker/entity-picker.css +323 -270
  71. package/src/entity-picker/entity-picker.tokens.json +3 -0
  72. package/src/event-calendar/event-calendar.css +357 -399
  73. package/src/field/field.css +106 -93
  74. package/src/field/field.tokens.json +2 -0
  75. package/src/field-group/field-group.css +43 -33
  76. package/src/field-group/field-group.tokens.json +3 -0
  77. package/src/filter-bar/filter-bar.css +200 -216
  78. package/src/form/form.css +99 -25
  79. package/src/form/form.tokens.json +5 -0
  80. package/src/fullscreen/fullscreen.css +26 -27
  81. package/src/grid/grid.css +29 -29
  82. package/src/highlight/highlight.css +11 -11
  83. package/src/hover-card/hover-card.css +9 -9
  84. package/src/icon/icon.css +67 -20
  85. package/src/icon/icon.tokens.json +1 -0
  86. package/src/image/image.css +42 -42
  87. package/src/import-export-center/import-export-center.css +144 -165
  88. package/src/inline/inline.css +28 -28
  89. package/src/inline-message/inline-message.css +162 -86
  90. package/src/inline-message/inline-message.tokens.json +4 -0
  91. package/src/kbd/kbd.css +62 -50
  92. package/src/kbd/kbd.tokens.json +3 -0
  93. package/src/link/link.css +54 -33
  94. package/src/link/link.tokens.json +4 -0
  95. package/src/list/list.css +23 -23
  96. package/src/list-item/list-item.css +89 -75
  97. package/src/list-item/list-item.tokens.json +7 -0
  98. package/src/listbox/listbox.css +71 -70
  99. package/src/listbox/listbox.tokens.json +0 -1
  100. package/src/loading-overlay/loading-overlay.css +86 -103
  101. package/src/markdown/markdown.css +20 -20
  102. package/src/media-viewer/media-viewer.css +790 -0
  103. package/src/media-viewer/media-viewer.tokens.json +53 -0
  104. package/src/menu/menu.css +162 -82
  105. package/src/menu/menu.tokens.json +2 -1
  106. package/src/menubar/menubar.css +16 -16
  107. package/src/message/message.css +1250 -1253
  108. package/src/message/message.tokens.json +5 -0
  109. package/src/message-scroller/message-scroller.css +323 -320
  110. package/src/multi-select/multi-select.css +230 -172
  111. package/src/multi-select/multi-select.tokens.json +2 -0
  112. package/src/navigation-menu/navigation-menu.css +169 -190
  113. package/src/notification-center/notification-center.css +153 -161
  114. package/src/notification-center/notification-center.tokens.json +3 -0
  115. package/src/number-field/number-field.css +93 -93
  116. package/src/number-field/number-field.tokens.json +1 -0
  117. package/src/otp-input/otp-input.css +74 -64
  118. package/src/otp-input/otp-input.tokens.json +1 -0
  119. package/src/page/page.css +41 -27
  120. package/src/page/page.tokens.json +1 -0
  121. package/src/page-header/page-header.css +341 -286
  122. package/src/page-header/page-header.tokens.json +5 -0
  123. package/src/pagination/pagination.css +75 -79
  124. package/src/popover/popover.css +81 -64
  125. package/src/popover/popover.tokens.json +1 -0
  126. package/src/progress-indicator/progress-indicator.css +192 -136
  127. package/src/progress-indicator/progress-indicator.tokens.json +1 -0
  128. package/src/prompt-composer/prompt-composer.css +260 -113
  129. package/src/prompt-composer/prompt-composer.tokens.json +15 -0
  130. package/src/prose/prose.css +77 -82
  131. package/src/radio-group/radio-group.css +107 -112
  132. package/src/rating/rating.css +146 -142
  133. package/src/rating/rating.tokens.json +1 -0
  134. package/src/result-state/result-state.css +94 -101
  135. package/src/runtime-properties.mjs +19 -6
  136. package/src/saved-views/saved-views.css +43 -49
  137. package/src/scroll-area/scroll-area.css +44 -37
  138. package/src/section/section.css +178 -43
  139. package/src/section/section.tokens.json +8 -2
  140. package/src/segmented-control/segmented-control.css +210 -133
  141. package/src/segmented-control/segmented-control.tokens.json +7 -11
  142. package/src/select/select.css +210 -147
  143. package/src/select/select.tokens.json +3 -0
  144. package/src/side-navigation/side-navigation.css +193 -196
  145. package/src/side-navigation/side-navigation.tokens.json +1 -0
  146. package/src/skeleton/skeleton.css +57 -58
  147. package/src/slider/slider.css +101 -103
  148. package/src/sparkline/sparkline.css +75 -53
  149. package/src/sparkline/sparkline.tokens.json +2 -0
  150. package/src/spinner/spinner.css +83 -180
  151. package/src/spinner/spinner.tokens.json +0 -1
  152. package/src/split-button/split-button.css +34 -35
  153. package/src/split-button/split-button.tokens.json +1 -0
  154. package/src/splitter/splitter.css +47 -48
  155. package/src/stack/stack.css +25 -25
  156. package/src/stat-card/stat-card.css +415 -245
  157. package/src/stat-card/stat-card.tokens.json +8 -0
  158. package/src/status-indicator/status-indicator.css +124 -100
  159. package/src/status-indicator/status-indicator.tokens.json +0 -3
  160. package/src/stepper/stepper.css +78 -82
  161. package/src/switch/switch.css +100 -106
  162. package/src/table/table.css +270 -198
  163. package/src/table/table.tokens.json +2 -0
  164. package/src/table-of-contents/table-of-contents.css +60 -59
  165. package/src/table-of-contents/table-of-contents.tokens.json +1 -0
  166. package/src/tabs/tabs.css +327 -294
  167. package/src/tabs/tabs.tokens.json +7 -1
  168. package/src/tag/tag.css +109 -88
  169. package/src/tag/tag.tokens.json +10 -0
  170. package/src/tags-input/tags-input.css +152 -87
  171. package/src/tags-input/tags-input.tokens.json +7 -1
  172. package/src/text-field/text-field.css +146 -148
  173. package/src/text-field/text-field.tokens.json +1 -0
  174. package/src/textarea/textarea.css +38 -33
  175. package/src/textarea/textarea.tokens.json +1 -0
  176. package/src/time-field/time-field.css +82 -77
  177. package/src/time-field/time-field.tokens.json +1 -0
  178. package/src/time-picker/time-picker.css +116 -64
  179. package/src/time-picker/time-picker.tokens.json +4 -1
  180. package/src/time-range-picker/time-range-picker.css +168 -140
  181. package/src/time-range-picker/time-range-picker.tokens.json +4 -0
  182. package/src/timeline/timeline.css +280 -292
  183. package/src/timeline/timeline.tokens.json +5 -0
  184. package/src/toast/toast.css +138 -121
  185. package/src/toast/toast.tokens.json +6 -0
  186. package/src/toggle/toggle.css +34 -38
  187. package/src/toggle-group/toggle-group.css +73 -77
  188. package/src/toolbar/toolbar.css +33 -38
  189. package/src/tooltip/tooltip.css +65 -39
  190. package/src/tooltip/tooltip.tokens.json +1 -0
  191. package/src/top-navigation/top-navigation.css +252 -268
  192. package/src/tour/tour.css +64 -73
  193. package/src/transfer/transfer.css +164 -168
  194. package/src/tree/tree.css +113 -121
  195. package/src/typography/typography.css +42 -38
  196. package/src/typography/typography.tokens.json +1 -0
  197. package/src/upload/upload.css +256 -257
  198. package/src/visually-hidden/visually-hidden.css +1 -1
  199. package/src/wizard/wizard.css +187 -199
@@ -11,1443 +11,1440 @@
11
11
  * The side is asked once, on the row. The bubble, its reactions and the
12
12
  * header follow `data-align`; the surveyed shadcn examples pass `align` to
13
13
  * both `Message` and `Bubble`, and two answers to one question can disagree
14
- * (`docs/history/designs/2026-09-30-message-design.md` §2.2).
14
+ *.
15
+ *
16
+ * Every rule is scoped to the family and stops at the parts of any other
17
+ * family nested in a message: a card or an alert in the body keeps its own
18
+ * `header`, `footer`, `content` and `actions`. The family's own nested roots
19
+ * (a bubble in a row, a row in a group) stay inside the scope.
15
20
  */
16
- [data-ui='message'][data-part='root'] {
17
- /**
18
- * The avatar column is the small avatar step, which the theme restates per
19
- * density; ReUI's 32 has no step there (dossier §3), and a row that follows
20
- * the density of the page around it is worth four pixels.
21
- */
22
- --_avatar-size: var(--slotted-message-avatar-size, var(--slotted-avatar-size-sm, 28px));
23
- --_column-gap: var(--slotted-message-column-gap, var(--slotted-space-4, 0.5rem));
24
- --_stack-gap: var(--slotted-message-stack-gap, var(--slotted-space-2, 0.25rem));
25
- --_meta-size: var(--slotted-font-size-xs, 0.75rem);
26
- --_meta-leading: round(up, calc(var(--_meta-size) * var(--slotted-line-height-xs, 1.4)), 1px);
21
+ @scope ([data-ui-message]) to (:scope [data-ui]:not([data-ui-message]) > *) {
22
+ :scope[data-part-root] {
23
+ /**
24
+ * The avatar column is the small avatar step, which the theme restates per
25
+ * density; ReUI's 32 has no step there (dossier §3), and a row that follows
26
+ * the density of the page around it is worth four pixels.
27
+ */
28
+ --_avatar-size: var(--slotted-message-avatar-size, var(--slotted-avatar-size-sm, 28px));
29
+ --_column-gap: var(--slotted-message-column-gap, var(--slotted-space-4, 0.5rem));
30
+ --_stack-gap: var(--slotted-message-stack-gap, var(--slotted-space-2, 0.25rem));
31
+ --_meta-size: var(--slotted-font-size-xs, 0.75rem);
32
+ --_meta-leading: round(up, calc(var(--_meta-size) * var(--slotted-line-height-xs, 1.4)), 1px);
33
+ /**
34
+ * The inset of the words inside a bubble, which the header and the footer
35
+ * repeat so a name stands over the first letter it names. Eight and twelve
36
+ * at comfortable, ReUI's measure (`c-bubble-2`), falling with the control
37
+ * gap the theme restates per density.
38
+ */
39
+ --_pad-block: var(--slotted-message-bubble-padding-block, var(--slotted-control-gap-md, 8px));
40
+ --_pad-inline: var(
41
+ --slotted-message-bubble-padding-inline,
42
+ calc(var(--slotted-control-gap-md, 8px) + var(--slotted-space-2, 0.25rem))
43
+ );
44
+ /**
45
+ * The inner controls of a row — the version pager — at the R2 size: the
46
+ * glyph plus a step of air on each side, never under the WCAG 2.2 target.
47
+ */
48
+ --_glyph-size: var(--slotted-control-icon-size-sm, 14px);
49
+ --_inner-size: max(
50
+ var(--slotted-target-min, 24px),
51
+ calc(var(--_glyph-size) + 2 * var(--slotted-space-2, 0.25rem))
52
+ );
53
+
54
+ display: grid;
55
+ grid-template-areas: 'body';
56
+ grid-template-columns: minmax(0, 1fr);
57
+ column-gap: var(--_column-gap);
58
+ position: relative;
59
+ min-inline-size: 0;
60
+ color: var(--slotted-text);
61
+ font-family: var(--slotted-font-family-sans, sans-serif);
62
+ }
63
+
27
64
  /**
28
- * The inset of the words inside a bubble, which the header and the footer
29
- * repeat so a name stands over the first letter it names. Eight and twelve
30
- * at comfortable, ReUI's measure (`c-bubble-2`), falling with the control
31
- * gap the theme restates per density.
65
+ * A row with an avatar, and every row of a run that holds one anywhere,
66
+ * gives the avatar a column. The earlier rows of a run carry no avatar and
67
+ * still stand on the spine the last one sits on — shadcn asks for an empty
68
+ * `MessageAvatar` in each of them (`c-message-6`); the column is read here
69
+ * from the DOM instead.
32
70
  */
33
- --_pad-block: var(--slotted-message-bubble-padding-block, var(--slotted-control-gap-md, 8px));
34
- --_pad-inline: var(
35
- --slotted-message-bubble-padding-inline,
36
- calc(var(--slotted-control-gap-md, 8px) + var(--slotted-space-2, 0.25rem))
37
- );
71
+ :scope[data-part-root]:has(> [data-part-avatar]),
72
+ :scope[data-part-group]:has([data-part-avatar]) > [data-ui-message][data-part-root] {
73
+ grid-template-areas: 'avatar body';
74
+ grid-template-columns: var(--_avatar-size) minmax(0, 1fr);
75
+ }
76
+
77
+ :scope[data-part-root][data-align='end']:has(> [data-part-avatar]),
78
+ :scope[data-part-group]:has([data-part-avatar])
79
+ > [data-ui-message][data-part-root][data-align='end'] {
80
+ grid-template-areas: 'body avatar';
81
+ grid-template-columns: minmax(0, 1fr) var(--_avatar-size);
82
+ }
83
+
38
84
  /**
39
- * The inner controls of a row — the version pager — at the R2 size: the
40
- * glyph plus a step of air on each side, never under the WCAG 2.2 target.
85
+ * The avatar sits at the foot of the row, on the line of the last bubble
86
+ * rather than of the footer under it: in a run it marks where the run ends,
87
+ * which is where the reader's eye arrives.
41
88
  */
42
- --_glyph-size: var(--slotted-control-icon-size-sm, 14px);
43
- --_inner-size: max(
44
- var(--slotted-target-min, 24px),
45
- calc(var(--_glyph-size) + 2 * var(--slotted-space-2, 0.25rem))
46
- );
47
-
48
- display: grid;
49
- grid-template-areas: 'body';
50
- grid-template-columns: minmax(0, 1fr);
51
- column-gap: var(--_column-gap);
52
- position: relative;
53
- min-inline-size: 0;
54
- color: var(--slotted-text);
55
- font-family: var(--slotted-font-family-sans, sans-serif);
56
- }
57
-
58
- /**
59
- * A row with an avatar, and every row of a run that holds one anywhere,
60
- * gives the avatar a column. The earlier rows of a run carry no avatar and
61
- * still stand on the spine the last one sits on — shadcn asks for an empty
62
- * `MessageAvatar` in each of them (`c-message-6`); the column is read here
63
- * from the DOM instead.
64
- */
65
- [data-ui='message'][data-part='root']:has(> [data-part='avatar']),
66
- [data-ui='message'][data-part='group']:has([data-part='avatar'])
67
- > [data-ui='message'][data-part='root'] {
68
- grid-template-areas: 'avatar body';
69
- grid-template-columns: var(--_avatar-size) minmax(0, 1fr);
70
- }
89
+ :scope[data-part-root] > [data-part-avatar] {
90
+ grid-area: avatar;
91
+ display: flex;
92
+ align-self: end;
93
+ justify-content: center;
94
+ inline-size: var(--_avatar-size);
95
+ min-block-size: var(--_avatar-size);
96
+ }
71
97
 
72
- [data-ui='message'][data-part='root'][data-align='end']:has(> [data-part='avatar']),
73
- [data-ui='message'][data-part='group']:has([data-part='avatar'])
74
- > [data-ui='message'][data-part='root'][data-align='end'] {
75
- grid-template-areas: 'body avatar';
76
- grid-template-columns: minmax(0, 1fr) var(--_avatar-size);
77
- }
98
+ :scope[data-part-root]:has(> [data-part-body] > [data-part-footer]) > [data-part-avatar] {
99
+ margin-block-end: calc(var(--_meta-leading) + var(--_stack-gap));
100
+ }
78
101
 
79
- /**
80
- * The avatar sits at the foot of the row, on the line of the last bubble
81
- * rather than of the footer under it: in a run it marks where the run ends,
82
- * which is where the reader's eye arrives.
83
- */
84
- [data-ui='message'][data-part='root'] > [data-part='avatar'] {
85
- grid-area: avatar;
86
- display: flex;
87
- align-self: end;
88
- justify-content: center;
89
- inline-size: var(--_avatar-size);
90
- min-block-size: var(--_avatar-size);
91
- }
102
+ :scope[data-part-root] > [data-part-body] {
103
+ grid-area: body;
104
+ display: flex;
105
+ flex-direction: column;
106
+ align-items: flex-start;
107
+ gap: var(--_stack-gap);
108
+ min-inline-size: 0;
109
+ }
92
110
 
93
- [data-ui='message'][data-part='root']:has(> [data-part='body'] > [data-part='footer'])
94
- > [data-part='avatar'] {
95
- margin-block-end: calc(var(--_meta-leading) + var(--_stack-gap));
96
- }
111
+ :scope[data-part-root][data-align='end'] > [data-part-body] {
112
+ align-items: flex-end;
113
+ }
97
114
 
98
- [data-ui='message'][data-part='root'] > [data-part='body'] {
99
- grid-area: body;
100
- display: flex;
101
- flex-direction: column;
102
- align-items: flex-start;
103
- gap: var(--_stack-gap);
104
- min-inline-size: 0;
105
- }
115
+ /**
116
+ * ── A run from one sender ──────────────────────────────────────────────
117
+ *
118
+ * Two pixels between the rows of a run, where ReUI puts eight (`c-bubble-3`).
119
+ * At eight the run read as four messages; at two, with the corners on the
120
+ * sender's side drawn in, it reads as one speaker holding the floor. The
121
+ * gap between runs belongs to whatever stacks them — the scroller gives it.
122
+ */
123
+ :scope[data-part-group] {
124
+ display: flex;
125
+ flex-direction: column;
126
+ gap: var(--slotted-message-run-gap, var(--slotted-space-1, 0.125rem));
127
+ min-inline-size: 0;
128
+ }
106
129
 
107
- [data-ui='message'][data-part='root'][data-align='end'] > [data-part='body'] {
108
- align-items: flex-end;
109
- }
130
+ /* ── Header and footer ──────────────────────────────────────────────── */
131
+
132
+ :scope[data-part-root] :is([data-part-header], [data-part-footer]) {
133
+ display: flex;
134
+ flex-wrap: wrap;
135
+ align-items: center;
136
+ column-gap: var(--slotted-space-3, 0.375rem);
137
+ max-inline-size: 100%;
138
+ min-inline-size: 0;
139
+ padding-inline: var(--_pad-inline);
140
+ color: var(--slotted-text-muted);
141
+ font-size: var(--_meta-size);
142
+ font-weight: var(--slotted-font-weight-medium, 500);
143
+ line-height: var(--_meta-leading);
144
+ }
110
145
 
111
- /**
112
- * ── A run from one sender ──────────────────────────────────────────────
113
- *
114
- * Two pixels between the rows of a run, where ReUI puts eight (`c-bubble-3`).
115
- * At eight the run read as four messages; at two, with the corners on the
116
- * sender's side drawn in, it reads as one speaker holding the floor. The
117
- * gap between runs belongs to whatever stacks them — the scroller gives it.
118
- */
119
- [data-ui='message'][data-part='group'] {
120
- display: flex;
121
- flex-direction: column;
122
- gap: var(--slotted-message-run-gap, var(--slotted-space-1, 0.125rem));
123
- min-inline-size: 0;
124
- }
146
+ :scope[data-part-root][data-align='end'] :is([data-part-header], [data-part-footer]) {
147
+ justify-content: flex-end;
148
+ }
125
149
 
126
- /* ── Header and footer ──────────────────────────────────────────────── */
127
-
128
- [data-ui='message'][data-part='root'] :is([data-part='header'], [data-part='footer']) {
129
- display: flex;
130
- flex-wrap: wrap;
131
- align-items: center;
132
- column-gap: var(--slotted-space-3, 0.375rem);
133
- max-inline-size: 100%;
134
- min-inline-size: 0;
135
- padding-inline: var(--_pad-inline);
136
- color: var(--slotted-text-muted);
137
- font-size: var(--_meta-size);
138
- font-weight: var(--slotted-font-weight-medium, 500);
139
- line-height: var(--_meta-leading);
140
- }
150
+ /**
151
+ * The name and the hour are two facts, and the dot between them is drawn by
152
+ * the stylesheet rather than written into the text: a character would be
153
+ * read aloud, copied with the name and wrapped onto a line of its own.
154
+ * ReUI asks the consumer to write the dot (`c-message-3`).
155
+ */
156
+ :scope[data-part-root] [data-part-header] > * + [data-part-time]::before {
157
+ content: '';
158
+ display: inline-block;
159
+ inline-size: var(--slotted-space-2, 0.25rem);
160
+ block-size: var(--slotted-space-2, 0.25rem);
161
+ margin-inline-end: var(--slotted-space-3, 0.375rem);
162
+ border-radius: var(--slotted-radius-full, 9999px);
163
+ background-color: currentColor;
164
+ opacity: 0.5;
165
+ vertical-align: middle;
166
+ }
141
167
 
142
- [data-ui='message'][data-part='root'][data-align='end']
143
- :is([data-part='header'], [data-part='footer']) {
144
- justify-content: flex-end;
145
- }
168
+ :scope[data-part-root] [data-part-author] {
169
+ min-inline-size: 0;
170
+ overflow: hidden;
171
+ text-overflow: ellipsis;
172
+ white-space: nowrap;
173
+ }
146
174
 
147
- /**
148
- * The name and the hour are two facts, and the dot between them is drawn by
149
- * the stylesheet rather than written into the text: a character would be
150
- * read aloud, copied with the name and wrapped onto a line of its own.
151
- * ReUI asks the consumer to write the dot (`c-message-3`).
152
- */
153
- [data-ui='message'][data-part='root'] [data-part='header'] > * + [data-part='time']::before {
154
- content: '';
155
- display: inline-block;
156
- inline-size: var(--slotted-space-2, 0.25rem);
157
- block-size: var(--slotted-space-2, 0.25rem);
158
- margin-inline-end: var(--slotted-space-3, 0.375rem);
159
- border-radius: var(--slotted-radius-full, 9999px);
160
- background-color: currentColor;
161
- opacity: 0.5;
162
- vertical-align: middle;
163
- }
175
+ :scope[data-part-root] [data-part-time] {
176
+ font-variant-numeric: tabular-nums;
177
+ white-space: nowrap;
178
+ }
164
179
 
165
- [data-ui='message'][data-part='root'] [data-part='author'] {
166
- min-inline-size: 0;
167
- overflow: hidden;
168
- text-overflow: ellipsis;
169
- white-space: nowrap;
170
- }
180
+ /* ── Receipt ──────────────────────────────────────────────────────────
181
+ *
182
+ * Where a message is in its delivery is said inside the bubble, in `meta`
183
+ * (below), as a mark beside the hour — the convention WhatsApp and Telegram
184
+ * taught. Outside a bubble — an unframed reply, a thread — the receipt is a
185
+ * word in the footer, set in the meta type, with no mark: a glyph beside a
186
+ * word of twelve pixels is two voices saying one thing, and the two never
187
+ * shared a center line.
188
+ */
189
+ :scope[data-part-root] [data-part-footer] > [data-part-receipt] {
190
+ white-space: nowrap;
191
+ }
171
192
 
172
- [data-ui='message'][data-part='root'] [data-part='time'] {
173
- font-variant-numeric: tabular-nums;
174
- white-space: nowrap;
175
- }
193
+ :scope[data-part-root] [data-part-footer] > [data-part-receipt] > [data-ui-icon] {
194
+ display: none;
195
+ }
176
196
 
177
- /* ── Receipt ──────────────────────────────────────────────────────────
178
- *
179
- * Where a message is in its delivery is said inside the bubble, in `meta`
180
- * (below), as a mark beside the hour — the convention WhatsApp and Telegram
181
- * taught. Outside a bubble — an unframed reply, a thread — the receipt is a
182
- * word in the footer, set in the meta type, with no mark: a glyph beside a
183
- * word of twelve pixels is two voices saying one thing, and the two never
184
- * shared a centre line.
185
- */
186
- [data-ui='message'][data-part='root'] [data-part='footer'] > [data-part='receipt'] {
187
- white-space: nowrap;
188
- }
197
+ /**
198
+ * A message that did not go says so in a word under its surface, in the
199
+ * danger ink, lined up with the surface's own edge on the sender's side —
200
+ * not with the words inside it — so the note reads as the bubble's caption.
201
+ * The control that sends it again stands beside the surface (`retry`).
202
+ */
203
+ :scope[data-part-root][data-invalid] > [data-part-body] > [data-part-footer] {
204
+ padding-inline: var(--slotted-space-2, 0.25rem);
205
+ color: var(--slotted-tone-danger-text);
206
+ }
189
207
 
190
- [data-ui='message'][data-part='root']
191
- [data-part='footer']
192
- > [data-part='receipt']
193
- > [data-ui='icon'] {
194
- display: none;
195
- }
208
+ /* ── Actions ────────────────────────────────────────────────────────────
209
+ *
210
+ * The actions keep their room at rest, so a revealed toolbar moves nothing.
211
+ * `hover` reveals them on the pointer, on focus anywhere in the row, and
212
+ * always on a screen that cannot hover: a reveal by hover alone would hide
213
+ * them from the keyboard and from a finger.
214
+ */
215
+ :scope[data-part-root] [data-part-actions] {
216
+ display: inline-flex;
217
+ align-items: center;
218
+ gap: var(--slotted-space-1, 0.125rem);
219
+ transition: opacity var(--slotted-duration-short) var(--slotted-easing-exit, ease-in);
220
+ }
196
221
 
197
- /**
198
- * A message that did not go says so in a word under its surface, in the
199
- * danger ink, lined up with the surface's own edge on the sender's side —
200
- * not with the words inside it — so the note reads as the bubble's caption.
201
- * The control that sends it again stands beside the surface (`retry`).
202
- */
203
- [data-ui='message'][data-part='root'][data-invalid] > [data-part='body'] > [data-part='footer'] {
204
- padding-inline: var(--slotted-space-2, 0.25rem);
205
- color: var(--slotted-tone-danger-text);
206
- }
222
+ @media (hover: hover) {
223
+ :scope[data-part-root][data-actions='hover'] [data-part-actions] {
224
+ opacity: 0;
225
+ }
207
226
 
208
- /* ── Actions ────────────────────────────────────────────────────────────
209
- *
210
- * The actions keep their room at rest, so a revealed toolbar moves nothing.
211
- * `hover` reveals them on the pointer, on focus anywhere in the row, and
212
- * always on a screen that cannot hover: a reveal by hover alone would hide
213
- * them from the keyboard and from a finger.
214
- */
215
- [data-ui='message'][data-part='root'] [data-part='actions'] {
216
- display: inline-flex;
217
- align-items: center;
218
- gap: var(--slotted-space-1, 0.125rem);
219
- transition: opacity var(--slotted-duration-short) var(--slotted-easing-exit, ease-in);
220
- }
227
+ :scope[data-part-root][data-actions='hover']:is(:hover:not([data-disabled]), :focus-within)
228
+ [data-part-actions] {
229
+ opacity: 1;
230
+ transition-timing-function: var(--slotted-easing-enter, ease-out);
231
+ }
232
+ }
221
233
 
222
- @media (hover: hover) {
223
- [data-ui='message'][data-part='root'][data-actions='hover'] [data-part='actions'] {
224
- opacity: 0;
234
+ /* ── Activity ───────────────────────────────────────────────────────────
235
+ *
236
+ * What a reply is doing before it has words, as a short log of steps on a
237
+ * raised card: the steps already done carry a tick and step back into the
238
+ * muted ink, and the step in progress carries the shared ring (`spinner`)
239
+ * and a band of light that travels across its words. A single step is the
240
+ * same card with one line. ReUI's `c-message-7` draws one muted line that
241
+ * pulses; the log says what has been done, not only that something is.
242
+ *
243
+ * The band is the one place the family paints text with a gradient, which
244
+ * the polish lens refuses as decoration: here it is the wait itself, it
245
+ * moves only while the step is current, and under reduced motion the words
246
+ * stand in the plain ink.
247
+ */
248
+ :scope[data-part-root] [data-part-activity] {
249
+ display: inline-flex;
250
+ flex-direction: column;
251
+ gap: var(--slotted-space-3, 0.375rem);
252
+ box-sizing: border-box;
253
+ max-inline-size: 100%;
254
+ padding-block: var(--_pad-block);
255
+ padding-inline: var(--_pad-inline) calc(var(--_pad-inline) + var(--slotted-space-2, 0.25rem));
256
+ border: var(--slotted-border-width-thin, 1px) solid var(--slotted-border-subtle);
257
+ border-radius: calc(var(--_pad-block) * 2);
258
+ background-color: var(--slotted-surface-raised);
259
+ box-shadow: var(--slotted-shadow-xs);
260
+ color: var(--slotted-text-muted);
261
+ font-size: var(--slotted-control-font-size-md, 13px);
262
+ line-height: round(up, calc(1em * var(--slotted-line-height-md, 1.5)), 1px);
225
263
  }
226
264
 
227
- [data-ui='message'][data-part='root'][data-actions='hover']:is(
228
- :hover:not([data-disabled]),
229
- :focus-within
230
- )
231
- [data-part='actions'] {
232
- opacity: 1;
233
- transition-timing-function: var(--slotted-easing-enter, ease-out);
265
+ :scope[data-part-root] [data-part-activity-step] {
266
+ display: flex;
267
+ align-items: center;
268
+ gap: var(--slotted-space-4, 0.5rem);
269
+ min-inline-size: 0;
270
+ transition:
271
+ opacity var(--slotted-duration-medium) var(--slotted-easing-enter, ease-out),
272
+ translate var(--slotted-duration-medium) var(--slotted-easing-enter, ease-out),
273
+ color var(--slotted-duration-medium) var(--slotted-easing-standard, ease);
274
+
275
+ @starting-style {
276
+ opacity: 0;
277
+ translate: 0 var(--slotted-space-2, 0.25rem);
278
+ }
234
279
  }
235
- }
236
280
 
237
- /* ── Activity ───────────────────────────────────────────────────────────
238
- *
239
- * What a reply is doing before it has words, as a short log of steps on a
240
- * raised card: the steps already done carry a tick and step back into the
241
- * muted ink, and the step in progress carries the shared ring (`spinner`)
242
- * and a band of light that travels across its words. A single step is the
243
- * same card with one line. ReUI's `c-message-7` draws one muted line that
244
- * pulses; the log says what has been done, not only that something is.
245
- *
246
- * The band is the one place the family paints text with a gradient, which
247
- * the polish lens refuses as decoration: here it is the wait itself, it
248
- * moves only while the step is current, and under reduced motion the words
249
- * stand in the plain ink.
250
- */
251
- [data-ui='message'][data-part='root'] [data-part='activity'] {
252
- display: inline-flex;
253
- flex-direction: column;
254
- gap: var(--slotted-space-3, 0.375rem);
255
- box-sizing: border-box;
256
- max-inline-size: 100%;
257
- padding-block: var(--_pad-block);
258
- padding-inline: var(--_pad-inline) calc(var(--_pad-inline) + var(--slotted-space-2, 0.25rem));
259
- border: var(--slotted-border-width-thin, 1px) solid var(--slotted-border-subtle);
260
- border-radius: calc(var(--_pad-block) * 2);
261
- background-color: var(--slotted-surface-raised);
262
- box-shadow: var(--slotted-shadow-xs);
263
- color: var(--slotted-text-muted);
264
- font-size: var(--slotted-control-font-size-md, 13px);
265
- line-height: round(up, calc(1em * var(--slotted-line-height-md, 1.5)), 1px);
266
- }
281
+ /** The mark column: a tick, or the ring, in one box so the words line up. */
282
+ :scope[data-part-root] [data-part-activity-step] > :first-child {
283
+ --slotted-icon-size: var(--_glyph-size);
284
+ --slotted-spinner-size: var(--_glyph-size);
267
285
 
268
- [data-ui='message'][data-part='root'] [data-part='activity-step'] {
269
- display: flex;
270
- align-items: center;
271
- gap: var(--slotted-space-4, 0.5rem);
272
- min-inline-size: 0;
273
- transition:
274
- opacity var(--slotted-duration-medium) var(--slotted-easing-enter, ease-out),
275
- translate var(--slotted-duration-medium) var(--slotted-easing-enter, ease-out),
276
- color var(--slotted-duration-medium) var(--slotted-easing-standard, ease);
277
-
278
- @starting-style {
279
- opacity: 0;
280
- translate: 0 var(--slotted-space-2, 0.25rem);
286
+ display: inline-grid;
287
+ flex: none;
288
+ place-items: center;
289
+ inline-size: var(--_glyph-size);
290
+ block-size: var(--_glyph-size);
281
291
  }
282
- }
283
292
 
284
- /** The mark column: a tick, or the ring, in one box so the words line up. */
285
- [data-ui='message'][data-part='root'] [data-part='activity-step'] > :first-child {
286
- --slotted-icon-size: var(--_glyph-size);
287
- --slotted-spinner-size: var(--_glyph-size);
293
+ :scope[data-part-root] [data-part-activity-step][data-complete] > :first-child {
294
+ color: var(--slotted-tone-success-text);
295
+ }
288
296
 
289
- display: inline-grid;
290
- flex: none;
291
- place-items: center;
292
- inline-size: var(--_glyph-size);
293
- block-size: var(--_glyph-size);
294
- }
297
+ :scope[data-part-root] [data-part-activity-step][data-current] {
298
+ color: var(--slotted-text);
299
+ }
295
300
 
296
- [data-ui='message'][data-part='root'] [data-part='activity-step'][data-complete] > :first-child {
297
- color: var(--slotted-tone-success-text);
298
- }
301
+ :scope[data-part-root] [data-part-activity-step][data-current] > :first-child {
302
+ color: var(--slotted-tone-accent-text);
303
+ }
299
304
 
300
- [data-ui='message'][data-part='root'] [data-part='activity-step'][data-current] {
301
- color: var(--slotted-text);
302
- }
305
+ :scope[data-part-root] [data-part-activity-step][data-current] > :last-child {
306
+ --_base: color-mix(in oklab, var(--slotted-text) 72%, var(--slotted-text-muted));
307
+
308
+ background-image: linear-gradient(
309
+ 90deg,
310
+ var(--_base) 0%,
311
+ var(--_base) 38%,
312
+ var(--slotted-text-muted) 50%,
313
+ var(--_base) 62%,
314
+ var(--_base) 100%
315
+ );
316
+ background-size: 220% 100%;
317
+ background-clip: text;
318
+ color: transparent;
319
+ animation: slotted-message-sweep var(--slotted-duration-loop-slow) linear infinite;
320
+ }
303
321
 
304
- [data-ui='message'][data-part='root'] [data-part='activity-step'][data-current] > :first-child {
305
- color: var(--slotted-tone-accent-text);
306
- }
322
+ /* ── Versions ───────────────────────────────────────────────────────────
323
+ *
324
+ * `2 de 3` between two inner controls. The chevron is one glyph turned for
325
+ * the previous control, and a right-to-left document turns both.
326
+ */
327
+ :scope[data-part-root] [data-part-versions] {
328
+ display: inline-flex;
329
+ align-items: center;
330
+ color: var(--slotted-text-muted);
331
+ }
307
332
 
308
- [data-ui='message'][data-part='root'] [data-part='activity-step'][data-current] > :last-child {
309
- --_base: color-mix(in oklab, var(--slotted-text) 72%, var(--slotted-text-muted));
310
-
311
- background-image: linear-gradient(
312
- 90deg,
313
- var(--_base) 0%,
314
- var(--_base) 38%,
315
- var(--slotted-text-muted) 50%,
316
- var(--_base) 62%,
317
- var(--_base) 100%
318
- );
319
- background-size: 220% 100%;
320
- background-clip: text;
321
- color: transparent;
322
- animation: slotted-message-sweep var(--slotted-duration-loop-slow) linear infinite;
323
- }
333
+ :scope[data-part-root] [data-part-version-label] {
334
+ padding-inline: var(--slotted-space-2, 0.25rem);
335
+ font-variant-numeric: tabular-nums;
336
+ white-space: nowrap;
337
+ }
324
338
 
325
- @keyframes slotted-message-sweep {
326
- from {
327
- background-position: 100% 0;
339
+ :scope[data-part-root] :is([data-part-version-previous], [data-part-version-next]) {
340
+ display: inline-grid;
341
+ place-items: center;
342
+ inline-size: var(--_inner-size);
343
+ block-size: var(--_inner-size);
344
+ margin: 0;
345
+ padding: 0;
346
+ border: 0;
347
+ border-radius: var(--slotted-control-radius, 4px);
348
+ background-color: transparent;
349
+ color: inherit;
350
+ font: inherit;
351
+ transition:
352
+ background-color var(--slotted-duration-short) var(--slotted-easing-standard, ease),
353
+ color var(--slotted-duration-short) var(--slotted-easing-standard, ease);
328
354
  }
329
355
 
330
- to {
331
- background-position: 0% 0;
356
+ :scope[data-part-root]
357
+ :is([data-part-version-previous], [data-part-version-next])
358
+ > [data-ui-icon] {
359
+ --slotted-icon-size: var(--_glyph-size);
332
360
  }
333
- }
334
361
 
335
- /* ── Versions ───────────────────────────────────────────────────────────
336
- *
337
- * `2 de 3` between two inner controls. The chevron is one glyph turned for
338
- * the previous control, and a right-to-left document turns both.
339
- */
340
- [data-ui='message'][data-part='root'] [data-part='versions'] {
341
- display: inline-flex;
342
- align-items: center;
343
- color: var(--slotted-text-muted);
344
- }
362
+ :scope[data-part-root] [data-part-version-previous] > [data-ui-icon] {
363
+ scale: -1 1;
364
+ }
345
365
 
346
- [data-ui='message'][data-part='root'] [data-part='version-label'] {
347
- padding-inline: var(--slotted-space-2, 0.25rem);
348
- font-variant-numeric: tabular-nums;
349
- white-space: nowrap;
350
- }
366
+ :scope[data-part-root]:dir(rtl)
367
+ :is([data-part-version-previous], [data-part-version-next])
368
+ > [data-ui-icon] {
369
+ scale: -1 1;
370
+ }
351
371
 
352
- [data-ui='message'][data-part='root']
353
- :is([data-part='version-previous'], [data-part='version-next']) {
354
- display: inline-grid;
355
- place-items: center;
356
- inline-size: var(--_inner-size);
357
- block-size: var(--_inner-size);
358
- margin: 0;
359
- padding: 0;
360
- border: 0;
361
- border-radius: var(--slotted-control-radius, 4px);
362
- background-color: transparent;
363
- color: inherit;
364
- font: inherit;
365
- transition:
366
- background-color var(--slotted-duration-short) var(--slotted-easing-standard, ease),
367
- color var(--slotted-duration-short) var(--slotted-easing-standard, ease);
368
- }
372
+ :scope[data-part-root]:dir(rtl) [data-part-version-previous] > [data-ui-icon] {
373
+ scale: 1 1;
374
+ }
369
375
 
370
- [data-ui='message'][data-part='root']
371
- :is([data-part='version-previous'], [data-part='version-next'])
372
- > [data-ui='icon'] {
373
- --slotted-icon-size: var(--_glyph-size);
374
- }
376
+ :scope[data-part-root]
377
+ :is([data-part-version-previous], [data-part-version-next]):hover:not(:disabled) {
378
+ background-color: var(--slotted-tone-secondary-subtle-hover);
379
+ color: var(--slotted-text);
380
+ }
375
381
 
376
- [data-ui='message'][data-part='root'] [data-part='version-previous'] > [data-ui='icon'] {
377
- scale: -1 1;
378
- }
382
+ :scope[data-part-root]
383
+ :is([data-part-version-previous], [data-part-version-next]):active:not(:disabled) {
384
+ background-color: var(--slotted-tone-secondary-subtle-active);
385
+ color: var(--slotted-text);
386
+ }
379
387
 
380
- [data-ui='message'][data-part='root']:dir(rtl)
381
- :is([data-part='version-previous'], [data-part='version-next'])
382
- > [data-ui='icon'] {
383
- scale: -1 1;
384
- }
388
+ :scope[data-part-root] :is([data-part-version-previous], [data-part-version-next]):disabled {
389
+ color: var(--slotted-disabled-foreground);
390
+ }
385
391
 
386
- [data-ui='message'][data-part='root']:dir(rtl) [data-part='version-previous'] > [data-ui='icon'] {
387
- scale: 1 1;
388
- }
392
+ :scope[data-part-root]
393
+ :is([data-part-version-previous], [data-part-version-next]):focus-visible {
394
+ outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color);
395
+ outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
396
+ }
389
397
 
390
- [data-ui='message'][data-part='root']
391
- :is([data-part='version-previous'], [data-part='version-next']):hover:not(:disabled) {
392
- background-color: var(--slotted-tone-secondary-subtle-hover);
393
- color: var(--slotted-text);
394
- }
398
+ /* ── A message that did not go ─────────────────────────────────────────
399
+ *
400
+ * The words stay as they were written, on their own surface. A red rim round
401
+ * a blue bubble said "error" twice and read as a second, clashing bubble,
402
+ * and a faded fill dropped white words on the accent under 4.5:1 (4.2 at
403
+ * 85%). What says it is a round control beside the surface, in the danger
404
+ * tone, which is also the way to send it again (`bubble` › `retry`,
405
+ * iMessage's placement), and the receipt under it, in words.
406
+ */
395
407
 
396
- [data-ui='message'][data-part='root']
397
- :is([data-part='version-previous'], [data-part='version-next']):active:not(:disabled) {
398
- background-color: var(--slotted-tone-secondary-subtle-active);
399
- color: var(--slotted-text);
400
- }
408
+ /* ── Layout: thread ─────────────────────────────────────────────────────
409
+ *
410
+ * The comment thread (Slack, ReUI `sheet-5`): every row at the start, the
411
+ * avatar at the top beside the name, the words unframed under it, and a
412
+ * band under the pointer that says which message the actions belong to.
413
+ */
414
+ :scope[data-part-root][data-layout='thread'] {
415
+ --_avatar-size: var(
416
+ --slotted-message-thread-avatar-size,
417
+ var(--slotted-avatar-size-md, 36px)
418
+ );
419
+ --_pad-inline: 0px;
420
+
421
+ padding-block: var(--slotted-space-3, 0.375rem);
422
+ padding-inline: var(--slotted-space-4, 0.5rem);
423
+ border-radius: var(--slotted-radius-md, 6px);
424
+ transition: background-color var(--slotted-duration-short)
425
+ var(--slotted-easing-standard, ease);
426
+ }
401
427
 
402
- [data-ui='message'][data-part='root']
403
- :is([data-part='version-previous'], [data-part='version-next']):disabled {
404
- color: var(--slotted-disabled-foreground);
405
- }
428
+ :scope[data-part-root][data-layout='thread'] > [data-part-avatar] {
429
+ align-self: start;
430
+ margin-block-end: 0;
431
+ }
406
432
 
407
- [data-ui='message'][data-part='root']
408
- :is([data-part='version-previous'], [data-part='version-next']):focus-visible {
409
- outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color);
410
- outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
411
- }
433
+ :scope[data-part-root][data-layout='thread'] [data-part-author] {
434
+ color: var(--slotted-text);
435
+ font-size: var(--slotted-control-font-size-md, 13px);
436
+ font-weight: var(--slotted-font-weight-semibold, 600);
437
+ }
412
438
 
413
- /* ── A message that did not go ─────────────────────────────────────────
414
- *
415
- * The words stay as they were written, on their own surface. A red rim round
416
- * a blue bubble said "error" twice and read as a second, clashing bubble,
417
- * and a faded fill dropped white words on the accent under 4.5:1 (4.2 at
418
- * 85%). What says it is a round control beside the surface, in the danger
419
- * tone, which is also the way to send it again (`bubble` › `retry`,
420
- * iMessage's placement), and the receipt under it, in words.
421
- */
439
+ :scope[data-part-root][data-layout='thread']:hover:not([data-disabled]) {
440
+ background-color: var(--slotted-tone-secondary-subtle-hover);
441
+ }
422
442
 
423
- /* ── Layout: thread ─────────────────────────────────────────────────────
424
- *
425
- * The comment thread (Slack, ReUI `sheet-5`): every row at the start, the
426
- * avatar at the top beside the name, the words unframed under it, and a
427
- * band under the pointer that says which message the actions belong to.
428
- */
429
- [data-ui='message'][data-part='root'][data-layout='thread'] {
430
- --_avatar-size: var(--slotted-message-thread-avatar-size, var(--slotted-avatar-size-md, 36px));
431
- --_pad-inline: 0px;
432
-
433
- padding-block: var(--slotted-space-3, 0.375rem);
434
- padding-inline: var(--slotted-space-4, 0.5rem);
435
- border-radius: var(--slotted-radius-md, 6px);
436
- transition: background-color var(--slotted-duration-short) var(--slotted-easing-standard, ease);
437
- }
443
+ /**
444
+ * In a thread the actions stand in the flow under the words, on the words'
445
+ * column. Where the pointer can hover and the row reveals them, they float
446
+ * instead at the row's top end over the band, the way every comment surface
447
+ * places them — a toolbar that appears only under the pointer takes no room.
448
+ * A plate that is always painted, on a touch screen or with `always`, floated
449
+ * over the words and covered them at 360 pixels.
450
+ */
451
+ :scope[data-part-root][data-layout='thread'] > [data-part-actions] {
452
+ grid-column: body;
453
+ justify-self: start;
454
+ }
438
455
 
439
- [data-ui='message'][data-part='root'][data-layout='thread'] > [data-part='avatar'] {
440
- align-self: start;
441
- margin-block-end: 0;
442
- }
456
+ @media (hover: hover) {
457
+ :scope[data-part-root][data-layout='thread'][data-actions='hover'] > [data-part-actions] {
458
+ position: absolute;
459
+ inset-block-start: calc(var(--slotted-space-2, 0.25rem) * -1);
460
+ inset-inline-end: var(--slotted-space-4, 0.5rem);
461
+ padding: var(--slotted-space-1, 0.125rem);
462
+ border: var(--slotted-border-width-thin, 1px) solid var(--slotted-border-subtle);
463
+ border-radius: var(--slotted-radius-md, 6px);
464
+ background-color: var(--slotted-surface-raised);
465
+ box-shadow: var(--slotted-shadow-sm);
466
+ }
467
+ }
443
468
 
444
- [data-ui='message'][data-part='root'][data-layout='thread'] [data-part='author'] {
445
- color: var(--slotted-text);
446
- font-size: var(--slotted-control-font-size-md, 13px);
447
- font-weight: var(--slotted-font-weight-semibold, 600);
448
- }
469
+ /* ══ The bubble ════════════════════════════════════════════════════════ */
470
+
471
+ :scope[data-part-bubble] {
472
+ /**
473
+ * The five tones, read into the roles a painting needs. `soft` writes in
474
+ * the page's ink on the accent and secondary grounds — a paragraph set in
475
+ * blue is a link — and in the tone's own ink on the three status tones,
476
+ * where the color of the words is the point.
477
+ */
478
+ --_solid: var(--slotted-tone-secondary-solid);
479
+ --_on-solid: var(--slotted-tone-secondary-on-solid);
480
+ --_surface: var(--slotted-tone-secondary-surface);
481
+ --_border: var(--slotted-border-subtle);
482
+ --_soft-ink: var(--slotted-text);
483
+
484
+ /**
485
+ * Twice the block inset: sixteen at comfortable, where ReUI draws fourteen
486
+ * (no step), falling to twelve and eight with the density. A one-line
487
+ * bubble is 39, 34 and 28 pixels tall at the three densities, so the
488
+ * corner never meets its twin and a bubble stays a bubble rather than a
489
+ * pill; a stated sixteen made the dense bubble a capsule.
490
+ */
491
+ --_radius: var(--slotted-message-bubble-radius, calc(var(--_pad-block) * 2));
492
+ --_radius-joined: var(--slotted-message-bubble-radius-joined, var(--slotted-radius-sm, 4px));
493
+ /* The row's inset, restated so a bubble outside a row keeps the density. */
494
+ --_pad-block: var(--slotted-message-bubble-padding-block, var(--slotted-control-gap-md, 8px));
495
+ --_pad-inline: var(
496
+ --slotted-message-bubble-padding-inline,
497
+ calc(var(--slotted-control-gap-md, 8px) + var(--slotted-space-2, 0.25rem))
498
+ );
499
+ --_top-side: var(--_radius);
500
+ --_bottom-side: var(--_radius);
501
+ --_font-size: var(--slotted-control-font-size-lg, 14px);
502
+ /**
503
+ * The line rounded up to a whole pixel: fourteen at 1.5 is 21, and a
504
+ * one-line bubble stands at 21 + 2 × 8 + 2 × 1 = 39. ReUI's 1.625 put it at
505
+ * 40.75, with every edge below the first line between two device pixels
506
+ * (dossier §3).
507
+ */
508
+ --_leading: round(up, calc(var(--_font-size) * var(--slotted-line-height-md, 1.5)), 1px);
509
+ --_reactions-size: max(
510
+ var(--slotted-target-min, 24px),
511
+ var(--slotted-control-inner-size-md, 24px)
512
+ );
513
+
514
+ display: flex;
515
+ flex-direction: column;
516
+ align-items: flex-start;
517
+ gap: var(--slotted-space-1, 0.125rem);
518
+ position: relative;
519
+ inline-size: fit-content;
520
+ min-inline-size: 0;
521
+ /**
522
+ * A bubble never reaches the far side of its row, so the side it hangs
523
+ * from stays readable: ReUI's 80%. It is a share of the row, not a measure
524
+ * of the text — the measure belongs to `container`.
525
+ */
526
+ max-inline-size: var(--slotted-message-bubble-share, 80%);
527
+ }
449
528
 
450
- [data-ui='message'][data-part='root'][data-layout='thread']:hover:not([data-disabled]) {
451
- background-color: var(--slotted-tone-secondary-subtle-hover);
452
- }
529
+ :scope[data-part-bubble][data-tone='accent'] {
530
+ --_solid: var(--slotted-tone-accent-solid);
531
+ --_on-solid: var(--slotted-tone-accent-on-solid);
532
+ --_surface: var(--slotted-tone-accent-surface);
533
+ --_border: var(--slotted-tone-accent-border);
534
+ }
453
535
 
454
- /**
455
- * In a thread the actions stand in the flow under the words, on the words'
456
- * column. Where the pointer can hover and the row reveals them, they float
457
- * instead at the row's top end over the band, the way every comment surface
458
- * places them — a toolbar that appears only under the pointer takes no room.
459
- * A plate that is always painted, on a touch screen or with `always`, floated
460
- * over the words and covered them at 360 pixels.
461
- */
462
- [data-ui='message'][data-part='root'][data-layout='thread'] > [data-part='actions'] {
463
- grid-column: body;
464
- justify-self: start;
465
- }
536
+ :scope[data-part-bubble][data-tone='success'] {
537
+ --_solid: var(--slotted-tone-success-solid);
538
+ --_on-solid: var(--slotted-tone-success-on-solid);
539
+ --_surface: var(--slotted-tone-success-surface);
540
+ --_border: var(--slotted-tone-success-border);
541
+ --_soft-ink: var(--slotted-tone-success-text);
542
+ }
466
543
 
467
- @media (hover: hover) {
468
- [data-ui='message'][data-part='root'][data-layout='thread'][data-actions='hover']
469
- > [data-part='actions'] {
470
- position: absolute;
471
- inset-block-start: calc(var(--slotted-space-2, 0.25rem) * -1);
472
- inset-inline-end: var(--slotted-space-4, 0.5rem);
473
- padding: var(--slotted-space-1, 0.125rem);
474
- border: var(--slotted-border-width-thin, 1px) solid var(--slotted-border-subtle);
475
- border-radius: var(--slotted-radius-md, 6px);
476
- background-color: var(--slotted-surface-raised);
477
- box-shadow: var(--slotted-shadow-sm);
544
+ :scope[data-part-bubble][data-tone='info'] {
545
+ --_solid: var(--slotted-tone-info-solid);
546
+ --_on-solid: var(--slotted-tone-info-on-solid);
547
+ --_surface: var(--slotted-tone-info-surface);
548
+ --_border: var(--slotted-tone-info-border);
549
+ --_soft-ink: var(--slotted-tone-info-text);
478
550
  }
479
- }
480
551
 
481
- /* ══ The bubble ════════════════════════════════════════════════════════ */
552
+ :scope[data-part-bubble][data-tone='warning'] {
553
+ --_solid: var(--slotted-tone-warning-solid);
554
+ --_on-solid: var(--slotted-tone-warning-on-solid);
555
+ --_surface: var(--slotted-tone-warning-surface);
556
+ --_border: var(--slotted-tone-warning-border);
557
+ --_soft-ink: var(--slotted-tone-warning-text);
558
+ }
482
559
 
483
- [data-ui='message'][data-part='bubble'] {
484
- /**
485
- * The five tones, read into the roles a painting needs. `soft` writes in
486
- * the page's ink on the accent and secondary grounds — a paragraph set in
487
- * blue is a link — and in the tone's own ink on the three status tones,
488
- * where the colour of the words is the point.
489
- */
490
- --_solid: var(--slotted-tone-secondary-solid);
491
- --_on-solid: var(--slotted-tone-secondary-on-solid);
492
- --_surface: var(--slotted-tone-secondary-surface);
493
- --_border: var(--slotted-border-subtle);
494
- --_soft-ink: var(--slotted-text);
560
+ :scope[data-part-bubble][data-tone='danger'] {
561
+ --_solid: var(--slotted-tone-danger-solid);
562
+ --_on-solid: var(--slotted-tone-danger-on-solid);
563
+ --_surface: var(--slotted-tone-danger-surface);
564
+ --_border: var(--slotted-tone-danger-border);
565
+ --_soft-ink: var(--slotted-tone-danger-text);
566
+ }
495
567
 
496
568
  /**
497
- * Twice the block inset: sixteen at comfortable, where ReUI draws fourteen
498
- * (no step), falling to twelve and eight with the density. A one-line
499
- * bubble is 39, 34 and 28 pixels tall at the three densities, so the
500
- * corner never meets its twin and a bubble stays a bubble rather than a
501
- * pill; a stated sixteen made the dense bubble a capsule.
502
- */
503
- --_radius: var(--slotted-message-bubble-radius, calc(var(--_pad-block) * 2));
504
- --_radius-joined: var(--slotted-message-bubble-radius-joined, var(--slotted-radius-sm, 4px));
505
- /* The row's inset, restated so a bubble outside a row keeps the density. */
506
- --_pad-block: var(--slotted-message-bubble-padding-block, var(--slotted-control-gap-md, 8px));
507
- --_pad-inline: var(
508
- --slotted-message-bubble-padding-inline,
509
- calc(var(--slotted-control-gap-md, 8px) + var(--slotted-space-2, 0.25rem))
510
- );
511
- --_top-side: var(--_radius);
512
- --_bottom-side: var(--_radius);
513
- --_font-size: var(--slotted-control-font-size-lg, 14px);
514
- /**
515
- * The line rounded up to a whole pixel: fourteen at 1.5 is 21, and a
516
- * one-line bubble stands at 21 + 2 × 8 + 2 × 1 = 39. ReUI's 1.625 put it at
517
- * 40.75, with every edge below the first line between two device pixels
518
- * (dossier §3).
569
+ * ── Variant: four paintings ────────────────────────────────────────────
570
+ *
571
+ * `solid` is the tone's fill with its own ink and no rim. `soft` is the
572
+ * tone's tinted ground; its rim is that ground mixed half-way to the subtle
573
+ * rule, which is next to invisible in `light` and `dark` and a grey line in
574
+ * `high-contrast`, where every tone surface is the page's white and a bubble
575
+ * without an edge is a paragraph. `outline` is the tone's edge around the
576
+ * page's ground, `plain` no box at all — the unframed assistant answer that
577
+ * takes the whole row.
519
578
  */
520
- --_leading: round(up, calc(var(--_font-size) * var(--slotted-line-height-md, 1.5)), 1px);
521
- --_reactions-size: max(
522
- var(--slotted-target-min, 24px),
523
- var(--slotted-control-inner-size-md, 24px)
524
- );
525
-
526
- display: flex;
527
- flex-direction: column;
528
- align-items: flex-start;
529
- gap: var(--slotted-space-1, 0.125rem);
530
- position: relative;
531
- inline-size: fit-content;
532
- min-inline-size: 0;
533
- /**
534
- * A bubble never reaches the far side of its row, so the side it hangs
535
- * from stays readable: ReUI's 80%. It is a share of the row, not a measure
536
- * of the text — the measure belongs to `container`.
537
- */
538
- max-inline-size: var(--slotted-message-bubble-share, 80%);
539
- }
579
+ :scope[data-part-bubble] > [data-part-content] {
580
+ --_ground: var(--_surface);
581
+ --_ink: var(--_soft-ink);
582
+ --_edge: color-mix(in oklab, var(--_surface), var(--slotted-border-subtle));
583
+
584
+ display: block;
585
+ box-sizing: border-box;
586
+ min-inline-size: 0;
587
+ max-inline-size: 100%;
588
+ margin: 0;
589
+ padding-block: var(--_pad-block, 8px);
590
+ padding-inline: var(--_pad-inline, 12px);
591
+ border: var(--slotted-border-width-thin, 1px) solid var(--_edge);
592
+ border-start-start-radius: var(--_top-side);
593
+ border-start-end-radius: var(--_radius);
594
+ border-end-start-radius: var(--_bottom-side);
595
+ border-end-end-radius: var(--_radius);
596
+ background-color: var(--_ground);
597
+ color: var(--_ink);
598
+ font-family: inherit;
599
+ font-size: var(--_font-size);
600
+ font-weight: var(--slotted-font-weight-regular, 400);
601
+ line-height: var(--_leading);
602
+ text-align: start;
603
+ text-decoration: none;
604
+ /**
605
+ * A URL or a hash of three hundred characters breaks where it must rather
606
+ * than pushing the bubble past its share, and each paragraph takes the
607
+ * direction of its own first strong letter: Arabic in an English thread
608
+ * reads from its own side.
609
+ */
610
+ overflow-wrap: anywhere;
611
+ unicode-bidi: plaintext;
612
+ }
540
613
 
541
- [data-ui='message'][data-part='bubble'][data-tone='accent'] {
542
- --_solid: var(--slotted-tone-accent-solid);
543
- --_on-solid: var(--slotted-tone-accent-on-solid);
544
- --_surface: var(--slotted-tone-accent-surface);
545
- --_border: var(--slotted-tone-accent-border);
546
- }
614
+ :scope[data-part-bubble][data-variant='solid'] > [data-part-content] {
615
+ --_ground: var(--_solid);
616
+ --_ink: var(--_on-solid);
617
+ --_edge: var(--_solid);
618
+ }
547
619
 
548
- [data-ui='message'][data-part='bubble'][data-tone='success'] {
549
- --_solid: var(--slotted-tone-success-solid);
550
- --_on-solid: var(--slotted-tone-success-on-solid);
551
- --_surface: var(--slotted-tone-success-surface);
552
- --_border: var(--slotted-tone-success-border);
553
- --_soft-ink: var(--slotted-tone-success-text);
554
- }
620
+ :scope[data-part-bubble][data-variant='outline'] > [data-part-content] {
621
+ --_ground: var(--slotted-surface);
622
+ --_ink: var(--slotted-text);
623
+ --_edge: var(--_border);
624
+ }
555
625
 
556
- [data-ui='message'][data-part='bubble'][data-tone='warning'] {
557
- --_solid: var(--slotted-tone-warning-solid);
558
- --_on-solid: var(--slotted-tone-warning-on-solid);
559
- --_surface: var(--slotted-tone-warning-surface);
560
- --_border: var(--slotted-tone-warning-border);
561
- --_soft-ink: var(--slotted-tone-warning-text);
562
- }
626
+ :scope[data-part-bubble][data-variant='plain'] {
627
+ --_pad-inline: 0px;
563
628
 
564
- [data-ui='message'][data-part='bubble'][data-tone='danger'] {
565
- --_solid: var(--slotted-tone-danger-solid);
566
- --_on-solid: var(--slotted-tone-danger-on-solid);
567
- --_surface: var(--slotted-tone-danger-surface);
568
- --_border: var(--slotted-tone-danger-border);
569
- --_soft-ink: var(--slotted-tone-danger-text);
570
- }
629
+ max-inline-size: 100%;
630
+ }
631
+
632
+ :scope[data-part-bubble][data-variant='plain'] > [data-part-content] {
633
+ --_ground: transparent;
634
+ --_ink: var(--slotted-text);
635
+ --_edge: transparent;
636
+
637
+ padding: 0;
638
+ border-width: 0;
639
+ border-radius: 0;
640
+ }
571
641
 
572
- /**
573
- * ── Variant: four paintings ────────────────────────────────────────────
574
- *
575
- * `solid` is the tone's fill with its own ink and no rim. `soft` is the
576
- * tone's tinted ground; its rim is that ground mixed half-way to the subtle
577
- * rule, which is next to invisible in `light` and `dark` and a grey line in
578
- * `high-contrast`, where every tone surface is the page's white and a bubble
579
- * without an edge is a paragraph. `outline` is the tone's edge around the
580
- * page's ground, `plain` no box at all — the unframed assistant answer that
581
- * takes the whole row.
582
- */
583
- [data-ui='message'][data-part='bubble'] > [data-part='content'] {
584
- --_ground: var(--_surface);
585
- --_ink: var(--_soft-ink);
586
- --_edge: color-mix(in oklab, var(--_surface), var(--slotted-border-subtle));
587
-
588
- display: block;
589
- box-sizing: border-box;
590
- min-inline-size: 0;
591
- max-inline-size: 100%;
592
- margin: 0;
593
- padding-block: var(--_pad-block, 8px);
594
- padding-inline: var(--_pad-inline, 12px);
595
- border: var(--slotted-border-width-thin, 1px) solid var(--_edge);
596
- border-start-start-radius: var(--_top-side);
597
- border-start-end-radius: var(--_radius);
598
- border-end-start-radius: var(--_bottom-side);
599
- border-end-end-radius: var(--_radius);
600
- background-color: var(--_ground);
601
- color: var(--_ink);
602
- font-family: inherit;
603
- font-size: var(--_font-size);
604
- font-weight: var(--slotted-font-weight-regular, 400);
605
- line-height: var(--_leading);
606
- text-align: start;
607
- text-decoration: none;
608
642
  /**
609
- * A URL or a hash of three hundred characters breaks where it must rather
610
- * than pushing the bubble past its share, and each paragraph takes the
611
- * direction of its own first strong letter: Arabic in an English thread
612
- * reads from its own side.
643
+ * The bubble sits on the sender's side, and so does everything it carries:
644
+ * the corners that join a run are the ones that face the avatar.
613
645
  */
614
- overflow-wrap: anywhere;
615
- unicode-bidi: plaintext;
616
- }
617
-
618
- [data-ui='message'][data-part='bubble'][data-variant='solid'] > [data-part='content'] {
619
- --_ground: var(--_solid);
620
- --_ink: var(--_on-solid);
621
- --_edge: var(--_solid);
622
- }
646
+ :scope[data-part-root][data-align='end'] [data-part-bubble] {
647
+ align-items: flex-end;
648
+ }
623
649
 
624
- [data-ui='message'][data-part='bubble'][data-variant='outline'] > [data-part='content'] {
625
- --_ground: var(--slotted-surface);
626
- --_ink: var(--slotted-text);
627
- --_edge: var(--_border);
628
- }
650
+ :scope[data-part-root][data-align='end'] [data-part-bubble] > [data-part-content] {
651
+ border-start-start-radius: var(--_radius);
652
+ border-start-end-radius: var(--_top-side);
653
+ border-end-start-radius: var(--_radius);
654
+ border-end-end-radius: var(--_bottom-side);
655
+ }
629
656
 
630
- [data-ui='message'][data-part='bubble'][data-variant='plain'] {
631
- --_pad-inline: 0px;
657
+ /**
658
+ * ── A bubble that is a control ─────────────────────────────────────────
659
+ *
660
+ * A quick reply is the content itself as a `button`, a way out of the
661
+ * thread the content as an `a`. The pointer's answer is the ink laid over
662
+ * the ground — six and twelve per cent — which answers every painting and
663
+ * every tone with one rule: 0.03 OKLab lightness over the accent fill in
664
+ * `light`, 0.044 under the secondary ground, over the 0.02 step
665
+ * `theme-conformance` asks of a hover, and the press twice that.
666
+ */
667
+ :scope[data-part-bubble] > [data-part-content]:is(button, a) {
668
+ --_ground-hover: color-mix(
669
+ in oklab,
670
+ var(--_ink) var(--slotted-message-state-layer-hover, 6%),
671
+ var(--_ground)
672
+ );
673
+ --_ground-active: color-mix(
674
+ in oklab,
675
+ var(--_ink) var(--slotted-message-state-layer-active, 12%),
676
+ var(--_ground)
677
+ );
678
+
679
+ appearance: none;
680
+ cursor: pointer;
681
+ transition:
682
+ background-color var(--slotted-duration-short) var(--slotted-easing-standard, ease),
683
+ border-color var(--slotted-duration-short) var(--slotted-easing-standard, ease);
684
+ }
632
685
 
633
- max-inline-size: 100%;
634
- }
686
+ :scope[data-part-bubble][data-variant='plain'] > [data-part-content]:is(button, a) {
687
+ padding-block: var(--slotted-space-1, 0.125rem);
688
+ padding-inline: var(--slotted-space-2, 0.25rem);
689
+ margin-inline: calc(var(--slotted-space-2, 0.25rem) * -1);
690
+ border-radius: var(--slotted-radius-sm, 4px);
691
+ }
635
692
 
636
- [data-ui='message'][data-part='bubble'][data-variant='plain'] > [data-part='content'] {
637
- --_ground: transparent;
638
- --_ink: var(--slotted-text);
639
- --_edge: transparent;
693
+ :scope[data-part-bubble]
694
+ > [data-part-content]:is(button, a):hover:not(:disabled):not([data-disabled]) {
695
+ background-color: var(--_ground-hover);
696
+ }
640
697
 
641
- padding: 0;
642
- border-width: 0;
643
- border-radius: 0;
644
- }
698
+ :scope[data-part-bubble]
699
+ > [data-part-content]:is(button, a):active:not(:disabled):not([data-disabled]) {
700
+ background-color: var(--_ground-active);
701
+ }
645
702
 
646
- /**
647
- * The bubble sits on the sender's side, and so does everything it carries:
648
- * the corners that join a run are the ones that face the avatar.
649
- */
650
- [data-ui='message'][data-part='root'][data-align='end'] [data-part='bubble'] {
651
- align-items: flex-end;
652
- }
703
+ :scope[data-part-bubble] > [data-part-content]:is(button, a):focus-visible {
704
+ outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color);
705
+ outline-offset: var(--slotted-focus-ring-offset, 2px);
706
+ }
653
707
 
654
- [data-ui='message'][data-part='root'][data-align='end']
655
- [data-part='bubble']
656
- > [data-part='content'] {
657
- border-start-start-radius: var(--_radius);
658
- border-start-end-radius: var(--_top-side);
659
- border-end-start-radius: var(--_radius);
660
- border-end-end-radius: var(--_bottom-side);
661
- }
708
+ /**
709
+ * ── Meta: the hour and the ticks inside the bubble ────────────────────
710
+ *
711
+ * The hour and the delivery mark ride at the end of the last line, inside
712
+ * the surface, in the bubble's own ink a step back: a float at the end of
713
+ * the words, so it shares the last line when there is room and takes a line
714
+ * of its own, still at the end, when there is not. The bubble never grows a
715
+ * caption under itself for a fact this small.
716
+ *
717
+ * The box is the height of the words' line and its contents stand on that
718
+ * line's center, a pixel down, where the twelve-pixel digits share the
719
+ * fourteen-pixel words' baseline to within a pixel and the mark sits on the
720
+ * same axis as the digits. WhatsApp hangs its meta below the baseline; set
721
+ * beside a line of text, the hanging meta read as misaligned. Read is the one state that changes the ink: full strength on a
722
+ * solid fill, the accent on a tinted one; the other marks differ by shape.
723
+ */
724
+ :scope[data-part-bubble] [data-part-meta] {
725
+ /*
726
+ * Ninety per cent of the bubble's ink: the lowest share at which the hour
727
+ * keeps 4.5:1 on every fill — 4.50 on the accent in `dark`, 5.74 in
728
+ * `light`, 8.39 in `high-contrast` against its 7:1 — measured in sRGB.
729
+ * Two thirds, the first choice, left it at 3.24 on the dark accent.
730
+ */
731
+ --_meta-ink: color-mix(in srgb, currentColor 90%, transparent);
732
+ --_read-ink: var(--slotted-tone-accent-text);
733
+
734
+ display: inline-flex;
735
+ float: inline-end;
736
+ align-items: center;
737
+ gap: var(--slotted-space-1, 0.125rem);
738
+ /* The line rounded down to an even length, so a fourteen-pixel mark and a fourteen-pixel line of digits center on whole pixels. */
739
+ block-size: round(down, var(--_leading), 2px);
740
+ margin-inline-start: var(--slotted-space-4, 0.5rem);
741
+ color: var(--_meta-ink);
742
+ font-size: var(--slotted-font-size-xs, 0.75rem);
743
+ font-weight: var(--slotted-font-weight-regular, 400);
744
+ line-height: var(--slotted-control-icon-size-sm, 14px);
745
+ font-variant-numeric: tabular-nums;
746
+ white-space: nowrap;
747
+ translate: 0 1px;
748
+ }
662
749
 
663
- /**
664
- * ── The corners of a run ───────────────────────────────────────────────
665
- *
666
- * Bubbles that follow one another from one sender draw in the corners that
667
- * face each other on the sender's side, inside one row and across the rows
668
- * of a group. A run reads as one speaker by its shape, with no position
669
- * prop on each message (Chatscope asks for `first`, `normal`, `last`).
670
- */
671
- [data-ui='message'][data-part='bubble']:has(~ [data-part='bubble']),
672
- [data-ui='message'][data-part='group']
673
- > [data-ui='message'][data-part='root']:not(:last-child)
674
- > [data-part='body']
675
- > [data-part='bubble']:not(:has(~ [data-part='bubble'])) {
676
- --_bottom-side: var(--_radius-joined);
677
- }
750
+ :scope[data-part-bubble][data-variant='solid'] [data-part-meta] {
751
+ --_read-ink: var(--_on-solid);
752
+ }
678
753
 
679
- [data-ui='message'][data-part='bubble'] ~ [data-part='bubble'],
680
- [data-ui='message'][data-part='group']
681
- > [data-ui='message'][data-part='root']:not(:first-child)
682
- > [data-part='body']
683
- > [data-part='bubble']:not([data-part='bubble'] ~ [data-part='bubble']) {
684
- --_top-side: var(--_radius-joined);
685
- }
754
+ :scope[data-part-bubble] [data-part-meta] [data-part-receipt] {
755
+ display: inline-grid;
756
+ place-items: center;
757
+ }
686
758
 
687
- /**
688
- * ── A bubble that is a control ─────────────────────────────────────────
689
- *
690
- * A quick reply is the content itself as a `button`, a way out of the
691
- * thread the content as an `a`. The pointer's answer is the ink laid over
692
- * the ground — six and twelve per cent — which answers every painting and
693
- * every tone with one rule: 0.03 OKLab lightness over the accent fill in
694
- * `light`, 0.044 under the secondary ground, over the 0.02 step
695
- * `theme-conformance` asks of a hover, and the press twice that.
696
- */
697
- [data-ui='message'][data-part='bubble'] > [data-part='content']:is(button, a) {
698
- --_ground-hover: color-mix(
699
- in oklab,
700
- var(--_ink) var(--slotted-message-state-layer-hover, 6%),
701
- var(--_ground)
702
- );
703
- --_ground-active: color-mix(
704
- in oklab,
705
- var(--_ink) var(--slotted-message-state-layer-active, 12%),
706
- var(--_ground)
707
- );
708
-
709
- appearance: none;
710
- cursor: pointer;
711
- transition:
712
- background-color var(--slotted-duration-short) var(--slotted-easing-standard, ease),
713
- border-color var(--slotted-duration-short) var(--slotted-easing-standard, ease);
714
- }
759
+ /**
760
+ * The mark is the small control glyph, the height of the digits' line, so
761
+ * the two share one box and one center; two ticks at twelve pixels were two
762
+ * scratches.
763
+ */
764
+ :scope[data-part-bubble] [data-part-meta] [data-part-receipt] > [data-ui-icon] {
765
+ --slotted-icon-size: var(--slotted-control-icon-size-sm, 14px);
766
+ }
715
767
 
716
- [data-ui='message'][data-part='bubble'][data-variant='plain']
717
- > [data-part='content']:is(button, a) {
718
- padding-block: var(--slotted-space-1, 0.125rem);
719
- padding-inline: var(--slotted-space-2, 0.25rem);
720
- margin-inline: calc(var(--slotted-space-2, 0.25rem) * -1);
721
- border-radius: var(--slotted-radius-sm, 4px);
722
- }
768
+ :scope[data-part-bubble] [data-part-meta] [data-part-receipt] > span:not([data-ui]) {
769
+ position: absolute;
770
+ inline-size: 1px;
771
+ block-size: 1px;
772
+ overflow: hidden;
773
+ clip-path: inset(50%);
774
+ white-space: nowrap;
775
+ }
723
776
 
724
- [data-ui='message'][data-part='bubble']
725
- > [data-part='content']:is(button, a):hover:not(:disabled):not([data-disabled]) {
726
- background-color: var(--_ground-hover);
727
- }
777
+ :scope[data-part-bubble] [data-part-meta] [data-part-receipt][data-status='read'] {
778
+ color: var(--_read-ink);
779
+ }
728
780
 
729
- [data-ui='message'][data-part='bubble']
730
- > [data-part='content']:is(button, a):active:not(:disabled):not([data-disabled]) {
731
- background-color: var(--_ground-active);
732
- }
781
+ /** A clock that breathes while the message is on its way. */
782
+ :scope[data-part-bubble]
783
+ [data-part-meta]
784
+ [data-part-receipt][data-status='sending']
785
+ > [data-ui-icon] {
786
+ animation: slotted-message-pending var(--slotted-duration-loop-slow)
787
+ var(--slotted-easing-standard, ease) infinite alternate;
788
+ }
733
789
 
734
- [data-ui='message'][data-part='bubble'] > [data-part='content']:is(button, a):focus-visible {
735
- outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color);
736
- outline-offset: var(--slotted-focus-ring-offset, 2px);
737
- }
790
+ /** The meta of an unframed reply has no surface to ride in; it is the footer's. */
791
+ :scope[data-part-bubble][data-variant='plain'] [data-part-meta] {
792
+ display: none;
793
+ }
738
794
 
739
- /**
740
- * ── Meta: the hour and the ticks inside the bubble ────────────────────
741
- *
742
- * The hour and the delivery mark ride at the end of the last line, inside
743
- * the surface, in the bubble's own ink a step back: a float at the end of
744
- * the words, so it shares the last line when there is room and takes a line
745
- * of its own, still at the end, when there is not. The bubble never grows a
746
- * caption under itself for a fact this small.
747
- *
748
- * The box is the height of the words' line and its contents stand on that
749
- * line's centre, a pixel down, where the twelve-pixel digits share the
750
- * fourteen-pixel words' baseline to within a pixel and the mark sits on the
751
- * same axis as the digits. WhatsApp hangs its meta below the baseline; set
752
- * beside a line of text, the hanging meta read as misaligned. Read is the one state that changes the ink: full strength on a
753
- * solid fill, the accent on a tinted one; the other marks differ by shape.
754
- */
755
- [data-ui='message'][data-part='bubble'] [data-part='meta'] {
756
- /*
757
- * Ninety per cent of the bubble's ink: the lowest share at which the hour
758
- * keeps 4.5:1 on every fill — 4.50 on the accent in `dark`, 5.74 in
759
- * `light`, 8.39 in `high-contrast` against its 7:1 — measured in sRGB.
760
- * Two thirds, the first choice, left it at 3.24 on the dark accent.
795
+ /* ── Clamp ──────────────────────────────────────────────────────────────
796
+ *
797
+ * A long bubble shows its first lines and the rest stays in the DOM — for
798
+ * copying, for finding in the page and for a screen reader — behind a line
799
+ * clamp. `more` shows it whole; the binding draws `more` only while the
800
+ * text overflows.
801
+ *
802
+ * The reveal snaps. A line clamp is not an interpolable length, and the
803
+ * alternative — a measured height transitioned through script — makes the
804
+ * text jump twice when a reply streaming above it reflows the column. The
805
+ * chevron turning is the motion that answers the press.
761
806
  */
762
- --_meta-ink: color-mix(in srgb, currentColor 90%, transparent);
763
- --_read-ink: var(--slotted-tone-accent-text);
764
-
765
- display: inline-flex;
766
- float: inline-end;
767
- align-items: center;
768
- gap: var(--slotted-space-1, 0.125rem);
769
- /* The line rounded down to an even length, so a fourteen-pixel mark and a fourteen-pixel line of digits centre on whole pixels. */
770
- block-size: round(down, var(--_leading), 2px);
771
- margin-inline-start: var(--slotted-space-4, 0.5rem);
772
- color: var(--_meta-ink);
773
- font-size: var(--slotted-font-size-xs, 0.75rem);
774
- font-weight: var(--slotted-font-weight-regular, 400);
775
- line-height: var(--slotted-control-icon-size-sm, 14px);
776
- font-variant-numeric: tabular-nums;
777
- white-space: nowrap;
778
- translate: 0 1px;
779
- }
780
-
781
- [data-ui='message'][data-part='bubble'][data-variant='solid'] [data-part='meta'] {
782
- --_read-ink: var(--_on-solid);
783
- }
784
-
785
- [data-ui='message'][data-part='bubble'] [data-part='meta'] [data-part='receipt'] {
786
- display: inline-grid;
787
- place-items: center;
788
- }
807
+ :scope[data-part-bubble][data-clamped]:not([data-revealed]) > [data-part-content] {
808
+ display: -webkit-box;
809
+ -webkit-box-orient: vertical;
810
+ -webkit-line-clamp: var(--slotted-message-max-lines, 6);
811
+ /**
812
+ * The clamp stops painting after the last line it keeps, but a box clips
813
+ * its overflow at the padding edge, and the inset under that line painted
814
+ * the top of the next one. Clipping at the content edge keeps the inset
815
+ * clean; the ellipsis is still the clamp's.
816
+ */
817
+ overflow: clip;
818
+ overflow-clip-margin: content-box;
819
+ }
789
820
 
790
- /**
791
- * The mark is the small control glyph, the height of the digits' line, so
792
- * the two share one box and one centre; two ticks at twelve pixels were two
793
- * scratches.
794
- */
795
- [data-ui='message'][data-part='bubble']
796
- [data-part='meta']
797
- [data-part='receipt']
798
- > [data-ui='icon'] {
799
- --slotted-icon-size: var(--slotted-control-icon-size-sm, 14px);
800
- }
821
+ :scope[data-part-bubble] > [data-part-more] {
822
+ display: inline-flex;
823
+ align-items: center;
824
+ gap: var(--slotted-space-1, 0.125rem);
825
+ min-block-size: var(--slotted-target-min, 24px);
826
+ margin: 0;
827
+ padding-block: 0;
828
+ padding-inline: var(--_pad-inline, 12px);
829
+ border: 0;
830
+ border-radius: var(--slotted-control-radius, 4px);
831
+ background-color: transparent;
832
+ color: var(--slotted-text-muted);
833
+ font: inherit;
834
+ font-size: var(--slotted-font-size-xs, 0.75rem);
835
+ font-weight: var(--slotted-font-weight-medium, 500);
836
+ transition: color var(--slotted-duration-short) var(--slotted-easing-standard, ease);
837
+ }
801
838
 
802
- [data-ui='message'][data-part='bubble']
803
- [data-part='meta']
804
- [data-part='receipt']
805
- > span:not([data-ui]) {
806
- position: absolute;
807
- inline-size: 1px;
808
- block-size: 1px;
809
- overflow: hidden;
810
- clip-path: inset(50%);
811
- white-space: nowrap;
812
- }
839
+ :scope[data-part-bubble] > [data-part-more] > [data-ui-icon] {
840
+ --slotted-icon-size: var(--slotted-control-icon-size-sm, 14px);
813
841
 
814
- [data-ui='message'][data-part='bubble']
815
- [data-part='meta']
816
- [data-part='receipt'][data-status='read'] {
817
- color: var(--_read-ink);
818
- }
842
+ transition: rotate var(--slotted-duration-medium) var(--slotted-easing-standard, ease);
843
+ }
819
844
 
820
- /** A clock that breathes while the message is on its way. */
821
- [data-ui='message'][data-part='bubble']
822
- [data-part='meta']
823
- [data-part='receipt'][data-status='sending']
824
- > [data-ui='icon'] {
825
- animation: slotted-message-pending var(--slotted-duration-loop-slow)
826
- var(--slotted-easing-standard, ease) infinite alternate;
827
- }
845
+ :scope[data-part-bubble][data-revealed] > [data-part-more] > [data-ui-icon] {
846
+ rotate: 180deg;
847
+ }
828
848
 
829
- @keyframes slotted-message-pending {
830
- from {
831
- opacity: 1;
849
+ :scope[data-part-bubble] > [data-part-more]:hover:not(:disabled) {
850
+ color: var(--slotted-text);
832
851
  }
833
852
 
834
- to {
835
- opacity: 0.4;
853
+ :scope[data-part-bubble] > [data-part-more]:active:not(:disabled) {
854
+ color: var(--slotted-tone-accent-text);
836
855
  }
837
- }
838
856
 
839
- /** The meta of an unframed reply has no surface to ride in; it is the footer's. */
840
- [data-ui='message'][data-part='bubble'][data-variant='plain'] [data-part='meta'] {
841
- display: none;
842
- }
857
+ :scope[data-part-bubble] > [data-part-more]:focus-visible {
858
+ outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color);
859
+ outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
860
+ }
843
861
 
844
- /* ── Clamp ──────────────────────────────────────────────────────────────
845
- *
846
- * A long bubble shows its first lines and the rest stays in the DOM — for
847
- * copying, for finding in the page and for a screen reader — behind a line
848
- * clamp. `more` shows it whole; the binding draws `more` only while the
849
- * text overflows.
850
- *
851
- * The reveal snaps. A line clamp is not an interpolable length, and the
852
- * alternative — a measured height transitioned through script — makes the
853
- * text jump twice when a reply streaming above it reflows the column. The
854
- * chevron turning is the motion that answers the press.
855
- */
856
- [data-ui='message'][data-part='bubble'][data-clamped]:not([data-revealed])
857
- > [data-part='content'] {
858
- display: -webkit-box;
859
- -webkit-box-orient: vertical;
860
- -webkit-line-clamp: var(--slotted-message-max-lines, 6);
861
- /**
862
- * The clamp stops painting after the last line it keeps, but a box clips
863
- * its overflow at the padding edge, and the inset under that line painted
864
- * the top of the next one. Clipping at the content edge keeps the inset
865
- * clean; the ellipsis is still the clamp's.
862
+ /* ── Quote ──────────────────────────────────────────────────────────────
863
+ *
864
+ * The message a reply answers, at the head of the surface: a block tinted
865
+ * with the surface's own ink, the author over two lines of the words. No
866
+ * rail on its start edge — a tinted block reads as quoted in every painting,
867
+ * the accent fill included, where a rail in the ink would be the only
868
+ * saturated stroke in the thread.
866
869
  */
867
- overflow: clip;
868
- overflow-clip-margin: content-box;
869
- }
870
-
871
- [data-ui='message'][data-part='bubble'] > [data-part='more'] {
872
- display: inline-flex;
873
- align-items: center;
874
- gap: var(--slotted-space-1, 0.125rem);
875
- min-block-size: var(--slotted-target-min, 24px);
876
- margin: 0;
877
- padding-block: 0;
878
- padding-inline: var(--_pad-inline, 12px);
879
- border: 0;
880
- border-radius: var(--slotted-control-radius, 4px);
881
- background-color: transparent;
882
- color: var(--slotted-text-muted);
883
- font: inherit;
884
- font-size: var(--slotted-font-size-xs, 0.75rem);
885
- font-weight: var(--slotted-font-weight-medium, 500);
886
- transition: color var(--slotted-duration-short) var(--slotted-easing-standard, ease);
887
- }
888
-
889
- [data-ui='message'][data-part='bubble'] > [data-part='more'] > [data-ui='icon'] {
890
- --slotted-icon-size: var(--slotted-control-icon-size-sm, 14px);
870
+ :scope[data-part-bubble] [data-part-quote] {
871
+ display: block;
872
+ box-sizing: border-box;
873
+ inline-size: 100%;
874
+ margin: 0;
875
+ margin-block-end: var(--slotted-space-3, 0.375rem);
876
+ padding-block: var(--slotted-space-2, 0.25rem);
877
+ padding-inline: var(--slotted-space-4, 0.5rem);
878
+ border: 0;
879
+ border-radius: calc(var(--_radius) - var(--_pad-block, 8px));
880
+ background-color: color-mix(in oklab, currentColor 8%, transparent);
881
+ color: inherit;
882
+ font: inherit;
883
+ font-size: var(--slotted-control-font-size-md, 13px);
884
+ line-height: round(up, calc(1em * var(--slotted-line-height-md, 1.5)), 1px);
885
+ text-align: start;
886
+ unicode-bidi: plaintext;
887
+ overflow: hidden;
888
+ display: -webkit-box;
889
+ -webkit-box-orient: vertical;
890
+ -webkit-line-clamp: 3;
891
+ }
891
892
 
892
- transition: rotate var(--slotted-duration-medium) var(--slotted-easing-standard, ease);
893
- }
893
+ :scope[data-part-bubble] [data-part-quote-author] {
894
+ display: block;
895
+ font-weight: var(--slotted-font-weight-semibold, 600);
896
+ }
894
897
 
895
- [data-ui='message'][data-part='bubble'][data-revealed] > [data-part='more'] > [data-ui='icon'] {
896
- rotate: 180deg;
897
- }
898
+ :scope[data-part-bubble] button[data-part-quote] {
899
+ cursor: pointer;
900
+ transition: background-color var(--slotted-duration-short)
901
+ var(--slotted-easing-standard, ease);
902
+ }
898
903
 
899
- [data-ui='message'][data-part='bubble'] > [data-part='more']:hover:not(:disabled) {
900
- color: var(--slotted-text);
901
- }
904
+ :scope[data-part-bubble] button[data-part-quote]:hover:not(:disabled) {
905
+ background-color: color-mix(in oklab, currentColor 13%, transparent);
906
+ }
902
907
 
903
- [data-ui='message'][data-part='bubble'] > [data-part='more']:active:not(:disabled) {
904
- color: var(--slotted-tone-accent-text);
905
- }
908
+ :scope[data-part-bubble] button[data-part-quote]:active:not(:disabled) {
909
+ background-color: color-mix(in oklab, currentColor 18%, transparent);
910
+ }
906
911
 
907
- [data-ui='message'][data-part='bubble'] > [data-part='more']:focus-visible {
908
- outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color);
909
- outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
910
- }
912
+ :scope[data-part-bubble] button[data-part-quote]:focus-visible {
913
+ outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color);
914
+ outline-offset: var(--slotted-focus-ring-offset, 2px);
915
+ }
911
916
 
912
- /* ── Quote ──────────────────────────────────────────────────────────────
913
- *
914
- * The message a reply answers, at the head of the surface: a block tinted
915
- * with the surface's own ink, the author over two lines of the words. No
916
- * rail on its start edge — a tinted block reads as quoted in every painting,
917
- * the accent fill included, where a rail in the ink would be the only
918
- * saturated stroke in the thread.
919
- */
920
- [data-ui='message'][data-part='bubble'] [data-part='quote'] {
921
- display: block;
922
- box-sizing: border-box;
923
- inline-size: 100%;
924
- margin: 0;
925
- margin-block-end: var(--slotted-space-3, 0.375rem);
926
- padding-block: var(--slotted-space-2, 0.25rem);
927
- padding-inline: var(--slotted-space-4, 0.5rem);
928
- border: 0;
929
- border-radius: calc(var(--_radius) - var(--_pad-block, 8px));
930
- background-color: color-mix(in oklab, currentColor 8%, transparent);
931
- color: inherit;
932
- font: inherit;
933
- font-size: var(--slotted-control-font-size-md, 13px);
934
- line-height: round(up, calc(1em * var(--slotted-line-height-md, 1.5)), 1px);
935
- text-align: start;
936
- unicode-bidi: plaintext;
937
- overflow: hidden;
938
- display: -webkit-box;
939
- -webkit-box-orient: vertical;
940
- -webkit-line-clamp: 3;
941
- }
917
+ /* ── Streaming text, caret and typing ──────────────────────────────────
918
+ *
919
+ * A streamed reply enters word by word. `stream` holds the settled words as
920
+ * plain text and each word still entering as a `stream-chunk`, whose delay
921
+ * the binding writes from `@slotted/core/text-stream`: a burst of forty
922
+ * words enters as a wave of at most 320 ms instead of landing as a block.
923
+ * A word comes out of a blur of a sixth of its own size, at nothing, and
924
+ * the ink and the edge arrive together: a word that is opaque while still
925
+ * blurred reads as a smudge, and five of them in a row as a smeared line.
926
+ *
927
+ * The caret is a dot after the last word, centerd on the middle of the
928
+ * x-height, breathing between full and 72 % while the reply is open. A bar
929
+ * blinking in two steps read as a text field waiting for input; the reply is
930
+ * not waiting for the reader, it is still being written. While words are
931
+ * entering, the wave is the leading edge and the dot steps aside: a word
932
+ * still invisible already holds its place in the line, and a dot after it
933
+ * would stand apart from the last word painted. It returns once the wave has
934
+ * landed and the transport has been quiet for a long transition.
935
+ *
936
+ * Under reduced motion the binding settles every word on arrival, the caret
937
+ * stands lit and the typing dots stand at three strengths, so the state is
938
+ * still drawn.
939
+ */
940
+ :scope[data-part-bubble] [data-part-stream] {
941
+ white-space: pre-wrap;
942
+ }
942
943
 
943
- [data-ui='message'][data-part='bubble'] [data-part='quote-author'] {
944
- display: block;
945
- font-weight: var(--slotted-font-weight-semibold, 600);
946
- }
944
+ :scope[data-part-bubble] [data-part-stream-chunk] {
945
+ animation: slotted-message-word var(--slotted-duration-long) var(--slotted-easing-standard)
946
+ both;
947
+ }
947
948
 
948
- [data-ui='message'][data-part='bubble'] button[data-part='quote'] {
949
- cursor: pointer;
950
- transition: background-color var(--slotted-duration-short) var(--slotted-easing-standard, ease);
951
- }
949
+ :scope[data-part-bubble] [data-part-caret] {
950
+ --_dot: round(nearest, 0.6em, 2px);
951
+
952
+ display: inline-block;
953
+ inline-size: var(--_dot);
954
+ block-size: var(--_dot);
955
+ /* A streamed word carries its own space; the margin only parts the dot from a word cut mid-way. */
956
+ margin-inline-start: var(--slotted-space-1, 0.125rem);
957
+ border-radius: var(--slotted-radius-full, 9999px);
958
+ background-color: currentColor;
959
+ vertical-align: middle;
960
+ transition: filter var(--slotted-duration-medium) var(--slotted-easing-enter)
961
+ var(--slotted-duration-long);
962
+ animation:
963
+ slotted-message-dot-in var(--slotted-duration-medium) var(--slotted-easing-enter),
964
+ slotted-message-breathe var(--slotted-duration-loop) var(--slotted-easing-standard)
965
+ var(--slotted-duration-medium) infinite alternate;
966
+ }
952
967
 
953
- [data-ui='message'][data-part='bubble'] button[data-part='quote']:hover:not(:disabled) {
954
- background-color: color-mix(in oklab, currentColor 13%, transparent);
955
- }
968
+ /* `filter`, not `opacity`: the breath animates opacity, and an animation outranks the rule. */
969
+ :scope[data-part-bubble]
970
+ [data-part-stream]:has(> [data-part-stream-chunk])
971
+ + [data-part-caret] {
972
+ filter: opacity(0);
973
+ transition: filter var(--slotted-duration-short) var(--slotted-easing-exit);
974
+ }
956
975
 
957
- [data-ui='message'][data-part='bubble'] button[data-part='quote']:active:not(:disabled) {
958
- background-color: color-mix(in oklab, currentColor 18%, transparent);
959
- }
976
+ /**
977
+ * Three dots a third of the line tall — seven pixels at comfortable — that
978
+ * rise and brighten in a wave, each a sixth of the loop behind the one
979
+ * before, in the bubble of the person writing. The wave travels half a dot:
980
+ * enough to read as a voice, not so much that the bubble seems to bounce.
981
+ */
982
+ :scope[data-part-bubble] [data-part-typing] {
983
+ --_dot: round(calc(var(--_leading) / 3), 1px);
984
+
985
+ display: inline-flex;
986
+ align-items: center;
987
+ gap: calc(var(--_dot) * 0.6);
988
+ block-size: var(--_leading);
989
+ padding-inline: var(--slotted-space-1, 0.125rem);
990
+ vertical-align: top;
991
+ }
960
992
 
961
- [data-ui='message'][data-part='bubble'] button[data-part='quote']:focus-visible {
962
- outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color);
963
- outline-offset: var(--slotted-focus-ring-offset, 2px);
964
- }
993
+ /**
994
+ * The bubble of someone writing trails two small circles from its foot on
995
+ * the sender's side, the way a thought is drawn, and arrives from them: it
996
+ * rises and fades in on the enter curve, and its trail follows one step
997
+ * behind. The circles are the surface's own fill and edge, so they answer
998
+ * every painting and every scheme with the bubble.
999
+ */
1000
+ :scope[data-part-bubble] > [data-part-content]:has(> [data-part-typing]) {
1001
+ position: relative;
1002
+ padding-inline: calc(var(--_pad-inline) + var(--slotted-space-1, 0.125rem));
1003
+ transition:
1004
+ opacity var(--slotted-duration-medium) var(--slotted-easing-enter, ease-out),
1005
+ translate var(--slotted-duration-medium) var(--slotted-easing-enter, ease-out);
1006
+
1007
+ @starting-style {
1008
+ opacity: 0;
1009
+ translate: 0 var(--slotted-space-3, 0.375rem);
1010
+ }
1011
+ }
965
1012
 
966
- /* ── Streaming text, caret and typing ──────────────────────────────────
967
- *
968
- * A streamed reply enters word by word. `stream` holds the settled words as
969
- * plain text and each word still entering as a `stream-chunk`, whose delay
970
- * the binding writes from `@slotted/core/text-stream`: a burst of forty
971
- * words enters as a wave of at most 320 ms instead of landing as a block.
972
- * A word comes out of a blur of a sixth of its own size, at nothing, and
973
- * the ink and the edge arrive together: a word that is opaque while still
974
- * blurred reads as a smudge, and five of them in a row as a smeared line.
975
- *
976
- * The caret is a dot after the last word, centred on the middle of the
977
- * x-height, breathing between full and 72 % while the reply is open. A bar
978
- * blinking in two steps read as a text field waiting for input; the reply is
979
- * not waiting for the reader, it is still being written. While words are
980
- * entering, the wave is the leading edge and the dot steps aside: a word
981
- * still invisible already holds its place in the line, and a dot after it
982
- * would stand apart from the last word painted. It returns once the wave has
983
- * landed and the transport has been quiet for a long transition.
984
- *
985
- * Under reduced motion the binding settles every word on arrival, the caret
986
- * stands lit and the typing dots stand at three strengths, so the state is
987
- * still drawn.
988
- */
989
- [data-ui='message'][data-part='bubble'] [data-part='stream'] {
990
- white-space: pre-wrap;
991
- }
1013
+ :scope[data-part-bubble] > [data-part-content]:has(> [data-part-typing])::before,
1014
+ :scope[data-part-bubble] > [data-part-content]:has(> [data-part-typing])::after {
1015
+ content: '';
1016
+ position: absolute;
1017
+ box-sizing: border-box;
1018
+ border: inherit;
1019
+ border-radius: var(--slotted-radius-full, 9999px);
1020
+ background-color: inherit;
1021
+ animation: slotted-message-trail var(--slotted-duration-loop-slow)
1022
+ var(--slotted-easing-standard, ease) infinite alternate;
1023
+ }
992
1024
 
993
- [data-ui='message'][data-part='bubble'] [data-part='stream-chunk'] {
994
- animation: slotted-message-word var(--slotted-duration-long) var(--slotted-easing-standard) both;
995
- }
1025
+ :scope[data-part-bubble] > [data-part-content]:has(> [data-part-typing])::before {
1026
+ inset-block-end: calc(var(--slotted-space-1, 0.125rem) * -1);
1027
+ inset-inline-start: calc(var(--slotted-space-1, 0.125rem) * -1);
1028
+ inline-size: var(--slotted-space-4, 0.5rem);
1029
+ block-size: var(--slotted-space-4, 0.5rem);
1030
+ }
996
1031
 
997
- @keyframes slotted-message-word {
998
- from {
999
- opacity: 0;
1000
- filter: blur(0.16em);
1032
+ :scope[data-part-bubble] > [data-part-content]:has(> [data-part-typing])::after {
1033
+ inset-block-end: calc(var(--slotted-space-3, 0.375rem) * -1);
1034
+ inset-inline-start: calc(var(--slotted-space-3, 0.375rem) * -1);
1035
+ inline-size: var(--slotted-space-2, 0.25rem);
1036
+ block-size: var(--slotted-space-2, 0.25rem);
1037
+ animation-delay: calc(var(--slotted-duration-loop-slow) / -2);
1001
1038
  }
1002
1039
 
1003
- to {
1004
- opacity: 1;
1005
- filter: blur(0);
1040
+ /** The line under a writing bubble clears the trail. */
1041
+ :scope[data-part-root]
1042
+ > [data-part-body]:has(> [data-part-bubble] [data-part-typing])
1043
+ > [data-part-footer] {
1044
+ margin-block-start: var(--slotted-space-2, 0.25rem);
1006
1045
  }
1007
- }
1008
1046
 
1009
- [data-ui='message'][data-part='bubble'] [data-part='caret'] {
1010
- --_dot: round(nearest, 0.6em, 2px);
1011
-
1012
- display: inline-block;
1013
- inline-size: var(--_dot);
1014
- block-size: var(--_dot);
1015
- /* A streamed word carries its own space; the margin only parts the dot from a word cut mid-way. */
1016
- margin-inline-start: var(--slotted-space-1, 0.125rem);
1017
- border-radius: var(--slotted-radius-full, 9999px);
1018
- background-color: currentColor;
1019
- vertical-align: middle;
1020
- transition: filter var(--slotted-duration-medium) var(--slotted-easing-enter)
1021
- var(--slotted-duration-long);
1022
- animation:
1023
- slotted-message-dot-in var(--slotted-duration-medium) var(--slotted-easing-enter),
1024
- slotted-message-breathe var(--slotted-duration-loop) var(--slotted-easing-standard)
1025
- var(--slotted-duration-medium) infinite alternate;
1026
- }
1047
+ :scope[data-part-bubble] [data-part-typing] > span {
1048
+ inline-size: var(--_dot);
1049
+ block-size: var(--_dot);
1050
+ border-radius: var(--slotted-radius-full, 9999px);
1051
+ background-color: currentColor;
1052
+ opacity: 0.3;
1053
+ animation: slotted-message-typing var(--slotted-duration-loop)
1054
+ var(--slotted-easing-standard, ease) infinite;
1055
+ }
1027
1056
 
1028
- /* `filter`, not `opacity`: the breath animates opacity, and an animation outranks the rule. */
1029
- [data-ui='message'][data-part='bubble']
1030
- [data-part='stream']:has(> [data-part='stream-chunk'])
1031
- + [data-part='caret'] {
1032
- filter: opacity(0);
1033
- transition: filter var(--slotted-duration-short) var(--slotted-easing-exit);
1034
- }
1057
+ :scope[data-part-bubble] [data-part-typing] > span:nth-child(2) {
1058
+ animation-delay: calc(var(--slotted-duration-loop) / 6);
1059
+ }
1035
1060
 
1036
- @keyframes slotted-message-dot-in {
1037
- from {
1038
- opacity: 0;
1039
- scale: 0;
1061
+ :scope[data-part-bubble] [data-part-typing] > span:nth-child(3) {
1062
+ animation-delay: calc(var(--slotted-duration-loop) / 3);
1040
1063
  }
1041
- }
1042
1064
 
1043
- /* 0.72 of 8 px is 5.76: the breath is seen, and the dot never shrinks to a full stop's 2 px. */
1044
- @keyframes slotted-message-breathe {
1045
- from {
1046
- opacity: 1;
1047
- scale: 1;
1065
+ /**
1066
+ * ── Retry ──────────────────────────────────────────────────────────────
1067
+ *
1068
+ * A message that did not go carries a round control beside its surface, on
1069
+ * the side away from the sender, in the danger tone, centerd on the last
1070
+ * line. It is the way to send it again, and its arrow turns a little under
1071
+ * the pointer toward the way it will go.
1072
+ */
1073
+ :scope[data-part-bubble] > [data-part-retry] {
1074
+ --_size: max(var(--slotted-target-min, 24px), var(--slotted-control-inner-size-md, 24px));
1075
+ --_ground: var(--slotted-tone-danger-solid);
1076
+
1077
+ display: inline-grid;
1078
+ place-items: center;
1079
+ position: absolute;
1080
+ inset-block-end: calc(
1081
+ (
1082
+ var(--_leading) + 2 * var(--_pad-block) + 2 * var(--slotted-border-width-thin, 1px) -
1083
+ var(--_size)
1084
+ ) /
1085
+ 2
1086
+ );
1087
+ inset-inline-start: calc(100% + var(--slotted-space-4, 0.5rem));
1088
+ box-sizing: border-box;
1089
+ inline-size: var(--_size);
1090
+ block-size: var(--_size);
1091
+ margin: 0;
1092
+ padding: 0;
1093
+ border: 0;
1094
+ border-radius: var(--slotted-radius-full, 9999px);
1095
+ background-color: var(--_ground);
1096
+ color: var(--slotted-tone-danger-on-solid);
1097
+ cursor: pointer;
1098
+ transition: background-color var(--slotted-duration-short)
1099
+ var(--slotted-easing-standard, ease);
1048
1100
  }
1049
1101
 
1050
- to {
1051
- opacity: 0.5;
1052
- scale: 0.72;
1102
+ :scope[data-part-root][data-align='end'] [data-part-bubble] > [data-part-retry] {
1103
+ inset-inline: auto calc(100% + var(--slotted-space-4, 0.5rem));
1053
1104
  }
1054
- }
1055
1105
 
1056
- /**
1057
- * Three dots a third of the line tall — seven pixels at comfortable — that
1058
- * rise and brighten in a wave, each a sixth of the loop behind the one
1059
- * before, in the bubble of the person writing. The wave travels half a dot:
1060
- * enough to read as a voice, not so much that the bubble seems to bounce.
1061
- */
1062
- [data-ui='message'][data-part='bubble'] [data-part='typing'] {
1063
- --_dot: round(calc(var(--_leading) / 3), 1px);
1064
-
1065
- display: inline-flex;
1066
- align-items: center;
1067
- gap: calc(var(--_dot) * 0.6);
1068
- block-size: var(--_leading);
1069
- padding-inline: var(--slotted-space-1, 0.125rem);
1070
- vertical-align: top;
1071
- }
1106
+ :scope[data-part-bubble] > [data-part-retry] > [data-ui-icon] {
1107
+ --slotted-icon-size: var(--slotted-control-icon-size-sm, 14px);
1072
1108
 
1073
- /**
1074
- * The bubble of someone writing trails two small circles from its foot on
1075
- * the sender's side, the way a thought is drawn, and arrives from them: it
1076
- * rises and fades in on the enter curve, and its trail follows one step
1077
- * behind. The circles are the surface's own fill and edge, so they answer
1078
- * every painting and every scheme with the bubble.
1079
- */
1080
- [data-ui='message'][data-part='bubble'] > [data-part='content']:has(> [data-part='typing']) {
1081
- position: relative;
1082
- padding-inline: calc(var(--_pad-inline) + var(--slotted-space-1, 0.125rem));
1083
- transition:
1084
- opacity var(--slotted-duration-medium) var(--slotted-easing-enter, ease-out),
1085
- translate var(--slotted-duration-medium) var(--slotted-easing-enter, ease-out);
1086
-
1087
- @starting-style {
1088
- opacity: 0;
1089
- translate: 0 var(--slotted-space-3, 0.375rem);
1109
+ transition: rotate var(--slotted-duration-medium) var(--slotted-easing-emphasized, ease);
1090
1110
  }
1091
- }
1092
1111
 
1093
- [data-ui='message'][data-part='bubble']
1094
- > [data-part='content']:has(> [data-part='typing'])::before,
1095
- [data-ui='message'][data-part='bubble']
1096
- > [data-part='content']:has(> [data-part='typing'])::after {
1097
- content: '';
1098
- position: absolute;
1099
- box-sizing: border-box;
1100
- border: inherit;
1101
- border-radius: var(--slotted-radius-full, 9999px);
1102
- background-color: inherit;
1103
- animation: slotted-message-trail var(--slotted-duration-loop-slow)
1104
- var(--slotted-easing-standard, ease) infinite alternate;
1105
- }
1112
+ /**
1113
+ * The tone's own hover step sits 0.01 OKLab lightness from its fill, under
1114
+ * the 0.02 `theme-conformance` asks; the control's ink laid over the fill at
1115
+ * fourteen per cent answers visibly in every scheme.
1116
+ */
1117
+ :scope[data-part-bubble] > [data-part-retry]:hover:not(:disabled):not([data-disabled]) {
1118
+ background-color: color-mix(
1119
+ in oklab,
1120
+ var(--slotted-tone-danger-on-solid) var(--slotted-message-retry-state-layer, 14%),
1121
+ var(--_ground)
1122
+ );
1123
+ }
1106
1124
 
1107
- [data-ui='message'][data-part='bubble']
1108
- > [data-part='content']:has(> [data-part='typing'])::before {
1109
- inset-block-end: calc(var(--slotted-space-1, 0.125rem) * -1);
1110
- inset-inline-start: calc(var(--slotted-space-1, 0.125rem) * -1);
1111
- inline-size: var(--slotted-space-4, 0.5rem);
1112
- block-size: var(--slotted-space-4, 0.5rem);
1113
- }
1125
+ :scope[data-part-bubble]
1126
+ > [data-part-retry]:hover:not(:disabled):not([data-disabled])
1127
+ > [data-ui-icon] {
1128
+ rotate: -45deg;
1129
+ }
1114
1130
 
1115
- [data-ui='message'][data-part='bubble']
1116
- > [data-part='content']:has(> [data-part='typing'])::after {
1117
- inset-block-end: calc(var(--slotted-space-3, 0.375rem) * -1);
1118
- inset-inline-start: calc(var(--slotted-space-3, 0.375rem) * -1);
1119
- inline-size: var(--slotted-space-2, 0.25rem);
1120
- block-size: var(--slotted-space-2, 0.25rem);
1121
- animation-delay: calc(var(--slotted-duration-loop-slow) / -2);
1122
- }
1131
+ :scope[data-part-bubble] > [data-part-retry]:active:not(:disabled):not([data-disabled]) {
1132
+ background-color: var(--slotted-tone-danger-solid-active);
1133
+ }
1123
1134
 
1124
- /** The line under a writing bubble clears the trail. */
1125
- [data-ui='message'][data-part='root']
1126
- > [data-part='body']:has(> [data-part='bubble'] [data-part='typing'])
1127
- > [data-part='footer'] {
1128
- margin-block-start: var(--slotted-space-2, 0.25rem);
1129
- }
1135
+ :scope[data-part-bubble] > [data-part-retry]:focus-visible {
1136
+ outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color);
1137
+ outline-offset: var(--slotted-focus-ring-offset, 2px);
1138
+ }
1130
1139
 
1131
- @keyframes slotted-message-trail {
1132
- from {
1133
- opacity: 1;
1140
+ @media (prefers-reduced-motion: reduce) {
1141
+ :scope[data-part-bubble] [data-part-caret],
1142
+ :scope[data-part-bubble] [data-part-stream-chunk],
1143
+ :scope[data-part-bubble] [data-part-typing] > span,
1144
+ :scope[data-part-bubble] > [data-part-content]:has(> [data-part-typing])::before,
1145
+ :scope[data-part-bubble] > [data-part-content]:has(> [data-part-typing])::after,
1146
+ :scope[data-part-bubble]
1147
+ [data-part-meta]
1148
+ [data-part-receipt][data-status='sending']
1149
+ > [data-ui-icon] {
1150
+ animation: none;
1151
+ }
1152
+
1153
+ :scope[data-part-root] [data-part-activity-step][data-current] > :last-child {
1154
+ animation: none;
1155
+ background-image: none;
1156
+ color: inherit;
1157
+ }
1158
+
1159
+ :scope[data-part-bubble] [data-part-typing] > span:nth-child(2) {
1160
+ opacity: 0.55;
1161
+ }
1162
+
1163
+ :scope[data-part-bubble] [data-part-typing] > span:nth-child(3) {
1164
+ opacity: 0.8;
1165
+ }
1134
1166
  }
1135
1167
 
1136
- to {
1137
- opacity: 0.55;
1168
+ /* ── Reactions ──────────────────────────────────────────────────────────
1169
+ *
1170
+ * A raised pill straddling the lower edge of the surface on the side away
1171
+ * from the sender. It rises into the surface by half the surface's own
1172
+ * inset, clear of the descenders of the last line; the bubble keeps the rest as room
1173
+ * below itself, so the pill never lands on the next message. ReUI hangs
1174
+ * the row three quarters out and its example needs a 32-pixel gap to clear
1175
+ * it (`c-bubble-4`). The pill draws its own edge and lift rather than a
1176
+ * ring in the color of a card it assumes it is on.
1177
+ */
1178
+ :scope[data-part-bubble]:has(> [data-part-reactions]) {
1179
+ padding-block-end: calc(var(--_reactions-size) - var(--_pad-block, 8px) / 2);
1138
1180
  }
1139
- }
1140
1181
 
1141
- [data-ui='message'][data-part='bubble'] [data-part='typing'] > span {
1142
- inline-size: var(--_dot);
1143
- block-size: var(--_dot);
1144
- border-radius: var(--slotted-radius-full, 9999px);
1145
- background-color: currentColor;
1146
- opacity: 0.3;
1147
- animation: slotted-message-typing var(--slotted-duration-loop)
1148
- var(--slotted-easing-standard, ease) infinite;
1149
- }
1182
+ :scope[data-part-bubble] > [data-part-reactions] {
1183
+ display: inline-flex;
1184
+ align-items: center;
1185
+ gap: var(--slotted-space-1, 0.125rem);
1186
+ position: absolute;
1187
+ inset-block-end: 0;
1188
+ inset-inline-end: var(--_pad-inline, 12px);
1189
+ padding: var(--slotted-space-1, 0.125rem);
1190
+ border: var(--slotted-border-width-thin, 1px) solid var(--slotted-border-subtle);
1191
+ border-radius: var(--slotted-radius-full, 9999px);
1192
+ background-color: var(--slotted-surface-raised);
1193
+ box-shadow: var(--slotted-shadow-xs);
1194
+ }
1150
1195
 
1151
- [data-ui='message'][data-part='bubble'] [data-part='typing'] > span:nth-child(2) {
1152
- animation-delay: calc(var(--slotted-duration-loop) / 6);
1153
- }
1196
+ :scope[data-part-root][data-align='end'] [data-part-bubble] > [data-part-reactions] {
1197
+ inset-inline: var(--_pad-inline, 12px) auto;
1198
+ }
1154
1199
 
1155
- [data-ui='message'][data-part='bubble'] [data-part='typing'] > span:nth-child(3) {
1156
- animation-delay: calc(var(--slotted-duration-loop) / 3);
1157
- }
1200
+ /**
1201
+ * In a thread there is no surface to straddle: the reactions are a row in
1202
+ * the flow under the words, the way Slack and GitHub set them.
1203
+ */
1204
+ :scope[data-part-bubble][data-variant='plain']:has(> [data-part-reactions]) {
1205
+ padding-block-end: 0;
1206
+ }
1158
1207
 
1159
- @keyframes slotted-message-typing {
1160
- 0%,
1161
- 55%,
1162
- 100% {
1163
- opacity: 0.3;
1164
- translate: 0 0;
1208
+ :scope[data-part-bubble][data-variant='plain'] > [data-part-reactions] {
1209
+ position: static;
1210
+ padding: 0;
1211
+ border: 0;
1212
+ background-color: transparent;
1213
+ box-shadow: none;
1214
+ translate: none;
1165
1215
  }
1166
1216
 
1167
- 25% {
1168
- opacity: 0.85;
1169
- translate: 0 calc(var(--_dot) * -0.5);
1217
+ :scope[data-part-bubble] [data-part-reaction] {
1218
+ display: inline-flex;
1219
+ align-items: center;
1220
+ gap: var(--slotted-space-1, 0.125rem);
1221
+ box-sizing: border-box;
1222
+ min-inline-size: var(--_reactions-size);
1223
+ block-size: var(--_reactions-size);
1224
+ margin: 0;
1225
+ padding-block: 0;
1226
+ padding-inline: var(--slotted-space-3, 0.375rem);
1227
+ --_reaction-ground: transparent;
1228
+
1229
+ border: var(--slotted-border-width-thin, 1px) solid transparent;
1230
+ border-radius: var(--slotted-radius-full, 9999px);
1231
+ background-color: var(--_reaction-ground);
1232
+ color: var(--slotted-text);
1233
+ font: inherit;
1234
+ font-size: var(--slotted-font-size-xs, 0.75rem);
1235
+ line-height: 1;
1236
+ transition:
1237
+ background-color var(--slotted-duration-short) var(--slotted-easing-standard, ease),
1238
+ border-color var(--slotted-duration-short) var(--slotted-easing-standard, ease),
1239
+ color var(--slotted-duration-short) var(--slotted-easing-standard, ease);
1170
1240
  }
1171
- }
1172
1241
 
1173
- /**
1174
- * ── Retry ──────────────────────────────────────────────────────────────
1175
- *
1176
- * A message that did not go carries a round control beside its surface, on
1177
- * the side away from the sender, in the danger tone, centred on the last
1178
- * line. It is the way to send it again, and its arrow turns a little under
1179
- * the pointer toward the way it will go.
1180
- */
1181
- [data-ui='message'][data-part='bubble'] > [data-part='retry'] {
1182
- --_size: max(var(--slotted-target-min, 24px), var(--slotted-control-inner-size-md, 24px));
1183
- --_ground: var(--slotted-tone-danger-solid);
1184
-
1185
- display: inline-grid;
1186
- place-items: center;
1187
- position: absolute;
1188
- inset-block-end: calc(
1189
- (
1190
- var(--_leading) + 2 * var(--_pad-block) + 2 * var(--slotted-border-width-thin, 1px) -
1191
- var(--_size)
1192
- ) /
1193
- 2
1194
- );
1195
- inset-inline-start: calc(100% + var(--slotted-space-4, 0.5rem));
1196
- box-sizing: border-box;
1197
- inline-size: var(--_size);
1198
- block-size: var(--_size);
1199
- margin: 0;
1200
- padding: 0;
1201
- border: 0;
1202
- border-radius: var(--slotted-radius-full, 9999px);
1203
- background-color: var(--_ground);
1204
- color: var(--slotted-tone-danger-on-solid);
1205
- cursor: pointer;
1206
- transition: background-color var(--slotted-duration-short) var(--slotted-easing-standard, ease);
1207
- }
1242
+ :scope[data-part-bubble][data-variant='plain'] [data-part-reaction] {
1243
+ --_reaction-ground: var(--slotted-surface);
1208
1244
 
1209
- [data-ui='message'][data-part='root'][data-align='end']
1210
- [data-part='bubble']
1211
- > [data-part='retry'] {
1212
- inset-inline: auto calc(100% + var(--slotted-space-4, 0.5rem));
1213
- }
1245
+ border-color: var(--slotted-border-subtle);
1246
+ }
1214
1247
 
1215
- [data-ui='message'][data-part='bubble'] > [data-part='retry'] > [data-ui='icon'] {
1216
- --slotted-icon-size: var(--slotted-control-icon-size-sm, 14px);
1248
+ :scope[data-part-bubble] [data-part-reaction-count] {
1249
+ color: var(--slotted-text-muted);
1250
+ font-weight: var(--slotted-font-weight-medium, 500);
1251
+ font-variant-numeric: tabular-nums;
1252
+ }
1217
1253
 
1218
- transition: rotate var(--slotted-duration-medium) var(--slotted-easing-emphasized, ease);
1219
- }
1254
+ /**
1255
+ * The pointer answers on whatever ground the reaction stands on — none, the
1256
+ * page, or the accent's tint when it is the reader's own — with the text's
1257
+ * ink laid over it at six and twelve per cent, so a pressed reaction answers
1258
+ * a hover and a press as clearly as a bare one and the two never match.
1259
+ */
1260
+ :scope[data-part-bubble] [data-part-reaction]:hover:not(:disabled):not([data-disabled]) {
1261
+ background-color: color-mix(
1262
+ in oklab,
1263
+ var(--slotted-text) var(--slotted-message-state-layer-hover, 6%),
1264
+ var(--_reaction-ground)
1265
+ );
1266
+ }
1220
1267
 
1221
- /**
1222
- * The tone's own hover step sits 0.01 OKLab lightness from its fill, under
1223
- * the 0.02 `theme-conformance` asks; the control's ink laid over the fill at
1224
- * fourteen per cent answers visibly in every scheme.
1225
- */
1226
- [data-ui='message'][data-part='bubble']
1227
- > [data-part='retry']:hover:not(:disabled):not([data-disabled]) {
1228
- background-color: color-mix(
1229
- in oklab,
1230
- var(--slotted-tone-danger-on-solid) var(--slotted-message-retry-state-layer, 14%),
1231
- var(--_ground)
1232
- );
1233
- }
1268
+ :scope[data-part-bubble] [data-part-reaction]:active:not(:disabled):not([data-disabled]) {
1269
+ background-color: color-mix(
1270
+ in oklab,
1271
+ var(--slotted-text) var(--slotted-message-state-layer-active, 12%),
1272
+ var(--_reaction-ground)
1273
+ );
1274
+ }
1234
1275
 
1235
- [data-ui='message'][data-part='bubble']
1236
- > [data-part='retry']:hover:not(:disabled):not([data-disabled])
1237
- > [data-ui='icon'] {
1238
- rotate: -45deg;
1239
- }
1276
+ /**
1277
+ * The reader's own reaction: the accent's tinted ground inside the accent's
1278
+ * edge, and the count in the accent's ink. The pair carries the ratio the
1279
+ * ground alone cannot (`docs/token-foundation.md` › Semantic color).
1280
+ */
1281
+ :scope[data-part-bubble] [data-part-reaction][data-pressed] {
1282
+ --_reaction-ground: var(--slotted-tone-accent-surface);
1240
1283
 
1241
- [data-ui='message'][data-part='bubble']
1242
- > [data-part='retry']:active:not(:disabled):not([data-disabled]) {
1243
- background-color: var(--slotted-tone-danger-solid-active);
1244
- }
1284
+ border-color: var(--slotted-tone-accent-border);
1285
+ }
1245
1286
 
1246
- [data-ui='message'][data-part='bubble'] > [data-part='retry']:focus-visible {
1247
- outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color);
1248
- outline-offset: var(--slotted-focus-ring-offset, 2px);
1249
- }
1287
+ :scope[data-part-bubble] [data-part-reaction][data-pressed] > [data-part-reaction-count] {
1288
+ color: var(--slotted-tone-accent-text);
1289
+ }
1250
1290
 
1251
- @media (prefers-reduced-motion: reduce) {
1252
- [data-ui='message'][data-part='bubble'] [data-part='caret'],
1253
- [data-ui='message'][data-part='bubble'] [data-part='stream-chunk'],
1254
- [data-ui='message'][data-part='bubble'] [data-part='typing'] > span,
1255
- [data-ui='message'][data-part='bubble']
1256
- > [data-part='content']:has(> [data-part='typing'])::before,
1257
- [data-ui='message'][data-part='bubble']
1258
- > [data-part='content']:has(> [data-part='typing'])::after,
1259
- [data-ui='message'][data-part='bubble']
1260
- [data-part='meta']
1261
- [data-part='receipt'][data-status='sending']
1262
- > [data-ui='icon'] {
1263
- animation: none;
1264
- }
1265
-
1266
- [data-ui='message'][data-part='root'] [data-part='activity-step'][data-current] > :last-child {
1267
- animation: none;
1268
- background-image: none;
1269
- color: inherit;
1291
+ :scope[data-part-bubble] [data-part-reaction]:is(:disabled, [data-disabled]) {
1292
+ color: var(--slotted-disabled-foreground);
1293
+ cursor: default;
1270
1294
  }
1271
1295
 
1272
- [data-ui='message'][data-part='bubble'] [data-part='typing'] > span:nth-child(2) {
1273
- opacity: 0.55;
1296
+ :scope[data-part-bubble] [data-part-reaction]:focus-visible {
1297
+ outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color);
1298
+ outline-offset: var(--slotted-focus-ring-offset, 2px);
1274
1299
  }
1275
1300
 
1276
- [data-ui='message'][data-part='bubble'] [data-part='typing'] > span:nth-child(3) {
1277
- opacity: 0.8;
1301
+ /* ── Forced colors ─────────────────────────────────────────────────────
1302
+ *
1303
+ * The system owns the palette: every bubble is a framed box of text, the
1304
+ * reader's own reaction is `Highlight`, and the tints of the quote and the
1305
+ * pointer go, because `color-mix` over system colors is not a color the
1306
+ * reader chose.
1307
+ */
1308
+ @media (forced-colors: active) {
1309
+ :scope[data-part-bubble] > [data-part-content] {
1310
+ border-color: CanvasText;
1311
+ }
1312
+
1313
+ /* A background is the system's to repaint; the dot is ink, so it keeps the text's color. */
1314
+ :scope[data-part-bubble] [data-part-caret] {
1315
+ forced-color-adjust: none;
1316
+ background-color: CanvasText;
1317
+ }
1318
+
1319
+ :scope[data-part-bubble][data-variant='plain'] > [data-part-content] {
1320
+ border-color: transparent;
1321
+ }
1322
+
1323
+ :scope[data-part-bubble] [data-part-reaction][data-pressed] {
1324
+ border-color: Highlight;
1325
+ forced-color-adjust: none;
1326
+ background-color: Highlight;
1327
+ color: HighlightText;
1328
+ }
1329
+
1330
+ :scope[data-part-bubble] [data-part-quote] {
1331
+ border: var(--slotted-border-width-thin, 1px) solid CanvasText;
1332
+ }
1278
1333
  }
1279
1334
  }
1280
1335
 
1281
- /* ── Reactions ──────────────────────────────────────────────────────────
1336
+ /**
1337
+ * ── The corners of a run ───────────────────────────────────────────────
1338
+ *
1339
+ * Bubbles that follow one another from one sender draw in the corners that
1340
+ * face each other on the sender's side, inside one row and across the rows
1341
+ * of a group. A run reads as one speaker by its shape, with no position
1342
+ * prop on each message (Chatscope asks for `first`, `normal`, `last`).
1282
1343
  *
1283
- * A raised pill straddling the lower edge of the surface on the side away
1284
- * from the sender. It rises into the surface by half the surface's own
1285
- * inset, clear of the descenders of the last line; the bubble keeps the rest as room
1286
- * below itself, so the pill never lands on the next message. ReUI hangs
1287
- * the row three quarters out and its example needs a 32-pixel gap to clear
1288
- * it (`c-bubble-4`). The pill draws its own edge and lift rather than a
1289
- * ring in the colour of a card it assumes it is on.
1344
+ * A bubble that follows a bubble is its sibling, outside the scope the
1345
+ * first bubble roots, so these rules stand outside the family's `@scope`.
1290
1346
  */
1291
- [data-ui='message'][data-part='bubble']:has(> [data-part='reactions']) {
1292
- padding-block-end: calc(var(--_reactions-size) - var(--_pad-block, 8px) / 2);
1293
- }
1294
-
1295
- [data-ui='message'][data-part='bubble'] > [data-part='reactions'] {
1296
- display: inline-flex;
1297
- align-items: center;
1298
- gap: var(--slotted-space-1, 0.125rem);
1299
- position: absolute;
1300
- inset-block-end: 0;
1301
- inset-inline-end: var(--_pad-inline, 12px);
1302
- padding: var(--slotted-space-1, 0.125rem);
1303
- border: var(--slotted-border-width-thin, 1px) solid var(--slotted-border-subtle);
1304
- border-radius: var(--slotted-radius-full, 9999px);
1305
- background-color: var(--slotted-surface-raised);
1306
- box-shadow: var(--slotted-shadow-xs);
1347
+ [data-ui-message][data-part-bubble]:has(~ [data-part-bubble]),
1348
+ [data-ui-message][data-part-group]
1349
+ > [data-ui-message][data-part-root]:not(:last-child)
1350
+ > [data-part-body]
1351
+ > [data-part-bubble]:not(:has(~ [data-part-bubble])) {
1352
+ --_bottom-side: var(--_radius-joined);
1307
1353
  }
1308
1354
 
1309
- [data-ui='message'][data-part='root'][data-align='end']
1310
- [data-part='bubble']
1311
- > [data-part='reactions'] {
1312
- inset-inline: var(--_pad-inline, 12px) auto;
1355
+ [data-ui-message][data-part-bubble] ~ [data-part-bubble],
1356
+ [data-ui-message][data-part-group]
1357
+ > [data-ui-message][data-part-root]:not(:first-child)
1358
+ > [data-part-body]
1359
+ > [data-part-bubble]:not([data-part-bubble] ~ [data-part-bubble]) {
1360
+ --_top-side: var(--_radius-joined);
1313
1361
  }
1314
1362
 
1315
1363
  /**
1316
- * In a thread there is no surface to straddle: the reactions are a row in
1317
- * the flow under the words, the way Slack and GitHub set them.
1364
+ * A bubble is as wide as its words. Prose — markdown's typography — is a size
1365
+ * container for its narrow-column rules, and a size container contributes no
1366
+ * width, so the bubble shrank to its padding. Inside a bubble prose sizes to
1367
+ * its text and its narrow-column rules do not apply. Prose sits inside the
1368
+ * markdown family, past the limit of the scope above, so the rule stands
1369
+ * outside it.
1318
1370
  */
1319
- [data-ui='message'][data-part='bubble'][data-variant='plain']:has(> [data-part='reactions']) {
1320
- padding-block-end: 0;
1321
- }
1322
-
1323
- [data-ui='message'][data-part='bubble'][data-variant='plain'] > [data-part='reactions'] {
1324
- position: static;
1325
- padding: 0;
1326
- border: 0;
1327
- background-color: transparent;
1328
- box-shadow: none;
1329
- translate: none;
1371
+ [data-ui-message][data-part-bubble] > [data-part-content] [data-ui-prose] {
1372
+ container-type: normal;
1330
1373
  }
1331
1374
 
1332
- [data-ui='message'][data-part='bubble'] [data-part='reaction'] {
1333
- display: inline-flex;
1334
- align-items: center;
1335
- gap: var(--slotted-space-1, 0.125rem);
1336
- box-sizing: border-box;
1337
- min-inline-size: var(--_reactions-size);
1338
- block-size: var(--_reactions-size);
1339
- margin: 0;
1340
- padding-block: 0;
1341
- padding-inline: var(--slotted-space-3, 0.375rem);
1342
- --_reaction-ground: transparent;
1343
-
1344
- border: var(--slotted-border-width-thin, 1px) solid transparent;
1345
- border-radius: var(--slotted-radius-full, 9999px);
1346
- background-color: var(--_reaction-ground);
1347
- color: var(--slotted-text);
1348
- font: inherit;
1349
- font-size: var(--slotted-font-size-xs, 0.75rem);
1350
- line-height: 1;
1351
- transition:
1352
- background-color var(--slotted-duration-short) var(--slotted-easing-standard, ease),
1353
- border-color var(--slotted-duration-short) var(--slotted-easing-standard, ease),
1354
- color var(--slotted-duration-short) var(--slotted-easing-standard, ease);
1355
- }
1356
-
1357
- [data-ui='message'][data-part='bubble'][data-variant='plain'] [data-part='reaction'] {
1358
- --_reaction-ground: var(--slotted-surface);
1359
-
1360
- border-color: var(--slotted-border-subtle);
1361
- }
1375
+ @keyframes slotted-message-sweep {
1376
+ from {
1377
+ background-position: 100% 0;
1378
+ }
1362
1379
 
1363
- [data-ui='message'][data-part='bubble'] [data-part='reaction-count'] {
1364
- color: var(--slotted-text-muted);
1365
- font-weight: var(--slotted-font-weight-medium, 500);
1366
- font-variant-numeric: tabular-nums;
1380
+ to {
1381
+ background-position: 0% 0;
1382
+ }
1367
1383
  }
1368
1384
 
1369
- /**
1370
- * The pointer answers on whatever ground the reaction stands on — none, the
1371
- * page, or the accent's tint when it is the reader's own — with the text's
1372
- * ink laid over it at six and twelve per cent, so a pressed reaction answers
1373
- * a hover and a press as clearly as a bare one and the two never match.
1374
- */
1375
- [data-ui='message'][data-part='bubble']
1376
- [data-part='reaction']:hover:not(:disabled):not([data-disabled]) {
1377
- background-color: color-mix(
1378
- in oklab,
1379
- var(--slotted-text) var(--slotted-message-state-layer-hover, 6%),
1380
- var(--_reaction-ground)
1381
- );
1382
- }
1385
+ @keyframes slotted-message-pending {
1386
+ from {
1387
+ opacity: 1;
1388
+ }
1383
1389
 
1384
- [data-ui='message'][data-part='bubble']
1385
- [data-part='reaction']:active:not(:disabled):not([data-disabled]) {
1386
- background-color: color-mix(
1387
- in oklab,
1388
- var(--slotted-text) var(--slotted-message-state-layer-active, 12%),
1389
- var(--_reaction-ground)
1390
- );
1390
+ to {
1391
+ opacity: 0.4;
1392
+ }
1391
1393
  }
1392
1394
 
1393
- /**
1394
- * The reader's own reaction: the accent's tinted ground inside the accent's
1395
- * edge, and the count in the accent's ink. The pair carries the ratio the
1396
- * ground alone cannot (`docs/token-foundation.md` › Semantic colour).
1397
- */
1398
- [data-ui='message'][data-part='bubble'] [data-part='reaction'][data-pressed] {
1399
- --_reaction-ground: var(--slotted-tone-accent-surface);
1400
-
1401
- border-color: var(--slotted-tone-accent-border);
1402
- }
1395
+ @keyframes slotted-message-word {
1396
+ from {
1397
+ opacity: 0;
1398
+ filter: blur(0.16em);
1399
+ }
1403
1400
 
1404
- [data-ui='message'][data-part='bubble']
1405
- [data-part='reaction'][data-pressed]
1406
- > [data-part='reaction-count'] {
1407
- color: var(--slotted-tone-accent-text);
1401
+ to {
1402
+ opacity: 1;
1403
+ filter: blur(0);
1404
+ }
1408
1405
  }
1409
1406
 
1410
- [data-ui='message'][data-part='bubble'] [data-part='reaction']:is(:disabled, [data-disabled]) {
1411
- color: var(--slotted-disabled-foreground);
1412
- cursor: default;
1407
+ @keyframes slotted-message-dot-in {
1408
+ from {
1409
+ opacity: 0;
1410
+ scale: 0;
1411
+ }
1413
1412
  }
1414
1413
 
1415
- [data-ui='message'][data-part='bubble'] [data-part='reaction']:focus-visible {
1416
- outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color);
1417
- outline-offset: var(--slotted-focus-ring-offset, 2px);
1418
- }
1414
+ /* 0.72 of 8 px is 5.76: the breath is seen, and the dot never shrinks to a full stop's 2 px. */
1415
+ @keyframes slotted-message-breathe {
1416
+ from {
1417
+ opacity: 1;
1418
+ scale: 1;
1419
+ }
1419
1420
 
1420
- /* ── Forced colours ─────────────────────────────────────────────────────
1421
- *
1422
- * The system owns the palette: every bubble is a framed box of text, the
1423
- * reader's own reaction is `Highlight`, and the tints of the quote and the
1424
- * pointer go, because `color-mix` over system colours is not a colour the
1425
- * reader chose.
1426
- */
1427
- @media (forced-colors: active) {
1428
- [data-ui='message'][data-part='bubble'] > [data-part='content'] {
1429
- border-color: CanvasText;
1421
+ to {
1422
+ opacity: 0.5;
1423
+ scale: 0.72;
1430
1424
  }
1425
+ }
1431
1426
 
1432
- /* A background is the system's to repaint; the dot is ink, so it keeps the text's colour. */
1433
- [data-ui='message'][data-part='bubble'] [data-part='caret'] {
1434
- forced-color-adjust: none;
1435
- background-color: CanvasText;
1427
+ @keyframes slotted-message-trail {
1428
+ from {
1429
+ opacity: 1;
1436
1430
  }
1437
1431
 
1438
- [data-ui='message'][data-part='bubble'][data-variant='plain'] > [data-part='content'] {
1439
- border-color: transparent;
1432
+ to {
1433
+ opacity: 0.55;
1440
1434
  }
1435
+ }
1441
1436
 
1442
- [data-ui='message'][data-part='bubble'] [data-part='reaction'][data-pressed] {
1443
- border-color: Highlight;
1444
- forced-color-adjust: none;
1445
- background-color: Highlight;
1446
- color: HighlightText;
1437
+ @keyframes slotted-message-typing {
1438
+ 0%,
1439
+ 55%,
1440
+ 100% {
1441
+ opacity: 0.3;
1442
+ translate: 0 0;
1447
1443
  }
1448
1444
 
1449
- [data-ui='message'][data-part='bubble'] [data-part='quote'] {
1450
- border: var(--slotted-border-width-thin, 1px) solid CanvasText;
1445
+ 25% {
1446
+ opacity: 0.85;
1447
+ translate: 0 calc(var(--_dot) * -0.5);
1451
1448
  }
1452
1449
  }
1453
1450
  }