/* APIN Assistant — Widget Chat (floating) */
#apin-chat-root{position:fixed!important;right:18px!important;bottom:18px!important;z-index:99999;font-family:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif}
#apin-chat-root *{box-sizing:border-box}

#apin-chat-root #apin-chat-toggle{position:relative!important;width:56px!important;height:56px!important;min-width:56px!important;padding:0!important;margin:0!important;border-radius:50%!important;border:none!important;cursor:pointer!important;
  background:linear-gradient(135deg,#0b7a3b,#12a34f)!important;color:#fff!important;font-size:23px!important;line-height:1!important;display:block!important;
  box-shadow:0 10px 26px rgba(11,122,59,.42)!important;transition:transform .18s ease,box-shadow .18s ease!important}
#apin-chat-toggle:hover{transform:translateY(-2px) scale(1.03);box-shadow:0 14px 32px rgba(11,122,59,.5)}
#apin-chat-toggle .apin-ico-close{display:none}
#apin-chat-root.open #apin-chat-toggle .apin-ico-chat{display:none}
#apin-chat-root.open #apin-chat-toggle .apin-ico-close{display:inline}
.apin-badge{position:absolute;top:-8px;right:-14px;background:#ffb703;color:#1a1a1a;font-size:9.5px;font-weight:800;letter-spacing:.2px;white-space:nowrap;
  padding:2px 6px;border-radius:9px;box-shadow:0 2px 6px rgba(0,0,0,.2)}

#apin-chat-root #apin-chat-panel{position:absolute!important;right:0!important;bottom:70px!important;width:360px!important;max-width:calc(100vw - 32px)!important;
  height:520px!important;max-height:calc(100vh - 120px)!important;background:#fff!important;border-radius:16px!important;overflow:hidden!important;
  display:none;flex-direction:column!important;box-shadow:0 22px 60px rgba(0,0,0,.28)!important;border:1px solid #e6ece8!important}
#apin-chat-root.open #apin-chat-panel{display:flex;animation:apinIn .2s ease}
@keyframes apinIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

#apin-chat-root #apin-chat-header{display:flex!important;align-items:center!important;gap:10px!important;padding:12px 14px!important;
  background:linear-gradient(135deg,#0b7a3b,#12a34f)!important;color:#fff!important}
.apin-hdr-avatar{width:38px;height:38px;border-radius:50%;background:rgba(255,255,255,.18);
  display:flex;align-items:center;justify-content:center;font-size:20px}
.apin-hdr-txt{flex:1;display:flex;flex-direction:column;line-height:1.25}
.apin-hdr-txt strong{font-size:15px}
.apin-hdr-txt span{font-size:11.5px;opacity:.92;display:flex;align-items:center;gap:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.apin-dot{width:7px;height:7px;border-radius:50%;background:#7CFFB2;display:inline-block;flex:0 0 7px;box-shadow:0 0 0 0 rgba(124,255,178,.7);animation:apinPulse 1.8s infinite}
@keyframes apinPulse{0%{box-shadow:0 0 0 0 rgba(124,255,178,.6)}70%{box-shadow:0 0 0 7px rgba(124,255,178,0)}100%{box-shadow:0 0 0 0 rgba(124,255,178,0)}}
#apin-chat-root #apin-chat-min{background:transparent!important;border:none!important;color:#fff!important;font-size:20px!important;cursor:pointer!important;opacity:.85;padding:0 4px!important}
#apin-chat-root #apin-chat-mute{background:transparent!important;border:none!important;color:#fff!important;font-size:16px!important;cursor:pointer!important;opacity:.9;padding:0 4px!important;line-height:1}
#apin-chat-mute:hover{opacity:1}
#apin-chat-root .apin-speak{position:absolute;bottom:-9px;right:6px;width:26px;height:26px;border-radius:50%;border:1px solid #d7e3dc!important;background:#fff!important;color:#0b7a3b!important;font-size:12px!important;line-height:1!important;padding:0!important;cursor:pointer!important;box-shadow:0 2px 6px rgba(0,0,0,.12);display:flex;align-items:center;justify-content:center;z-index:2}
#apin-chat-root .apin-speak:hover{background:#f1f8f3!important}
#apin-chat-root .apin-speak.apin-speaking{background:#0b7a3b!important;color:#fff!important;border-color:#0b7a3b!important}
#apin-chat-root .apin-msg{position:relative}
#apin-chat-min:hover{opacity:1}

#apin-chat-root #apin-chat-body{flex:1!important;overflow-y:auto!important;padding:14px!important;background:#f6f9f7!important;display:flex!important;flex-direction:column!important;gap:10px!important}
.apin-msg{display:flex}
.apin-msg.apin-user{justify-content:flex-end}
.apin-bubble{padding:10px 13px;border-radius:14px;font-size:13.5px;line-height:1.5;max-width:82%;white-space:pre-wrap;word-wrap:break-word}
.apin-bot .apin-bubble{background:#fff;color:#1f2a24;border:1px solid #e3ebe6;border-bottom-left-radius:4px}
.apin-user .apin-bubble{background:#0b7a3b;color:#fff;border-bottom-right-radius:4px}
.apin-bubble a{color:#0b7a3b;font-weight:600}
.apin-typing .apin-bubble{display:flex;gap:4px;align-items:center}
.apin-typing i{width:7px;height:7px;border-radius:50%;background:#9db8a9;display:inline-block;animation:apinBounce 1.2s infinite}
.apin-typing i:nth-child(2){animation-delay:.15s}
.apin-typing i:nth-child(3){animation-delay:.3s}
@keyframes apinBounce{0%,60%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(-5px);opacity:1}}

.apin-chips{display:flex;flex-wrap:wrap;gap:7px;margin-top:2px}
#apin-chat-root .apin-chips button{background:#fff!important;border:1px solid #cfe3d6!important;color:#0b7a3b!important;font-size:12px!important;padding:6px 11px!important;
  border-radius:999px!important;cursor:pointer!important;transition:.15s}
.apin-chips button:hover{background:#0b7a3b;color:#fff;border-color:#0b7a3b}

#apin-chat-root #apin-chat-form{display:flex!important;gap:8px!important;padding:10px!important;border-top:1px solid #e6ece8!important;background:#fff!important;margin:0!important}
#apin-chat-root #apin-chat-input{flex:1!important;border:1px solid #d7e3dc!important;border-radius:10px!important;padding:10px 12px!important;font-size:13.5px!important;outline:none!important;background:#fff!important;color:#1f2a24!important;min-width:0!important}
#apin-chat-input:focus{border-color:#0b7a3b;box-shadow:0 0 0 3px rgba(11,122,59,.12)}
#apin-chat-root #apin-chat-send{width:42px!important;min-width:42px!important;flex:0 0 42px!important;border:none!important;border-radius:10px!important;background:#0b7a3b!important;color:#fff!important;font-size:16px!important;cursor:pointer!important;transition:.15s;padding:0!important}
#apin-chat-send:hover{background:#0a6b34}
#apin-chat-send:disabled{opacity:.5;cursor:not-allowed}
#apin-chat-foot{padding:6px 12px 9px;font-size:10.5px;color:#8a9a90;text-align:center;background:#fff}
#apin-chat-foot a{color:#0b7a3b;text-decoration:none}

@media(max-width:420px){
  #apin-chat-root{right:14px;bottom:14px}
  #apin-chat-panel{width:calc(100vw - 28px);height:min(70vh,540px)}
}

#apin-chat-root .apin-chips{display:none!important}
