.chat-page {
    padding: 30px 0 40px;
}

.chat-page__box {
    height: calc(100vh - 170px);
    min-height: 560px;
    max-width: 900px;
    margin: 0 auto;

    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);

    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-page__header {
    flex: 0 0 auto;

    min-height: 76px;
    padding: 14px 20px;

    display: flex;
    align-items: center;
    gap: 12px;

    background: #16a34a;
    color: #fff;
}

.chat-page__back {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    color: #fff;
    text-decoration: none;
    font-size: 24px;

    border-radius: 10px;
}

.chat-page__back:hover {
    background: rgba(255,255,255,.12);
}

.chat-page__avatar {
    width: 42px;
    height: 42px;

    border-radius: 13px;

    display: grid;
    place-items: center;

    background: rgba(255,255,255,.18);
    font-size: 21px;
}

.chat-page__title {
    display: flex;
    flex-direction: column;
}

.chat-page__title strong {
    font-size: 16px;
}

.chat-page__title span {
    margin-top: 3px;
    font-size: 12px;
    opacity: .85;
}

.chat-page__messages {
    flex: 1 1 auto;
    min-height: 0;

    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    padding: 20px;

    background: #f8fafc;

    display: flex;
    flex-direction: column;
    gap: 9px;
}

.chat-page__form {
    flex: 0 0 auto;

    padding: 12px;

    border-top: 1px solid #e5e7eb;
    background: #fff;

    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.chat-page__input {
    flex: 1;
    min-width: 0;

    max-height: 120px;

    resize: none;

    border: 1px solid #d1d5db;
    border-radius: 13px;

    padding: 11px 13px;

    font: inherit;
    font-size: 14px;

    outline: none;
}

.chat-page__input:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22,163,74,.10);
}

.chat-page__send {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;

    border: 0;
    border-radius: 12px;

    background: #16a34a;
    color: #fff;

    cursor: pointer;

    font-size: 18px;
}

.chat-page__send:disabled {
    opacity: .55;
    cursor: not-allowed;
}


.arcar-chat__empty {
    margin: auto;

    max-width: 420px;

    text-align: center;

    color: #6b7280;

    font-size: 14px;
    line-height: 1.5;

    padding: 30px;
}

.arcar-chat__message {
    max-width: 75%;

    padding: 10px 13px;

    border-radius: 15px;

    font-size: 14px;
    line-height: 1.45;

    word-break: break-word;
}

.arcar-chat__message--client {
    align-self: flex-end;

    background: #16a34a;
    color: #fff;

    border-bottom-right-radius: 5px;
}

.arcar-chat__message--operator {
    align-self: flex-start;

    background: #fff;
    color: #111827;

    border: 1px solid #e5e7eb;

    border-bottom-left-radius: 5px;
}

.arcar-chat__time {
    display: block;

    margin-top: 4px;

    font-size: 10px;
    opacity: .65;
}


@media (max-width: 768px) {

    .chat-page {
        padding: 0;
    }

    .chat-page .container {
        width: 100%;
        max-width: none;

        padding: 0;
    }

    .chat-page__box {
        height: calc(100dvh - 72px);
        min-height: 0;

        max-width: none;

        margin: 0;

        border-radius: 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;

        box-shadow: none;
    }

    .chat-page__header {
        min-height: 68px;

        padding:
            10px 14px
            calc(10px + env(safe-area-inset-bottom))
            14px;
    }

    .chat-page__messages {
        padding: 14px;
    }

    .chat-page__form {
        padding:
            10px 10px
            calc(10px + env(safe-area-inset-bottom));
    }

    .chat-page__input {
        font-size: 16px;
    }

    .arcar-chat__message {
        max-width: 86%;
    }
}
