@aparte/n8n-chat 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +635 -598
  3. package/dist/cdn/chunks/{chunk-LGVX5DQP.js → chunk-3ZPEJRUN.js} +2 -2
  4. package/dist/cdn/chunks/{chunk-LGVX5DQP.js.map → chunk-3ZPEJRUN.js.map} +1 -1
  5. package/dist/cdn/chunks/{chunk-PPDOW5CO.js → chunk-HR2ND5EK.js} +2 -2
  6. package/dist/cdn/chunks/{chunk-PPDOW5CO.js.map → chunk-HR2ND5EK.js.map} +1 -1
  7. package/dist/cdn/chunks/{chunk-HASLYSSG.js → chunk-KXLJFCTW.js} +2 -2
  8. package/dist/cdn/chunks/{chunk-HASLYSSG.js.map → chunk-KXLJFCTW.js.map} +1 -1
  9. package/dist/cdn/chunks/{chunk-4MZPEZPE.js → chunk-QGJMBP66.js} +30 -30
  10. package/dist/cdn/chunks/chunk-QGJMBP66.js.map +7 -0
  11. package/dist/cdn/chunks/{chunk-XY3GEFGN.js → chunk-QLQPHZ4I.js} +2 -2
  12. package/dist/cdn/chunks/{chunk-XY3GEFGN.js.map → chunk-QLQPHZ4I.js.map} +1 -1
  13. package/dist/cdn/chunks/{chunk-KPADIE5S.js → chunk-Z3UL76XU.js} +1 -1
  14. package/dist/cdn/chunks/{chunk-KPADIE5S.js.map → chunk-Z3UL76XU.js.map} +1 -1
  15. package/dist/cdn/chunks/{de-VHSIFTGU.js → de-SOZWA4P4.js} +2 -2
  16. package/dist/cdn/chunks/{de-VHSIFTGU.js.map → de-SOZWA4P4.js.map} +3 -3
  17. package/dist/cdn/chunks/{es-CSDZBDZK.js → es-WUHNDTG7.js} +2 -2
  18. package/dist/cdn/chunks/{es-CSDZBDZK.js.map → es-WUHNDTG7.js.map} +3 -3
  19. package/dist/cdn/chunks/{fr-A7LKKK4U.js → fr-QOUVY5FA.js} +2 -2
  20. package/dist/cdn/chunks/{fr-A7LKKK4U.js.map → fr-QOUVY5FA.js.map} +3 -3
  21. package/dist/cdn/chunks/{highlight-IMZBI6FV.js → highlight-ZJAA24RG.js} +2 -2
  22. package/dist/cdn/chunks/{highlight-IMZBI6FV.js.map → highlight-ZJAA24RG.js.map} +2 -2
  23. package/dist/cdn/chunks/{it-4UDH2XVX.js → it-JOAAJHQH.js} +2 -2
  24. package/dist/cdn/chunks/{it-4UDH2XVX.js.map → it-JOAAJHQH.js.map} +3 -3
  25. package/dist/cdn/chunks/{items-FFNVAESC.js → items-6EVOWL4Q.js} +2 -2
  26. package/dist/cdn/chunks/{items-FFNVAESC.js.map → items-6EVOWL4Q.js.map} +1 -1
  27. package/dist/cdn/chunks/{ja-5FMFPBXT.js → ja-VUZC7PKR.js} +2 -2
  28. package/dist/cdn/chunks/{ja-5FMFPBXT.js.map → ja-VUZC7PKR.js.map} +3 -3
  29. package/dist/cdn/chunks/{ko-KXXFK5U7.js → ko-O3YDRWQK.js} +2 -2
  30. package/dist/cdn/chunks/{ko-KXXFK5U7.js.map → ko-O3YDRWQK.js.map} +3 -3
  31. package/dist/cdn/chunks/{link-3AMG5PIK.js → link-77UEHUXF.js} +2 -2
  32. package/dist/cdn/chunks/{link-3AMG5PIK.js.map → link-77UEHUXF.js.map} +1 -1
  33. package/dist/cdn/chunks/{media-F3HYZLYR.js → media-PN3A7I2Y.js} +2 -2
  34. package/dist/cdn/chunks/{media-F3HYZLYR.js.map → media-PN3A7I2Y.js.map} +1 -1
  35. package/dist/cdn/chunks/{order-L6GKT5I6.js → order-PC45M52X.js} +2 -2
  36. package/dist/cdn/chunks/{order-L6GKT5I6.js.map → order-PC45M52X.js.map} +1 -1
  37. package/dist/cdn/chunks/{place-J7BDZGKL.js → place-HVNXQ2XT.js} +2 -2
  38. package/dist/cdn/chunks/{place-J7BDZGKL.js.map → place-HVNXQ2XT.js.map} +1 -1
  39. package/dist/cdn/chunks/{plan-BAI6GY4A.js → plan-VVVGWRRY.js} +2 -2
  40. package/dist/cdn/chunks/{plan-BAI6GY4A.js.map → plan-VVVGWRRY.js.map} +1 -1
  41. package/dist/cdn/chunks/{product-VOKQKP4K.js → product-344AZESV.js} +2 -2
  42. package/dist/cdn/chunks/{product-VOKQKP4K.js.map → product-344AZESV.js.map} +1 -1
  43. package/dist/cdn/chunks/{pt-BR-T2PIW5LH.js → pt-BR-VRSALGOW.js} +2 -2
  44. package/dist/cdn/chunks/{pt-BR-T2PIW5LH.js.map → pt-BR-VRSALGOW.js.map} +3 -3
  45. package/dist/cdn/chunks/{ru-CWHLBHXX.js → ru-QHPM4IVN.js} +2 -2
  46. package/dist/cdn/chunks/{ru-CWHLBHXX.js.map → ru-QHPM4IVN.js.map} +3 -3
  47. package/dist/cdn/chunks/{score-IPBHXWWN.js → score-3VE4ZDCR.js} +2 -2
  48. package/dist/cdn/chunks/{score-IPBHXWWN.js.map → score-3VE4ZDCR.js.map} +1 -1
  49. package/dist/cdn/chunks/{stats-V6H3J3WL.js → stats-A6ATSHOO.js} +2 -2
  50. package/dist/cdn/chunks/{stats-V6H3J3WL.js.map → stats-A6ATSHOO.js.map} +1 -1
  51. package/dist/cdn/chunks/{stock-UNSEZYGA.js → stock-KPAFYPNA.js} +2 -2
  52. package/dist/cdn/chunks/{stock-UNSEZYGA.js.map → stock-KPAFYPNA.js.map} +1 -1
  53. package/dist/cdn/chunks/{weather-4IMAIRYF.js → weather-OHQUZ3YG.js} +2 -2
  54. package/dist/cdn/chunks/{weather-4IMAIRYF.js.map → weather-OHQUZ3YG.js.map} +1 -1
  55. package/dist/cdn/chunks/{zh-CN-UEBLECMR.js → zh-CN-U7Y6ABLD.js} +2 -2
  56. package/dist/cdn/chunks/{zh-CN-UEBLECMR.js.map → zh-CN-U7Y6ABLD.js.map} +3 -3
  57. package/dist/cdn/latest.js +11 -0
  58. package/dist/cdn/n8n-chat.js +42 -42
  59. package/dist/cdn/n8n-chat.js.map +4 -4
  60. package/dist/create-chat.d.ts +18 -1
  61. package/dist/highlight-DDyMJYBk.js.map +1 -1
  62. package/dist/index.js +40 -26
  63. package/dist/index.js.map +1 -1
  64. package/dist/strings.d.ts +3 -1
  65. package/dist/style.css +463 -411
  66. package/dist/theme.css +461 -409
  67. package/package.json +83 -83
  68. package/dist/cdn/chunks/chunk-4MZPEZPE.js.map +0 -7
