.mm-telegram-widget {
    position: fixed;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 76;
    font-family: "Manrope", Arial, sans-serif;
}

.mm-telegram-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 0 23px;
    border: 0;
    border-radius: 999px;
    background: #149bd3;
    box-shadow: 0 12px 30px rgba(9, 94, 135, .3);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.mm-telegram-trigger svg,
.mm-telegram-start svg {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    fill: currentColor;
}

.mm-telegram-trigger:hover,
.mm-telegram-trigger:focus-visible {
    background: #078bc3;
    box-shadow: 0 15px 35px rgba(9, 94, 135, .38);
    outline: 0;
    transform: translateY(-2px);
}

.mm-telegram-notice {
    position: absolute;
    top: 1px;
    right: 4px;
    width: 13px;
    height: 13px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #f0162f;
}

.mm-telegram-widget.is-seen .mm-telegram-notice {
    display: none;
}

.mm-telegram-panel[hidden] {
    display: none !important;
}

.mm-telegram-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 13px);
    width: min(360px, calc(100vw - 24px));
    overflow: hidden;
    border: 1px solid rgba(12, 97, 134, .12);
    border-radius: 22px;
    background: #e4f1df;
    box-shadow: 0 22px 60px rgba(20, 48, 62, .3);
    animation: mmTelegramOpen .2s ease-out both;
}

.mm-telegram-panel-head {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 88px;
    padding: 15px 46px 15px 18px;
    background: #109bd3;
    color: #fff;
}

.mm-telegram-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, .82);
    border-radius: 50%;
    background: #fff;
}

.mm-telegram-avatar::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 2px;
    width: 10px;
    height: 10px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #35d04f;
}

.mm-telegram-avatar img {
    width: 43px;
    height: 43px;
    object-fit: contain;
}

.mm-telegram-person {
    min-width: 0;
    padding-left: 13px;
}

.mm-telegram-person strong,
.mm-telegram-person span {
    display: block;
}

.mm-telegram-person strong {
    margin-bottom: 4px;
    font-size: 18px;
    line-height: 1.15;
}

.mm-telegram-person span {
    color: rgba(255, 255, 255, .84);
    font-size: 13px;
    line-height: 1.35;
}

.mm-telegram-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .68);
    font: 400 30px/30px Arial, sans-serif;
    cursor: pointer;
}

.mm-telegram-close:hover,
.mm-telegram-close:focus-visible {
    color: #fff;
    outline: 0;
}

.mm-telegram-panel-body {
    padding: 16px 18px 20px;
    background-color: #dff0dc;
    background-image: radial-gradient(circle at 20% 25%, rgba(17, 155, 211, .06) 0 2px, transparent 3px), radial-gradient(circle at 75% 70%, rgba(219, 127, 45, .07) 0 2px, transparent 3px);
    background-size: 42px 42px, 54px 54px;
}

.mm-telegram-time {
    margin-bottom: 8px;
    color: #7d9a83;
    font-size: 11px;
    text-align: center;
}

.mm-telegram-message {
    max-width: 285px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 7px 19px 19px 19px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(40, 82, 63, .1);
    color: #26343c;
    font-size: 14px;
    line-height: 1.55;
}

.mm-telegram-message strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.mm-telegram-message p {
    margin: 0;
}

.mm-telegram-start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: fit-content;
    min-height: 50px;
    margin: 0 auto;
    padding: 0 22px;
    border-radius: 999px;
    background: #149bd3;
    box-shadow: 0 9px 22px rgba(9, 94, 135, .23);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    transition: background-color .2s ease, transform .2s ease;
}

.mm-telegram-start:hover,
.mm-telegram-start:focus-visible {
    background: #078bc3;
    color: #fff;
    outline: 0;
    transform: translateY(-2px);
}

body:has(.object-mobile-actions) .mm-telegram-widget {
    bottom: calc(84px + env(safe-area-inset-bottom));
}

@keyframes mmTelegramOpen {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media screen and (max-width: 767px) {
    .mm-telegram-widget {
        right: 12px;
        bottom: calc(14px + env(safe-area-inset-bottom));
    }

    .mm-telegram-trigger {
        min-height: 52px;
        padding: 0 19px;
        font-size: 15px;
    }

    .mm-telegram-panel {
        bottom: calc(100% + 10px);
        border-radius: 19px;
    }

    .mm-telegram-panel-head {
        min-height: 80px;
        padding: 13px 42px 13px 15px;
    }

    .mm-telegram-avatar {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
    }

    .mm-telegram-avatar img {
        width: 39px;
        height: 39px;
    }

    .mm-telegram-panel-body {
        padding: 14px 15px 18px;
    }

    .mm-telegram-message {
        max-width: 270px;
        padding: 14px 16px;
    }

    body:has(.object-mobile-actions) .mm-telegram-widget {
        bottom: calc(84px + env(safe-area-inset-bottom));
    }
}

@media screen and (max-width: 420px) {
    .mm-telegram-trigger span {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mm-telegram-trigger,
    .mm-telegram-start,
    .mm-telegram-panel {
        animation: none;
        transition: none;
    }
}
