#svc-chat-root {
  --svc-accent: #D4A017;
  --svc-ink: #141414;
  --svc-soft: #FAF4E3;
  position: fixed;
  bottom: 20px;
  z-index: 99999;
  font-family: Inter, Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--svc-ink);
}
#svc-chat-root.svc-pos-right { right: 20px; }
#svc-chat-root.svc-pos-left { left: 20px; }
#svc-chat-root *, #svc-chat-root *::before, #svc-chat-root *::after { box-sizing: border-box; }

/* Botón flotante */
#svc-chat-root .svc-launcher {
  position: relative;
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 0;
  background: var(--svc-ink);
  color: var(--svc-accent);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform .2s ease;
  padding: 0;
}
#svc-chat-root .svc-launcher:hover { transform: scale(1.06); }
#svc-chat-root .svc-badge {
  position: absolute; top: -2px; right: -2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #e5484d; color: #fff;
  font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid #fff;
}
#svc-chat-root.svc-open .svc-launcher { display: none; }

/* Panel */
#svc-chat-root .svc-panel {
  position: absolute; bottom: 0;
  width: 370px; height: min(600px, calc(100vh - 40px));
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
  display: flex; flex-direction: column;
  overflow: hidden;
  opacity: 0; visibility: hidden;
  transform: translateY(16px) scale(.98);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
#svc-chat-root.svc-pos-right .svc-panel { right: 0; }
#svc-chat-root.svc-pos-left .svc-panel { left: 0; }
#svc-chat-root.svc-open .svc-panel { opacity: 1; visibility: visible; transform: none; }

#svc-chat-root .svc-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px;
  background: var(--svc-ink); color: #fff;
}
#svc-chat-root .svc-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--svc-accent); color: var(--svc-ink);
  font-family: Montserrat, sans-serif; font-weight: 800; font-size: 12px;
  display: grid; place-items: center; flex: none;
}
#svc-chat-root .svc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#svc-chat-root .svc-title strong { font-family: Montserrat, sans-serif; font-size: 15px; }
#svc-chat-root .svc-title span { font-size: 12px; opacity: .75; display: flex; align-items: center; gap: 6px; }
#svc-chat-root .svc-title i { width: 7px; height: 7px; border-radius: 50%; background: #3fcf6c; display: inline-block; }
#svc-chat-root .svc-wa, #svc-chat-root .svc-close {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.08); color: #fff;
  border: 0; cursor: pointer; padding: 0; text-decoration: none;
}
#svc-chat-root .svc-wa { color: #3fcf6c; }
#svc-chat-root .svc-wa:hover, #svc-chat-root .svc-close:hover { background: rgba(255,255,255,.18); }

#svc-chat-root .svc-body {
  flex: 1; overflow-y: auto;
  padding: 16px 14px 8px;
  background: var(--svc-soft);
  display: flex; flex-direction: column; gap: 8px;
}
#svc-chat-root .svc-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 16px;
  word-wrap: break-word;
}
#svc-chat-root .svc-msg p { margin: 0 0 6px; }
#svc-chat-root .svc-msg p:last-child { margin: 0; }
#svc-chat-root .svc-msg ul { margin: 4px 0 6px; padding-left: 18px; }
#svc-chat-root .svc-msg li { margin: 2px 0; }
#svc-chat-root .svc-bot {
  align-self: flex-start;
  background: #fff;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
#svc-chat-root .svc-bot a { color: #8a6500; font-weight: 600; text-decoration: underline; }
#svc-chat-root .svc-user {
  align-self: flex-end;
  background: var(--svc-accent);
  color: var(--svc-ink);
  border-bottom-right-radius: 4px;
}
#svc-chat-root .svc-typing { display: flex; gap: 4px; padding: 14px; }
#svc-chat-root .svc-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #b9b1a0;
  animation: svc-dot 1.2s infinite ease-in-out;
}
#svc-chat-root .svc-typing span:nth-child(2) { animation-delay: .15s; }
#svc-chat-root .svc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes svc-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

#svc-chat-root .svc-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 14px 10px;
  background: var(--svc-soft);
}
#svc-chat-root .svc-chips:empty { display: none; }
#svc-chat-root .svc-chips button {
  border: 1px solid var(--svc-accent);
  background: #fff; color: var(--svc-ink);
  border-radius: 99px;
  padding: 6px 12px;
  font: inherit; font-size: 13px;
  cursor: pointer;
}
#svc-chat-root .svc-chips button:hover { background: var(--svc-accent); }

#svc-chat-root .svc-form {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #eee;
  background: #fff;
  margin: 0;
}
#svc-chat-root .svc-form textarea {
  flex: 1; resize: none;
  border: 1px solid #ddd; border-radius: 14px;
  padding: 10px 12px;
  font: inherit; font-size: 16px; /* evita zoom en iPhone */
  line-height: 1.35;
  max-height: 110px;
  outline: none;
  background: #fff; color: var(--svc-ink);
  margin: 0; min-height: 0;
}
#svc-chat-root .svc-form textarea:focus { border-color: var(--svc-accent); }
#svc-chat-root .svc-form button {
  width: 42px; height: 42px; flex: none;
  border-radius: 50%; border: 0;
  background: var(--svc-accent); color: var(--svc-ink);
  display: grid; place-items: center;
  cursor: pointer; padding: 0;
}
#svc-chat-root .svc-foot {
  font-size: 11px; color: #8a8a8a; text-align: center;
  padding: 0 12px 8px; background: #fff;
}

/* Móvil: pantalla completa */
@media (max-width: 480px) {
  #svc-chat-root { bottom: 16px; }
  #svc-chat-root.svc-pos-right { right: 16px; }
  #svc-chat-root.svc-pos-left { left: 16px; }
  #svc-chat-root .svc-panel {
    position: fixed; inset: 0;
    width: 100%; height: 100%;
    border-radius: 0;
  }
}

#svc-chat-root .svc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#svc-chat-root .svc-wa-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px;
  padding: 8px 14px;
  border-radius: 99px;
  background: #25D366; color: #fff !important;
  font-weight: 600; text-decoration: none !important;
}
#svc-chat-root .svc-wa-btn:hover { filter: brightness(.95); }
