#swg-chatbot-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.swg-position-bottom-right { bottom: 24px; right: 24px; }
.swg-position-bottom-left  { bottom: 24px; left: 24px; }

#swg-chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--swg-color, #378ADD);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 14px;
    font-weight: 600;
    padding: 0 12px;
    min-width: 56px;
}
#swg-chat-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
#swg-chat-toggle span { white-space: nowrap; }

#swg-chat-window {
    width: 360px;
    height: 500px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 12px;
    box-sizing: border-box;
    transform-origin: bottom center;
}
#swg-chat-window.swg-open {
    display: flex;
    animation: swgSlideUp 0.25s ease forwards;
}
#swg-chat-window.swg-closing {
    display: flex;
    animation: swgSlideDown 0.2s ease forwards;
}
@keyframes swgSlideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes swgSlideDown {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(16px) scale(0.97); }
}

#swg-chat-header {
    background: var(--swg-color, #378ADD);
    color: white;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 30px;
}
#swg-chat-close {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: white !important;
    cursor: pointer !important;
    font-size: 20px !important;
    line-height: 1 !important;
    opacity: 0.85;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
#swg-chat-close:hover { opacity: 1; background: none !important; }

#swg-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fa;
}

.swg-bubble-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.swg-bot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--swg-color, #378ADD);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.swg-bot-avatar img { width: 100%; height: 100%; object-fit: cover; }

.swg-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}
.swg-bubble ol, .swg-bubble ul {
    margin: 6px 0 2px 0;
    padding-left: 18px;
}
.swg-bubble li { margin-bottom: 4px; }
.swg-bubble strong { font-weight: 600; }
.swg-bubble-bot {
    background: #fff;
    color: #1a1a1a;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.swg-bubble-user {
    background: var(--swg-color, #378ADD);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

.swg-typing {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.swg-typing span {
    width: 7px;
    height: 7px;
    background: #aaa;
    border-radius: 50%;
    animation: swgDot 1.2s infinite;
}
.swg-typing span:nth-child(2) { animation-delay: 0.2s; }
.swg-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes swgDot {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

#swg-chat-input-area {
    display: flex !important;
    align-items: flex-end !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    border-top: 1px solid #eee !important;
    background: #fff !important;
    box-sizing: border-box !important;
}
#swg-chat-input {
    flex: 1 !important;
    border: 1px solid #ddd !important;
    border-radius: 20px !important;
    padding: 8px 14px !important;
    font-size: 14px !important;
    resize: none !important;
    outline: none !important;
    font-family: inherit !important;
    max-height: 100px !important;
    min-height: 36px !important;
    overflow-y: auto !important;
    transition: border-color 0.2s !important;
    box-sizing: border-box !important;
    width: auto !important;
    margin: 0 !important;
}
#swg-chat-input:focus { border-color: var(--swg-color, #378ADD) !important; }
#swg-chat-send {
    background: var(--swg-color, #378ADD) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    cursor: pointer !important;
    font-size: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    transition: opacity 0.2s !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
}
#swg-chat-send:hover { opacity: 0.85 !important; }
#swg-chat-send:disabled { opacity: 0.5 !important; cursor: not-allowed !important; }

#swg-escalate-form {
    display: none;
    padding: 12px 16px;
    background: #f0f6ff;
    border-top: 1px solid #dde8f5;
}
#swg-escalate-form p {
    font-size: 13px;
    color: #555;
    margin: 0 0 10px;
    line-height: 1.4;
}
.swg-escalate-input {
    display: block !important;
    width: 100% !important;
    padding: 7px 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    margin-bottom: 8px !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    background: #fff !important;
}
.swg-escalate-input:focus { outline: none !important; border-color: var(--swg-color, #378ADD) !important; }
.swg-escalate-actions { display: flex; gap: 8px; }
#swg-escalate-submit {
    flex: 1 !important;
    background: var(--swg-color, #378ADD) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px !important;
    font-size: 13px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    box-shadow: none !important;
}
#swg-escalate-cancel {
    background: none !important;
    color: #aaa !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    cursor: pointer !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    box-shadow: none !important;
}

#swg-chat-footer {
    text-align: center;
    font-size: 11px;
    color: #aaa;
    padding: 4px 0 6px;
    background: #fff;
}
#swg-chat-footer a { color: #aaa; text-decoration: none; }
#swg-chat-footer a:hover { text-decoration: underline; }
#swg-escalate-btn {
    display: block !important;
    background: none !important;
    border: none !important;
    color: var(--swg-color, #378ADD) !important;
    font-size: 11px !important;
    cursor: pointer !important;
    padding: 2px 0 4px !important;
    margin: 0 auto !important;
    text-decoration: underline !important;
    opacity: 0.75;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-family: inherit !important;
}
#swg-escalate-btn:hover { opacity: 1 !important; }

/* Conversation Starter chips */
.swg-starters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0 2px;
}
.swg-starter-btn {
    background: #fff !important;
    border: 1px solid var(--swg-color, #378ADD) !important;
    color: var(--swg-color, #378ADD) !important;
    border-radius: 20px !important;
    padding: 6px 13px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    font-family: inherit !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    transition: background 0.15s, color 0.15s !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
}
.swg-starter-btn:hover {
    background: var(--swg-color, #378ADD) !important;
    color: #fff !important;
}

/* 👍 👎 Rating row */
.swg-rating {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 0 10px 48px;
}
.swg-rating-label {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}
.swg-rate-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 8px 20px !important;
    border-radius: 50px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s !important;
    border: 1.5px solid #ddd !important;
    background: #fff !important;
    color: #555 !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    min-width: 95px !important;
    opacity: 1 !important;
}
.swg-rate-btn:hover:not(:disabled) {
    border-color: var(--swg-color, #378ADD) !important;
    color: var(--swg-color, #378ADD) !important;
    transform: none !important;
}
.swg-rate-btn:disabled {
    cursor: default !important;
}
.swg-rate-btn.swg-rate-active {
    background: var(--swg-color, #378ADD) !important;
    border-color: var(--swg-color, #378ADD) !important;
    color: #fff !important;
    transform: scale(1.05) !important;
}
.swg-rated {
    font-size: 11px;
    color: #aaa;
    padding: 2px 0;
    line-height: 1.6;
    width: 100%;
}

@media (max-width: 420px) {
    #swg-chat-window { width: calc(100vw - 24px); }
    .swg-position-bottom-right { right: 12px; bottom: 12px; }
    .swg-position-bottom-left  { left: 12px; bottom: 12px; }
}
