
:root{
  --sab-primary: #2563eb;
  --sab-radius: 16px;
  --sab-shadow: 0 20px 40px rgba(0,0,0,.15);
  --sab-shadow-soft: 0 10px 25px rgba(0,0,0,.18);
  --sab-bg: #ffffff;
  --sab-muted: #6b7280;
  --sab-border: #e5e7eb;
  --sab-bot: #f3f4f6;
}

#sab-launcher{
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: var(--sab-primary);
  color: #fff;
  height: 56px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 0 12px;
  cursor: pointer;
  box-shadow: var(--sab-shadow-soft);
  z-index: 99999;
  user-select: none;
}
.sab-launcher-icon{
  width: 32px;height: 32px;display:inline-block;
  background: rgba(255,255,255,.15);
  border-radius: 10px; position: relative;
}
.sab-launcher-icon::before{
  content:""; position:absolute; inset:6px; background:#fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h16v11H7l-3 3V4z' fill='black'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h16v11H7l-3 3V4z' fill='black'/%3E%3C/svg%3E") no-repeat center / contain;
}
.sab-launcher-text{ font-weight: 800; font-size: 14px; letter-spacing:.2px; line-height: 1; }

#sab-widget{
  position: fixed;
  bottom: 86px;
  right: 18px;
  width: 360px;
  height: 520px;
  background: var(--sab-bg);
  border-radius: var(--sab-radius);
  box-shadow: var(--sab-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 99999;
  border: 1px solid rgba(0,0,0,.04);
}
.sab-closed{ display:none !important; }

.sab-header{
  background: var(--sab-primary);
  color:#fff;
  padding: 14px;
  display:flex;
  justify-content: space-between;
  align-items:flex-start;
}
.sab-header-title{ display:flex; flex-direction:column; gap:4px; }
#sab-title{ font-weight: 900; font-size: 14px; letter-spacing:.2px; }
.sab-subtitle{ font-size: 12px; opacity:.92; }

.sab-icon-btn{
  appearance:none;
  background: rgba(255,255,255,.15);
  color:#fff;
  border:none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 20px;
  cursor:pointer;
  line-height: 1;
}
.sab-icon-btn:hover{ background: rgba(255,255,255,.22); }

