/* Everything is scoped to this widget; Bitrix24 has its own controls on the right. */
.kpm-widget {
    --kpm-red: #d70d38;
    --kpm-lift: 0px;
    --kpm-bottom: calc(24px + var(--kpm-lift) + env(safe-area-inset-bottom, 0px));
    position: fixed;
    bottom: var(--kpm-bottom);
    left: max(24px, env(safe-area-inset-left, 0px));
    z-index: 900;
    font-family: "TildaSans", Arial, sans-serif;
    color: #18181b;
    font-size: 16px;
    line-height: 1.4;
    text-align: left;
}
.kpm-widget *, .kpm-widget *::before, .kpm-widget *::after { box-sizing: border-box; }
.kpm-widget button, .kpm-widget a { -webkit-tap-highlight-color: transparent; }
.kpm-widget button { font: inherit; cursor: pointer; text-transform: none; letter-spacing: normal; }
.kpm-widget svg { display: block; width: 24px; height: 24px; flex-shrink: 0; }
.kpm-widget .kpm-launcher {
    position: relative; display: grid; place-items: center; width: 60px; height: 60px;
    padding: 0; margin: 0; border: 1px solid rgba(255,255,255,.25); border-radius: 50%;
    color: #fff; background: var(--kpm-red); box-shadow: 0 6px 22px rgba(130,4,31,.24);
    transition: background .16s, transform .16s;
}
.kpm-launcher svg { width: 30px; height: 30px; }
.kpm-widget .kpm-launcher:hover { background: #b7082d; transform: translateY(-2px); }
.kpm-launcher-label {
    position: absolute; left: 72px; padding: 9px 13px; white-space: nowrap;
    border: 1px solid #e8e5e5; border-radius: 10px; background: #fff; color: #262329;
    font-size: 13px; font-weight: 600; box-shadow: 0 3px 12px #0000000d;
    visibility: hidden; opacity: 0; transition: opacity .16s;
}
.kpm-launcher:hover .kpm-launcher-label, .kpm-launcher:focus-visible .kpm-launcher-label { visibility: visible; opacity: 1; }
.kpm-widget .kpm-panel {
    position: fixed; inset: auto auto calc(var(--kpm-bottom) + 72px) max(24px, env(safe-area-inset-left, 0px));
    width: 320px; max-width: calc(100vw - 32px); max-height: calc(100dvh - var(--kpm-bottom) - 92px);
    margin: 0; padding: 24px; overflow: auto; overscroll-behavior: contain;
    border: 1px solid #eae6e7; border-radius: 22px; color: #18181b; background: #fff;
    box-shadow: 0 14px 55px rgba(33,20,24,.18); font: inherit;
}
.kpm-panel:not([open]) { display: none; }
.kpm-panel::backdrop { background: rgba(20,15,18,.12); }
.kpm-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.kpm-widget .kpm-brand { margin: 0 0 7px; font-size: 10px; letter-spacing: .18em; font-weight: 800; color: var(--kpm-red); }
.kpm-widget #kpm-title { margin: 0; padding: 0; font: 700 23px/1.2 "TildaSans",Arial,sans-serif; letter-spacing: -.02em; color: #18181b; }
.kpm-widget .kpm-description { margin: 10px 0 19px; font-size: 14px; color: #63616a; line-height: 1.4; }
.kpm-widget .kpm-close { display: grid; place-items: center; width: 36px; height: 36px; min-width: 36px; margin: -7px -7px 0 0; padding: 0; background: #f3f2f3; border: 0; border-radius: 50%; color: #67626a; }
.kpm-widget .kpm-close:hover { background: #e9e7e9; }
.kpm-channels { display: flex; flex-direction: column; gap: 9px; }
.kpm-widget .kpm-channel {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px;
    padding: 11px 12px; margin: 0; border: 1px solid #eceaed; border-radius: 13px;
    background: #fff; text-decoration: none; text-align: left; color: #18181b;
    font-size: 15px; font-weight: 600; line-height: 1.2; transition: background .16s, border-color .16s;
}
.kpm-widget .kpm-channel:hover { background: #f9f8f9; border-color: #d6d1d6; color: #18181b; }
.kpm-channel-icon { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; color: #fff; overflow: hidden; }
.kpm-channel-icon svg { width: 23px; height: 23px; }
.kpm-telegram { background: #229ed9; }
.kpm-whatsapp { background: #138641; }
.kpm-max { background: #fff; }
.kpm-max img { display: block; width: 38px; height: 38px; margin: 0; border: 0; border-radius: 11px; }
.kpm-arrow { margin-left: auto; color: #8c8791; }
.kpm-arrow svg { width: 18px; height: 18px; }
.kpm-widget .kpm-phone { margin: 18px 0 0; font-size: 13px; line-height: 1.2; text-align: center; color: #77717a; }
.kpm-widget [hidden] { display: none !important; }
.kpm-max-help { padding: 14px; border-radius: 12px; background: #f5f3fb; }
.kpm-widget .kpm-max-help p { margin: 0 0 9px; color: #4a425a; font-size: 13px; line-height: 1.4; }
.kpm-widget .kpm-copy-number { display: block; width: 100%; height: 38px; padding: 5px 8px; margin: 0 0 10px; border: 1px solid #ddd7e8; border-radius: 7px; font: 600 15px/1.3 Arial,sans-serif; color: #282032; background: #fff; }
.kpm-max-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.kpm-widget .kpm-max-actions button { min-height: 36px; padding: 8px 10px; border: 0; border-radius: 7px; font-size: 12px; background: #5737b2; color: #fff; }
.kpm-widget .kpm-max-actions a { min-height: 36px; display: inline-flex; align-items: center; font-size: 12px; color: #48318c; text-decoration: underline; }
.kpm-copy-status { display: block; margin-top: 8px; font-size: 12px; color: #4a425a; }
.kpm-copy-status:empty { display: none; }
.kpm-widget :is(a,button,input):focus-visible { outline: 3px solid #165dc8; outline-offset: 3px; }
.kpm-noscript { padding: 14px 24px; font: 14px/1.5 Arial,sans-serif; background: #f5f4f4; color: #18181b; }
body.kpm-replace-chaty .chaty-widget, body.kpm-replace-chaty #chaty-widget, body.kpm-replace-chaty .chaty-widget-i { display: none !important; }
@media (max-width: 760px) {
    .kpm-widget { --kpm-bottom: calc(12px + var(--kpm-lift) + env(safe-area-inset-bottom, 0px)); left: max(12px, env(safe-area-inset-left, 0px)); }
    .kpm-widget.kpm-desktop-only .kpm-launcher { display: none; }
    .kpm-widget .kpm-launcher { width: 52px; height: 52px; }
    .kpm-launcher svg { width: 27px; height: 27px; }
    .kpm-launcher-label { display: none; }
    .kpm-widget .kpm-panel { left: max(12px, env(safe-area-inset-left, 0px)); bottom: calc(var(--kpm-bottom) + 64px); max-width: calc(100vw - 24px); max-height: calc(100dvh - var(--kpm-bottom) - 84px); padding: 20px; border-radius: 19px; }
}
@media (max-height: 520px) {
    .kpm-widget .kpm-panel { top: 12px; bottom: auto; max-height: calc(100dvh - 24px); }
}
@media (prefers-reduced-motion: reduce) {
    .kpm-widget *, .kpm-widget *::before, .kpm-widget *::after { transition: none !important; scroll-behavior: auto !important; }
}
