/* ===== Parrotto Chat — widget styles (namespaced) ===== */
#pws-chat{
  --pws-primary:#2150AD;
  --pws-accent:#ED9432;
  --pws-bottom:24px;
  --pws-bottom-mobile:80px;
  --pws-bar-mobile:70px;
  --pws-right:24px;
  --pws-left:auto;
}
#pws-chat, #pws-chat *{ box-sizing:border-box; margin:0; padding:0; }

/* launcher */
#pws-chat .pws-launcher{
  position:fixed; bottom:var(--pws-bottom); right:var(--pws-right); left:var(--pws-left); z-index:99999;
  display:flex; align-items:center; gap:10px;
  background:var(--pws-primary); color:#fff; border:none; cursor:pointer;
  border-radius:50px; padding:14px 22px 14px 18px;
  font-family:'Poppins',Arial,sans-serif; font-size:14px; font-weight:600;
  box-shadow:0 10px 30px rgba(33,80,173,.35);
  transition:transform .18s ease, box-shadow .18s ease;
}
#pws-chat .pws-launcher:hover{ transform:translateY(-2px); box-shadow:0 14px 36px rgba(33,80,173,.45); }
#pws-chat .pws-launcher .pws-dot{ width:9px; height:9px; border-radius:50%; background:#5BD18B; animation:pwsPulse 2s infinite; }
@keyframes pwsPulse{ 0%{box-shadow:0 0 0 0 rgba(91,209,139,.55);} 70%{box-shadow:0 0 0 7px rgba(91,209,139,0);} 100%{box-shadow:0 0 0 0 rgba(91,209,139,0);} }
#pws-chat .pws-launcher.pws-hidden{ display:none; }

/* panel */
#pws-chat .pws-panel{
  position:fixed; bottom:var(--pws-bottom); right:var(--pws-right); left:var(--pws-left); z-index:99999;
  width:380px; max-width:calc(100vw - 32px);
  height:600px; max-height:calc(100vh - 48px);
  background:#fff; border-radius:18px; overflow:hidden;
  display:none; flex-direction:column;
  box-shadow:0 24px 60px rgba(12,26,56,.28);
  animation:pwsIn .24s cubic-bezier(.2,.8,.2,1);
}
#pws-chat .pws-panel.pws-open{ display:flex; }
@keyframes pwsIn{ from{opacity:0; transform:translateY(14px) scale(.98);} to{opacity:1; transform:none;} }

/* header */
#pws-chat .pws-head{ background:var(--pws-primary); padding:18px 20px; display:flex; align-items:center; gap:12px; flex-shrink:0; }
#pws-chat .pws-head img{ height:26px; width:auto; display:block; }
#pws-chat .pws-head-meta{ flex:1; }
#pws-chat .pws-head-name{ font-family:'Bricolage Grotesque','Poppins',sans-serif; font-weight:700; font-size:14px; color:#fff; line-height:1.2; }
#pws-chat .pws-head-status{ font-size:11px; color:#A8C0E8; margin-top:2px; display:flex; align-items:center; gap:6px; }
#pws-chat .pws-head-status::before{ content:""; width:7px; height:7px; border-radius:50%; background:#5BD18B; display:inline-block; }
#pws-chat .pws-close{ background:rgba(255,255,255,.12); border:none; color:#fff; cursor:pointer; width:30px; height:30px; border-radius:8px; font-size:18px; line-height:1; display:flex; align-items:center; justify-content:center; }
#pws-chat .pws-close:hover{ background:rgba(255,255,255,.22); }

/* body */
#pws-chat .pws-body{ flex:1; overflow-y:auto; padding:20px 18px; background:#F4F7FC; display:flex; flex-direction:column; gap:12px; }
#pws-chat .pws-msg{ max-width:84%; font-size:13.5px; line-height:1.6; font-family:'Poppins',Arial,sans-serif; }
#pws-chat .pws-msg-bot{ align-self:flex-start; background:#fff; color:#333; padding:12px 15px; border-radius:4px 14px 14px 14px; box-shadow:0 2px 8px rgba(33,80,173,.07); }
#pws-chat .pws-msg-user{ align-self:flex-end; background:var(--pws-primary); color:#fff; padding:12px 15px; border-radius:14px 14px 4px 14px; }
#pws-chat .pws-msg strong{ font-weight:600; }
#pws-chat .pws-msg-bot strong{ color:var(--pws-primary); }

