.sy-ol,
.sy-ol * {
    box-sizing: border-box;
    letter-spacing: 0;
}

.sy-ol {
    --sy-ink: #15202b;
    --sy-muted: #66727d;
    --sy-line: #d8dde2;
    --sy-green: #16844a;
    --sy-blue: #1469a8;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 2147483000;
    font: 14px/1.4 Arial, sans-serif;
    color: var(--sy-ink);
}

.sy-ol--left {
    right: auto;
    left: 24px;
}

.sy-ol-trigger {
    display: block;
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 50%;
    background: #176b42;
    color: #fff;
    box-shadow: 0 8px 24px rgba(21, 32, 43, .28);
    font: 700 14px/1 Arial, sans-serif;
    cursor: pointer;
    margin-left: auto;
}

.sy-ol--left .sy-ol-trigger {
    margin-right: auto;
    margin-left: 0;
}

.sy-ol-trigger:hover,
.sy-ol-trigger:focus-visible {
    background: #0f5835;
    outline: 3px solid rgba(22, 132, 74, .25);
}

.sy-ol-panel {
    width: min(376px, calc(100vw - 32px));
    height: min(590px, calc(100vh - 116px));
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--sy-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(21, 32, 43, .24);
}

.sy-ol-panel[hidden] {
    display: none;
}

.sy-ol-header {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 12px 16px;
    background: #202a33;
    color: #fff;
}

.sy-ol-header__text,
.sy-ol-header__title,
.sy-ol-header__subtitle {
    display: block;
}

.sy-ol-header__title {
    font-size: 16px;
    line-height: 20px;
}

.sy-ol-header__subtitle {
    margin-top: 3px;
    color: #cfd7dd;
    font-size: 12px;
}

.sy-ol-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: #4bd37b;
}

.sy-ol-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 26px;
    line-height: 34px;
    cursor: pointer;
}

.sy-ol-close:hover,
.sy-ol-close:focus-visible {
    background: rgba(255, 255, 255, .12);
    outline: none;
}

.sy-ol-messages {
    height: calc(100% - 224px);
    min-height: 190px;
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #f4f6f7;
}

.sy-ol-message {
    display: flex;
    margin: 0 0 10px;
}

.sy-ol-message--user {
    justify-content: flex-end;
}

.sy-ol-message__bubble {
    max-width: 82%;
    padding: 10px 12px;
    border: 1px solid #dce1e5;
    border-radius: 8px;
    background: #fff;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.sy-ol-message--user .sy-ol-message__bubble {
    border-color: #b9d8c8;
    background: #dff2e8;
}

.sy-ol-typing {
    height: 24px;
    padding: 3px 16px;
    color: var(--sy-muted);
    background: #f4f6f7;
    font-size: 12px;
}

.sy-ol-typing[hidden] {
    visibility: hidden;
}

.sy-ol-channels {
    height: 72px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 10px;
    border-top: 1px solid var(--sy-line);
    background: #fff;
}

.sy-ol-channel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--sy-ink);
    text-decoration: none;
    font-size: 11px;
}

.sy-ol-channel__mark {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e8edf0;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.sy-ol-channel--telegram .sy-ol-channel__mark { background: #229ed9; }
.sy-ol-channel--max .sy-ol-channel__mark { background: #7357d8; }
.sy-ol-channel--whatsapp .sy-ol-channel__mark { background: #218c4f; }
.sy-ol-channel--phone .sy-ol-channel__mark { background: #313d46; }

.sy-ol-channel:hover .sy-ol-channel__label,
.sy-ol-channel:focus-visible .sy-ol-channel__label {
    color: var(--sy-blue);
}

.sy-ol-form {
    height: 60px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 8px;
    padding: 9px 10px;
    border-top: 1px solid var(--sy-line);
    background: #fff;
}

.sy-ol-input {
    width: 100%;
    height: 42px;
    resize: none;
    border: 1px solid #aeb8c0;
    border-radius: 6px;
    padding: 10px 11px;
    color: var(--sy-ink);
    background: #fff;
    font: inherit;
}

.sy-ol-input:focus {
    border-color: var(--sy-green);
    outline: 2px solid rgba(22, 132, 74, .16);
}

.sy-ol-send {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 6px;
    background: var(--sy-green);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.sy-ol-send:hover,
.sy-ol-send:focus-visible {
    background: #0f673c;
    outline: 2px solid rgba(22, 132, 74, .2);
}

.sy-ol-send:disabled,
.sy-ol-input:disabled {
    opacity: .62;
    cursor: wait;
}

@media (max-width: 520px) {
    .sy-ol {
        right: 12px;
        bottom: 12px;
    }

    .sy-ol--left {
        right: auto;
        left: 12px;
    }

    .sy-ol-panel {
        width: calc(100vw - 24px);
        height: calc(100dvh - 96px);
        max-height: 680px;
    }

    .sy-ol-trigger {
        width: 58px;
        height: 58px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sy-ol * {
        scroll-behavior: auto !important;
    }
}
