#sag-chat-launcher {
  position: fixed;
  bottom: 24px;
  z-index: 999998;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #7c3aed 0%, #22c55e 100%);
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#sag-chat-launcher:hover { transform: scale(1.06); box-shadow: 0 10px 28px rgba(124, 58, 237, 0.5); }
#sag-chat-launcher .sag-dot {
  position: absolute; top: 2px; right: 2px; width: 12px; height: 12px;
  background: #ef4444; border-radius: 50%; border: 2px solid #fff;
}

#sag-chat-window {
  position: fixed;
  bottom: 96px;
  z-index: 999999;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 140px);
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#sag-chat-window.sag-open { display: flex; }

#sag-chat-header {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#sag-chat-header .sag-title { font-weight: 700; font-size: 15px; }
#sag-chat-header .sag-sub { font-size: 12px; opacity: 0.85; margin-top: 2px; }
#sag-chat-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

#sag-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8f8fc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sag-msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; }
.sag-msg.bot { background: #ffffff; border: 1px solid #ececf5; color: #1f2937; align-self: flex-start; border-bottom-left-radius: 4px; }
.sag-msg.user { background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }

.sag-quick-replies { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.sag-quick-btn {
  background: #fff; border: 1px solid #d8b4fe; color: #7c3aed;
  padding: 7px 12px; border-radius: 999px; font-size: 12.5px; cursor: pointer;
  transition: all 0.15s ease;
}
.sag-quick-btn:hover { background: #7c3aed; color: #fff; }

.sag-whatsapp-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #25D366; color: #fff; text-decoration: none;
  padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  margin-top: 6px;
}

#sag-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #ececf5;
  background: #fff;
}
#sag-chat-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13.5px;
  outline: none;
}
#sag-chat-input:focus { border-color: #7c3aed; }
#sag-chat-send {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  border: none;
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
}

@media (max-width: 480px) {
  #sag-chat-window { width: calc(100vw - 24px); right: 12px !important; left: 12px !important; }
}
