.mt-chat-launcher[hidden], .mt-chat-dialog:not([open]) { display: none; }
.mt-chat-launcher {
    position: fixed;
    z-index: 44;
    inset: auto auto 20px 20px;
    display: inline-flex;
    width: 50px;
    height: 50px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #4f7364;
    border-radius: 50%;
    background: #204638;
    color: #fff;
    font: 700 13px/1.2 system-ui, sans-serif;
    box-shadow: 0 4px 14px #193e2e26;
    cursor: pointer;
}
.mt-chat-launcher:hover { background: #2d5a47; }
.mt-chat-launcher-label {
    position: absolute;
    inset-inline-start: calc(100% + 8px);
    padding: 7px 10px;
    border-radius: 8px;
    background: #204638;
    color: #fff;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}
@media (hover: hover) {
    .mt-chat-launcher:hover .mt-chat-launcher-label,
    .mt-chat-launcher:focus-visible .mt-chat-launcher-label { opacity: 1; }
}
.mt-chat-dialog {
    position: fixed;
    inset: auto auto 20px 20px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(420px, calc(100% - 40px));
    height: min(590px, calc(100dvh - 40px));
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #d4e1d7;
    border-radius: 17px;
    background: #fff;
    color: #192e22;
    box-shadow: 0 14px 48px #11271b4d;
    animation: mt-chat-open .2s ease-out;
}
.mt-chat-dialog::backdrop { background: #10231a55; }
.mt-chat-dialog header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px 8px 16px;
    background: #204638;
    color: #fff;
}
.mt-chat-dialog h2 { margin: 0; color: inherit; font-size: 17px; }
.mt-chat-dialog button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 9px;
    background: #ffffff20;
    color: inherit;
    font: 23px/1 system-ui, sans-serif;
    cursor: pointer;
}
.mt-chat-dialog iframe { display: block; width: 100%; height: 100%; border: 0; }
html[data-mt-theme="dark"] .mt-chat-dialog { border-color: #4b6255; background: #1a2720; color: #eef4ee; }
@keyframes mt-chat-open { from { opacity: .5; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) {
    .mt-chat-launcher {
        inset: auto auto calc(var(--mt-bottom-bar, 58px) + 10px) 10px;
        width: 48px;
        height: 48px;
    }
    .mt-chat-launcher span { display: none; }
    body:has(.mt-filter-trigger:not([hidden])) .mt-chat-launcher { bottom: calc(var(--mt-bottom-bar, 58px) + 64px); }
    body:has(.mt-sticky-buy.is-visible) .mt-chat-launcher { bottom: calc(var(--mt-bottom-bar, 58px) + 80px); }
    .mt-chat-dialog {
        inset: auto 6px max(6px, env(safe-area-inset-bottom)) 6px;
        width: auto;
        height: min(620px, calc(100dvh - 14px));
    }
}
@media (prefers-reduced-motion: reduce) {
    .mt-chat-dialog { animation: none; }
    .mt-chat-launcher-label { transition: none; }
}
