.ps-chat-root {
    position: fixed;
    bottom: 20px;
    z-index: 99999;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

.ps-chat-right {
    right: 20px;
}

.ps-chat-left {
    left: 20px;
}

.ps-chat-launcher {
    background: #0f766e;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.ps-chat-launcher:hover {
    opacity: 0.94;
}

.ps-chat-panel {
    width: min(360px, calc(100vw - 24px));
    max-height: calc(100vh - 60px);
    background: #ffffff;
    border: 1px solid #d6dde3;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 16px 44px rgba(15, 23, 42, 0.24);
    display: flex;
    flex-direction: column;
}

.ps-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: linear-gradient(120deg, #0f172a 0%, #0f766e 100%);
    color: #ffffff;
    padding: 12px 14px;
    font-size: 14px;
}

.ps-chat-close {
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.ps-chat-body {
    padding: 12px;
    overflow-y: auto;
}

.ps-chat-greeting {
    margin: 0 0 10px;
    color: #334155;
    font-size: 13px;
}

.ps-chat-status {
    min-height: 18px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #475569;
}

.ps-chat-status.error {
    color: #b91c1c;
}

.ps-chat-status.ok {
    color: #0f766e;
}

.ps-chat-messages {
    min-height: 120px;
    max-height: 210px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 10px;
    background: #f8fafc;
}

.ps-chat-message {
    margin-bottom: 8px;
    display: flex;
}

.ps-chat-message .bubble {
    max-width: 85%;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.4;
}

.ps-chat-message.visitor {
    justify-content: flex-end;
}

.ps-chat-message.visitor .bubble {
    background: #0f766e;
    color: #ffffff;
}

.ps-chat-message.system,
.ps-chat-message.agent {
    justify-content: flex-start;
}

.ps-chat-message.system .bubble,
.ps-chat-message.agent .bubble {
    background: #e2e8f0;
    color: #0f172a;
}

.ps-chat-label {
    display: block;
    margin: 0 0 4px;
    font-size: 12px;
    color: #334155;
    font-weight: 600;
}

.ps-chat-body input,
.ps-chat-body select,
.ps-chat-body textarea,
.ps-chat-body button {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 13px;
}

.ps-chat-body textarea {
    resize: vertical;
}

.ps-chat-body button {
    background: #0f766e;
    color: #ffffff;
    border-color: #0f766e;
    font-weight: 700;
    cursor: pointer;
}

.ps-chat-body button:hover {
    opacity: 0.94;
}

.ps-chat-ticket-form {
    border-top: 1px dashed #cbd5e1;
    padding-top: 8px;
    margin-top: 6px;
}

@media (max-width: 640px) {
    .ps-chat-root {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .ps-chat-right,
    .ps-chat-left {
        left: 10px;
        right: 10px;
    }

    .ps-chat-panel {
        width: 100%;
    }
}
