luzia-widget 0.1.2 → 0.1.4
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.
- package/README.md +1 -1
- package/dist/element.d.ts +30 -2
- package/dist/element.js +213 -119
- package/dist/element.js.map +1 -1
- package/dist/links.d.ts +9 -0
- package/dist/links.js +85 -0
- package/dist/links.js.map +1 -0
- package/dist/luzia-widget.js +455 -150
- package/dist/styles.d.ts +4 -4
- package/dist/styles.js +428 -141
- package/dist/styles.js.map +1 -1
- package/package.json +1 -1
package/dist/styles.d.ts
CHANGED
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
* override on the element (`luzia-widget { --luzia-accent: #e11d48; }`); an
|
|
4
4
|
* Owner's value wins over both the light and the dark palette.
|
|
5
5
|
*
|
|
6
|
-
* - `--luzia-accent` / `--luzia-accent-contrast`: bubble,
|
|
6
|
+
* - `--luzia-accent` / `--luzia-accent-contrast`: bubble, the light behind luzIA, Visitor messages, buttons, and text on them
|
|
7
7
|
* - `--luzia-surface` / `--luzia-text`: chat background and text
|
|
8
8
|
* - `--luzia-muted`: Agent messages, greeting and suggested questions
|
|
9
9
|
* - `--luzia-border`: input and inline-panel borders
|
|
10
10
|
* - `--luzia-font`: font family
|
|
11
11
|
* - `--luzia-inline-height`: height of the chat in inline mode
|
|
12
|
-
* - `--luzia-
|
|
13
|
-
* - `--luzia-
|
|
12
|
+
* - `--luzia-avatar-size`: height of luzIA's picture at the top of the chat (default: 6rem to 11rem, by screen height)
|
|
13
|
+
* - `--luzia-peek-size`: height of the hello animation when luzIA peeks out of the closed launcher (default: 8.5rem)
|
|
14
14
|
*
|
|
15
15
|
* Every control is at least 44px square (a comfortable tap target) and shows
|
|
16
16
|
* a focus ring for keyboard users. Below 480px wide the bubble's chat fills
|
|
17
17
|
* the screen; the inline chat stays in the page at full width.
|
|
18
18
|
*/
|
|
19
|
-
export declare const styles = "\n :host {\n --luzia-accent: #4f46e5;\n --luzia-accent-contrast: #ffffff;\n --luzia-surface: #ffffff;\n --luzia-text: #18181b;\n --luzia-muted: #f4f4f5;\n --luzia-font: system-ui, -apple-system, 'Segoe UI', sans-serif;\n --luzia-border: #d4d4d8;\n --luzia-inline-height: 38rem;\n position: fixed;\n right: 1.25rem;\n bottom: 1.25rem;\n z-index: 2147483000;\n font-family: var(--luzia-font);\n color: var(--luzia-text);\n }\n :host([theme='dark']) {\n --luzia-surface: #18181b;\n --luzia-text: #f4f4f5;\n --luzia-muted: #27272a;\n --luzia-border: #3f3f46;\n }\n @media (prefers-color-scheme: dark) {\n :host([theme='auto']) {\n --luzia-surface: #18181b;\n --luzia-text: #f4f4f5;\n --luzia-muted: #27272a;\n --luzia-border: #3f3f46;\n }\n }\n [hidden] { display: none !important; }\n button { min-width: 44px; min-height: 44px; }\n button:focus-visible,\n textarea:focus-visible {\n outline: 2px solid var(--luzia-accent);\n outline-offset: 2px;\n }\n /* The header is accent-coloured, so its focus ring takes the text colour. */\n .header button:focus-visible { outline-color: currentColor; outline-offset: -4px; }\n /* Read by screen readers only: each finished reply (see the element's View). */\n .announcer {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n }\n .bubble {\n display: grid;\n place-items: center;\n width: 3.5rem;\n height: 3.5rem;\n margin-left: auto;\n border: none;\n border-radius: 50%;\n background: var(--luzia-accent);\n color: var(--luzia-accent-contrast);\n font: 600 0.8rem var(--luzia-font);\n box-shadow: 0 6px 20px rgb(0 0 0 / 0.2);\n cursor: pointer;\n }\n .panel {\n display: flex;\n flex-direction: column;\n width: min(24rem, calc(100vw - 2.5rem));\n height: min(40rem, calc(100vh - 7rem));\n margin-bottom: 0.75rem;\n background: var(--luzia-surface);\n border-radius: 1rem;\n box-shadow: 0 12px 40px rgb(0 0 0 / 0.2);\n overflow: hidden;\n }\n :host([mode='inline']) {\n position: static;\n display: block;\n z-index: auto;\n }\n :host([mode='inline']) .panel {\n position: static;\n width: 100%;\n height: var(--luzia-inline-height);\n margin: 0;\n border: 1px solid var(--luzia-border);\n box-shadow: none;\n }\n .header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.25rem 0.5rem 0.25rem 1rem;\n background: var(--luzia-accent);\n color: var(--luzia-accent-contrast);\n }\n /* Like a video call: luzIA's whole picture large and centred at the top, the conversation below it. */\n .stage {\n flex: none;\n display: flex;\n justify-content: flex-start;\n gap: 0.75rem;\n padding: 0.75rem 1rem 0;\n border-bottom: 1px solid var(--luzia-border);\n }\n /* The picture is shown whole, in its own shape (a cut-out stands on the divider line). */\n .avatar {\n display: block;\n height: var(--luzia-avatar-size, clamp(7rem, 30vh, 13rem));\n }\n .avatar img,\n .avatar svg {\n display: block;\n height: 100%;\n width: auto;\n max-width: 100%;\n object-fit: contain;\n transition: filter 0.2s ease;\n }\n .avatar svg { aspect-ratio: 1; margin-bottom: 0.75rem; height: calc(100% - 0.75rem); }\n /* luzIA stays on the left; her speech bubble appears on the right without moving her. */\n .speech {\n position: relative;\n flex: 1;\n align-self: flex-start;\n min-width: 0;\n margin: 0.75rem 0 0;\n padding: 0.55rem 0.75rem;\n border: 1px solid var(--luzia-border);\n border-radius: 0.9rem;\n background: var(--luzia-surface);\n color: var(--luzia-text);\n box-shadow: 0 6px 18px rgb(0 0 0 / 0.18);\n font-size: 0.875rem;\n line-height: 1.4;\n opacity: 1;\n transition: opacity 0.4s ease;\n }\n .speech-text {\n display: block;\n max-height: calc(var(--luzia-avatar-size, clamp(7rem, 30vh, 13rem)) - 2.75rem);\n /* Long replies scroll inside the bubble, so their beginning can be read. */\n overflow-y: auto;\n overscroll-behavior: contain;\n scrollbar-width: thin;\n padding-inline-end: 0.25rem;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n }\n /* The tail points back at luzIA's mouth (tune its height with --luzia-speech-tail-top). */\n .speech::before,\n .speech::after {\n content: '';\n position: absolute;\n border-block-style: solid;\n border-block-color: transparent;\n border-inline-end-style: solid;\n }\n .speech::before {\n top: var(--luzia-speech-tail-top, 1.6rem);\n left: -0.6rem;\n border-block-width: 0.45rem;\n border-inline-end-width: 0.6rem;\n border-inline-end-color: var(--luzia-border);\n }\n .speech::after {\n top: calc(var(--luzia-speech-tail-top, 1.6rem) + 1px);\n left: calc(-0.6rem + 1.5px);\n border-block-width: calc(0.45rem - 1px);\n border-inline-end-width: 0.6rem;\n border-inline-end-color: var(--luzia-surface);\n }\n .speech.leaving { opacity: 0; }\n @media (prefers-reduced-motion: reduce) {\n .speech { transition: none; }\n }\n /* While a reply streams in, a soft glow follows the picture's outline. */\n .stage[data-speaking] .avatar img,\n .stage[data-speaking] .avatar svg {\n filter: drop-shadow(0 0 6px var(--luzia-accent));\n animation: luzia-speaking 1.4s ease-in-out infinite;\n }\n @keyframes luzia-speaking {\n 50% { filter: drop-shadow(0 0 14px var(--luzia-accent)); }\n }\n @media (prefers-reduced-motion: reduce) {\n .stage[data-speaking] .avatar img,\n .stage[data-speaking] .avatar svg { animation: none; }\n }\n .title { margin: 0; font-size: 1rem; }\n .new-conversation {\n margin-inline: auto 0.5rem;\n padding: 0.25rem 0.5rem;\n border: 1px solid currentColor;\n border-radius: 0.375rem;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 0.8rem;\n cursor: pointer;\n }\n .close {\n border: none;\n background: transparent;\n color: inherit;\n font-size: 1.4rem;\n line-height: 1;\n cursor: pointer;\n }\n .body {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n padding: 1rem;\n overflow-y: auto;\n }\n .greeting {\n align-self: flex-start;\n max-width: 85%;\n margin: 0;\n padding: 0.5rem 0.75rem;\n border-radius: 0.75rem;\n background: var(--luzia-muted);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n line-height: 1.4;\n }\n .messages {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n }\n .message {\n max-width: 85%;\n padding: 0.5rem 0.75rem;\n border-radius: 0.75rem;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n line-height: 1.4;\n }\n .message[data-role='user'] {\n align-self: flex-end;\n background: var(--luzia-accent);\n color: var(--luzia-accent-contrast);\n }\n .message[data-role='assistant'] {\n align-self: flex-start;\n background: var(--luzia-muted);\n }\n .suggestions {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: 0.5rem;\n margin: auto 0 0;\n padding: 0;\n list-style: none;\n }\n .suggestion {\n padding: 0.4rem 0.75rem;\n border: 1px solid var(--luzia-accent);\n border-radius: 999px;\n background: var(--luzia-surface);\n color: var(--luzia-text);\n font: 0.875rem var(--luzia-font);\n text-align: left;\n cursor: pointer;\n }\n .suggestion:hover { background: var(--luzia-muted); }\n .alert {\n margin: 0 1rem 0.5rem;\n font-size: 0.875rem;\n color: #b91c1c;\n }\n .alert a {\n color: inherit;\n }\n .composer {\n display: flex;\n gap: 0.5rem;\n padding: 0.75rem;\n border-top: 1px solid var(--luzia-muted);\n }\n .composer textarea {\n flex: 1;\n resize: none;\n padding: 0.5rem;\n border: 1px solid var(--luzia-border);\n border-radius: 0.5rem;\n background: var(--luzia-surface);\n color: var(--luzia-text);\n font: inherit;\n }\n .composer button {\n padding: 0 1rem;\n border: none;\n border-radius: 0.5rem;\n background: var(--luzia-accent);\n color: var(--luzia-accent-contrast);\n font: 600 0.875rem var(--luzia-font);\n cursor: pointer;\n }\n .composer button:disabled { opacity: 0.5; cursor: default; }\n @media (max-width: 480px) {\n /* The whole visible screen: above the on-screen keyboard when it is open (set by the element from visualViewport). */\n .panel {\n position: fixed;\n top: var(--luzia-viewport-top, 0px);\n left: 0;\n width: 100vw;\n height: var(--luzia-viewport-height, 100vh);\n margin: 0;\n border-radius: 0;\n }\n @supports (height: 100dvh) {\n .panel { height: var(--luzia-viewport-height, 100dvh); }\n }\n /* With the keyboard open there is little room: a smaller picture keeps the speech bubble and the last messages in view. */\n :host([data-keyboard]) .avatar { height: min(var(--luzia-avatar-size, 6rem), 6rem); }\n :host([data-keyboard]) .speech-text { max-height: 4.5rem; }\n /* Inline, the chat stays in the page but never taller than the screen. */\n :host([mode='inline']) .panel { height: min(var(--luzia-inline-height), 85vh); }\n .composer { padding-bottom: max(0.75rem, env(safe-area-inset-bottom)); }\n /* Below 16px, mobile browsers zoom the page when the text box gets focus. */\n .composer textarea { font-size: 16px; }\n }\n";
|
|
19
|
+
export declare const styles = "\n :host {\n --luzia-accent: #4f46e5;\n --luzia-accent-contrast: #ffffff;\n --luzia-surface: #ffffff;\n --luzia-text: #18181b;\n --luzia-muted: #f4f4f5;\n --luzia-font: system-ui, -apple-system, 'Segoe UI', sans-serif;\n --luzia-border: #d4d4d8;\n --luzia-inline-height: 38rem;\n --luzia-ease-out: cubic-bezier(0.23, 1, 0.32, 1);\n /* How strongly the accent lights the top of the chat, behind luzIA. */\n --luzia-glow-strength: 22%;\n position: fixed;\n right: 1.25rem;\n bottom: 1.25rem;\n z-index: 2147483000;\n font-family: var(--luzia-font);\n color: var(--luzia-text);\n }\n :host([theme='dark']) {\n --luzia-glow-strength: 30%;\n --luzia-surface: #18181b;\n --luzia-text: #f4f4f5;\n --luzia-muted: #27272a;\n --luzia-border: #3f3f46;\n }\n @media (prefers-color-scheme: dark) {\n :host([theme='auto']) {\n --luzia-glow-strength: 30%;\n --luzia-surface: #18181b;\n --luzia-text: #f4f4f5;\n --luzia-muted: #27272a;\n --luzia-border: #3f3f46;\n }\n }\n [hidden] { display: none !important; }\n button { min-width: 44px; min-height: 44px; }\n button:focus-visible,\n textarea:focus-visible {\n outline: 2px solid var(--luzia-accent);\n outline-offset: 2px;\n }\n /* The message box shows focus on its whole field (see .composer:focus-within). */\n .composer textarea:focus-visible { outline: none; }\n ::selection { background: color-mix(in srgb, var(--luzia-accent) 28%, transparent); }\n .message[data-role='user']::selection { background: color-mix(in srgb, var(--luzia-accent-contrast) 35%, transparent); }\n /* Read by screen readers only: each finished reply (see the element's View). */\n .announcer {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n }\n /*\n * The launcher: a pill with luzIA's icon and an invitation to ask. With the\n * chat open it folds into just the icon: the text fades and blurs out first,\n * then the pill narrows (unfolding, the pill widens first, then the text comes in).\n */\n .bubble {\n display: flex;\n align-items: center;\n height: 3.25rem;\n margin-left: auto;\n padding: 0 0.45rem;\n border: none;\n border-radius: 999px;\n background: var(--luzia-accent);\n color: var(--luzia-accent-contrast);\n font: 600 0.95rem var(--luzia-font);\n box-shadow: 0 6px 20px rgb(0 0 0 / 0.2);\n cursor: pointer;\n transition: transform 160ms ease-out, box-shadow 160ms ease-out;\n position: relative;\n }\n /*\n * With the Owner's hello animation, luzIA peeks out of the closed launcher\n * now and then, above its text: she rises from its top edge (clipped there,\n * as if from behind it), says hello, and ducks back down.\n */\n .peek {\n position: absolute;\n left: calc(50% + 1.15rem);\n bottom: calc(100% - 1px);\n width: 10.5rem;\n height: var(--luzia-peek-size, 8.5rem);\n transform: translateX(-50%);\n clip-path: inset(-3rem -3rem 0 -3rem);\n pointer-events: none;\n }\n .peek-image {\n display: block;\n height: 100%;\n width: 100%;\n object-fit: contain;\n object-position: 50% 100%;\n transform: translateY(105%);\n transform-origin: 50% 100%;\n filter: drop-shadow(0 4px 10px rgb(0 0 0 / 0.18));\n }\n /* The animation says hello; she only rises and ducks: half a second up, gently settling;\n half a second down, easing in and out (no sudden drop). */\n .bubble[data-peeking] .peek-image { animation: luzia-peek-rise 4s both; }\n @keyframes luzia-peek-rise {\n 0% { transform: translateY(105%); animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }\n 12.5%, 87.5% { transform: translateY(0); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }\n 100% { transform: translateY(105%); }\n }\n @media (hover: hover) and (pointer: fine) {\n .bubble:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgb(0 0 0 / 0.25); }\n }\n .bubble:active { transform: scale(0.97); }\n .bubble-icon { display: block; width: 2.35rem; height: 2.35rem; flex: none; }\n .bubble-icon svg { display: block; }\n /* The star turns a little as the pill folds and unfolds. */\n .bubble-icon path {\n transform-box: fill-box;\n transform-origin: center;\n transition: transform 400ms var(--luzia-ease-out);\n }\n .bubble[aria-expanded='true'] .bubble-icon path { transform: rotate(90deg); }\n .bubble-label {\n display: block;\n overflow: hidden;\n max-width: 14rem;\n transition: max-width 320ms var(--luzia-ease-out);\n }\n .bubble-text {\n display: block;\n padding: 0 0.95rem 0 0.6rem;\n white-space: nowrap;\n transition: opacity 200ms ease 90ms, filter 200ms ease 90ms, transform 200ms ease-out 90ms;\n }\n .bubble[aria-expanded='true'] .bubble-label {\n max-width: 0;\n transition-delay: 60ms;\n }\n .bubble[aria-expanded='true'] .bubble-text {\n opacity: 0;\n filter: blur(3px);\n transform: translateX(-0.4rem);\n transition-duration: 140ms;\n transition-delay: 0ms;\n }\n /* Less motion: the text still fades, but nothing moves or turns (and luzIA doesn't peek). */\n @media (prefers-reduced-motion: reduce) {\n .peek { display: none; }\n .bubble, .bubble-label, .bubble-icon path { transition: none; }\n .bubble:hover, .bubble:active, .bubble-text, .bubble[aria-expanded='true'] .bubble-text { transform: none; }\n .bubble-text, .bubble[aria-expanded='true'] .bubble-text { filter: none; transition: opacity 150ms ease; }\n }\n .panel {\n display: flex;\n flex-direction: column;\n width: min(24rem, calc(100vw - 2.5rem));\n height: min(40rem, calc(100vh - 7rem));\n margin-bottom: 0.75rem;\n background: var(--luzia-surface);\n /* luzIA's light (.stage::before) sits behind the header and stage, above this background. */\n isolation: isolate;\n border: 1px solid color-mix(in srgb, var(--luzia-border) 70%, transparent);\n border-radius: 1.25rem;\n box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 24px 48px -12px rgb(0 0 0 / 0.3);\n overflow: hidden;\n }\n /* Opening grows the chat out of the launcher below it; closing is instant. */\n :host(:not([mode='inline'])) .panel {\n transform-origin: bottom right;\n transition: opacity 200ms ease-out, transform 240ms var(--luzia-ease-out);\n @starting-style {\n opacity: 0;\n transform: translateY(8px) scale(0.97);\n }\n }\n @media (prefers-reduced-motion: reduce) {\n :host(:not([mode='inline'])) .panel {\n transition: opacity 150ms ease;\n @starting-style { transform: none; }\n }\n }\n :host([mode='inline']) {\n position: static;\n display: block;\n z-index: auto;\n }\n :host([mode='inline']) .panel {\n position: static;\n width: 100%;\n height: var(--luzia-inline-height);\n margin: 0;\n box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);\n }\n /* Quiet: luzIA's mark and name, then two icon buttons. The light below carries the colour. */\n .header {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.375rem 0.375rem 0 0.875rem;\n color: var(--luzia-text);\n }\n .header-icon { display: block; width: 1.5rem; height: 1.5rem; flex: none; }\n .header-icon svg { display: block; }\n .header-icon circle { fill: var(--luzia-accent); }\n .header-icon path { fill: var(--luzia-accent-contrast); }\n /* Like a video call: luzIA's whole picture at the top, her state beside it like a name tag. */\n .stage {\n --luzia-avatar-height: var(--luzia-avatar-size, clamp(6rem, 26vh, 11rem));\n position: relative;\n flex: none;\n display: flex;\n justify-content: center;\n align-items: flex-end;\n padding: 0.25rem 1rem 0;\n border-bottom: 1px solid color-mix(in srgb, var(--luzia-border) 75%, transparent);\n }\n /* She stands in a soft light of the accent colour. */\n .stage::before {\n content: '';\n position: absolute;\n z-index: -1;\n left: 50%;\n bottom: -3rem;\n width: 22rem;\n height: 15rem;\n transform: translateX(-50%);\n background: radial-gradient(closest-side, color-mix(in srgb, var(--luzia-accent) var(--luzia-glow-strength), transparent), transparent);\n pointer-events: none;\n }\n /* The picture is shown whole, in its own shape (a cut-out stands on the divider line). */\n .avatar {\n display: grid;\n grid-template-rows: 100%;\n flex: none;\n height: var(--luzia-avatar-height);\n }\n /* The still picture and its talking version share one place; only one shows at a time. */\n .avatar > * { grid-area: 1 / 1; }\n .avatar .speaking { opacity: 0; }\n .stage[data-talking] .avatar .speaking { opacity: 1; }\n .stage[data-talking] .avatar:has(.speaking) .still { opacity: 0; }\n .avatar img,\n .avatar svg {\n display: block;\n height: 100%;\n width: auto;\n max-width: 100%;\n object-fit: contain;\n transform-origin: 50% 100%;\n transition: filter 0.2s ease, transform 360ms cubic-bezier(0.23, 1, 0.32, 1);\n }\n .avatar svg { aspect-ratio: 1; margin-bottom: 0.5rem; height: calc(100% - 0.5rem); }\n /* luzIA's own icon: the star on a disc lit by the accent, not a flat white circle. */\n .avatar svg circle { fill: color-mix(in srgb, var(--luzia-accent) 12%, var(--luzia-surface)); }\n /* While the Visitor types, she leans in a little, as someone listening does. */\n .stage[data-presence='listening'] .avatar img,\n .stage[data-presence='listening'] .avatar svg { transform: scale(1.025) rotate(-1deg); }\n /* Speaking (the greeting, or a reply as it streams in): a soft glow breathes along her outline. */\n .stage[data-speaking] .avatar img,\n .stage[data-speaking] .avatar svg,\n .stage[data-greeting] .avatar img,\n .stage[data-greeting] .avatar svg {\n filter: drop-shadow(0 0 6px var(--luzia-accent));\n animation: luzia-speaking 1.4s ease-in-out infinite;\n }\n @keyframes luzia-speaking {\n 50% { filter: drop-shadow(0 0 14px var(--luzia-accent)); }\n }\n /* Her state, like the name tag in a video call: a dot that is lit while she is busy. */\n /* Centred under her, on the divider line, like the name tag in a video call. */\n .presence {\n position: absolute;\n z-index: 1;\n left: 50%;\n bottom: 0;\n transform: translate(-50%, 50%);\n display: flex;\n align-items: center;\n gap: 0.45rem;\n max-width: calc(100% - 2rem);\n padding: 0.3rem 0.7rem 0.3rem 0.55rem;\n border-radius: 999px;\n background: var(--luzia-surface);\n box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 0 0 1px color-mix(in srgb, var(--luzia-border) 60%, transparent);\n color: color-mix(in srgb, var(--luzia-text) 72%, transparent);\n font-size: 0.8125rem;\n font-weight: 500;\n line-height: 1.2;\n white-space: nowrap;\n }\n .presence-dot {\n flex: none;\n width: 0.5rem;\n height: 0.5rem;\n border-radius: 50%;\n background: #16a34a;\n box-shadow: 0 0 0 3px color-mix(in srgb, #16a34a 18%, transparent);\n transition: background-color 200ms ease, box-shadow 200ms ease;\n }\n .stage:not([data-presence='idle']) .presence-dot {\n background: var(--luzia-accent);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--luzia-accent) 22%, transparent);\n animation: luzia-pulse 1.2s ease-in-out infinite;\n }\n .stage:not([data-presence='idle']) .presence-text { color: var(--luzia-text); }\n @keyframes luzia-pulse {\n 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--luzia-accent) 8%, transparent); }\n }\n @media (prefers-reduced-motion: reduce) {\n .avatar img, .avatar svg { transition: filter 0.2s ease; transform: none !important; }\n .stage[data-speaking] .avatar img,\n .stage[data-speaking] .avatar svg,\n .stage[data-greeting] .avatar img,\n .stage[data-greeting] .avatar svg,\n .stage:not([data-presence='idle']) .presence-dot { animation: none; }\n /* A moving mouth is motion too: the still picture stays. */\n .stage[data-talking] .avatar .speaking { opacity: 0; }\n .stage[data-talking] .avatar:has(.speaking) .still { opacity: 1; }\n }\n .title { margin: 0; font-size: 0.95rem; font-weight: 650; letter-spacing: -0.01em; }\n .new-conversation,\n .close {\n color: color-mix(in srgb, var(--luzia-text) 65%, transparent);\n }\n /* Restart: a circular arrow, named by a tooltip on hover or keyboard focus. */\n .new-conversation {\n position: relative;\n display: grid;\n place-items: center;\n margin-inline: auto 0.25rem;\n padding: 0;\n border: none;\n border-radius: 0.75rem;\n background: transparent;\n cursor: pointer;\n transition: background-color 150ms ease, color 150ms ease, transform 160ms ease-out;\n }\n .new-conversation svg { display: block; transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1); }\n .new-conversation:active { transform: scale(0.94); }\n .tooltip {\n position: absolute;\n top: calc(100% + 0.4rem);\n right: 0;\n z-index: 1;\n padding: 0.35rem 0.6rem;\n border-radius: 0.375rem;\n background: var(--luzia-text);\n color: var(--luzia-surface);\n font: 500 0.75rem var(--luzia-font);\n white-space: nowrap;\n box-shadow: 0 4px 12px rgb(0 0 0 / 0.18);\n pointer-events: none;\n opacity: 0;\n transform: translateY(-2px) scale(0.97);\n transform-origin: top right;\n /* Leaving: quick, with no wait. */\n transition: opacity 100ms ease-out, transform 100ms ease-out;\n }\n /* Appearing: after a short pause, so passing over the button does not flash it. */\n .new-conversation:focus-visible .tooltip {\n opacity: 1;\n transform: none;\n transition: opacity 125ms ease-out, transform 125ms ease-out;\n }\n @media (hover: hover) and (pointer: fine) {\n .new-conversation:hover,\n .close:hover { background-color: color-mix(in srgb, var(--luzia-text) 8%, transparent); color: var(--luzia-text); }\n /* The arrow winds back a little, hinting at what it does. */\n .new-conversation:hover svg { transform: rotate(-45deg); }\n .new-conversation:hover .tooltip {\n opacity: 1;\n transform: none;\n transition: opacity 125ms ease-out 350ms, transform 125ms ease-out 350ms;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .tooltip, .new-conversation:active, .new-conversation svg { transform: none !important; }\n }\n .close {\n display: grid;\n place-items: center;\n padding: 0;\n border: none;\n border-radius: 0.75rem;\n background: transparent;\n cursor: pointer;\n transition: background-color 150ms ease, color 150ms ease, transform 160ms ease-out;\n }\n .close svg { display: block; }\n .close:active { transform: scale(0.94); }\n @media (prefers-reduced-motion: reduce) {\n .close:active { transform: none; }\n }\n .body {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 0.375rem;\n /* Room at the top for luzIA's name tag, which sits on the divider line. */\n padding: 1.5rem 1rem 0.75rem;\n overflow-y: auto;\n }\n .body {\n scrollbar-width: thin;\n scrollbar-color: color-mix(in srgb, var(--luzia-text) 22%, transparent) transparent;\n }\n /* Messages: soft, with the corner nearest the speaker drawn in, like a tail. */\n .greeting,\n .message {\n max-width: 85%;\n margin: 0;\n padding: 0.55rem 0.875rem;\n border-radius: 1.125rem;\n font-size: 0.9375rem;\n line-height: 1.45;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n }\n .greeting,\n .message[data-role='assistant'] {\n align-self: flex-start;\n border-bottom-left-radius: 0.375rem;\n background: var(--luzia-muted);\n transform-origin: bottom left;\n }\n /* Before her reply starts, luzIA thinks in her own message: three dots that rise in turn. */\n .message[data-thinking] {\n display: flex;\n gap: 0.3rem;\n padding-block: 0.85rem;\n }\n .message[data-thinking] .dot {\n width: 0.4rem;\n height: 0.4rem;\n border-radius: 50%;\n background: color-mix(in srgb, var(--luzia-text) 45%, transparent);\n animation: luzia-think 1.1s ease-in-out infinite;\n }\n .message[data-thinking] .dot:nth-child(2) { animation-delay: 160ms; }\n .message[data-thinking] .dot:nth-child(3) { animation-delay: 320ms; }\n @keyframes luzia-think {\n 0%, 60%, 100% { transform: translateY(0); opacity: 0.55; }\n 30% { transform: translateY(-3px); opacity: 1; }\n }\n @media (prefers-reduced-motion: reduce) {\n .message[data-thinking] .dot { animation: luzia-fade 1.1s ease-in-out infinite alternate; }\n }\n /* Links in luzIA's replies: underlined in the text's own colour, so they read as links on any theme. */\n .message a {\n color: inherit;\n text-decoration: underline;\n text-decoration-thickness: 1px;\n text-underline-offset: 0.15em;\n border-radius: 0.125rem;\n }\n .message a:hover { text-decoration-thickness: 2px; }\n .message a:focus-visible {\n outline: 2px solid var(--luzia-accent);\n outline-offset: 1px;\n }\n .messages {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n flex-direction: column;\n gap: 0.375rem;\n }\n .message[data-role='user'] {\n align-self: flex-end;\n border-bottom-right-radius: 0.375rem;\n background: var(--luzia-accent);\n color: var(--luzia-accent-contrast);\n box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--luzia-accent) 80%, transparent);\n transform-origin: bottom right;\n }\n /* A little more room where the speaker changes. */\n .message[data-role='assistant'] + .message[data-role='user'],\n .message[data-role='user'] + .message[data-role='assistant'] { margin-top: 0.375rem; }\n .greeting:not([hidden]) + .messages:not(:empty) { margin-top: 0.375rem; }\n /* Each new message rises into place once. */\n .greeting, .message { animation: luzia-rise 260ms var(--luzia-ease-out); }\n @keyframes luzia-rise {\n from { opacity: 0; transform: translateY(6px) scale(0.98); }\n }\n @keyframes luzia-fade {\n from { opacity: 0; }\n }\n .suggestions {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: 0.5rem;\n margin: auto 0 0;\n padding: 0;\n list-style: none;\n }\n /* Questions the Visitor could ask, tinted with the accent; they arrive one after another. */\n .suggestions li { animation: luzia-rise 320ms var(--luzia-ease-out) both; transform-origin: bottom right; }\n .suggestions li:nth-child(2) { animation-delay: 50ms; }\n .suggestions li:nth-child(3) { animation-delay: 100ms; }\n .suggestions li:nth-child(n + 4) { animation-delay: 150ms; }\n .suggestion {\n padding: 0.5rem 0.9rem;\n border: 1px solid color-mix(in srgb, var(--luzia-accent) 24%, transparent);\n border-radius: 999px;\n background: color-mix(in srgb, var(--luzia-accent) 7%, var(--luzia-surface));\n color: color-mix(in srgb, var(--luzia-accent) 60%, var(--luzia-text));\n font: 500 0.875rem/1.3 var(--luzia-font);\n text-align: left;\n cursor: pointer;\n transition: background-color 150ms ease, border-color 150ms ease, transform 160ms ease-out;\n }\n @media (hover: hover) and (pointer: fine) {\n .suggestion:hover {\n border-color: color-mix(in srgb, var(--luzia-accent) 45%, transparent);\n background: color-mix(in srgb, var(--luzia-accent) 13%, var(--luzia-surface));\n }\n }\n .suggestion:active { transform: scale(0.97); }\n @media (prefers-reduced-motion: reduce) {\n .greeting, .message, .suggestions li { animation-name: luzia-fade; }\n .suggestion:active { transform: none; }\n }\n .alert {\n margin: 0 1rem 0.5rem;\n font-size: 0.875rem;\n color: #b91c1c;\n }\n .alert a {\n color: inherit;\n }\n /* One rounded field: the message box with a round Send button inside it. */\n .composer {\n display: flex;\n align-items: flex-end;\n gap: 0.375rem;\n margin: 0 0.75rem 0.75rem;\n padding: 0.25rem 0.25rem 0.25rem 1rem;\n border: 1px solid var(--luzia-border);\n border-radius: 1.5rem;\n background: var(--luzia-surface);\n box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);\n transition: border-color 150ms ease, box-shadow 150ms ease;\n }\n .composer:focus-within {\n border-color: color-mix(in srgb, var(--luzia-accent) 60%, var(--luzia-border));\n box-shadow: 0 0 0 4px color-mix(in srgb, var(--luzia-accent) 16%, transparent);\n }\n .composer textarea {\n flex: 1;\n box-sizing: border-box;\n min-height: 2.75rem;\n max-height: 8rem;\n resize: none;\n padding: 0.7rem 0;\n border: none;\n background: transparent;\n color: var(--luzia-text);\n caret-color: var(--luzia-accent);\n font: inherit;\n font-size: 0.9375rem;\n line-height: 1.4;\n /* Grows with what is typed, where supported. */\n field-sizing: content;\n }\n .composer textarea::placeholder { color: color-mix(in srgb, var(--luzia-text) 55%, transparent); }\n .composer textarea:disabled { cursor: not-allowed; }\n .send {\n display: grid;\n place-items: center;\n flex: none;\n width: 44px;\n height: 44px;\n padding: 0;\n border: none;\n border-radius: 50%;\n background: var(--luzia-accent);\n color: var(--luzia-accent-contrast);\n cursor: pointer;\n transition: background-color 150ms ease, opacity 150ms ease, transform 160ms ease-out;\n }\n .send svg { display: block; }\n @media (hover: hover) and (pointer: fine) {\n .send:not(:disabled):hover { background: color-mix(in srgb, var(--luzia-accent) 86%, #000); }\n }\n .send:not(:disabled):active { transform: scale(0.94); }\n .send:disabled { opacity: 0.35; cursor: default; }\n @media (prefers-reduced-motion: reduce) {\n .send:not(:disabled):active { transform: none; }\n }\n @media (max-width: 480px) {\n /* The whole visible screen: above the on-screen keyboard when it is open (set by the element from visualViewport). */\n .panel {\n position: fixed;\n top: var(--luzia-viewport-top, 0px);\n left: 0;\n width: 100vw;\n height: var(--luzia-viewport-height, 100vh);\n margin: 0;\n border: none;\n border-radius: 0;\n }\n @supports (height: 100dvh) {\n .panel { height: var(--luzia-viewport-height, 100dvh); }\n }\n /* With the keyboard open there is little room: a smaller picture keeps the last messages in view. */\n :host([data-keyboard]) .stage { --luzia-avatar-height: 4.5rem; }\n /* Inline, the chat stays in the page but never taller than the screen. */\n :host([mode='inline']) .panel { height: min(var(--luzia-inline-height), 85vh); }\n .composer { margin-bottom: max(0.75rem, env(safe-area-inset-bottom)); }\n :host(:not([mode='inline'])) .panel { transform-origin: bottom center; }\n /* Below 16px, mobile browsers zoom the page when the text box gets focus. */\n .composer textarea { font-size: 16px; }\n }\n";
|