/* MATAUTOLUX AI assistant widget — dark glass + gold, matches the site theme */
.chat{--chat-w:390px;position:fixed;right:22px;bottom:22px;z-index:120;font-family:var(--font-sans)}
.chat-fab{position:relative;display:inline-flex;align-items:center;gap:10px;height:58px;padding:0 20px 0 18px;border-radius:999px;border:0;background:var(--primary);color:var(--primary-foreground);font-size:14px;font-weight:700;box-shadow:0 14px 34px -10px color-mix(in srgb,var(--primary) 70%,transparent),0 6px 18px rgb(0 0 0/.45);transition:transform .35s cubic-bezier(.22,1,.36,1),box-shadow .3s,opacity .4s}
.chat-fab:hover{transform:translateY(-2px)}
.chat-fab:focus-visible{outline:none;box-shadow:0 0 0 3px var(--background),0 0 0 5px var(--primary)}
.chat-fab-icon{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.chat-fab-ring{position:absolute;inset:0;border-radius:inherit;border:2px solid var(--primary);animation:chat-ring 2.6s ease-out infinite;pointer-events:none}
@keyframes chat-ring{0%{transform:scale(1);opacity:.7}70%,100%{transform:scale(1.25,1.45);opacity:0}}
.chat.is-open .chat-fab{opacity:0;pointer-events:none;transform:scale(.8)}
.intro .chat-fab{opacity:0;pointer-events:none;transform:translateY(20px)}

.chat-panel{position:fixed;right:22px;bottom:22px;width:var(--chat-w);height:min(620px,calc(100dvh - 44px));display:flex;flex-direction:column;border-radius:20px;border:1px solid color-mix(in srgb,var(--foreground) 10%,transparent);background:color-mix(in srgb,var(--card) 88%,transparent);backdrop-filter:blur(24px) saturate(1.2);-webkit-backdrop-filter:blur(24px) saturate(1.2);box-shadow:0 30px 80px -20px #000d;overflow:hidden;opacity:0;transform:translateY(16px) scale(.98);transform-origin:bottom right;transition:opacity .25s ease,transform .35s cubic-bezier(.22,1,.36,1)}
.chat.is-open .chat-panel{opacity:1;transform:none}
.chat-head{display:flex;align-items:center;gap:12px;padding:14px 12px 14px 16px;border-bottom:1px solid var(--border)}
.chat-avatar{width:auto;height:42px;flex:none}
.chat-head>div{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.chat-title{font-size:14px;color:var(--foreground)}
.chat-badge{align-self:flex-start;padding:2px 8px;border-radius:999px;background:color-mix(in srgb,var(--primary) 14%,transparent);color:var(--primary);font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
.chat-head button{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;border:1px solid var(--border);background:transparent;color:var(--muted-foreground);transition:color .2s,border-color .2s}
.chat-head button:hover{color:var(--foreground);border-color:var(--input)}
.chat-head svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

.chat-log{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:16px 14px 6px;display:flex;flex-direction:column;gap:10px;scrollbar-width:thin}
.chat-msg{max-width:86%;padding:10px 13px;border-radius:16px;font-size:14px;line-height:1.55;color:var(--foreground);word-wrap:break-word;animation:chat-in .35s cubic-bezier(.22,1,.36,1)}
@keyframes chat-in{from{opacity:0;transform:translateY(6px)}}
.chat-msg p{margin:0;color:inherit}.chat-msg p+p,.chat-msg p+ul,.chat-msg ul+p{margin-top:7px}
.chat-msg ul{margin:6px 0 0;padding-left:18px}.chat-msg li{margin:2px 0}
.chat-msg strong{color:var(--primary);font-weight:600}
.chat-msg a{color:var(--primary);text-decoration:underline;text-underline-offset:2px}
.chat-bot{align-self:flex-start;background:color-mix(in srgb,var(--foreground) 6%,transparent);border:1px solid var(--border);border-bottom-left-radius:6px}
.chat-user{align-self:flex-end;background:var(--primary);color:var(--primary-foreground);border-bottom-right-radius:6px}
.chat-user strong,.chat-user a{color:inherit}
.chat-note{align-self:center;display:inline-flex;align-items:center;gap:7px;padding:6px 12px;border-radius:999px;background:color-mix(in srgb,#22c55e 14%,transparent);color:#86efac;font-size:12px}
.chat-note svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2}
.chat-error{border-color:color-mix(in srgb,var(--destructive) 50%,transparent)}
.chat-typing{display:inline-flex;gap:4px;padding:4px 2px}
.chat-typing i{width:6px;height:6px;border-radius:50%;background:var(--muted-foreground);animation:chat-dot 1.2s infinite ease-in-out}
.chat-typing i:nth-child(2){animation-delay:.15s}.chat-typing i:nth-child(3){animation-delay:.3s}
@keyframes chat-dot{0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}

.chat-chips{display:flex;flex-wrap:wrap;gap:7px;padding:4px 14px 10px}
.chat-chips:empty{display:none}
.chat-chips button{padding:7px 12px;border-radius:999px;border:1px solid color-mix(in srgb,var(--primary) 40%,transparent);background:transparent;color:var(--foreground);font-size:12px;transition:background-color .2s,border-color .2s}
.chat-chips button:hover{background:color-mix(in srgb,var(--primary) 12%,transparent);border-color:var(--primary)}
.chat-form{display:flex;align-items:flex-end;gap:8px;margin:0 12px;padding:6px 6px 6px 14px;border-radius:16px;border:1px solid var(--input);background:color-mix(in srgb,var(--background) 60%,transparent);transition:border-color .2s}
.chat-form:focus-within{border-color:color-mix(in srgb,var(--primary) 70%,transparent)}
.chat-form textarea{flex:1;resize:none;border:0;outline:0;background:transparent;color:var(--foreground);font:inherit;font-size:16px;line-height:1.4;padding:8px 0;max-height:120px}
.chat-send{display:grid;place-items:center;flex:none;width:40px;height:40px;border-radius:12px;border:0;background:var(--primary);color:var(--primary-foreground);transition:opacity .2s,transform .15s}
.chat-send:active{transform:scale(.94)}.chat-send:disabled{opacity:.45}
.chat-send svg{width:18px;height:18px}
.chat-notice{margin:8px 16px 12px;font-size:10.5px;line-height:1.45;color:var(--muted-foreground);text-align:center}
.chat-notice a{color:inherit;text-decoration:underline;text-underline-offset:2px}.chat-notice a:hover{color:var(--foreground)}

@media(max-width:680px){
  .chat{right:14px;bottom:14px}
  .chat-fab{height:54px;width:54px;padding:0;justify-content:center}
  .chat-fab-label{display:none}
  .chat-panel{inset:0;right:0;bottom:0;width:100%;height:100dvh;border-radius:0;border:0}
}
@media(prefers-reduced-motion:reduce){.chat-fab-ring,.chat-msg{animation:none}.chat-panel,.chat-fab{transition:none}}
