.flai-launcher{position:fixed;right:20px;bottom:20px;width:60px;height:60px;border-radius:50%;border:none;background:#FAB536;color:#17181a;cursor:pointer;box-shadow:0 6px 20px rgba(0,0,0,.25);z-index:99998;display:flex;align-items:center;justify-content:center;transition:transform .15s}
.flai-launcher:hover{transform:scale(1.06)}
.flai-launcher-ico{font-size:26px;line-height:1}
.flai-launcher.flai-hidden{display:none}

.flai-panel{position:fixed;right:20px;bottom:20px;width:360px;max-width:calc(100vw - 32px);height:520px;max-height:calc(100vh - 40px);background:#fff;border-radius:14px;box-shadow:0 12px 40px rgba(0,0,0,.28);z-index:99999;display:none;flex-direction:column;overflow:hidden;font-family:inherit}
.flai-panel.flai-open{display:flex}

.flai-head{display:flex;align-items:center;gap:8px;background:#FAB536;color:#17181a;padding:12px 14px;font-weight:800}
.flai-head .flai-avatar{width:34px;height:34px;border-radius:50%;background:#fff;display:flex;align-items:center;justify-content:center;font-size:19px;flex:0 0 auto}
.flai-head .flai-title{flex:1;font-size:1rem}
.flai-head .flai-close{background:none;border:none;color:#17181a;font-size:24px;line-height:1;cursor:pointer;padding:0 4px}

.flai-body{flex:1;overflow-y:auto;padding:14px;background:#f7f7f8;display:flex;flex-direction:column;gap:10px}
.flai-msg{display:flex}
.flai-msg.flai-user{justify-content:flex-end}
.flai-bubble{max-width:82%;padding:9px 12px;border-radius:14px;font-size:.9rem;line-height:1.4;word-wrap:break-word;white-space:normal}
.flai-user .flai-bubble{background:#FAB536;color:#17181a;border-bottom-right-radius:4px}
.flai-bot .flai-bubble{background:#fff;color:#222;border:1px solid #eee;border-bottom-left-radius:4px}
.flai-bubble a{color:#c77b00;text-decoration:underline;font-weight:600}
.flai-user .flai-bubble a{color:#5a3d00}

.flai-typing .flai-bubble{display:flex;gap:4px;align-items:center}
.flai-typing .flai-bubble span{width:7px;height:7px;border-radius:50%;background:#bbb;display:inline-block;animation:flaiBlink 1.2s infinite both}
.flai-typing .flai-bubble span:nth-child(2){animation-delay:.2s}
.flai-typing .flai-bubble span:nth-child(3){animation-delay:.4s}
@keyframes flaiBlink{0%,80%,100%{opacity:.3}40%{opacity:1}}

.flai-foot{display:flex;gap:8px;padding:10px;border-top:1px solid #eee;background:#fff}
.flai-input{flex:1;resize:none;border:1px solid #ddd;border-radius:20px;padding:9px 14px;font-size:.9rem;font-family:inherit;max-height:90px;outline:none}
.flai-input:focus{border-color:#FAB536}
.flai-send{flex:0 0 auto;width:40px;height:40px;border:none;border-radius:50%;background:#FAB536;color:#17181a;font-size:16px;cursor:pointer}
.flai-send:disabled{opacity:.5;cursor:default}

@media (max-width:480px){
  .flai-panel{right:8px;bottom:8px;width:calc(100vw - 16px);height:calc(100vh - 16px);max-height:calc(100vh - 16px)}
}
