.dpai-chat {
    width: 100%;
    max-width: 760px;
    margin: 24px auto;
    background: #fff;
    border: 1px solid #e6ecea;
    border-radius: 22px;
    box-shadow: 0 18px 50px rgba(11, 42, 34, 0.10);
    overflow: hidden;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #13231f;
}

.dpai-chat * {
    box-sizing: border-box;
}

.dpai-chat__header {
    padding: 18px 20px;
    border-bottom: 1px solid #edf1f0;
    background: linear-gradient(135deg, #f7fffc, #ffffff);
}

.dpai-chat__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dpai-chat__brand strong {
    display: block;
    font-size: 16px;
    line-height: 1.25;
}

.dpai-chat__logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #00D79E;
    color: #06251d;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.dpai-chat__status {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #678079;
    font-size: 12px;
}

.dpai-chat__status i {
    width: 7px;
    height: 7px;
    background: #00D79E;
    border-radius: 50%;
    display: inline-block;
}

.dpai-chat__messages {
    height: 430px;
    overflow-y: auto;
    padding: 22px 18px;
    background: #fbfdfc;
    scroll-behavior: smooth;
}

.dpai-msg {
    display: flex;
    margin: 0 0 14px;
}

.dpai-msg--user {
    justify-content: flex-end;
}

.dpai-msg__bubble {
    max-width: min(82%, 620px);
    padding: 12px 14px;
    border-radius: 16px;
    line-height: 1.55;
    font-size: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.dpai-msg--ai .dpai-msg__bubble {
    background: #fff;
    border: 1px solid #e4ebe8;
    border-bottom-left-radius: 5px;
}

.dpai-msg--user .dpai-msg__bubble {
    background: #00D79E;
    color: #06251d;
    border-bottom-right-radius: 5px;
}

.dpai-msg--error .dpai-msg__bubble {
    background: #fff3f2;
    color: #8c2f26;
    border: 1px solid #ffd8d4;
}

.dpai-chat__typing {
    padding: 0 20px 12px;
    color: #698079;
    font-size: 12px;
    background: #fbfdfc;
}

.dpai-chat__typing span {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 3px;
    border-radius: 50%;
    background: #00D79E;
    animation: dpaiBounce 1s infinite ease-in-out;
}

.dpai-chat__typing span:nth-child(2) { animation-delay: 0.12s; }
.dpai-chat__typing span:nth-child(3) { animation-delay: 0.24s; }

.dpai-chat__typing em {
    margin-left: 7px;
    font-style: normal;
}

@keyframes dpaiBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .45; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.dpai-chat__composer {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    padding: 14px 16px 8px;
    border-top: 1px solid #edf1f0;
    background: #fff;
}

.dpai-chat__composer textarea {
    flex: 1;
    min-height: 46px;
    max-height: 130px;
    resize: none;
    border: 1px solid #dce6e2;
    border-radius: 15px;
    padding: 12px 14px;
    outline: none;
    font: inherit;
    line-height: 1.45;
    color: #13231f;
    background: #fbfdfc;
}

.dpai-chat__composer textarea:focus {
    border-color: #00D79E;
    box-shadow: 0 0 0 3px rgba(0, 215, 158, 0.10);
}

.dpai-chat__composer button {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border: 0;
    border-radius: 15px;
    background: #00D79E;
    color: #06251d;
    cursor: pointer;
    font-size: 18px;
    font-weight: 800;
}

.dpai-chat__composer button:disabled {
    opacity: .55;
    cursor: wait;
}

.dpai-chat__hint {
    padding: 0 18px 12px;
    color: #8b9b96;
    font-size: 11px;
    background: #fff;
}

@media (max-width: 640px) {
    .dpai-chat {
        margin: 12px auto;
        border-radius: 16px;
    }

    .dpai-chat__messages {
        height: 62vh;
        min-height: 360px;
        padding: 16px 12px;
    }

    .dpai-msg__bubble {
        max-width: 88%;
        font-size: 14px;
    }

    .dpai-chat__header {
        padding: 14px;
    }

    .dpai-chat__composer {
        padding: 10px;
    }
}
