.mt-chat,
.mt-chat * {
    box-sizing: border-box;
}

.mt-chat {
    position: fixed;
    right: 16px;
    bottom: 64px;
    z-index: 100000;
    font-family: "Nunito Sans", "Helvetica Neue", Arial, sans-serif;
}

.mt-chat-launcher {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    margin: 0;
    padding: 0 18px 0 14px;
    border: 0;
    border-radius: 999px;
    background: #ff7a30;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(40, 20, 10, 0.22);
}

.mt-chat-launcher i {
    font-size: 18px;
}

.mt-chat-launcher:hover,
.mt-chat-launcher:focus {
    background: #e56a22;
    color: #fff;
    outline: none;
}

.mt-chat.is-open .mt-chat-launcher {
    display: none;
}

.mt-chat-panel {
    display: flex;
    flex-direction: column;
    width: 360px;
    max-width: calc(100vw - 24px);
    height: 520px;
    max-height: calc(100vh - 96px);
    margin-bottom: 12px;
    overflow: hidden;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

.mt-chat-panel[hidden] {
    display: none !important;
}

.mt-chat-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: #ff7a30;
    color: #fff;
}

.mt-chat-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    font-weight: 800;
}

.mt-chat-id {
    display: flex;
    flex: 1;
    flex-direction: column;
    line-height: 1.25;
}

.mt-chat-id strong {
    font-size: 15px;
}

.mt-chat-id span {
    font-size: 12px;
    opacity: 0.95;
}

.mt-chat-id span:before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: #b6f3c4;
}

.mt-chat-close {
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.mt-chat-log {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #f4f5f7;
}

.mt-chat-bubble {
    display: flex;
    max-width: 88%;
}

.mt-chat-bubble p {
    margin: 0;
    padding: 10px 12px;
    overflow-wrap: anywhere;
    font-size: 14.5px;
    line-height: 1.4;
}

.mt-chat-bubble-bot {
    align-self: flex-start;
}

.mt-chat-bubble-bot p {
    background: #fff;
    color: #222;
    border-radius: 4px 16px 16px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.mt-chat-bubble-user {
    align-self: flex-end;
}

.mt-chat-bubble-user p {
    background: #ff7a30;
    color: #fff;
    border-radius: 16px 16px 4px 16px;
}

.mt-chat-typing {
    display: inline-flex;
    align-self: flex-start;
    gap: 4px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 4px 16px 16px 16px;
}

.mt-chat-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c5c5c5;
    animation: mt-chat-dot 1s infinite;
}

.mt-chat-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.mt-chat-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes mt-chat-dot {
    0%,
    80%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

.mt-chat-form {
    position: relative;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #eee;
    background: #fff;
}

.mt-chat-form[hidden] {
    display: none !important;
}

.mt-chat-form input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    height: 42px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid #e4e4e4;
    border-radius: 999px;
    background: #fff;
    color: #222;
    box-shadow: none;
    font-size: 14px;
}

.mt-chat-form input[type="text"]:focus {
    border-color: #ff7a30;
    outline: none;
}

.mt-chat-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ff7a30;
    color: #fff;
    cursor: pointer;
}

.mt-chat-send:hover,
.mt-chat-send:focus {
    background: #e56a22;
    color: #fff;
    outline: none;
}

.mt-chat-error {
    flex-shrink: 0;
    margin: 0;
    padding: 0 16px 8px;
    background: #fff;
    color: #c0392b;
    font-size: 13px;
}

.mt-chat-error[hidden] {
    display: none !important;
}

.mt-chat-retry {
    margin: 0;
    padding: 8px 12px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #ff7a30;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.booking-form .mt-open-chat {
    margin-top: 4px;
}

@media (max-width: 640px) {
    html.mt-chat-lock,
    body.mt-chat-lock {
        overflow: hidden;
        height: 100%;
        overscroll-behavior: none;
    }

    .mt-chat.is-open {
        top: 0;
        right: 0;
        bottom: auto;
        left: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
        overscroll-behavior: none;
        touch-action: pan-y;
    }

    .mt-chat.is-open .mt-chat-panel {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        margin: 0;
        border-radius: 0;
        overscroll-behavior: none;
    }

    .mt-chat.is-open .mt-chat-log {
        touch-action: pan-y;
    }

    .mt-chat.is-open .mt-chat-header,
    .mt-chat.is-open .mt-chat-form,
    .mt-chat.is-open .mt-chat-error {
        touch-action: manipulation;
    }

    .mt-chat-form input[type="text"] {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mt-chat-typing span {
        animation: none;
    }
}
