.site-chat-bubble,
.site-chat-bubble *,
.site-chat-panel,
.site-chat-panel * {
    box-sizing: border-box;
}

.site-chat-bubble {
    position: fixed;
    bottom: 58px;
    right: 24px;
    width: 118px;
    height: 54px;
    border-radius: 14px;
    background: #fff;
    border: 2px solid #e51d2a;
    padding: 6px 10px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    z-index: 9999;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-chat-bubble img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.site-chat-bubble-label {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: #e51d2a;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    padding: 4px 10px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    white-space: nowrap;
    pointer-events: none;
    max-width: 40vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-chat-panel {
    position: fixed;
    bottom: 126px;
    right: 24px;
    width: 340px;
    max-width: 90vw;
    height: 460px;
    max-height: 70vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.site-chat-panel.open {
    display: flex;
}

.site-chat-header {
    background: #e51d2a;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.site-chat-header-text {
    line-height: 1.2;
    min-width: 0;
}

.site-chat-header-text .name {
    font-weight: 600;
    font-size: 14px;
}

.site-chat-header-text .subtitle {
    font-size: 11px;
    opacity: 0.85;
}

.site-chat-header button {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    flex-shrink: 0;
}

.site-chat-messages {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.site-chat-msg {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    max-width: 85%;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.site-chat-msg.user {
    background: #e51d2a;
    color: #fff;
    margin-left: auto;
}

.site-chat-msg.assistant {
    background: #f1f3f4;
    color: #202124;
}

.site-chat-input-row {
    display: flex;
    border-top: 1px solid #e0e0e0;
    padding: 8px;
    flex-shrink: 0;
}

.site-chat-input-row input {
    flex: 1;
    min-width: 0;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 16px;
    outline: none;
}

.site-chat-input-row button {
    margin-left: 8px;
    margin-right: 6px;
    background: #e51d2a;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
}

.site-chat-input-row button:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Small phones: the bubble shrinks a little, panel stays a floating card
   (capped by max-width/max-height above) rather than taking over the screen. */
@media (max-width: 640px) {
    .site-chat-bubble {
        bottom: 40px;
        right: 20px;
        width: 100px;
        height: 46px;
        border-radius: 12px;
    }

    .site-chat-bubble-label {
        bottom: 16px;
        right: 20px;
        font-size: 10px;
    }
}

/* Very narrow phones (older/small devices) */
@media (max-width: 340px) {
    .site-chat-bubble-label {
        display: none;
    }
}