/* Minimal, independent chat surface; no page-layout selectors. */
:host {
  --al-ink:#29232f; --al-muted:#6b6171; --al-purple:#4a256f;
  --al-paper:#faf8f4; --al-line:#e1d8e7; --al-lilac:#efe9f5;
  --al-font:var(--font-dm-sans,"Segoe UI"),Arial,sans-serif;
  position:fixed; inset:auto 22px calc(22px + env(safe-area-inset-bottom,0px)) auto;
  z-index:65; display:block; direction:ltr; color:var(--al-ink);
  font:400 14px/1.5 var(--al-font); -webkit-text-size-adjust:100%;
}
:host([hidden]),[hidden] { display:none !important; }
*,*::before,*::after { box-sizing:border-box; }
button,textarea,a { font:inherit; -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; border:0; color:inherit; }
button:disabled { cursor:default; }
svg { display:block; width:20px; height:20px; flex:0 0 auto; }
a { color:var(--al-purple); text-underline-offset:3px; }
button:focus-visible,a:focus-visible,textarea:focus-visible { outline:3px solid #9565d3; outline-offset:3px; }
.launcher { position:relative;display:block;width:234px;height:76px;max-width:calc(100vw - 30px);padding:0;border-radius:23px;color:#fff;background:transparent;box-shadow:none;text-align:start;isolation:isolate;transition:transform 180ms ease; }
.launcher-label { position:absolute;z-index:1;right:0;bottom:0;display:flex;width:210px;min-height:58px;align-items:center;justify-content:flex-start;overflow:hidden;padding:10px 59px 10px 67px;border:1px solid #704690;border-radius:21px;background:linear-gradient(135deg,#3f185f 0%,#572475 54%,#713991 100%);color:#fff;box-shadow:0 20px 42px -21px #271334,0 7px 18px #3a15512b,inset 0 1px #ffffff38;line-height:1.15;white-space:nowrap;transition:transform 200ms cubic-bezier(.2,.8,.2,1),border-color 180ms ease,box-shadow 180ms ease; }
.launcher-label::before { content:"";position:absolute;right:-21px;top:-39px;width:112px;height:112px;border-radius:50%;background:radial-gradient(circle,#d7aff64a 0 24%,transparent 68%);pointer-events:none; }
.launcher-label::after { content:"→";position:absolute;right:12px;top:50%;display:grid;width:33px;height:33px;place-items:center;border:1px solid #ffffff2e;border-radius:50%;background:#ffffff17;color:#fff;font-size:17px;font-weight:500;line-height:1;transform:translateY(-50%); }
.launcher-title { position:relative;z-index:1;display:block;max-width:none;overflow:visible;color:#fff;font-size:13.5px;font-weight:760;letter-spacing:.005em;text-overflow:clip; }
.launcher-mascot { position:absolute;z-index:3;left:-4px;bottom:1px;display:grid;width:94px;height:94px;place-items:center;pointer-events:none;transition:transform 220ms cubic-bezier(.2,.8,.2,1); }
.launcher-mascot::after { content:"";position:absolute;z-index:-1;left:17px;right:12px;bottom:8px;height:13px;border-radius:50%;background:#16092152;filter:blur(7px);transform:scaleX(.92); }
.launcher-avatar { display:block;width:90px;height:90px;object-fit:contain;object-position:center;filter:drop-shadow(0 8px 8px #16092145);transform:rotate(-1.5deg) scale(1.08);transition:transform 220ms cubic-bezier(.2,.8,.2,1); }
.launcher:hover { transform:translateY(-1px); }
.launcher:hover .launcher-mascot { transform:translateY(-4px); }
.launcher:hover .launcher-avatar { transform:rotate(1deg) scale(1.12); }
.launcher:hover .launcher-label { transform:translateY(-2px);border-color:#a980c1;box-shadow:0 24px 46px -21px #271334,0 9px 20px #3a155138,inset 0 1px #ffffff45; }
.unread { position:absolute;right:3px;top:7px;width:12px;height:12px;border:2px solid #fff;border-radius:50%;background:#cf7b59;box-shadow:0 2px 6px #3d20374d; }
.panel { position:fixed; inset:auto 22px calc(22px + env(safe-area-inset-bottom,0px) + var(--al-keyboard-offset,0px)) auto; width:min(392px,calc(100vw - 32px)); height:min(560px,calc(var(--al-vh,100dvh) - 40px)); max-height:calc(var(--al-vh,100dvh) - 40px); max-width:none; margin:0; padding:0; border:1px solid #e9e0ed; border-radius:22px; overflow:hidden; background:var(--al-paper); color:var(--al-ink); box-shadow:0 18px 70px #190c3824; font:400 14px/1.5 var(--al-font); }
.panel[open] { display:flex; flex-direction:column; }
.panel::backdrop { background:#20172912; }
.top { flex:0 0 auto; display:flex; align-items:center; gap:10px; padding:13px 12px 12px 19px; }
.mark { flex:0 0 auto; display:grid; place-items:center; width:32px; height:36px; border-radius:10px; background:var(--al-lilac); color:#7543ad; }
.mark svg { width:16px; height:23px; }
.title { flex:1; min-width:0; }
h2 { margin:0; font-size:14px; font-weight:650; letter-spacing:-.02em; }
.disclosure { margin:1px 0 0; font-size:11px; color:var(--al-muted); }
.icon-button { flex:0 0 auto; display:grid; place-items:center; width:44px; height:44px; border-radius:50%; background:transparent; color:var(--al-muted); }
.icon-button:hover { background:var(--al-lilac); }
.icon-button svg { width:17px; height:17px; }
.scroll { flex:1; min-height:0; padding:24px 21px 15px; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#c6b7d4 transparent; }
.welcome { padding-top:11px; }
h3 { margin:0; max-width:300px; font:500 22px/1.3 var(--al-font); letter-spacing:-.035em; }
.welcome-body { margin:13px 0 22px; max-width:285px; color:var(--al-muted); font-size:13px; line-height:1.6; }
.suggestions { display:flex; flex-wrap:wrap; gap:8px; }
.suggestion { min-height:44px; padding:9px 12px; border:1px solid var(--al-line); border-radius:999px; background:transparent; font-size:12px; line-height:1.4; text-align:start; }
.suggestion:hover { background:var(--al-lilac); border-color:#bdaacb; }
.message { margin-top:20px; overflow-wrap:anywhere; }
.message:first-child { margin-top:0; }
.speaker { margin:0 0 6px; font-size:10px; font-weight:650; color:var(--al-muted); }
.message-body { font-size:13px; line-height:1.7; white-space:pre-wrap; }
.user { margin-inline-start:20px; padding:11px 14px; border-radius:15px 15px 4px 15px; background:var(--al-lilac); }
.user .speaker { color:var(--al-purple); }
.assistant { padding-inline:1px; }
.recommendations { display:flex; flex-wrap:wrap; gap:8px 12px; margin-top:10px; }
.recommendations a { display:inline-flex; align-items:center; gap:6px; min-height:44px; font-size:12px; text-decoration:underline; }
.recommendations svg { width:13px; height:13px; }
.loading { padding:18px 0 4px; color:var(--al-muted); font-size:12px; }
.loading-row { display:flex; align-items:center; gap:8px; }
.dots { display:flex; gap:3px; }
.dots i { display:block; width:4px; height:4px; border-radius:50%; background:var(--al-purple); animation:breathe 1.2s infinite; }
.dots i:nth-child(2) { animation-delay:.2s; } .dots i:nth-child(3) { animation-delay:.4s; }
.text-button { min-height:44px; padding:7px 0; background:transparent; color:var(--al-purple); text-decoration:underline; text-underline-offset:3px; font-size:12px; }
.error { margin-top:16px; padding:12px 13px; border:1px solid #dfc5b3; border-radius:12px; background:#fff7ef; color:#653c27; font-size:12px; line-height:1.6; }
.error p { margin:0; }
.error-actions,.reset-actions { display:flex; gap:18px; }
.error button { color:#653c27; } .error button:disabled { opacity:.65; }
.reset-box { padding:10px 20px; margin:0; border-block:1px solid var(--al-line); background:#f0eaf5; font-size:12px; }
.reset-box p { margin:0; }
.compose { flex:0 0 auto; margin:0; padding:9px 17px 17px; }
.privacy { margin:0 2px 10px; color:var(--al-muted); font-size:11px; line-height:1.55; }
.privacy a { white-space:nowrap; }
.input-row { display:flex; align-items:flex-end; gap:10px; padding:10px 10px 10px 13px; border:1px solid #b8a6c7; border-radius:15px; background:#fffdf9; }
textarea { flex:1; min-width:0; width:100%; min-height:45px; height:45px; max-height:106px; padding:3px 0; resize:none; border:0; background:transparent; color:var(--al-ink); font-size:14px; line-height:1.5; }
textarea::placeholder { color:#7c7283; opacity:1; }
textarea:focus-visible { outline-offset:3px; border-radius:3px; }
.send { display:grid; place-items:center; flex:0 0 44px; width:44px; height:44px; padding:0; border-radius:50%; color:white; background:var(--al-purple); }
.send:disabled { color:#806c8e; background:#eee7f3; }
.send svg { width:18px; height:18px; }
.input-meta { margin:5px 2px 0; font-size:10px; color:var(--al-muted); text-align:end; }
.handoff { flex:0 0 auto; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:0 19px 16px; }
.handoff a { display:inline-flex; align-items:center; justify-content:center; min-height:44px; font-size:11px; line-height:1.4; text-align:center; }
.action-primary { flex:1; padding:9px 12px; color:white; background:var(--al-purple); border-radius:10px; font-weight:600; text-decoration:none; }
.action-secondary { flex:0 1 auto; max-width:42%; padding:6px 0; color:var(--al-purple); text-decoration:underline; }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
:host(:not([lang="en"])) { --al-font:var(--font-local-script,"Nirmala UI"),"Segoe UI",sans-serif; }
:host(:not([lang="en"])) h3 { letter-spacing:0; line-height:1.4; }
[dir="rtl"] .recommendations svg { transform:scaleX(-1); }
@keyframes breathe { 0%,75%,100% { opacity:.35; } 35% { opacity:1; } }
@media(max-width:600px) {
 :host { right:15px; bottom:calc(var(--al-bottom-offset,16px) + env(safe-area-inset-bottom,0px)); }
 .launcher { width:214px;height:70px; }
 .launcher-label { width:196px;min-height:54px;padding:9px 47px 9px 65px;border-radius:19px; }
 .launcher-title { font-size:12.5px; }
 .launcher-label::after { right:10px;width:29px;height:29px;font-size:15px; }
 .launcher-mascot { left:-3px;bottom:0;width:82px;height:82px; }
 .launcher-avatar { width:79px;height:79px; }
 .panel { width:calc(100vw - 24px); right:12px; bottom:calc(max(12px,env(safe-area-inset-bottom,0px)) + var(--al-keyboard-offset,0px)); height:min(560px,calc(var(--al-vh,100dvh) - 24px)); max-height:calc(var(--al-vh,100dvh) - 24px); border-radius:21px; }
 .top { padding:11px 10px 9px 16px; gap:8px; }
 .scroll { padding:20px 18px 13px; }
 .compose { padding:8px 14px 15px; }
 textarea { font-size:16px; }
 .message-body { font-size:14px; }
 .handoff { padding:0 16px 14px; }
}
@media(max-width:359px) { .top { gap:5px; padding-inline-start:12px; } .mark { width:25px; background:transparent; } h2 { font-size:13px; } .scroll { padding-inline:16px; } h3 { font-size:21px; } .suggestion { font-size:11px; } }
:host([data-compact]) .top { padding-block:5px; }
:host([data-compact]) .scroll { padding-top:12px; }
:host([data-compact]) .compose { padding-block:7px; }
:host([data-compact]) .handoff { padding-bottom:7px; }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none !important; transition:none !important; scroll-behavior:auto !important; } }
@media(forced-colors:active) { .launcher,.launcher-mascot,.launcher-label,.send,.suggestion,.input-row,.user,.action-primary { border:1px solid ButtonText; } .launcher-label::before { display:none; }.panel { border:2px solid CanvasText; } }

/* The pictured assistant is AI; its identity stays labelled in text. */
.avatar { display:block; width:40px; height:40px; flex:none; padding:1px; object-fit:contain; object-position:center; border-radius:14px; background:radial-gradient(circle at 36% 28%,#fff 0 17%,#f1e8f7 58%,#ddcaeb 100%); filter:drop-shadow(0 3px 4px #2f153c24); }
.mark { width:40px; height:40px; overflow:hidden; border-radius:14px; }
.mark .avatar { width:100%; height:100%; transform:scale(1.08); }
.speaker-row { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.speaker-row .avatar,.loading-row .avatar { width:28px; height:28px; border-radius:10px; }
.speaker-row .speaker { margin:0; }
.user .speaker-row { margin-bottom:5px; }
.typing { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.loading-row { gap:9px; }

@media(max-width:359px){.mark{width:32px;height:36px;border-radius:12px}.mark .avatar{border-radius:12px}}
