@slotted/styles 0.1.0-beta.28 → 0.1.0-beta.29

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