.sd-nova-bot-widget {
    position: fixed;
    bottom: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}
.sd-nova-bot-pos-right { right: 20px; }
.sd-nova-bot-pos-left { left: 20px; }

.sd-nova-bot-launcher {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    cursor: pointer;
    gap: 8px;
}
.sd-nova-bot-pos-left .sd-nova-bot-launcher { align-items: flex-start; }

.sd-nova-bot-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sd-nova-theme-primary, #2271b1);
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.sd-nova-bot-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.sd-nova-bot-toggle-btn svg {
    width: 28px;
    height: 28px;
}
.sd-nova-bot-toggle-avatar {
    background: none;
    padding: 0;
    overflow: visible;
}
.sd-nova-bot-toggle-avatar .sd-nova-bot-avatar-circle {
    width: 60px;
    height: 60px;
}
.sd-nova-bot-toggle-avatar .sd-nova-avatar-custom {
    width: 60px;
    height: 60px;
}
.sd-nova-bot-toggle-avatar .sd-nova-avatar-custom img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}
.sd-nova-bot-toggle-avatar .sd-nova-avatar-emoji {
    font-size: 28px;
}

.sd-nova-bot-avatar-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
}
.sd-nova-bot-avatar-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.sd-nova-bot-avatar-icon {
    font-size: 32px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.sd-nova-bot-avatar-circle.speaking .sd-nova-bot-avatar-icon {
    animation: sd-nova-bot-lipsync 0.3s ease-in-out infinite alternate;
}
@keyframes sd-nova-bot-lipsync {
    0% { transform: scaleY(1) translateY(0); }
    100% { transform: scaleY(1.15) translateY(-2px); }
}

.sd-nova-bot-greeting-bubble {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px 12px 12px 4px;
    padding: 10px 14px;
    max-width: 220px;
    font-size: 13px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    animation: sd-nova-bot-fadeIn 0.3s ease-out;
    position: relative;
}
.sd-nova-bot-pos-left .sd-nova-bot-greeting-bubble {
    border-radius: 12px 12px 4px 12px;
}
.sd-nova-bot-greeting-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 16px;
    width: 10px;
    height: 10px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    transform: rotate(45deg);
}
.sd-nova-bot-pos-left .sd-nova-bot-greeting-bubble::after {
    right: auto;
    left: 16px;
}

.sd-nova-bot-chat-panel {
    position: fixed;
    bottom: 90px;
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: sd-nova-bot-slideUp 0.3s ease-out;
}
.sd-nova-bot-pos-right .sd-nova-bot-chat-panel { right: 0; }
.sd-nova-bot-pos-left .sd-nova-bot-chat-panel { left: 0; }

@keyframes sd-nova-bot-slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes sd-nova-bot-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.sd-nova-bot-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    color: #fff;
    gap: 10px;
    flex-shrink: 0;
}
.sd-nova-bot-header-avatar .sd-nova-bot-avatar-icon { font-size: 28px; }
.sd-nova-bot-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sd-nova-bot-header-info strong { font-size: 15px; }
.sd-nova-bot-status { font-size: 11px; opacity: 0.85; }
.sd-nova-bot-header-actions {
    display: flex;
    gap: 4px;
}
.sd-nova-bot-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}
.sd-nova-bot-btn:hover { background: rgba(255,255,255,0.35); }
.sd-nova-bot-mic-btn.listening { background: #ff4444; animation: sd-nova-bot-pulse 1s infinite; }
@keyframes sd-nova-bot-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,68,68,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(255,68,68,0); }
}

.sd-nova-bot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fa;
}
.sd-nova-bot-messages::-webkit-scrollbar { width: 4px; }
.sd-nova-bot-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.sd-nova-bot-msg {
    display: flex;
    animation: sd-nova-bot-fadeIn 0.2s ease-out;
}
.sd-nova-bot-msg-bot { justify-content: flex-start; }
.sd-nova-bot-msg-user { justify-content: flex-end; }

.sd-nova-bot-msg-content {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}
.sd-nova-bot-msg-bot .sd-nova-bot-msg-content {
    background: #fff;
    color: #333;
    border: 1px solid #e8e8e8;
    border-radius: 14px 14px 14px 4px;
}
.sd-nova-bot-msg-user .sd-nova-bot-msg-content {
    background: #4A90D9;
    color: #fff;
    border-radius: 14px 14px 4px 14px;
}

.sd-nova-bot-msg-bot .sd-nova-bot-msg-content.listening {
    border-left: 3px solid #ff4444;
}

