#sugo-ia-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#sugo-ia-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--sugo-ia-primary, #0073aa);
    color: white;
    border: none;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    line-height: 1;
}

#sugo-ia-toggle:hover {
    transform: scale(1.1);
}

#sugo-ia-chat-window {
    width: 400px;
    height: auto;
    background: white;
    /* border-radius: 12px; Removed for sidebar */
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* margin-bottom: 20px; Removed */
    border-left: 1px solid #e1e1e1;

    /* Fixed Sidebar Positioning */
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 1000000;
    /* Higher than widget button */
    transition: transform 0.3s ease-in-out;
    /* Smooth slide-in if needed, though toggle handles display */
}

/* Resize Handle */
/* Resize Handle */
#sugo-ia-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 10px;
    /* Wider hit area */
    cursor: col-resize;
    z-index: 10;
    background: transparent;
    transition: background 0.2s;
    /* Optional: Visual hint */
    border-left: 4px solid transparent;
}

#sugo-ia-resize-handle:hover,
#sugo-ia-resize-handle:active {
    background: rgba(0, 0, 0, 0.05);
    border-left-color: rgba(0, 0, 0, 0.1);
}

.sugo-ia-actions {
    display: flex;
    align-items: center;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #sugo-ia-chat-window {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        /* Force full width */
        height: 80vh;
        /* Bottom sheet height */
        border-radius: 16px 16px 0 0;
        /* Rounded top corners */
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
        border-left: none;
        border-top: 1px solid #e1e1e1;
    }

    #sugo-ia-resize-handle {
        display: none;
        /* No horizontal resize on mobile */
    }
}

.sugo-ia-header {
    background: var(--sugo-ia-primary, #0073aa);
    color: white;
    padding: 0px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    min-height: 50px;
    /* Ensure minimum height */
}

.sugo-ia-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 15px;
    /* Restore internal spacing */
}

.sugo-ia-header-content img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

#sugo-ia-close,
#sugo-ia-whatsapp,
#sugo-ia-clear {
    background: #00000059 !important;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 33%;
    margin: 4px;
    padding: 0;
    /* sugo-ia-whatsapp padding might need tweak if svg is large but let's try standard */
    line-height: 1;
}

#sugo-ia-clear:hover,
#sugo-ia-whatsapp:hover,
#sugo-ia-close:hover {
    background: #00000080 !important;
}

.sugo-ia-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #eee;
}

.msg {
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 12px;
    max-width: 80%;
    line-height: 1.4;
    font-size: 14px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.msg.user {
    background: var(--sugo-ia-primary, #0073aa);
    color: white;
    margin-left: auto;
    border-top-right-radius: 2px;
}

.msg.bot {
    background: #e5e5ea;
    color: #333;
    margin-right: auto;
    border-top-left-radius: 2px;
}

.msg.error {
    background: #ffecec;
    color: #d63638;
}

.sugo-ia-input-area {
    padding: 10px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    background: white;
}

#sugo-ia-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

#sugo-ia-send {
    background: var(--sugo-ia-primary, #0073aa);
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
}

/* Fix for list rendering */
.sugo-list-item {
    margin-left: 10px;
    margin-bottom: 5px;
    display: block;
}