.octopus-helpdesk-launcher {
    position: fixed;
    right: 24px;
    bottom: 18px;
    z-index: 1050;
    width: auto;
    min-width: 286px;
    max-width: calc(100vw - 32px);
    border: 0;
    border-radius: 999px;
    padding: 13px 48px 13px 18px;
    color: #fff;
    text-align: left;
    background: linear-gradient(100deg, #ff743d 0%, #354064 88%);
    box-shadow: 0 16px 36px rgba(15, 23, 42, .28);
    overflow: hidden;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.octopus-helpdesk-panel {
    position: fixed;
    right: 72px;
    bottom: 0;
    z-index: 1051;
    width: min(336px, calc(100vw - 24px));
    height: min(560px, calc(100vh - 36px));
    display: none;
    flex-direction: column;
    background: #fff;
    color: #3f526a;
    box-shadow: 0 22px 70px rgba(15, 23, 42, .28);
}

.octopus-helpdesk-panel.is-open {
    display: flex;
}

.octopus-helpdesk-close {
    position: fixed;
    right: 416px;
    bottom: min(526px, calc(100vh - 68px));
    z-index: 1052;
    display: none;
    width: 30px;
    height: 30px;
    border: 2px solid #465569;
    border-radius: 50%;
    background: #fff;
    color: #354155;
    font-size: 22px;
    line-height: 22px;
    align-items: center;
    justify-content: center;
}

.octopus-helpdesk-close.is-open {
    display: flex;
}

.octopus-helpdesk-header {
    position: relative;
    min-height: 70px;
    padding: 18px 58px 16px 18px;
    color: #fff;
    background: linear-gradient(100deg, #ff743d 0%, #354064 88%);
    overflow: hidden;
}

.octopus-helpdesk-title {
    font-weight: 600;
    line-height: 1.15;
}

.octopus-helpdesk-subtitle {
    font-size: 13px;
    opacity: .9;
}

.octopus-helpdesk-messages {
    flex: 1;
    min-height: 0;
    padding: 18px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
}

.octopus-helpdesk-chip-row {
    margin-top: auto;
    display: grid;
    gap: 8px;
    justify-items: end;
}

.octopus-helpdesk-chip,
.octopus-helpdesk-bubble {
    border: 1px solid #8ca4bd;
    border-radius: 18px;
    padding: 7px 15px;
    color: #4b6380;
    background: #fff;
    box-shadow: 0 2px 5px rgba(20, 36, 55, .14);
    font-size: 14px;
    max-width: 88%;
}

.octopus-helpdesk-bubble.user {
    align-self: flex-end;
}

.octopus-helpdesk-bubble.admin,
.octopus-helpdesk-bubble.system {
    align-self: flex-start;
    border-color: #d3dce7;
    color: #42546a;
    background: #f7f9fc;
}

.octopus-helpdesk-input {
    border-top: 1px solid #dbe2ea;
    padding: 14px 14px 10px;
    background: #fff;
}

.octopus-helpdesk-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.octopus-helpdesk-textarea {
    flex: 1;
    height: 46px;
    max-height: 96px;
    resize: none;
    border: 0;
    outline: 0;
    color: #3f526a;
    background: transparent;
}

.octopus-helpdesk-send {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #eef0f2;
    color: #fff;
    font-size: 22px;
    line-height: 34px;
}

.octopus-helpdesk-send.is-ready {
    background: #ff743d;
}

.octopus-helpdesk-tools {
    display: flex;
    gap: 12px;
    padding-top: 6px;
}

.octopus-helpdesk-tool {
    width: 24px;
    height: 24px;
    border: 0;
    padding: 0;
    color: #9aa7b8;
    background: transparent;
    font-size: 22px;
    line-height: 24px;
    text-align: center;
}

.octopus-helpdesk-tool:hover,
.octopus-helpdesk-tool:focus {
    color: #4b6380;
    outline: 0;
}

.octopus-helpdesk-emoji-panel {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    background: #f8fafc;
    box-shadow: 0 8px 22px rgba(20, 36, 55, .12);
}

.octopus-helpdesk-emoji {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 18px;
    line-height: 28px;
    text-align: center;
}

.octopus-helpdesk-emoji:hover,
.octopus-helpdesk-emoji:focus {
    background: #e8eef6;
    outline: 0;
}

.octopus-helpdesk-error {
    color: #b42318;
    font-size: 12px;
    margin-top: 6px;
}

@media (max-width: 560px) {
    .octopus-helpdesk-launcher {
        right: 18px;
        bottom: calc(78px + env(safe-area-inset-bottom, 0px));
        min-width: 0;
        width: 58px;
        height: 58px;
        max-width: none;
        padding: 0;
        border-radius: 50%;
        font-size: 0;
        text-align: center;
    }

    .octopus-helpdesk-launcher::before {
        content: "?";
        position: relative;
        z-index: 1;
        color: #fff;
        font-size: 28px;
        font-weight: 900;
        line-height: 58px;
    }

    .octopus-helpdesk-panel {
        right: 0;
        width: 100vw;
        height: 100vh;
    }

    .octopus-helpdesk-close {
        right: auto;
        left: 14px;
        bottom: calc(100vh - 48px);
    }
}
