/* SnapEX Live Chat Widget */
.scw-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #4c6fff 0%, #38bdf8 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(76, 111, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.33, 1, 0.68, 1), box-shadow 0.2s;
}
.scw-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(76, 111, 255, 0.45);
}
.scw-fab svg {
    width: 26px;
    height: 26px;
    fill: #fff;
}
.scw-fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    padding: 0 5px;
    display: none;
}
.scw-fab-badge.is-visible {
    display: block;
}

/* Chat panel */
.scw-panel {
    position: fixed;
    bottom: 92px;
    right: 24px;
    z-index: 9998;
    width: 370px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: "Inter", "DM Sans", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: #1a2233;
}
.scw-panel.is-open {
    display: flex;
}

/* Header */
.scw-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #4c6fff 0%, #38bdf8 100%);
    color: #fff;
}
.scw-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.scw-header-icon svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}
.scw-header-text {
    flex: 1;
    min-width: 0;
}
.scw-header-title {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
}
.scw-header-subtitle {
    font-size: 12px;
    opacity: 0.85;
    line-height: 1.3;
}
.scw-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    opacity: 0.8;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.scw-close:hover {
    opacity: 1;
}
.scw-close svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Messages area */
.scw-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
.scw-messages::-webkit-scrollbar {
    width: 5px;
}
.scw-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.scw-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    position: relative;
}
.scw-msg--visitor {
    align-self: flex-end;
    background: #4c6fff;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.scw-msg--admin {
    align-self: flex-start;
    background: #f1f5f9;
    color: #1a2233;
    border-bottom-left-radius: 4px;
}
.scw-msg-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
}
.scw-msg--visitor .scw-msg-time {
    text-align: right;
}

.scw-welcome {
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    padding: 24px 16px;
    line-height: 1.5;
}

/* Input area */
.scw-input-area {
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #e2e8f0;
    background: #fafbfc;
}
.scw-textarea {
    flex: 1;
    resize: none;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    color: #1a2233;
    background: #fff;
    outline: none;
    max-height: 100px;
    min-height: 40px;
    transition: border-color 0.15s;
}
.scw-textarea:focus {
    border-color: #4c6fff;
    box-shadow: 0 0 0 3px rgba(76, 111, 255, 0.12);
}
.scw-textarea::placeholder {
    color: #94a3b8;
}
.scw-send {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: #4c6fff;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
}
.scw-send:hover {
    background: #3b5bdb;
}
.scw-send:active {
    transform: scale(0.95);
}
.scw-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.scw-send svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* Typing indicator placeholder */
.scw-status {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    padding: 2px 0;
    min-height: 16px;
}

@media (max-width: 480px) {
    .scw-panel {
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .scw-fab {
        bottom: 16px;
        right: 16px;
    }
}
