:root{
  --uk-chat-purple:#7c4dff;
  --uk-chat-purple-deep:#6a3ef0;
  --uk-chat-purple-soft:#f4efff;
  --uk-chat-gold:#d4a64a;
  --uk-chat-ink:#1d1725;
  --uk-chat-muted:#7d7489;
  --uk-chat-line:#ebe3f1;
  --uk-chat-bg:#fffdfb;
  --uk-chat-bg-soft:#fffaf7;
  --uk-chat-white:#ffffff;
}

#ukAiChatRoot{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:2147483000;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
#ukAiChatRoot *{box-sizing:border-box}

.uk-ai-launcher{
  width:76px;
  height:76px;
  border:0;
  border-radius:50%;
  padding:5px;
  background:linear-gradient(180deg,#fff,#fff9f5);
  box-shadow:0 18px 46px rgba(46,34,62,.20), 0 6px 18px rgba(124,77,255,.12);
  cursor:pointer;
  position:relative;
  transition:transform .38s cubic-bezier(.22,1,.36,1), box-shadow .32s ease, filter .32s ease;
  overflow:hidden;
}
.uk-ai-launcher::before{
  content:"";
  position:absolute;
  inset:-12px;
  border-radius:50%;
  background:radial-gradient(circle at center, rgba(124,77,255,.18), rgba(124,77,255,0) 60%);
  opacity:.7;
  pointer-events:none;
}
.uk-ai-launcher:hover{
  transform:translateY(-4px) scale(1.04);
  box-shadow:0 24px 56px rgba(46,34,62,.28), 0 10px 20px rgba(124,77,255,.18);
}
.uk-ai-launcher:active{transform:scale(.96)}
.uk-ai-launcher img{
  width:100%;
  height:100%;
  object-fit:contain;
  border-radius:50%;
  display:block;
  position:relative;
  z-index:1;
}
.uk-ai-online-dot{
  position:absolute;
  right:5px;
  bottom:8px;
  width:13px;
  height:13px;
  border-radius:50%;
  background:#22c55e;
  border:3px solid #fff;
  z-index:2;
}
.uk-ai-pulse{
  position:absolute;
  inset:-4px;
  border-radius:50%;
  border:1px solid rgba(124,77,255,.26);
  animation:ukAiPulse 2.4s ease-out infinite;
  pointer-events:none;
}
@keyframes ukAiPulse{
  0%{transform:scale(.92);opacity:.85}
  75%,100%{transform:scale(1.28);opacity:0}
}
#ukAiChatRoot.uk-open .uk-ai-launcher{
  transform:scale(.94);
  box-shadow:0 12px 28px rgba(46,34,62,.16);
}

.uk-ai-panel{
  position:absolute;
  right:0;
  bottom:92px;
  width:min(385px,calc(100vw - 28px));
  height:min(620px,calc(100vh - 130px));
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border-radius:28px;
  border:1px solid rgba(232,223,239,.95);
  background:linear-gradient(180deg, rgba(255,254,253,.96), rgba(255,250,246,.94));
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  box-shadow:0 28px 80px rgba(38,26,47,.22), 0 10px 24px rgba(38,26,47,.10);
  transform-origin:bottom right;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translateY(18px) scale(.92) rotateX(7deg);
  transition:
    opacity .24s ease,
    transform .42s cubic-bezier(.22,1,.36,1),
    visibility .24s ease;
}
#ukAiChatRoot.uk-open .uk-ai-panel{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform:translateY(0) scale(1) rotateX(0);
}

