.mc-webchat {
    position: fixed;
    z-index: 9998;
    font-family: inherit;
    color: #172033;
}

.mc-webchat * {
    box-sizing: border-box;
}

.mc-webchat__button {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.mc-webchat__button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.24);
}

.mc-webchat__button i {
    font-size: 26px;
}

.mc-webchat__panel {
    width: min(370px, calc(100vw - 24px));
    height: min(620px, calc(100vh - 110px));
    margin-bottom: 14px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 8px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.mc-webchat.is-open .mc-webchat__panel {
    display: flex;
}

.mc-webchat__header {
    color: #ffffff;
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.mc-webchat__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 4px;
}

.mc-webchat__subtitle {
    font-size: 13px;
    line-height: 1.35;
    margin: 0;
    opacity: 0.9;
}

.mc-webchat__close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    cursor: pointer;
    flex: 0 0 auto;
}

.mc-webchat__body {
    flex: 1;
    min-height: 0;
    background: #f6f8fb;
    display: flex;
    flex-direction: column;
}

.mc-webchat__form,
.mc-webchat__chat {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mc-webchat__form {
    padding: 16px;
    gap: 10px;
}

.mc-webchat__field {
    width: 100%;
    border: 1px solid #d9e0ea;
    border-radius: 6px;
    background: #ffffff;
    padding: 11px 12px;
    font-size: 14px;
    color: #172033;
    outline: none;
}

.mc-webchat__field:focus {
    border-color: currentColor;
    box-shadow: 0 0 0 3px rgba(31, 122, 236, 0.12);
}

.mc-webchat__textarea {
    min-height: 96px;
    resize: vertical;
}

.mc-webchat__consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #465267;
    font-size: 12px;
    line-height: 1.35;
}

.mc-webchat__submit,
.mc-webchat__send {
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.mc-webchat__submit {
    min-height: 42px;
}

.mc-webchat__messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
}

.mc-webchat__bubble {
    max-width: 82%;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.35;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.mc-webchat__bubble--visitor {
    margin-left: auto;
    color: #ffffff;
}

.mc-webchat__bubble--agent {
    background: #ffffff;
    color: #172033;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.mc-webchat__composer {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
}

.mc-webchat__composer textarea {
    min-height: 42px;
    max-height: 100px;
    resize: none;
}

.mc-webchat__send {
    width: 46px;
    flex: 0 0 46px;
}

.mc-webchat__error {
    color: #b42318;
    background: #fff1f0;
    border: 1px solid #ffd7d2;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.35;
    display: none;
}

.mc-webchat.has-error .mc-webchat__error {
    display: block;
}

@media (max-width: 575.98px) {
    .mc-webchat {
        right: 12px !important;
        left: 12px !important;
        bottom: 12px !important;
    }

    .mc-webchat__panel {
        width: 100%;
        height: min(620px, calc(100vh - 92px));
    }
}