/* typing */
#pws-chat .pws-typing{ align-self:flex-start; background:#fff; padding:14px 16px; border-radius:4px 14px 14px 14px; box-shadow:0 2px 8px rgba(33,80,173,.07); display:flex; gap:5px; }
#pws-chat .pws-typing span{ width:7px; height:7px; border-radius:50%; background:#A8C0E8; animation:pwsBounce 1.2s infinite; }
#pws-chat .pws-typing span:nth-child(2){ animation-delay:.18s; }
#pws-chat .pws-typing span:nth-child(3){ animation-delay:.36s; }
@keyframes pwsBounce{ 0%,60%,100%{transform:translateY(0); opacity:.5;} 30%{transform:translateY(-5px); opacity:1;} }

/* chips */
#pws-chat .pws-chips{ display:flex; flex-wrap:wrap; gap:7px; margin-top:2px; }
#pws-chat .pws-chip{ background:#fff; border:1px solid #D9E3F5; color:var(--pws-primary); cursor:pointer; font-family:'Poppins',Arial,sans-serif; font-size:12px; font-weight:500; padding:8px 13px; border-radius:30px; transition:all .15s ease; text-align:left; }
#pws-chat .pws-chip:hover{ background:var(--pws-primary); color:#fff; border-color:var(--pws-primary); }

/* CTA */
#pws-chat .pws-cta{ flex-shrink:0; padding:10px 16px; background:#F4F7FC; border-top:1px solid #E3EAF6; text-align:center; }
#pws-chat .pws-cta a{ display:inline-block; background:var(--pws-accent); color:#fff; text-decoration:none; font-family:'Poppins',Arial,sans-serif; font-size:11px; font-weight:700; letter-spacing:1px; text-transform:uppercase; padding:11px 22px; border-radius:6px; transition:filter .15s; }
#pws-chat .pws-cta a:hover{ filter:brightness(1.05); }

/* input */
#pws-chat .pws-input{ flex-shrink:0; padding:14px 16px; background:#fff; border-top:1px solid #E3EAF6; display:flex; gap:10px; align-items:flex-end; }
#pws-chat .pws-input textarea{ flex:1; resize:none; border:1px solid #D9E3F5; border-radius:12px; padding:11px 14px; font-family:'Poppins',Arial,sans-serif; font-size:13.5px; color:#333; max-height:96px; line-height:1.5; outline:none; transition:border-color .15s; }
#pws-chat .pws-input textarea:focus{ border-color:var(--pws-primary); }
#pws-chat .pws-send{ background:var(--pws-primary); border:none; color:#fff; cursor:pointer; width:42px; height:42px; border-radius:12px; flex-shrink:0; display:flex; align-items:center; justify-content:center; transition:filter .15s; }
#pws-chat .pws-send:hover{ filter:brightness(1.1); }
#pws-chat .pws-send:disabled{ opacity:.4; cursor:not-allowed; }
#pws-chat .pws-send svg{ width:18px; height:18px; }

#pws-chat .pws-foot{ text-align:center; font-size:10px; color:#AAB7CC; padding:8px 0 12px; background:#fff; font-family:'Poppins',Arial,sans-serif; }

/* mobile: pannello a tutto schermo (override delle variabili) */
@media (max-width:480px){
  #pws-chat .pws-panel{ top:0 !important; bottom:var(--pws-bar-mobile) !important; left:0 !important; right:0 !important; width:100vw !important; max-width:100vw !important; height:auto !important; max-height:none !important; border-radius:0; }
  #pws-chat .pws-launcher{ bottom:var(--pws-bottom-mobile) !important; }
}
