#automatika-chat-root * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ak-chat-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b3fb8 0%, #4a2577 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(107, 44, 145, 0.45);
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ak-chat-button:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 28px rgba(107, 44, 145, 0.55);
}

.ak-chat-button svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.ak-chat-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: white;
    border-radius: 18px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 999999;
}

.ak-chat-window.ak-open { display: flex; }

/* HEADER con texto bien legible */
.ak-chat-header {
    background: linear-gradient(135deg, #8b3fb8 0%, #4a2577 100%);
    color: #ffffff;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ak-header-info h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.2px;
}

.ak-header-info p {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ak-status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.25);
}

.ak-close-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ak-close-btn:hover { background: rgba(255, 255, 255, 0.15); }
.ak-close-btn svg { width: 18px; height: 18px; fill: white; }

.ak-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background: #faf9fc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ak-message {
    max-width: 82%;
    padding: 11px 15px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
}

.ak-message.ak-bot {
    background: white;
    color: #1a1a1a;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.ak-message.ak-user {
    background: linear-gradient(135deg, #8b3fb8 0%, #6b2c91 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ak-message a { color: inherit; text-decoration: underline; }
.ak-message.ak-bot a { color: #6b2c91; font-weight: 600; }

.ak-typing {
    align-self: flex-start;
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.ak-typing span {
    width: 7px;
    height: 7px;
    background: #b8a9c9;
    border-radius: 50%;
    animation: ak-bounce 1.4s infinite;
}

.ak-typing span:nth-child(2) { animation-delay: 0.2s; }
.ak-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ak-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* INPUT AREA moderna y legible */
.ak-chat-input-area {
    border-top: 1px solid #ece8f1;
    padding: 14px;
    display: flex;
    gap: 10px;
    align-items: center;
    background: white;
}

.ak-chat-input {
    flex: 1;
    border: 1.5px solid #e5e1ec;
    border-radius: 24px;
    padding: 11px 18px;
    font-size: 14.5px;
    color: #1a1a1a;
    background: #f7f5fa;
    outline: none;
    transition: all 0.2s;
}

.ak-chat-input::placeholder {
    color: #9a8fad;
}

.ak-chat-input:focus {
    border-color: #8b3fb8;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(139, 63, 184, 0.12);
}

.ak-chat-send {
    background: linear-gradient(135deg, #8b3fb8 0%, #6b2c91 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    min-width: 42px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(107, 44, 145, 0.3);
}

.ak-chat-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(107, 44, 145, 0.4);
}

.ak-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.ak-chat-send svg {
    width: 18px;
    height: 18px;
    fill: white;
    margin-left: 2px;
}

@media (max-width: 480px) {
    .ak-chat-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}