body {
    font-family: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f4f6f9;
}

/* Contenedor */
#qsis-chat-container {
    width: 360px;
    max-height: 470px;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* Header */
#qsis-chat-header {
    padding: 14px 16px;
    background: linear-gradient(135deg, #2f80ed, #1c63c7);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

/* Body */
#qsis-chat-body {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Mensajes */
.msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.25;
    letter-spacing: -0.3px;
    white-space: pre-wrap;
    word-break: break-word;
	margin: 2px 0px;
}

/* Usuario */
.msg.user {
    align-self: flex-end;
    background: #6ba2c3;
    color: #fff;
    border-radius: 16px 16px 4px 16px;
}

/* Agente */
.msg.agent {
    align-self: flex-start;
    background: #e8ecf1a3;
    color: #212529;
    border-radius: 16px 16px 16px 4px;
}

/* Niveles */
.msg.agent.A { border-left: 4px solid #ff4d4f; }
.msg.agent.B { border-left: 4px solid #faad14; }
.msg.agent.C { border-left: 4px solid #52c41a; }

/* Footer */
#qsis-chat-footer {
    display: flex;
    padding: 8px;
    border-top: 1px solid #ddd;
    background: #fff;
}

#qsis-chat-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e5e8ef;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

#qsis-chat-send {
    margin-left: 8px;
    padding: 8px 16px;
    background: #0054a6;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

#qsis-chat-send:hover { background: #003d7a; }

/* Cursor tipo máquina de escribir */
.qsis-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #3a7bd5;
    margin-left: 2px;
    animation: blink 1s infinite;
    vertical-align: bottom;
}

@keyframes blink {
    0%,50%,100% { opacity: 1; }
    25%,75% { opacity: 0; }
}

/* Indicador "escribiendo" */
.typing {
    display: flex;
    gap: 4px;
    padding: 6px 12px;
    align-self: flex-start;
}
.typing span {
    width: 6px; height: 6px;
    background: #3a7bd5;
    border-radius: 50%;
    animation: typing 1.4s infinite both;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
.hidden { display: none; }

@keyframes typing {
    0% { opacity: .3; }
    20% { opacity: 1; }
    100% { opacity: .3; }
}