.sab-messages{
  flex: 1;
  padding: 14px;
  overflow-y:auto;
  background: #fbfbfc;
}
.sab-message{
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  margin: 0 0 10px 0;
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid rgba(0,0,0,.02);
  word-wrap: break-word;
}
.sab-user{ margin-left:auto; background: var(--sab-primary); color:#fff; }
.sab-bot{ background: var(--sab-bot); color:#111827; }

/* markdown elements */
.sab-message p{ margin: 0 0 8px 0; }
.sab-message p:last-child{ margin-bottom: 0; }
.sab-message ul{ margin: 6px 0 8px 18px; padding: 0; }
.sab-message li{ margin: 4px 0; }
.sab-message a{ color: #1d4ed8; text-decoration: underline; }

.sab-input-wrap{
  padding: 10px;
  border-top: 1px solid var(--sab-border);
  display:flex;
  gap: 8px;
  align-items:flex-end;
  background:#fff;
}
#sab-input{
  flex:1;
  resize:none;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--sab-border);
  font-size: 14px;
  line-height: 1.35;
  outline:none;
  max-height: 110px;
}
#sab-input:focus{ border-color: rgba(37,99,235,.45); box-shadow: 0 0 0 4px rgba(37,99,235,.14); }
.sab-send{
  background: var(--sab-primary);
  color:#fff;
  border:none;
  border-radius: 12px;
  font-weight: 900;
  padding: 10px 12px;
  cursor:pointer;
  min-width: 72px;
}
.sab-send:disabled{ opacity:.6; cursor:not-allowed; }

.sab-footnote{
  font-size: 11px;
  color: var(--sab-muted);
  padding: 8px 12px 10px 12px;
  border-top: 1px solid rgba(0,0,0,.04);
  background:#fff;
}

/* CTA buttons appear under latest bot response */
.sab-cta-wrap{
  margin-top: -2px;
  margin-bottom: 12px;
  display:flex;
  flex-direction: column;
  gap: 8px;
}
.sab-cta{
  display:flex;
  align-items:center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration:none;
  font-weight: 900;
  font-size: 14px;
  border: 1px solid rgba(0,0,0,.06);
}
.sab-cta.primary{ background: var(--sab-primary); color:#fff; }
.sab-cta.secondary{ background: #fff; color:#111827; }
.sab-cta-icon{ width: 18px; height: 18px; display:inline-block; }
.sab-cta-icon.whatsapp{
  background:#fff;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M19.11 17.53c-.29-.15-1.7-.84-1.96-.94-.26-.1-.45-.15-.64.15-.19.29-.74.94-.9 1.13-.17.19-.33.22-.62.07-.29-.15-1.22-.45-2.33-1.44-.86-.77-1.44-1.73-1.61-2.02-.17-.29-.02-.45.13-.59.13-.13.29-.33.44-.5.15-.17.19-.29.29-.48.1-.19.05-.36-.02-.5-.07-.15-.64-1.55-.88-2.12-.23-.55-.47-.48-.64-.49h-.55c-.19 0-.5.07-.76.36-.26.29-1  .98-1 2.39 0 1.41 1.02 2.77 1.16 2.96.15.19 2.01 3.06 4.88 4.29.68.29 1.21.46 1.62.59.68.22 1.3.19 1.79.11.55-.08 1.7-.7 1.94-1.38.24-.68.24-1.26.17-1.38-.07-.12-.26-.19-.55-.34z' fill='black'/%3E%3Cpath d='M16.04 2.67c-7.21 0-13.07 5.86-13.07 13.07 0 2.31.61 4.56 1.77 6.55L3.1 29.33l7.2-1.89c1.94 1.06 4.13 1.62 5.74 1.62 7.21 0 13.07-5.86 13.07-13.07S23.25 2.67 16.04 2.67zm0 23.74c-1.46 0-3.44-.47-5.07-1.45l-.36-.21-4.28 1.12 1.14-4.17-.23-.43c-1.05-1.97-1.61-4.19-1.61-6.44 0-6.13 4.99-11.12 11.12-11.12S27.86 8.7 27.86 14.83 22.17 26.41 16.04 26.41z' fill='black'/%3E%3C/svg%3E") no-repeat center/contain;
          mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M19.11 17.53c-.29-.15-1.7-.84-1.96-.94-.26-.1-.45-.15-.64.15-.19.29-.74.94-.9 1.13-.17.19-.33.22-.62.07-.29-.15-1.22-.45-2.33-1.44-.86-.77-1.44-1.73-1.61-2.02-.17-.29-.02-.45.13-.59.13-.13.29-.33.44-.5.15-.17.19-.29.29-.48.1-.19.05-.36-.02-.5-.07-.15-.64-1.55-.88-2.12-.23-.55-.47-.48-.64-.49h-.55c-.19 0-.5.07-.76.36-.26.29-1 .98-1 2.39 0 1.41 1.02 2.77 1.16 2.96.15.19 2.01 3.06 4.88 4.29.68.29 1.21.46 1.62.59.68.22 1.3.19 1.79.11.55-.08 1.7-.7 1.94-1.38.24-.68.24-1.26.17-1.38-.07-.12-.26-.19-.55-.34z' fill='black'/%3E%3Cpath d='M16.04 2.67c-7.21 0-13.07 5.86-13.07 13.07 0 2.31.61 4.56 1.77 6.55L3.1 29.33l7.2-1.89c1.94 1.06 4.13 1.62 5.74 1.62 7.21 0 13.07-5.86 13.07-13.07S23.25 2.67 16.04 2.67zm0 23.74c-1.46 0-3.44-.47-5.07-1.45l-.36-.21-4.28 1.12 1.14-4.17-.23-.43c-1.05-1.97-1.61-4.19-1.61-6.44 0-6.13 4.99-11.12 11.12-11.12S27.86 8.7 27.86 14.83 22.17 26.41 16.04 26.41z' fill='black'/%3E%3C/svg%3E") no-repeat center/contain;
}

#sab-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.62);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 100000;
}
.sab-hidden{ display:none !important; }
.sab-modal-content{
  width: min(1000px, 92vw);
  height: min(720px, 92vh);
  background:#fff;
  border-radius: 18px;
  overflow:hidden;
  box-shadow: var(--sab-shadow);
  position: relative;
}
.sab-modal-close{
  position:absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(0,0,0,.06);
  border: none;
  font-size: 22px;
  cursor: pointer;
}
#sab-modal-frame{ width:100%; height:100%; border:none; }

@media (max-width: 420px){
  #sab-widget{ right: 10px; left: 10px; width: auto !important; height: 70vh; bottom: 84px; }
  #sab-launcher{ right: 10px; left: auto; }
}