.uk-ai-head{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px 16px 14px;
  border-bottom:1px solid rgba(235,227,241,.95);
  background:linear-gradient(135deg, rgba(255,248,243,.98), rgba(248,243,255,.98));
}
.uk-ai-avatar{
  width:46px;
  height:46px;
  border-radius:50%;
  background:#fff;
  border:1px solid #efe5df;
  padding:3px;
  flex:none;
  box-shadow:0 8px 18px rgba(124,77,255,.10);
}
.uk-ai-avatar img{width:100%;height:100%;object-fit:contain;border-radius:50%}
.uk-ai-head-copy{min-width:0;flex:1}
.uk-ai-title{
  font-weight:900;
  color:var(--uk-chat-ink);
  font-size:16px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.uk-ai-status{font-size:11px;color:#16a34a;margin-top:3px}
.uk-ai-close{
  border:0;
  background:rgba(255,255,255,.72);
  width:36px;
  height:36px;
  border-radius:50%;
  cursor:pointer;
  font-size:20px;
  color:#8b8490;
  transition:transform .24s ease, background .24s ease, color .24s ease;
}
.uk-ai-close:hover{background:#f5eff8;color:#574c65;transform:rotate(90deg)}
.uk-ai-close:active{transform:scale(.9) rotate(90deg)}

.uk-ai-messages{
  flex:1;
  overflow:auto;
  padding:18px 14px 10px;
  scroll-behavior:smooth;
  overscroll-behavior:contain;
  background:
    radial-gradient(circle at top right, rgba(124,77,255,.06), transparent 22%),
    linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0));
}
.uk-ai-row{
  display:flex;
  margin:0 0 12px;
  animation:ukAiBubbleIn .28s cubic-bezier(.22,1,.36,1);
}
.uk-ai-row.user{justify-content:flex-end}
@keyframes ukAiBubbleIn{
  from{opacity:0;transform:translateY(10px) scale(.98)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
.uk-ai-row>div{max-width:84%}
.uk-ai-bubble{
  display:inline-block;
  max-width:100%;
  padding:12px 14px;
  border-radius:18px;
  font-size:13px;
  line-height:1.6;
  white-space:pre-wrap;
  overflow-wrap:break-word;
  word-break:normal;
  box-shadow:0 10px 24px rgba(26,18,34,.05);
}
.uk-ai-row.bot .uk-ai-bubble{
  background:rgba(255,255,255,.95);
  border:1px solid var(--uk-chat-line);
  color:#26212b;
  border-top-left-radius:7px;
}
.uk-ai-row.user .uk-ai-bubble{
  background:linear-gradient(135deg,#f6efff,#fff1f6);
  border:1px solid #eadcf5;
  color:#31263d;
  border-top-right-radius:7px;
}
.uk-ai-time{
  font-size:10px;
  color:#a59baa;
  margin-top:5px;
  padding:0 3px;
}
.uk-ai-thinking{display:inline-flex;gap:5px;align-items:center}
.uk-ai-thinking i{
  width:6px;
  height:6px;
  background:#a98bcf;
  border-radius:50%;
  animation:ukDot 1.1s infinite ease-in-out;
}
.uk-ai-thinking i:nth-child(2){animation-delay:.15s}
.uk-ai-thinking i:nth-child(3){animation-delay:.3s}
@keyframes ukDot{
  0%,80%,100%{transform:scale(.7);opacity:.45}
  40%{transform:scale(1);opacity:1}
}

.uk-ai-quick{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding:4px 14px 12px;
  scrollbar-width:none;
}
.uk-ai-quick::-webkit-scrollbar{display:none}
.uk-ai-chip{
  white-space:nowrap;
  border:1px solid #eadff2;
  background:rgba(255,255,255,.88);
  border-radius:999px;
  padding:9px 12px;
  font-size:10.5px;
  font-weight:800;
  color:#71528f;
  cursor:pointer;
  transition:transform .22s ease, background .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.uk-ai-chip:hover{
  background:#faf6ff;
  border-color:#dccbf1;
  transform:translateY(-1px);
  box-shadow:0 10px 16px rgba(124,77,255,.08);
}
.uk-ai-chip:active{transform:scale(.97)}

.uk-ai-compose{
  padding:12px;
  border-top:1px solid var(--uk-chat-line);
  background:linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,251,247,.98));
}
.uk-ai-form{
  display:flex;
  gap:8px;
  align-items:flex-end;
  border:1px solid #e9e1ee;
  background:rgba(255,255,255,.92);
  border-radius:18px;
  padding:8px 8px 8px 12px;
  transition:border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}
.uk-ai-form:focus-within{
  border-color:#ccb4f2;
  box-shadow:0 0 0 4px rgba(124,77,255,.10);
  transform:translateY(-1px);
}
.uk-ai-input{
  flex:1;
  border:0;
  outline:0;
  resize:none;
  min-height:22px;
  max-height:96px;
  font:inherit;
  font-size:13px;
  line-height:1.5;
  background:transparent;
  color:#26212b;
}
.uk-ai-input::placeholder{color:#ada3b5}
.uk-ai-send{
  width:40px;
  height:40px;
  flex:none;
  border:0;
  border-radius:14px;
  cursor:pointer;
  background:linear-gradient(135deg,var(--uk-chat-purple),#9d6cff);
  color:#fff;
  font-size:16px;
  font-weight:900;
  box-shadow:0 12px 22px rgba(124,77,255,.28);
  transition:transform .22s ease, box-shadow .22s ease, filter .22s ease;
}
.uk-ai-send:hover{transform:translateY(-1px);box-shadow:0 16px 26px rgba(124,77,255,.32)}
.uk-ai-send:active{transform:scale(.95)}
.uk-ai-send:disabled{opacity:.55;cursor:not-allowed;box-shadow:none}
.uk-ai-note{text-align:center;font-size:9px;color:#aaa2ad;margin-top:8px;line-height:1.45}
.uk-ai-error{color:#b42318}

@media(max-width:600px){
  #ukAiChatRoot{right:11px;bottom:11px}
  .uk-ai-launcher{width:68px;height:68px}
  .uk-ai-panel{
    position:fixed;
    left:10px;
    right:10px;
    bottom:88px;
    width:auto;
    height:min(74vh,620px);
    transform-origin:bottom right;
  }
  .uk-ai-head{padding:15px 14px 13px}
  .uk-ai-title{font-size:15px}
}
