.cap-support-tabs {
    position: fixed;
    top: 50%;
    right: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transform: translateY(-50%);
}

.cap-support-tabs .cap-support-tab {
    width: 33px;
    height: 100px;
    margin: 0;
    padding: 12px 4px;
    color: #fff;
    background-color: #24557a;
    border: 1px solid #193e59;
    border-radius: 5px 0 0 5px;
    writing-mode: vertical-rl;
    white-space: nowrap;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 8px #0002;
}

.cap-support-tabs .cap-support-tab:hover {
    background-color: #2f6b95;
}

.cap-support-tab:focus-visible,
.cap-chat-panel button:focus-visible {
    outline: 3px solid currentColor !important;
    outline-offset: -5px;
}

.cap-chat-panel {
    position: fixed;
    top: 50%;
    right: 45px;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    width: min(380px, calc(100vw - 57px));
    height: min(600px, calc(100vh - 140px));
    height: min(600px, calc(100dvh - 140px));
    transform: translateY(-50%);
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px #0003;
    overflow: hidden;
}

.cap-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 12px 16px;
    border-bottom: 1px solid #ddd;
}

.cap-chat-header h2 {
    margin: 0;
    font-size: 18px;
}

.cap-chat-status {
    padding: 16px;
    margin: 0;
}

.cap-chat-embed {
    flex: 1;
    min-height: 0;
}

#cap-chat-embed #hubspot-conversations-inline-parent,
#cap-chat-embed #hubspot-conversations-inline-iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.cap-support-tools [hidden] {
    display: none !important;
}

.modal-open .cap-support-tools,
.cap-support-tools.cap-support-modal-open {
    visibility: hidden;
}

@media (max-width: 575.98px) {
    .cap-chat-panel {
        top: auto;
        right: 8px;
        bottom: max(60px, env(safe-area-inset-bottom));
        width: calc(100vw - 16px);
        height: min(600px, calc(100vh - 120px));
        height: min(600px, calc(100dvh - 120px));
        transform: none;
    }

    .cap-chat-open .cap-support-tabs {
        visibility: hidden;
    }
}