.sd-nova-bot-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}
.sd-nova-bot-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 80px;
    font-family: inherit;
    line-height: 1.4;
}
.sd-nova-bot-input:focus { border-color: #4A90D9; }
.sd-nova-bot-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #4A90D9;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
    padding: 0;
}
.sd-nova-bot-send-btn:hover { background: #357ABD; }

.sd-nova-bot-upload-btn {
    font-size: 18px;
    background: #f0f0f0;
    color: #555;
    border: 1px solid #ddd;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.sd-nova-bot-upload-btn:hover { background: #e0e0e0; color: #333; }

.sd-nova-bot-chat-panel.drag-over {
    border-color: #4A90D9;
    box-shadow: 0 0 0 2px rgba(74,144,217,0.2);
}

.sd-nova-bot-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 14px 14px 14px 4px;
    align-self: flex-start;
}
.sd-nova-bot-typing span {
    width: 7px;
    height: 7px;
    background: #999;
    border-radius: 50%;
    animation: sd-nova-bot-typing 1.4s infinite ease-in-out;
}
.sd-nova-bot-typing span:nth-child(2) { animation-delay: 0.2s; }
.sd-nova-bot-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes sd-nova-bot-typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

.sd-nova-bot-chat-panel.open { display: flex; }

/* Suggested question chips */
.sd-nova-bot-suggested {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    animation: sd-nova-bot-fadeIn 0.4s ease-out;
}
.sd-nova-bot-chip {
    background: #fff;
    border: 1px solid #4A90D9;
    color: #4A90D9;
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sd-nova-bot-chip:hover {
    background: #4A90D9;
    color: #fff;
}

/* Inline mode — embedded in page content, not floating */
.sd-nova-bot-widget.sd-nova-bot-inline {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    z-index: auto;
    margin: 20px 0;
}
.sd-nova-bot-widget.sd-nova-bot-inline .sd-nova-bot-launcher {
    display: none;
}
.sd-nova-bot-widget.sd-nova-bot-inline .sd-nova-bot-chat-panel {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    display: flex !important;
    width: 100%;
    max-width: 100%;
    height: 480px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    border-radius: 12px;
}

@media (max-width: 480px) {
    .sd-nova-bot-chat-panel {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        bottom: 0;
        border-radius: 0;
    }
    .sd-nova-bot-pos-right .sd-nova-bot-chat-panel,
    .sd-nova-bot-pos-left .sd-nova-bot-chat-panel { right: 0; left: 0; }
}

/* Custom avatar image */
.sd-nova-avatar-custom {
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sd-nova-avatar-custom img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Avatar sizes */
.sd-nova-avatar-small {
    width: 40px;
    height: 40px;
}
.sd-nova-avatar-small .sd-nova-avatar-emoji {
    font-size: 22px;
}
.sd-nova-avatar-medium {
    width: 56px;
    height: 56px;
}
.sd-nova-avatar-medium .sd-nova-avatar-emoji {
    font-size: 30px;
}
.sd-nova-avatar-large {
    width: 72px;
    height: 72px;
}
.sd-nova-avatar-large .sd-nova-avatar-emoji {
    font-size: 40px;
}

/* Header avatar sizing */
.sd-nova-bot-header .sd-nova-avatar-small { width: 32px; height: 32px; }
.sd-nova-bot-header .sd-nova-avatar-medium { width: 38px; height: 38px; }
.sd-nova-bot-header .sd-nova-avatar-large { width: 44px; height: 44px; }
.sd-nova-bot-header .sd-nova-avatar-emoji { font-size: inherit; }

/* Avatar animations */
.sd-nova-avatar-anim-bounce {
    animation: sd-nova-avatar-bounce 2s infinite;
}
.sd-nova-avatar-anim-pulse {
    animation: sd-nova-avatar-pulse 2s infinite;
}
.sd-nova-avatar-anim-wave {
    animation: sd-nova-avatar-wave 2.5s infinite;
}
@keyframes sd-nova-avatar-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes sd-nova-avatar-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
    50% { box-shadow: 0 4px 24px rgba(74,144,217,0.5); }
}
@keyframes sd-nova-avatar-wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}

/* Avatar speaking overrides for custom images */
.sd-nova-avatar-custom.speaking {
    animation: sd-nova-bot-lipsync 0.3s ease-in-out infinite alternate;
}

/* Chat file attachment styling in messages */
.sd-nova-bot-file-attachment {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 12px;
    margin-top: 4px;
}
.sd-nova-bot-file-attachment img {
    max-width: 120px;
    border-radius: 6px;
}
.sd-nova-bot-file-attachment a {
    color: inherit;
    text-decoration: underline;
}

/* Inline styles for theme CSS variables */
:root {
    --sd-nova-theme-primary: #2271b1;
    --sd-nova-theme-background: #ffffff;
    --sd-nova-theme-text: #333333;
    --sd-nova-theme-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
