.truk-chat-popout-control {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin: 0.75rem 0;
    width: 100%;
}

.truk-chat-popout-button {
    appearance: none;
    border: 2px solid #111827;
    border-radius: 999px;
    background: linear-gradient(135deg, #5bcffa, #f5a9b8 55%, #ffffff);
    color: #111827;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    line-height: 1.2;
    min-height: 44px;
    max-width: 100%;
    padding: 0.7rem 1.1rem;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.18);
    transition: transform 160ms ease, box-shadow 160ms ease, outline-offset 160ms ease;
    white-space: normal;
}

.truk-chat-popout-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.24);
}

.truk-chat-popout-button:focus-visible {
    outline: 4px solid #111827;
    outline-offset: 3px;
}

body.truk-chat-popout-mode {
    background: #f8fafc !important;
    margin: 0 !important;
}

.truk-chat-popout-shell {
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 12px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
}

.truk-chat-popout-heading {
    align-items: center;
    background: #111827;
    border-radius: 16px 16px 0 0;
    color: #ffffff;
    display: flex;
    font-weight: 800;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    flex: 0 0 auto;
    flex-wrap: wrap;
}

.truk-chat-popout-heading small {
    color: #d1d5db;
    display: block;
    font-weight: 500;
    margin-top: 0.15rem;
}

.truk-chat-popout-content {
    background: #ffffff;
    border: 2px solid #111827;
    border-top: 0;
    border-radius: 0 0 16px 16px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.truk-chat-popout-content > * {
    max-width: none !important;
    width: 100% !important;
}

.truk-chat-popout-content img,
.truk-chat-popout-content video,
.truk-chat-popout-content iframe {
    max-width: 100% !important;
    height: auto;
}

.truk-chat-popout-content input,
.truk-chat-popout-content textarea,
.truk-chat-popout-content select,
.truk-chat-popout-content button {
    max-width: 100%;
}

.truk-chat-popout-close {
    background: #ffffff;
    border: 0;
    border-radius: 999px;
    color: #111827;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    min-height: 44px;
    padding: 0.45rem 0.7rem;
}

.truk-chat-popout-close:focus-visible {
    outline: 3px solid #5bcffa;
    outline-offset: 2px;
}

@media (max-width: 700px) {
    .truk-chat-popout-control {
        justify-content: stretch;
    }

    .truk-chat-popout-button {
        width: 100%;
        border-radius: 14px;
    }

    .truk-chat-popout-shell {
        padding: 0;
    }

    .truk-chat-popout-heading {
        border-radius: 0;
        padding: 0.75rem;
    }

    .truk-chat-popout-content {
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        border-radius: 0;
    }
}
