/* Cybermatica Live Chat */
.cma-chat {
    --cma-chat-accent: #087455;
    position: fixed;
    z-index: 999999;
    bottom: 22px;
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    color: #203743;
}

.cma-chat--right { right: 22px; }
.cma-chat--left { left: 22px; }

.cma-chat-launcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 54px;
    padding: 10px 17px 10px 12px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--cma-chat-accent), #034b39);
    color: #fff;
    box-shadow: 0 16px 38px rgba(4,75,57,.28);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    transition: transform .2s ease, box-shadow .2s ease;
}

.cma-chat-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 45px rgba(4,75,57,.33);
}

.cma-chat-launcher__icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    background: rgba(255,255,255,.15);
}

.cma-chat-launcher__icon svg {
    width: 20px;
    height: 20px;
}

.cma-chat-launcher__pulse {
    position: absolute;
    top: -4px;
    right: -3px;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #2cc879;
    box-shadow: 0 0 0 0 rgba(44,200,121,.5);
    animation: cma-chat-pulse 1.8s infinite;
}

@keyframes cma-chat-pulse {
    0% { box-shadow: 0 0 0 0 rgba(44,200,121,.5); }
    70% { box-shadow: 0 0 0 10px rgba(44,200,121,0); }
    100% { box-shadow: 0 0 0 0 rgba(44,200,121,0); }
}

.cma-chat-panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    display: flex;
    width: min(370px, calc(100vw - 28px));
    height: min(560px, calc(100vh - 110px));
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dce8e3;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 26px 75px rgba(17,49,39,.25);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(.98);
    transform-origin: bottom right;
    transition: opacity .2s ease, transform .2s ease;
}

.cma-chat--left .cma-chat-panel {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

.cma-chat.is-open .cma-chat-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.cma-chat.is-open .cma-chat-launcher {
    display: none;
}

.cma-chat-header {
    display: grid;
    grid-template-columns: 43px minmax(0,1fr) 34px;
    gap: 11px;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, var(--cma-chat-accent), #034b39);
    color: #fff;
}

.cma-chat-avatar {
    display: grid;
    width: 43px;
    height: 43px;
    place-items: center;
    border-radius: 13px;
    background: rgba(255,255,255,.15);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .04em;
}

.cma-chat-header__copy {
    min-width: 0;
}

.cma-chat-header__copy strong,
.cma-chat-header__copy small {
    display: block;
}

.cma-chat-header__copy strong {
    font-size: 14px;
    line-height: 1.3;
}

.cma-chat-header__copy small {
    margin-top: 3px;
    color: rgba(255,255,255,.8);
    font-size: 10px;
    line-height: 1.25;
}

.cma-chat-online-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: #39d98a;
}

.cma-chat-minimize {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
    font-size: 19px;
}

.cma-chat-body {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    background: #f5f9f7;
}

.cma-chat-prechat {
    overflow-y: auto;
    padding: 18px;
}

.cma-chat-welcome {
    margin-bottom: 17px;
    padding: 15px;
    border: 1px solid #e1ece7;
    border-radius: 14px;
    background: #fff;
}

.cma-chat-welcome strong {
    color: #173247;
    font-size: 13px;
}

.cma-chat-welcome p {
    margin: 5px 0 0;
    color: #64767e;
    font-size: 12px;
    line-height: 1.55;
}

.cma-chat-start-form {
    display: grid;
    gap: 13px;
}

.cma-chat-start-form label span {
    display: block;
    margin-bottom: 5px;
    color: #233c47;
    font-size: 11px;
    font-weight: 800;
}

.cma-chat-start-form input,
.cma-chat-message-form textarea {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid #d8e5df;
    outline: none;
    background: #fff;
    color: #203743;
    font: inherit;
}

.cma-chat-start-form input {
    min-height: 44px;
    padding: 9px 11px;
    border-radius: 11px;
    font-size: 12px;
}

.cma-chat-start-form input:focus,
.cma-chat-message-form textarea:focus {
    border-color: var(--cma-chat-accent);
    box-shadow: 0 0 0 3px rgba(8,116,85,.1);
}

.cma-chat-primary {
    min-height: 46px;
    border: 0;
    border-radius: 11px;
    background: var(--cma-chat-accent);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 850;
}

.cma-chat-privacy {
    color: #82918a;
    font-size: 9px;
    line-height: 1.45;
    text-align: center;
}

.cma-chat-conversation {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
}

.cma-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scroll-behavior: smooth;
}

.cma-chat-message {
    display: flex;
    margin-bottom: 10px;
}

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

.cma-chat-message__bubble {
    max-width: 80%;
    padding: 10px 12px 8px;
    border-radius: 14px 14px 14px 4px;
    background: #fff;
    color: #263d48;
    box-shadow: 0 5px 18px rgba(20,50,68,.07);
    font-size: 12px;
    line-height: 1.48;
    white-space: pre-wrap;
    word-break: break-word;
}

.cma-chat-message--visitor .cma-chat-message__bubble {
    border-radius: 14px 14px 4px 14px;
    background: var(--cma-chat-accent);
    color: #fff;
    box-shadow: 0 5px 18px rgba(8,116,85,.18);
}

.cma-chat-message__meta {
    display: block;
    margin-top: 5px;
    color: #91a09a;
    font-size: 8px;
}

.cma-chat-message--visitor .cma-chat-message__meta {
    color: rgba(255,255,255,.7);
    text-align: right;
}

.cma-chat-agent-status {
    padding: 6px 15px;
    border-top: 1px solid #e5eee9;
    background: #fff;
    color: #75867e;
    font-size: 9px;
}

.cma-chat-message-form {
    display: grid;
    grid-template-columns: minmax(0,1fr) 42px;
    gap: 8px;
    padding: 10px 12px 12px;
    background: #fff;
}

.cma-chat-message-form textarea {
    min-height: 42px;
    max-height: 105px;
    padding: 10px 11px;
    resize: none;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.4;
}

.cma-chat-message-form button {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: var(--cma-chat-accent);
    color: #fff;
    cursor: pointer;
}

.cma-chat-message-form button svg {
    width: 19px;
    height: 19px;
}

.cma-chat-end {
    align-self: center;
    margin: 0 0 8px;
    padding: 3px 7px;
    border: 0;
    background: transparent;
    color: #87958f;
    cursor: pointer;
    font-size: 9px;
    text-decoration: underline;
}

.cma-chat-error {
    margin: 8px 0;
    padding: 8px 10px;
    border-radius: 9px;
    background: #fff0f0;
    color: #a33a3a;
    font-size: 10px;
}

@media (max-width: 600px) {
    .cma-chat {
        right: 12px !important;
        left: 12px !important;
        bottom: 12px;
    }

    .cma-chat-launcher {
        float: right;
    }

    .cma-chat--left .cma-chat-launcher {
        float: left;
    }

    .cma-chat-panel,
    .cma-chat--left .cma-chat-panel {
        position: fixed;
        right: 10px;
        bottom: 10px;
        left: 10px;
        width: auto;
        height: min(620px, calc(100vh - 20px));
        border-radius: 18px;
        transform-origin: bottom center;
    }
}

