.aipc-chat-container {
    position: fixed;
    z-index: 9999 !important;
}

.aipc-chat-button {
    position: fixed;
    z-index: 9998 !important;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FCBB24;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.4);
    transition: all 0.3s ease;
}

.aipc-chat-button:hover {
    background: #FCBB24;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 115, 170, 0.5);
}

.aipc-chat-button svg {
    width: 24px;
    height: 24px;
}

.aipc-chat-popup {
    display: none;
    position: fixed;
    width: 380px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    overflow: hidden;
    z-index: 9999 !important;
    -webkit-overflow-scrolling: touch;
    bottom: 10px !important;
    right: 10px !important;
}

.aipc-chat-popup.active {
    display: flex;
}

.aipc-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #3d3d3d 0%, #000 100%);
    color: white;
}

.aipc-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.aipc-close-button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.aipc-close-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.aipc-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
    min-height: 200px;
    max-height: calc(100vh - 250px);
}

.aipc-message {
    margin-bottom: 15px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aipc-message-content {
    display: inline-block;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
}

.aipc-bot-message .aipc-message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.aipc-user-message {
    text-align: right;
}

.aipc-user-message .aipc-message-content {
    background: #FCBB24;
    color: white;
    border-bottom-right-radius: 4px;
}

.aipc-chat-input-container {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.aipc-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.aipc-chat-input:focus {
    border-color: #FCBB24;
}

.aipc-send-button {
    background: #FCBB24;
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.aipc-send-button:hover {
    background: #FCBB24;
    transform: scale(1.05);
}

.aipc-send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: scale(1);
}

.aipc-loading {
    position: absolute;
    bottom: 70px;
    left: 20px;
    background: white;
    padding: 10px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.aipc-loading-dots {
    display: flex;
    gap: 4px;
}

.aipc-loading-dots span {
    width: 8px;
    height: 8px;
    background: #FCBB24;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.aipc-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.aipc-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

@media (max-width: 480px) {

  .aipc-chat-popup {
    /* 🔄 Substituições */
    width: 80vw !important;              /* antes: calc(100vw - 20px) */
    max-width: 350px !important;         /* antes: 100vw */
    height: 45vh !important;             /* antes: auto */
    max-height: 380px !important;        /* antes: 85vh */
    left: 50% !important;                /* antes: 10px */
    right: auto !important;              /* antes: 10px */
    transform: translateX(-50%) !important; /* adicionado p/ centralizar */
    margin: 0 auto;
  }

  .aipc-chat-messages {
    /* 🔄 Ajuste proporcional ao novo tamanho */
    padding: 12px; 
    max-height: calc(45vh - 55px - 60px); /* antes: calc(85vh - 180px) */
    min-height: 0;                        /* antes: 250px (removido p/ caber no popup) */
  }

  .aipc-chat-header {
    /* 🔄 Aumentei altura e padding */
    padding: 10px 16px;                   /* antes: 15px */
    height: 55px !important;              /* adicionado */
  }

  .aipc-chat-header h3 {
    font-size: 16px;                      /* mantido igual */
  }

  .aipc-chat-input-container {
    padding: 10px 12px;                   /* antes: 12px */
  }

  .aipc-chat-input {
    font-size: 16px;                      /* mantido p/ evitar zoom no iOS */
    padding: 8px 12px;                    /* antes: 10px 14px */
  }

  /* 🟩 Abaixo: tudo do seu CSS original preservado */
  .aipc-message-content {
    max-width: 85%;
    font-size: 14px;
  }

  .aipc-chat-button.icon-only span {
    display: none;
  }

  .aipc-chat-button.icon-only {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
  }

  .aipc-chat-button.icon-text span {
    display: inline;
    font-size: 14px;
  }

  .aipc-chat-button.icon-text {
    padding: 12px 18px;
    font-size: 14px;
  }

  .aipc-chat-button.icon-text svg {
    width: 20px;
    height: 20px;
  }

  .aipc-loading {
    bottom: 60px;
    left: 15px;
  }
}
