  /* --- Scoped reset --- */
  .chat-embed, .chat-embed * { box-sizing: border-box; margin: 0; padding: 0; }

  .chat-embed {
    background: transparent;
    font-family: sans-serif;
    display: flex; justify-content: center; align-items: center;
    padding: 0.5rem;
  }

  .chat-embed .chat-slider {
    width: 100%; max-width: 400px; height: 600px;
    border-radius: 20px; overflow: hidden;
    background: white; box-shadow: 0 0 20px rgba(0,0,0,0.2);
    transition: background 0.3s ease-in-out;
    display: flex; flex-direction: column;
  }
  .chat-embed .chat-header {
    position: relative;
    height: 60px; display: flex; align-items: center;
    padding: 0 1rem;
    font-weight: bold; font-size: 16px;
    background: #3b82f6; color: white;
    transition: background 0.3s ease-in-out;
  }
  .chat-embed .progress-container {
    position: absolute; bottom: 0; left: 0;
    width: 100%; height: 4px;
    background: rgba(255,255,255,0.3);
  }
  .chat-embed .progress-bar {
    width: 0; height: 100%;
    background: rgba(255,255,255,0.8);
    animation: chatProgress 20s linear forwards;
  }
  @keyframes chatProgress { from { width:0 } to { width:100% } }

  .chat-embed .chat-body {
    flex: 1; padding: 1rem;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 1.5rem;
  }
  .chat-embed .chat-footer {
    height: 60px; display: flex; align-items: center;
    padding: 0.5rem 1rem; background: #f9fafb;
  }
  .chat-embed .chat-footer input {
    flex: 1; padding: 8px 12px;
    border: 1px solid #d1d5db; border-radius: 9999px;
    font-size: 14px;
  }
  .chat-embed .chat-footer button {
    margin-left: 0.5rem;
    background: #3b82f6; color: white;
    border: none; padding: 8px 12px; border-radius: 50%;
    cursor: pointer; transition: transform 0.2s ease;
  }
  .chat-embed .chat-footer button:hover { transform: scale(1.1); }

  .chat-embed .message { display: flex; gap: 16px; align-items: flex-start; }
  .chat-embed .message.user { flex-direction: row-reverse; gap: 1px;}
  .chat-embed .bubble {
    padding: 1px 7px; border-radius: 10px;
    max-width: 85%; font-size: 14px;
    background: #e5e7eb; color: #111827;
    animation: chatSlideIn 0.4s ease both;
  }
  .chat-embed .message.user .bubble { background: #3b82f6; color: white; }

  .chat-embed .avatar {
    width:50px; height:50px; border-radius:100%; object-fit:cover;
    border:2px solid #fff; box-shadow:0 1px 2px rgba(0,0,0,0.1);
  }

  @keyframes chatSlideIn {
    from { opacity: 0; transform: translateX(20px) translateY(10px); }
    to   { opacity: 1; transform: translateX(0) translateY(0); }
  }

  .chat-embed .timestamp { font-size: 11px; color: #6b7280; margin-top: 0px; opacity: 0.7; }
  .chat-embed .theme-logo { margin-right: 8px; width: 24px; height: 24px; }

  .chat-embed .typing { display: flex; gap: 6px; margin-left: 40px; }
  .chat-embed .typing div {
    width: 6px; height: 6px; background: #9ca3af;
    border-radius: 50%; animation: chatBounce 1.2s infinite;
  }
  .chat-embed .typing div:nth-child(2) { animation-delay: 0.2s; }
  .chat-embed .typing div:nth-child(3) { animation-delay: 0.4s; }
  @keyframes chatBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

  /* Themes (scopeado) */
  .chat-embed .whatsapp   { background: #075E54!important; }
  .chat-embed .instagram  { background: linear-gradient(to right,#feda75,#fa7e1e,#d62976,#962fbf,#4f5bd5)!important; }
  .chat-embed .facebook   { background: #1877F2!important; }
  .chat-embed .x          { background: #000!important; }
  .chat-embed .telegram   { background: #0088cc!important; }
  .chat-embed .line       { background: #00c300!important; }
  .chat-embed .viber      { background: #7360f2!important; }
  .chat-embed .webchat    { background: #2563eb!important; }
  .chat-embed .zalo       { background: #0068ff!important; }
  .chat-embed .shopify    { background: #96bf48!important; }
  .chat-embed .woocommerce{ background: #96588a!important; }
  .chat-embed .gmail      { background: #ea4335!important; }
  .chat-embed .sms        { background: #4b5563!important; }
  .chat-embed .wechat     { background: #7bb32e!important; }
  .chat-embed .zendesk    { background: #03363d!important; }