package/dist/theme.css CHANGED
@@ -1,409 +1,461 @@
1
- /*
2
- * The n8n theme: aparté's chat in the look of n8n's chat widget, on anything inside
3
- * `.aparte-n8n` — the widget `createChat()` mounts, or a chat you compose yourself.
4
- *
5
- * It reads n8n's main `--chat--*` variables — the colors, the fonts, the radii, the window's
6
- * size and its button — so a page that set them for n8n's widget keeps them. Their defaults
7
- * are n8n's, but for one: the green behind white text is n8n's darkened just enough to read
8
- * (#178272, 4.7:1, where n8n's #20b69e gives 2.55:1). The input's and buttons' own variables,
9
- * and rules written against n8n's `.chat-*` classes, do not carry over.
10
- *
11
- * To restyle with aparté's variables instead: the palette (`--aparte-primary`, `--aparte-bg`,
12
- * `--aparte-text`…) on `.aparte-n8n`; a message's own tokens (`--aparte-message-content-*`)
13
- * on `.aparte-n8n aparte-chat`, where core derives them.
14
- *
15
- * Light by default like n8n's widget, whatever the visitor's system: a chat half in the
16
- * page's colors is worse than one in its own. Dark is `colorScheme: 'dark'` (or
17
- * `data-aparte-theme="dark"`), or the visitor's own with `colorScheme: 'auto'`.
18
- *
19
- * One color is enough: `--chat--color--secondary` alone also colors the button in the corner
20
- * (n8n's `--primary`, when the page leaves it unset), every hover is derived from the color it
21
- * darkens, and dark keeps the page's header and tints its surfaces with that color. Unset,
22
- * each falls back to n8n's own.
23
- */
24
-
25
- .aparte-n8n {
26
- color-scheme: light;
27
- font-family: var(--aparte-font-family);
28
- color: var(--aparte-text);
29
-
30
- --aparte-font-family: var(--chat--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif);
31
- --aparte-code-font-family: var(--chat--font-family--monospace, ui-monospace, Menlo, Consolas, 'DejaVu Sans Mono', monospace);
32
-
33
- /* The palette: literal, on the root, inherited by everything inside. */
34
- --aparte-bg: var(--chat--body--background, var(--chat--color-light, #f2f4f8));
35
- --aparte-surface-1: var(--chat--color-white, #fff);
36
- --aparte-surface-2: var(--chat--color-light-shade-50, #e6e9f1);
37
- --aparte-text: var(--chat--color-dark, #101330);
38
- --aparte-text-muted: #5b5f7a;
39
- --aparte-neutral: #5b5f7a;
40
- --aparte-border: var(--chat--color-light-shade-50, #e6e9f1);
41
- --aparte-primary: var(--chat--color--secondary, #178272);
42
- /* Derived, not n8n's fixed shade: a page that set its own color would hover back to n8n's green. */
43
- --aparte-primary-hover: var(--chat--color-secondary-shade-50, color-mix(in oklab, var(--aparte-primary) 85%, #000));
44
- --aparte-on-primary: var(--chat--color-white, #fff);
45
- --aparte-message-content-text-user: var(--chat--message--user--color, var(--chat--color-white, #fff));
46
- --aparte-message-content-bg-assistant: var(--chat--message--bot--background, var(--chat--color-white, #fff));
47
- --aparte-message-content-text-assistant: var(--chat--message--bot--color, var(--chat--color-dark, #101330));
48
- --aparte-message-content-padding-assistant: var(--chat--message--padding, var(--chat--spacing, 1rem));
49
-
50
- /* What core derives on the chat's own anchors, kept here and handed down below. */
51
- --aparte-n8n-accent: var(--chat--color--primary, var(--chat--color--secondary, #e74266));
52
- --aparte-n8n-user-bg: var(--chat--message--user--background, var(--aparte-primary));
53
- --aparte-n8n-radius: var(--chat--message--border-radius, var(--chat--border-radius, 0.25rem));
54
- --aparte-n8n-code-bg: var(--chat--message--pre--background, rgba(0, 0, 0, 0.05));
55
- --aparte-n8n-input-bg: var(--chat--input--background, var(--chat--color-white, #fff));
56
- --aparte-n8n-message-padding: var(--chat--message--padding, var(--chat--spacing, 1rem));
57
-
58
- /* The window and the button in the corner, read by the launcher, which is this element. */
59
- --aparte-launcher-width: var(--chat--window--width, 400px);
60
- --aparte-launcher-height: var(--chat--window--height, 600px);
61
- --aparte-launcher-offset: var(--chat--window--bottom, var(--chat--spacing, 1rem));
62
- --aparte-launcher-gap: var(--chat--window--margin-bottom, var(--chat--spacing, 1rem));
63
- --aparte-launcher-radius: var(--chat--window--border-radius, var(--chat--border-radius, 0.25rem));
64
-
65
- /* The header, the footer and the button, drawn by this theme. */
66
- --aparte-n8n-header-bg: var(--chat--header--background, var(--chat--color-dark, #101330));
67
- --aparte-n8n-header-color: var(--chat--header--color, var(--chat--color-light, #f2f4f8));
68
- --aparte-n8n-footer-bg: var(--chat--footer--background, var(--chat--color-light, #f2f4f8));
69
- --aparte-n8n-footer-color: var(--chat--footer--color, var(--chat--color-dark, #101330));
70
- /* The page's one color when it set no --primary: a green chat behind a pink button reads as a bug. */
71
- --aparte-n8n-toggle-bg: var(--chat--toggle--background, var(--chat--color--primary, var(--chat--color--secondary, #e74266)));
72
- --aparte-n8n-toggle-hover-bg: var(--chat--toggle--hover--background, var(--chat--color--primary-shade-50, color-mix(in oklab, var(--aparte-n8n-toggle-bg) 88%, #000)));
73
- --aparte-n8n-toggle-color: var(--chat--toggle--color, var(--chat--color-white, #fff));
74
- }
75
-
76
- /*
77
- * On the chat's own anchors, where core derives these tokens from its own: as references to
78
- * the root's, so the root's values — and a page's `--chat--*` — reach the messages.
79
- */
80
- .aparte-n8n :is(aparte-chat, [data-aparte-host]) {
81
- --aparte-accent: var(--aparte-n8n-accent);
82
- --aparte-message-content-bg-user: var(--aparte-n8n-user-bg);
83
- --aparte-radius-bubble: var(--aparte-n8n-radius);
84
- --aparte-message-content-radius: var(--aparte-n8n-radius);
85
- --aparte-code-bg: var(--aparte-n8n-code-bg);
86
- --aparte-prose-code-bg: var(--aparte-n8n-code-bg);
87
- --aparte-input-bg: var(--aparte-n8n-input-bg);
88
- --aparte-message-content-padding: var(--aparte-n8n-message-padding);
89
- }
90
-
91
- /* n8n pads the bot's message too, and core caps the message at its column's width without
92
- counting padding: the message ran past the column and the bubble clipped its right edge —
93
- unseen in wrapped text, plain on a card that fills the width. A card is 100% wide plus its
94
- border, the same way. */
95
- .aparte-n8n :is(.aparte-message-content, .aparte-rich-card) {
96
- box-sizing: border-box;
97
- }
98
-
99
- /* Dark: n8n's own navy, which its widget never had. */
100
- .aparte-n8n[data-aparte-theme='dark'] {
101
- color-scheme: dark;
102
- /* n8n's navy, tinted with the page's color when it set one (unset, the navy itself). */
103
- --aparte-bg: color-mix(in oklab, var(--chat--color--secondary, #0b0d24) 7%, #0b0d24);
104
- --aparte-surface-1: color-mix(in oklab, var(--chat--color--secondary, #151937) 9%, #151937);
105
- --aparte-surface-2: color-mix(in oklab, var(--chat--color--secondary, #1d2246) 10%, #1d2246);
106
- --aparte-text: #eef0f6;
107
- --aparte-text-muted: #a3a7c2;
108
- --aparte-neutral: #a3a7c2;
109
- --aparte-border: color-mix(in oklab, var(--chat--color--secondary, #262b52) 16%, #262b52);
110
- --aparte-message-content-bg-assistant: color-mix(in oklab, var(--chat--color--secondary, #171b3d) 9%, #171b3d);
111
- --aparte-message-content-text-assistant: #eef0f6;
112
- --aparte-n8n-code-bg: rgba(255, 255, 255, 0.06);
113
- /* Read from the surfaces, so a page that sets them in dark sets the field and the footer too. */
114
- --aparte-n8n-input-bg: var(--aparte-surface-1);
115
- /* The page's header color, kept in dark: a brand bar does not turn navy at night. */
116
- --aparte-n8n-header-bg: var(--chat--header--background, #060716);
117
- --aparte-n8n-footer-bg: var(--aparte-bg);
118
- --aparte-n8n-footer-color: #eef0f6;
119
- }
120
-
121
- @media (prefers-color-scheme: dark) {
122
- .aparte-n8n:not([data-aparte-theme]) {
123
- color-scheme: dark;
124
- /* n8n's navy, tinted with the page's color when it set one (unset, the navy itself). */
125
- --aparte-bg: color-mix(in oklab, var(--chat--color--secondary, #0b0d24) 7%, #0b0d24);
126
- --aparte-surface-1: color-mix(in oklab, var(--chat--color--secondary, #151937) 9%, #151937);
127
- --aparte-surface-2: color-mix(in oklab, var(--chat--color--secondary, #1d2246) 10%, #1d2246);
128
- --aparte-text: #eef0f6;
129
- --aparte-text-muted: #a3a7c2;
130
- --aparte-neutral: #a3a7c2;
131
- --aparte-border: color-mix(in oklab, var(--chat--color--secondary, #262b52) 16%, #262b52);
132
- --aparte-message-content-bg-assistant: color-mix(in oklab, var(--chat--color--secondary, #171b3d) 9%, #171b3d);
133
- --aparte-message-content-text-assistant: #eef0f6;
134
- --aparte-n8n-code-bg: rgba(255, 255, 255, 0.06);
135
- /* Read from the surfaces, so a page that sets them in dark sets the field and the footer too. */
136
- --aparte-n8n-input-bg: var(--aparte-surface-1);
137
- /* The page's header color, kept in dark: a brand bar does not turn navy at night. */
138
- --aparte-n8n-header-bg: var(--chat--header--background, #060716);
139
- --aparte-n8n-footer-bg: var(--aparte-bg);
140
- --aparte-n8n-footer-color: #eef0f6;
141
- }
142
- }
143
-
144
- /* ── The window ─────────────────────────────────────────────────────────────────────── */
145
-
146
- .aparte-n8n__window {
147
- display: flex;
148
- flex-direction: column;
149
- min-block-size: 0;
150
- background: var(--aparte-bg);
151
- border: var(--chat--window--border, 1px solid var(--aparte-border));
152
- border-radius: var(--aparte-launcher-radius);
153
- overflow: hidden;
154
- }
155
-
156
- .aparte-n8n--fullscreen,
157
- .aparte-n8n--fullscreen > .aparte-n8n__window {
158
- block-size: 100%;
159
- inline-size: 100%;
160
- box-sizing: border-box;
161
- }
162
-
163
- .aparte-n8n--fullscreen > .aparte-n8n__window {
164
- border: 0;
165
- border-radius: 0;
166
- }
167
-
168
- .aparte-n8n__header {
169
- /* The focus ring in the header's own ink: core's would be lost on its navy. */
170
- --aparte-border-focus: var(--aparte-n8n-header-color);
171
- display: flex;
172
- align-items: flex-start;
173
- gap: var(--aparte-space-2, 0.5rem);
174
- padding: var(--chat--header--padding, var(--chat--spacing, 1rem));
175
- background: var(--aparte-n8n-header-bg);
176
- color: var(--aparte-n8n-header-color);
177
- border-block-start: var(--chat--header--border-top, none);
178
- border-block-end: var(--chat--header--border-bottom, none);
179
- flex: none;
180
- }
181
-
182
- .aparte-n8n__heading {
183
- flex: 1 1 auto;
184
- min-inline-size: 0;
185
- }
186
-
187
- .aparte-n8n__title {
188
- margin: 0;
189
- font-size: var(--chat--heading--font-size, 2em);
190
- font-weight: 700;
191
- line-height: 1.2;
192
- }
193
-
194
- .aparte-n8n__subtitle {
195
- margin: 0.5rem 0 0;
196
- font-size: var(--chat--subtitle--font-size, inherit);
197
- line-height: var(--chat--subtitle--line-height, 1.8);
198
- opacity: 0.9;
199
- }
200
-
201
- .aparte-n8n__close {
202
- --aparte-btn-intent: var(--aparte-n8n-header-color);
203
- --aparte-btn-intent-ink: var(--aparte-n8n-header-color);
204
- flex: none;
205
- }
206
-
207
- .aparte-n8n__close:hover {
208
- --aparte-btn-intent-ink: var(--chat--close--button--color-hover, var(--chat--color--primary, #e74266));
209
- }
210
-
211
- .aparte-n8n__chat {
212
- flex: 1 1 auto;
213
- min-block-size: 0;
214
- /* The Powered by line sits right under the composer, so the chat's own gap below it
215
- (aparté's 16px, for a chat that ends at the composer) shrinks to a breath: the
216
- composer comes down to the line. */
217
- --aparte-chat-bottom-gap: var(--aparte-space-3, 0.375rem);
218
- }
219
-
220
- .aparte-n8n__welcome {
221
- flex: 1 1 auto;
222
- display: grid;
223
- place-items: center;
224
- padding: var(--chat--spacing, 1rem);
225
- }
226
-
227
- /* "Powered by aparté": one small grey line under the input, not a band; "aparté" is the
228
- link, underlined so it reads as one. */
229
- .aparte-n8n__powered {
230
- margin: 0;
231
- flex: none;
232
- padding: 0 1rem 0.375rem;
233
- text-align: center;
234
- color: var(--aparte-text-muted);
235
- font-size: 0.6875rem;
236
- line-height: 1.4;
237
- }
238
-
239
- .aparte-n8n__powered a {
240
- color: inherit;
241
- font-weight: 600;
242
- text-decoration: underline;
243
- text-underline-offset: 2px;
244
- }
245
-
246
- .aparte-n8n__powered a:hover,
247
- .aparte-n8n__powered a:focus-visible {
248
- color: var(--aparte-text);
249
- }
250
-
251
- .aparte-n8n__footer {
252
- margin: 0;
253
- flex: none;
254
- padding: var(--chat--footer--padding, 0.5rem 1rem);
255
- background: var(--aparte-n8n-footer-bg);
256
- color: var(--aparte-n8n-footer-color);
257
- border-block-start: var(--chat--footer--border-top, 1px solid var(--chat--color-light-shade-100, #c2c5cc));
258
- font-size: var(--aparte-font-size-sm, 0.875rem);
259
- }
260
-
261
- /* ── The messages ───────────────────────────────────────────────────────────────────── */
262
-
263
- /* n8n's rhythm: bubbles a line apart, not turns a paragraph apart. On the message, where
264
- the narrow-container measures are declared (responsive.css), so this wins over them. */
265
- .aparte-n8n .aparte-message {
266
- --aparte-message-padding-block: var(--aparte-space-2);
267
- --aparte-message-gap: var(--aparte-space-4);
268
- }
269
-
270
- /* n8n's bubbles: as wide as their text, the corner on the speaker's side squared. */
271
- .aparte-n8n .aparte-message .aparte-message-content {
272
- font-size: var(--chat--message--font-size, 1rem);
273
- line-height: var(--chat--message-line-height, 1.5);
274
- }
275
-
276
- .aparte-n8n .aparte-message[data-role='assistant'] .aparte-message-content {
277
- width: fit-content;
278
- max-width: 100%;
279
- border-radius: var(--aparte-message-content-radius);
280
- border-end-start-radius: 0;
281
- /* Transparent, not none: under Windows' high contrast the edge is drawn, and the bubble keeps it. */
282
- border: var(--chat--message--bot--border, 1px solid transparent);
283
- }
284
-
285
- /* A turn that is only an error is the error card alone: n8n's white bubble around it drew
286
- two boxes, one inside the other. A turn with words before its error keeps its bubble. */
287
- .aparte-n8n .aparte-message[data-role='assistant'][data-error] .aparte-message-content:not(:has(.aparte-segment-text, .aparte-segment-code)) {
288
- background: none;
289
- padding: 0;
290
- border: 0;
291
- }
292
-
293
- .aparte-n8n .aparte-message[data-role='user'] .aparte-message-content {
294
- border-end-end-radius: 0;
295
- border: var(--chat--message--user--border, 1px solid transparent);
296
- }
297
-
298
- /* The person's messages on the far side, as in n8n's widget (and any messenger): their
299
- files, their words and their actions together. `end`, so a right-to-left page mirrors it. */
300
- .aparte-n8n .aparte-message[data-role='user'] .aparte-body {
301
- display: flex;
302
- flex-direction: column;
303
- align-items: end;
304
- }
305
-
306
- /* `createChat`'s first messages are the widget's greeting, not an answer: nothing to copy. */
307
- .aparte-n8n aparte-chat-bubble[message-id^='n8n-initial-'] .aparte-action-bar {
308
- display: none;
309
- }
310
-
311
- /* n8n names no one and shows no time. Hidden from the eye only: a screen reader still
312
- hears who is speaking, which n8n's widget never said. */
313
- .aparte-n8n .aparte-message > .aparte-body > .aparte-header {
314
- position: absolute;
315
- inline-size: 1px;
316
- block-size: 1px;
317
- overflow: hidden;
318
- clip-path: inset(50%);
319
- white-space: nowrap;
320
- }
321
-
322
- /* ── Files ──────────────────────────────────────────────────────────────────────────── */
323
-
324
- /* A file as n8n draws it: a chip with its name, waiting in the composer and sent in the
325
- conversation. Core's square tile shows the name on hover alone, so a visitor on a phone,
326
- or on the keyboard, never saw which invoice they were sending. The ✕ stays in sight. */
327
- .aparte-n8n .aparte-thumb {
328
- --aparte-thumbnail-size: auto;
329
- --aparte-thumbnail-radius: 0.25rem;
330
- --aparte-thumbnail-bg: var(--aparte-surface-1);
331
- --aparte-thumbnail-border: var(--aparte-border);
332
- --aparte-thumb-name-color: var(--aparte-text);
333
- --aparte-thumb-remove-bg: transparent;
334
- --aparte-thumb-remove-bg-hover: var(--aparte-bg);
335
- --aparte-thumb-remove-color: var(--aparte-text-muted);
336
- max-inline-size: 15rem;
337
- justify-content: flex-start;
338
- gap: 0.375rem;
339
- padding: 0.375rem 0.5rem;
340
- font-size: 0.75rem;
341
- }
342
-
343
- .aparte-n8n .aparte-thumb .aparte-thumbnail__image {
344
- inline-size: 1.5rem;
345
- block-size: 1.5rem;
346
- flex: none;
347
- border-radius: 0.125rem;
348
- }
349
-
350
- .aparte-n8n .aparte-thumb__name,
351
- .aparte-n8n .aparte-thumb__remove {
352
- position: static;
353
- opacity: 1;
354
- }
355
-
356
- .aparte-n8n .aparte-thumb__name {
357
- padding: 0;
358
- background: none;
359
- font-size: inherit;
360
- min-inline-size: 0;
361
- }
362
-
363
- .aparte-n8n .aparte-thumb__remove {
364
- flex: none;
365
- }
366
-
367
- /* ── The button in the corner ───────────────────────────────────────────────────────── */
368
-
369
- .aparte-n8n .aparte-launcher__button {
370
- --aparte-btn-size-lg: var(--chat--toggle--size, 64px);
371
- /* Half the button, as n8n draws it. */
372
- --aparte-btn-icon-size: calc(var(--chat--toggle--size, 64px) / 2);
373
- --aparte-primary: var(--aparte-n8n-toggle-bg);
374
- --aparte-primary-hover: var(--aparte-n8n-toggle-hover-bg);
375
- --aparte-on-primary: var(--aparte-n8n-toggle-color);
376
- /* Open, it stays n8n's color, as n8n's does, rather than the recipe's neutral. */
377
- --aparte-btn-bg-toggled: var(--aparte-n8n-toggle-bg);
378
- --aparte-btn-color-toggled: var(--aparte-n8n-toggle-color);
379
- inline-size: var(--chat--toggle--width, var(--chat--toggle--size, 64px));
380
- block-size: var(--chat--toggle--height, var(--chat--toggle--size, 64px));
381
- border-radius: var(--chat--toggle--border-radius, 50%);
382
- }
383
-
384
- /* The button floats over a page that is not ours: a ring in two tones, light then dark,
385
- that shows on any ground and on the button's own color. */
386
- .aparte-n8n .aparte-launcher__button:focus-visible {
387
- outline: 3px solid var(--aparte-n8n-header-bg);
388
- outline-offset: 2px;
389
- box-shadow: 0 0 0 2px #fff, var(--aparte-popover-shadow);
390
- }
391
-
392
- /* A short window — a phone held sideways, a page zoomed in: the header gives the room
393
- back to the conversation. */
394
- @media (max-height: 34rem) {
395
- .aparte-n8n__title {
396
- font-size: 1.25em;
397
- }
398
-
399
- .aparte-n8n__subtitle {
400
- display: none;
401
- }
402
- }
403
-
404
- /* n8n's `transparent` history message: its words without the bubble around them. */
405
- .aparte-n8n aparte-chat-bubble[data-n8n-transparent] .aparte-message-content {
406
- background: none;
407
- border-color: transparent;
408
- padding-inline: 0;
409
- }
1
+ /*
2
+ * The n8n theme: aparté's chat in the look of n8n's chat widget, on anything inside
3
+ * `.aparte-n8n` — the widget `createChat()` mounts, or a chat you compose yourself.
4
+ *
5
+ * It reads n8n's main `--chat--*` variables — the colors, the fonts, the radii, the window's
6
+ * size and its button — so a page that set them for n8n's widget keeps them. Their defaults
7
+ * are n8n's, but for one: the green behind white text is n8n's darkened just enough to read
8
+ * (#178272, 4.7:1, where n8n's #20b69e gives 2.55:1). The input's and buttons' own variables,
9
+ * and rules written against n8n's `.chat-*` classes, do not carry over.
10
+ *
11
+ * To restyle with aparté's variables instead: the palette (`--aparte-primary`, `--aparte-bg`,
12
+ * `--aparte-text`…) on `.aparte-n8n`; a message's own tokens (`--aparte-message-content-*`)
13
+ * on `.aparte-n8n aparte-chat`, where core derives them.
14
+ *
15
+ * Light by default like n8n's widget, whatever the visitor's system: a chat half in the
16
+ * page's colors is worse than one in its own. Dark is `colorScheme: 'dark'` (or
17
+ * `data-aparte-theme="dark"`), or the visitor's own with `colorScheme: 'auto'`.
18
+ *
19
+ * One color is enough: `--chat--color--secondary` alone also colors the button in the corner
20
+ * (n8n's `--primary`, when the page leaves it unset), every hover is derived from the color it
21
+ * darkens, and dark keeps the page's header and tints its surfaces with that color. Unset,
22
+ * each falls back to n8n's own.
23
+ */
24
+
25
+ .aparte-n8n {
26
+ color-scheme: light;
27
+ font-family: var(--aparte-font-family);
28
+ color: var(--aparte-text);
29
+
30
+ --aparte-font-family: var(--chat--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif);
31
+ --aparte-code-font-family: var(--chat--font-family--monospace, ui-monospace, Menlo, Consolas, 'DejaVu Sans Mono', monospace);
32
+
33
+ /* The palette: literal, on the root, inherited by everything inside. */
34
+ --aparte-bg: var(--chat--body--background, var(--chat--color-light, #f2f4f8));
35
+ --aparte-surface-1: var(--chat--color-white, #fff);
36
+ --aparte-surface-2: var(--chat--color-light-shade-50, #e6e9f1);
37
+ --aparte-text: var(--chat--color-dark, #101330);
38
+ --aparte-text-muted: #5b5f7a;
39
+ --aparte-neutral: #5b5f7a;
40
+ --aparte-border: var(--chat--color-light-shade-50, #e6e9f1);
41
+ --aparte-primary: var(--chat--color--secondary, #178272);
42
+ /* Derived, not n8n's fixed shade: a page that set its own color would hover back to n8n's green. */
43
+ --aparte-primary-hover: var(--chat--color-secondary-shade-50, color-mix(in oklab, var(--aparte-primary) 85%, #000));
44
+ --aparte-on-primary: var(--chat--color-white, #fff);
45
+ --aparte-message-content-text-user: var(--chat--message--user--color, var(--chat--color-white, #fff));
46
+ --aparte-message-content-bg-assistant: var(--chat--message--bot--background, var(--chat--color-white, #fff));
47
+ --aparte-message-content-text-assistant: var(--chat--message--bot--color, var(--chat--color-dark, #101330));
48
+ --aparte-message-content-padding-assistant: var(--chat--message--padding, var(--chat--spacing, 1rem));
49
+
50
+ /* What core derives on the chat's own anchors, kept here and handed down below. */
51
+ --aparte-n8n-accent: var(--chat--color--primary, var(--chat--color--secondary, #e74266));
52
+ --aparte-n8n-user-bg: var(--chat--message--user--background, var(--aparte-primary));
53
+ --aparte-n8n-radius: var(--chat--message--border-radius, var(--chat--border-radius, 0.25rem));
54
+ --aparte-n8n-code-bg: var(--chat--message--pre--background, rgba(0, 0, 0, 0.05));
55
+ --aparte-n8n-input-bg: var(--chat--input--background, var(--chat--color-white, #fff));
56
+ --aparte-n8n-message-padding: var(--chat--message--padding, var(--chat--spacing, 1rem));
57
+
58
+ /* The window and the button in the corner, read by the launcher, which is this element. */
59
+ --aparte-launcher-width: var(--chat--window--width, 400px);
60
+ --aparte-launcher-height: var(--chat--window--height, 600px);
61
+ --aparte-launcher-offset: var(--chat--window--bottom, var(--chat--spacing, 1rem));
62
+ --aparte-launcher-gap: var(--chat--window--margin-bottom, var(--chat--spacing, 1rem));
63
+ --aparte-launcher-radius: var(--chat--window--border-radius, var(--chat--border-radius, 0.25rem));
64
+
65
+ /* The header, the footer and the button, drawn by this theme. */
66
+ --aparte-n8n-header-bg: var(--chat--header--background, var(--chat--color-dark, #101330));
67
+ --aparte-n8n-header-color: var(--chat--header--color, var(--chat--color-light, #f2f4f8));
68
+ --aparte-n8n-footer-bg: var(--chat--footer--background, var(--chat--color-light, #f2f4f8));
69
+ --aparte-n8n-footer-color: var(--chat--footer--color, var(--chat--color-dark, #101330));
70
+ /* The page's one color when it set no --primary: a green chat behind a pink button reads as a bug. */
71
+ --aparte-n8n-toggle-bg: var(--chat--toggle--background, var(--chat--color--primary, var(--chat--color--secondary, #e74266)));
72
+ --aparte-n8n-toggle-hover-bg: var(--chat--toggle--hover--background, var(--chat--color--primary-shade-50, color-mix(in oklab, var(--aparte-n8n-toggle-bg) 88%, #000)));
73
+ --aparte-n8n-toggle-color: var(--chat--toggle--color, var(--chat--color-white, #fff));
74
+ --aparte-n8n-toggle-height: var(--chat--toggle--height, var(--chat--toggle--size, 64px));
75
+ }
76
+
77
+ /*
78
+ * On the chat's own anchors, where core derives these tokens from its own: as references to
79
+ * the root's, so the root's values — and a page's `--chat--*` — reach the messages.
80
+ */
81
+ .aparte-n8n :is(aparte-chat, [data-aparte-host]) {
82
+ --aparte-accent: var(--aparte-n8n-accent);
83
+ --aparte-message-content-bg-user: var(--aparte-n8n-user-bg);
84
+ --aparte-radius-bubble: var(--aparte-n8n-radius);
85
+ --aparte-message-content-radius: var(--aparte-n8n-radius);
86
+ --aparte-code-bg: var(--aparte-n8n-code-bg);
87
+ --aparte-prose-code-bg: var(--aparte-n8n-code-bg);
88
+ --aparte-input-bg: var(--aparte-n8n-input-bg);
89
+ --aparte-message-content-padding: var(--aparte-n8n-message-padding);
90
+ }
91
+
92
+ /* n8n pads the bot's message too, and core caps the message at its column's width without
93
+ counting padding: the message ran past the column and the bubble clipped its right edge —
94
+ unseen in wrapped text, plain on a card that fills the width. A card is 100% wide plus its
95
+ border, the same way. */
96
+ .aparte-n8n :is(.aparte-message-content, .aparte-rich-card) {
97
+ box-sizing: border-box;
98
+ }
99
+
100
+ /* Dark: n8n's own navy, which its widget never had. */
101
+ .aparte-n8n[data-aparte-theme='dark'] {
102
+ color-scheme: dark;
103
+ /* n8n's navy, tinted with the page's color when it set one (unset, the navy itself). */
104
+ --aparte-bg: color-mix(in oklab, var(--chat--color--secondary, #0b0d24) 7%, #0b0d24);
105
+ --aparte-surface-1: color-mix(in oklab, var(--chat--color--secondary, #151937) 9%, #151937);
106
+ --aparte-surface-2: color-mix(in oklab, var(--chat--color--secondary, #1d2246) 10%, #1d2246);
107
+ --aparte-text: #eef0f6;
108
+ --aparte-text-muted: #a3a7c2;
109
+ --aparte-neutral: #a3a7c2;
110
+ --aparte-border: color-mix(in oklab, var(--chat--color--secondary, #262b52) 16%, #262b52);
111
+ --aparte-message-content-bg-assistant: color-mix(in oklab, var(--chat--color--secondary, #171b3d) 9%, #171b3d);
112
+ --aparte-message-content-text-assistant: #eef0f6;
113
+ --aparte-n8n-code-bg: rgba(255, 255, 255, 0.06);
114
+ /* Read from the surfaces, so a page that sets them in dark sets the field and the footer too. */
115
+ --aparte-n8n-input-bg: var(--aparte-surface-1);
116
+ /* The page's header color, kept in dark: a brand bar does not turn navy at night. */
117
+ --aparte-n8n-header-bg: var(--chat--header--background, #060716);
118
+ --aparte-n8n-footer-bg: var(--aparte-bg);
119
+ --aparte-n8n-footer-color: #eef0f6;
120
+ }
121
+
122
+ @media (prefers-color-scheme: dark) {
123
+ .aparte-n8n:not([data-aparte-theme]) {
124
+ color-scheme: dark;
125
+ /* n8n's navy, tinted with the page's color when it set one (unset, the navy itself). */
126
+ --aparte-bg: color-mix(in oklab, var(--chat--color--secondary, #0b0d24) 7%, #0b0d24);
127
+ --aparte-surface-1: color-mix(in oklab, var(--chat--color--secondary, #151937) 9%, #151937);
128
+ --aparte-surface-2: color-mix(in oklab, var(--chat--color--secondary, #1d2246) 10%, #1d2246);
129
+ --aparte-text: #eef0f6;
130
+ --aparte-text-muted: #a3a7c2;
131
+ --aparte-neutral: #a3a7c2;
132
+ --aparte-border: color-mix(in oklab, var(--chat--color--secondary, #262b52) 16%, #262b52);
133
+ --aparte-message-content-bg-assistant: color-mix(in oklab, var(--chat--color--secondary, #171b3d) 9%, #171b3d);
134
+ --aparte-message-content-text-assistant: #eef0f6;
135
+ --aparte-n8n-code-bg: rgba(255, 255, 255, 0.06);
136
+ /* Read from the surfaces, so a page that sets them in dark sets the field and the footer too. */
137
+ --aparte-n8n-input-bg: var(--aparte-surface-1);
138
+ /* The page's header color, kept in dark: a brand bar does not turn navy at night. */
139
+ --aparte-n8n-header-bg: var(--chat--header--background, #060716);
140
+ --aparte-n8n-footer-bg: var(--aparte-bg);
141
+ --aparte-n8n-footer-color: #eef0f6;
142
+ }
143
+ }
144
+
145
+ /* ── The window ─────────────────────────────────────────────────────────────────────── */
146
+
147
+ .aparte-n8n__window {
148
+ display: flex;
149
+ flex-direction: column;
150
+ min-block-size: 0;
151
+ background: var(--aparte-bg);
152
+ border: var(--chat--window--border, 1px solid var(--aparte-border));
153
+ border-radius: var(--aparte-launcher-radius);
154
+ overflow: hidden;
155
+ }
156
+
157
+ .aparte-n8n--fullscreen,
158
+ .aparte-n8n--fullscreen > .aparte-n8n__window {
159
+ block-size: 100%;
160
+ inline-size: 100%;
161
+ box-sizing: border-box;
162
+ }
163
+
164
+ .aparte-n8n--fullscreen > .aparte-n8n__window {
165
+ border: 0;
166
+ border-radius: 0;
167
+ }
168
+
169
+ /* The header: the card's own in the page, the launcher's over the window — both in n8n's look,
170
+ which the launcher's (aparté's app header) takes from here. */
171
+ .aparte-n8n__header,
172
+ .aparte-n8n > .aparte-launcher__header {
173
+ /* The focus ring in the header's own ink: core's would be lost on its navy. */
174
+ --aparte-border-focus: var(--aparte-n8n-header-color);
175
+ display: flex;
176
+ align-items: flex-start;
177
+ gap: var(--aparte-space-2, 0.5rem);
178
+ padding: var(--chat--header--padding, var(--chat--spacing, 1rem));
179
+ background: var(--aparte-n8n-header-bg);
180
+ color: var(--aparte-n8n-header-color);
181
+ border-block-start: var(--chat--header--border-top, none);
182
+ border-block-end: var(--chat--header--border-bottom, none);
183
+ flex: none;
184
+ }
185
+
186
+ /* Over the window, the header is the window's top: its edge is the window's border, which
187
+ n8n's header sat inside. */
188
+ .aparte-n8n > .aparte-launcher__header {
189
+ border: var(--chat--window--border, 1px solid var(--aparte-border));
190
+ border-block-start: var(--chat--header--border-top, var(--chat--window--border, 1px solid var(--aparte-border)));
191
+ border-block-end: var(--chat--header--border-bottom, none);
192
+ }
193
+
194
+ /* Covering the window — a phone, or maximized — core's header keeps clear of the notch with
195
+ aparté's small padding, which left n8n's 2em title against the top edge: n8n's padding,
196
+ the notch added. And the page's bottom border, which core's sheet sets to 1px. */
197
+ .aparte-n8n[open]:is([data-sheet], [maximized]) > .aparte-launcher__header {
198
+ padding-block-start: calc(var(--chat--spacing, 1rem) + env(safe-area-inset-top, 0px));
199
+ border-block-end: var(--chat--header--border-bottom, none);
200
+ }
201
+
202
+ /* And the card under it starts where the header ends: no second edge, no corners. */
203
+ .aparte-n8n:has(> .aparte-launcher__header) > .aparte-n8n__window {
204
+ border-block-start: 0;
205
+ border-start-start-radius: 0;
206
+ border-start-end-radius: 0;
207
+ }
208
+
209
+ .aparte-n8n__heading {
210
+ flex: 1 1 auto;
211
+ min-inline-size: 0;
212
+ }
213
+
214
+ /* n8n's title wraps where aparté's header truncates it. */
215
+ .aparte-n8n__title,
216
+ .aparte-n8n .aparte-launcher__title {
217
+ margin: 0;
218
+ font-size: var(--chat--heading--font-size, 2em);
219
+ font-weight: 700;
220
+ line-height: 1.2;
221
+ white-space: normal;
222
+ }
223
+
224
+ .aparte-n8n__subtitle,
225
+ .aparte-n8n .aparte-launcher__subheading {
226
+ margin: 0.5rem 0 0;
227
+ font-size: var(--chat--subtitle--font-size, inherit);
228
+ line-height: var(--chat--subtitle--line-height, 1.8);
229
+ opacity: 0.9;
230
+ white-space: normal;
231
+ }
232
+
233
+ /* The header's buttons — maximize and the ✕ — in the header's ink, n8n's close color on hover. */
234
+ .aparte-n8n > .aparte-launcher__header .aparte-btn:hover {
235
+ --aparte-btn-intent-ink: var(--chat--close--button--color-hover, var(--chat--color--primary, #e74266));
236
+ }
237
+
238
+ /* n8n's widget draws no ✕ unless `showWindowCloseButton`: the button in the corner closes the
239
+ chat. While the chat fills a phone's screen or is maximized (a panel too), that button is
240
+ gone and the ✕ is the way out, so it stays. */
241
+ .aparte-n8n:not([data-n8n-close-button], [data-sheet], [maximized]) > .aparte-launcher__header .aparte-launcher__close {
242
+ display: none;
243
+ }
244
+
245
+ .aparte-n8n__chat {
246
+ flex: 1 1 auto;
247
+ min-block-size: 0;
248
+ /* The Powered by line sits right under the composer, so the chat's own gap below it
249
+ (aparté's 16px, for a chat that ends at the composer) shrinks to a breath: the
250
+ composer comes down to the line. */
251
+ --aparte-chat-bottom-gap: var(--aparte-space-3, 0.375rem);
252
+ }
253
+
254
+ .aparte-n8n__welcome {
255
+ flex: 1 1 auto;
256
+ display: grid;
257
+ place-items: center;
258
+ padding: var(--chat--spacing, 1rem);
259
+ }
260
+
261
+ /* "Powered by aparté": one small grey line under the input, not a band; "aparté" is the
262
+ link, underlined so it reads as one. */
263
+ .aparte-n8n__powered {
264
+ margin: 0;
265
+ flex: none;
266
+ padding: 0 1rem 0.375rem;
267
+ text-align: center;
268
+ color: var(--aparte-text-muted);
269
+ font-size: 0.6875rem;
270
+ line-height: 1.4;
271
+ }
272
+
273
+ .aparte-n8n__powered a {
274
+ color: inherit;
275
+ font-weight: 600;
276
+ text-decoration: underline;
277
+ text-underline-offset: 2px;
278
+ }
279
+
280
+ .aparte-n8n__powered a:hover,
281
+ .aparte-n8n__powered a:focus-visible {
282
+ color: var(--aparte-text);
283
+ }
284
+
285
+ .aparte-n8n__footer {
286
+ margin: 0;
287
+ flex: none;
288
+ padding: var(--chat--footer--padding, 0.5rem 1rem);
289
+ background: var(--aparte-n8n-footer-bg);
290
+ color: var(--aparte-n8n-footer-color);
291
+ border-block-start: var(--chat--footer--border-top, 1px solid var(--chat--color-light-shade-100, #c2c5cc));
292
+ font-size: var(--aparte-font-size-sm, 0.875rem);
293
+ }
294
+
295
+ /* ── The messages ───────────────────────────────────────────────────────────────────── */
296
+
297
+ /* n8n's rhythm: bubbles a line apart, not turns a paragraph apart. On the message, where
298
+ the narrow-container measures are declared (responsive.css), so this wins over them. */
299
+ .aparte-n8n .aparte-message {
300
+ --aparte-message-padding-block: var(--aparte-space-2);
301
+ --aparte-message-gap: var(--aparte-space-4);
302
+ }
303
+
304
+ /* n8n's bubbles: as wide as their text, the corner on the speaker's side squared. */
305
+ .aparte-n8n .aparte-message .aparte-message-content {
306
+ font-size: var(--chat--message--font-size, 1rem);
307
+ line-height: var(--chat--message-line-height, 1.5);
308
+ }
309
+
310
+ .aparte-n8n .aparte-message[data-role='assistant'] .aparte-message-content {
311
+ width: fit-content;
312
+ max-width: 100%;
313
+ border-radius: var(--aparte-message-content-radius);
314
+ border-end-start-radius: 0;
315
+ /* Transparent, not none: under Windows' high contrast the edge is drawn, and the bubble keeps it. */
316
+ border: var(--chat--message--bot--border, 1px solid transparent);
317
+ }
318
+
319
+ /* A turn that is only an error is the error card alone: n8n's white bubble around it drew
320
+ two boxes, one inside the other. A turn with words before its error keeps its bubble. */
321
+ .aparte-n8n .aparte-message[data-role='assistant'][data-error] .aparte-message-content:not(:has(.aparte-segment-text, .aparte-segment-code)) {
322
+ background: none;
323
+ padding: 0;
324
+ border: 0;
325
+ }
326
+
327
+ .aparte-n8n .aparte-message[data-role='user'] .aparte-message-content {
328
+ border-end-end-radius: 0;
329
+ border: var(--chat--message--user--border, 1px solid transparent);
330
+ }
331
+
332
+ /* The person's messages on the far side, as in n8n's widget (and any messenger): their
333
+ files, their words and their actions together. `end`, so a right-to-left page mirrors it. */
334
+ .aparte-n8n .aparte-message[data-role='user'] .aparte-body {
335
+ display: flex;
336
+ flex-direction: column;
337
+ align-items: end;
338
+ }
339
+
340
+ /* `createChat`'s first messages are the widget's greeting, not an answer: nothing to copy. */
341
+ .aparte-n8n aparte-chat-bubble[message-id^='n8n-initial-'] .aparte-action-bar {
342
+ display: none;
343
+ }
344
+
345
+ /* n8n names no one and shows no time. Hidden from the eye only: a screen reader still
346
+ hears who is speaking, which n8n's widget never said. */
347
+ .aparte-n8n .aparte-message > .aparte-body > .aparte-header {
348
+ position: absolute;
349
+ inline-size: 1px;
350
+ block-size: 1px;
351
+ overflow: hidden;
352
+ clip-path: inset(50%);
353
+ white-space: nowrap;
354
+ }
355
+
356
+ /* ── Files ──────────────────────────────────────────────────────────────────────────── */
357
+
358
+ /* A file as n8n draws it: a chip with its name, waiting in the composer and sent in the
359
+ conversation. Core's square tile shows the name on hover alone, so a visitor on a phone,
360
+ or on the keyboard, never saw which invoice they were sending. The ✕ stays in sight. */
361
+ .aparte-n8n .aparte-thumb {
362
+ --aparte-thumbnail-size: auto;
363
+ --aparte-thumbnail-radius: 0.25rem;
364
+ --aparte-thumbnail-bg: var(--aparte-surface-1);
365
+ --aparte-thumbnail-border: var(--aparte-border);
366
+ --aparte-thumb-name-color: var(--aparte-text);
367
+ --aparte-thumb-remove-bg: transparent;
368
+ --aparte-thumb-remove-bg-hover: var(--aparte-bg);
369
+ --aparte-thumb-remove-color: var(--aparte-text-muted);
370
+ max-inline-size: 15rem;
371
+ justify-content: flex-start;
372
+ gap: 0.375rem;
373
+ padding: 0.375rem 0.5rem;
374
+ font-size: 0.75rem;
375
+ }
376
+
377
+ .aparte-n8n .aparte-thumb .aparte-thumbnail__image {
378
+ inline-size: 1.5rem;
379
+ block-size: 1.5rem;
380
+ flex: none;
381
+ border-radius: 0.125rem;
382
+ }
383
+
384
+ .aparte-n8n .aparte-thumb__name,
385
+ .aparte-n8n .aparte-thumb__remove {
386
+ position: static;
387
+ opacity: 1;
388
+ }
389
+
390
+ .aparte-n8n .aparte-thumb__name {
391
+ padding: 0;
392
+ background: none;
393
+ font-size: inherit;
394
+ min-inline-size: 0;
395
+ }
396
+
397
+ .aparte-n8n .aparte-thumb__remove {
398
+ flex: none;
399
+ }
400
+
401
+ /* ── The button in the corner ───────────────────────────────────────────────────────── */
402
+
403
+ .aparte-n8n .aparte-launcher__button {
404
+ --aparte-btn-size-lg: var(--chat--toggle--size, 64px);
405
+ /* Half the button, as n8n draws it. */
406
+ --aparte-btn-icon-size: calc(var(--chat--toggle--size, 64px) / 2);
407
+ --aparte-primary: var(--aparte-n8n-toggle-bg);
408
+ --aparte-primary-hover: var(--aparte-n8n-toggle-hover-bg);
409
+ --aparte-on-primary: var(--aparte-n8n-toggle-color);
410
+ /* Open, it stays n8n's color, as n8n's does, rather than the recipe's neutral. */
411
+ --aparte-btn-bg-toggled: var(--aparte-n8n-toggle-bg);
412
+ --aparte-btn-color-toggled: var(--aparte-n8n-toggle-color);
413
+ inline-size: var(--chat--toggle--width, var(--chat--toggle--size, 64px));
414
+ block-size: var(--aparte-n8n-toggle-height);
415
+ border-radius: var(--chat--toggle--border-radius, 50%);
416
+ }
417
+
418
+ /* Under its header the launcher holds the window, the gap and the button, and draws the
419
+ window's shadow above the gap. Core counts the button by `--aparte-btn-size-lg`, aparté's
420
+ large button; n8n's is larger, and is declared on the button alone, since the chat's own
421
+ large buttons (the scroll to the end) keep aparté's size. So the count is n8n's here:
422
+ without it the window came out 28px short of `--chat--window--height`. */
423
+ .aparte-n8n[open]:not([data-sheet], [maximized]):has(> .aparte-launcher__header) {
424
+ block-size: min(
425
+ calc(var(--aparte-launcher-height) + var(--aparte-launcher-gap) + var(--aparte-n8n-toggle-height)),
426
+ calc(100dvh - 2 * var(--aparte-launcher-offset))
427
+ );
428
+ }
429
+
430
+ .aparte-n8n[open]:not([data-sheet], [maximized]):has(> .aparte-launcher__header)::before {
431
+ inset-block-end: calc(var(--aparte-launcher-gap) + var(--aparte-n8n-toggle-height));
432
+ }
433
+
434
+ /* The button floats over a page that is not ours: a ring in two tones, light then dark,
435
+ that shows on any ground and on the button's own color. */
436
+ .aparte-n8n .aparte-launcher__button:focus-visible {
437
+ outline: 3px solid var(--aparte-n8n-header-bg);
438
+ outline-offset: 2px;
439
+ box-shadow: 0 0 0 2px #fff, var(--aparte-popover-shadow);
440
+ }
441
+
442
+ /* A short window — a phone held sideways, a page zoomed in: the header gives the room
443
+ back to the conversation. */
444
+ @media (max-height: 34rem) {
445
+ .aparte-n8n__title,
446
+ .aparte-n8n .aparte-launcher__title {
447
+ font-size: 1.25em;
448
+ }
449
+
450
+ .aparte-n8n__subtitle,
451
+ .aparte-n8n .aparte-launcher__subheading {
452
+ display: none;
453
+ }
454
+ }
455
+
456
+ /* n8n's `transparent` history message: its words without the bubble around them. */
457
+ .aparte-n8n aparte-chat-bubble[data-n8n-transparent] .aparte-message-content {
458
+ background: none;
459
+ border-color: transparent;
460
+ padding-inline: 0;
461
+ }