:root {
    --chat-primary-color: #2563eb;
    --chat-primary-hover: #1d4ed8;
    --chat-secondary-color: #3b82f6;
    --chat-accent-color: #c2410c;

    --chat-bg: #fafafa;
    --chat-bg-gradient: #f8f9ff;
    --chat-surface: #ffffff;
    --chat-surface-elevated: #f8fafc;

    --chat-modal-bg: #ffffff;
    --chat-modal-border: transparent;
    --chat-modal-btn-cancel-bg: var(--chat-divider);
    --chat-modal-btn-cancel-hover: var(--chat-border);

    --chat-text: #1e293b;
    --chat-text-secondary: #64748b;
    --chat-text-light: #94a3b8;
    --chat-text-muted: #cbd5e1;

    --chat-border: #e2e8f0;
    --chat-divider: #f1f5f9;

    --chat-user-bubble: #2563eb;
    --chat-user-bubble-text: #ffffff;
    --chat-support-bubble: #ffffff;
    --chat-support-border: #e2e8f0;
    --chat-support-shadow: 0 1px 4px rgba(37, 99, 235, 0.07);

    --chat-error: #ef4444;
    --chat-error-light: #fef2f2;
    --chat-success: #10b981;
    --chat-success-light: #ecfdf5;
    --chat-warning: #f59e0b;
    --chat-warning-light: #fffbeb;
    --chat-info: #3b82f6;
    --chat-info-light: #eff6ff;

    --chat-shadow-sm: 0 1px 2px rgba(37, 99, 235, 0.08);
    --chat-shadow-md: 0 2px 6px rgba(37, 99, 235, 0.1);
    --chat-shadow-lg: 0 6px 16px rgba(37, 99, 235, 0.1);
    --chat-shadow-xl: 0 12px 24px rgba(37, 99, 235, 0.1);
    --chat-shadow-glow: 0 0 14px rgba(37, 99, 235, 0.25);

    --chat-radius-sm: 5px;
    --chat-radius-md: 8px;
    --chat-radius-lg: 11px;
    --chat-radius-xl: 14px;
    --chat-radius-2xl: 16px;
    --chat-radius-full: 9999px;

    --chat-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --chat-transition-fast: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
    --chat-transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --chat-primary-color: #3b82f6;
    --chat-primary-hover: #60a5fa;

    --chat-bg: #0f0f0f;
    --chat-bg-gradient: #0f0f0f;
    --chat-surface: #141414;
    --chat-surface-elevated: #1a1a1a;

    --chat-modal-bg: #1a1a1a;
    --chat-modal-border: #2a2a2a;
    --chat-modal-btn-cancel-bg: #2a2a2a;
    --chat-modal-btn-cancel-hover: #333333;

    --chat-text: #e2e8f0;
    --chat-text-secondary: #94a3b8;
    --chat-text-light: #64748b;
    --chat-text-muted: #475569;

    --chat-border: #2a2a2a;
    --chat-divider: #1f1f1f;

    --chat-user-bubble: #2563eb;
    --chat-user-bubble-text: #ffffff;
    --chat-support-bubble: #1f1f1f;
    --chat-support-border: #2a2a2a;
    --chat-support-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);

    --chat-error: #f87171;
    --chat-error-light: rgba(239, 68, 68, 0.1);
    --chat-success: #34d399;
    --chat-success-light: rgba(16, 185, 129, 0.1);
    --chat-warning: #fbbf24;
    --chat-warning-light: rgba(245, 158, 11, 0.1);
    --chat-info: #60a5fa;
    --chat-info-light: rgba(59, 130, 246, 0.1);

    --chat-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --chat-shadow-md: 0 2px 6px rgba(0, 0, 0, 0.4);
    --chat-shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.5);
    --chat-shadow-xl: 0 12px 30px rgba(0, 0, 0, 0.6);
    --chat-shadow-glow: 0 0 14px rgba(59, 130, 246, 0.12);
}

.live-chat-widget {
    position: fixed;
    bottom: 0;
    right: 24px;
    z-index: 999;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 380px;
    max-width: calc(100vw - 48px);
}

.live-chat-widget .chat-open-button {
    background: var(--chat-primary-color);
    color: white;
    height: 38px;
    border-radius: 10px 10px 0 0;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -2px 12px rgba(37,99,235,0.16);
    transition: var(--chat-transition);
    position: relative;
    overflow: visible;
    padding: 0 16px 0 13px;
    gap: 0;
    white-space: nowrap;
    min-width: 130px;
}

.live-chat-widget .chat-open-button:hover {
    background: var(--chat-primary-hover);
    box-shadow: 0 -3px 16px rgba(37,99,235,0.24);
}

.live-chat-widget .chat-open-button:active {
    background: var(--chat-primary-hover);
}

.live-chat-widget .chat-open-button-inner {
    display: flex;
    align-items: center;
    gap: 7px;
}

.live-chat-widget .chat-open-button-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
    animation: chatBtnPulse 2s ease-in-out infinite;
}

@keyframes chatBtnPulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
    70% { box-shadow: 0 0 0 5px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.live-chat-widget .chat-open-button-icon {
    font-size: 13px;
}

.live-chat-widget .chat-open-button-label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.live-chat-widget .chat-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--chat-error);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: var(--chat-shadow-sm);
    z-index: 2;
    animation: bounceIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="dark"] .live-chat-widget .chat-notification-badge {
    border-color: #141414;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.live-chat-widget .chat-welcome-popup {
    position: absolute;
    bottom: 100%;
    right: 0;
    width: max-content;
    max-width: min(300px, calc(100vw - 44px));
    min-width: 200px;
    background: var(--chat-surface);
    border: 1px solid var(--chat-border);
    border-radius: var(--chat-radius-xl);
    box-shadow: var(--chat-shadow-lg);
    padding: 13px 30px 13px 13px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateY(16px) scale(0.92);
    pointer-events: none;
    transition: opacity 0.3s ease-out, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 998;
    transform-origin: bottom right;
}

.live-chat-widget .chat-welcome-popup.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.live-chat-widget .welcome-popup-close {
    position: absolute;
    top: 6px;
    right: 6px;
    background: none;
    border: none;
    color: var(--chat-text-light);
    cursor: pointer;
    font-size: 12px;
    padding: 3px 6px;
    transition: var(--chat-transition-fast);
    line-height: 1;
}

.live-chat-widget .welcome-popup-close:hover {
    color: var(--chat-error);
    transform: scale(1.1);
}

.live-chat-widget .welcome-popup-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-chat-widget .welcome-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--chat-primary-color);
    box-shadow: var(--chat-shadow-sm);
    flex-shrink: 0;
    background: white;
}

.live-chat-widget .welcome-popup-content p {
    font-size: 0.82rem;
    color: var(--chat-text);
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
}

.live-chat-widget .chat-popup {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    width: 100%;
    min-width: 300px;
    height: 520px;
    max-height: min(520px, calc(100vh - 60px));
    background: var(--chat-surface);
    border-radius: 10px 10px 0 0;
    border: 1px solid var(--chat-border);
    border-bottom: none;
    box-shadow: 0 -3px 24px rgba(37,99,235,0.11), 0 0 0 1px var(--chat-border);
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    transform: scale(0.96) translateY(12px);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

.live-chat-widget .chat-popup.active {
    display: flex;
    transform: scale(1) translateY(0);
    opacity: 1;
    animation: slideUpFade 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUpFade {
    from {
        transform: scale(0.93) translateY(12px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.live-chat-widget .chat-header {
    background: var(--chat-primary-color);
    color: white;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    cursor: default;
    border-radius: 10px 10px 0 0;
}

.live-chat-widget .chat-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.live-chat-widget .chat-header .header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.live-chat-widget .header-title .agent-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background-color: #fff;
    flex-shrink: 0;
}

.live-chat-widget .header-title .agent-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.live-chat-widget .header-title .agent-name {
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: -0.1px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.live-chat-widget .header-title .agent-name img {
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.live-chat-widget .header-title .agent-status {
    font-size: 0.68rem;
    opacity: 0.85;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.live-chat-widget .chat-header .header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
    z-index: 1;
}

.live-chat-widget .chat-header .header-actions button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    cursor: pointer;
    transition: var(--chat-transition-fast);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.live-chat-widget .chat-header .header-actions button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.live-chat-widget .chat-header .header-actions button:active {
    transform: scale(0.95);
}

.live-chat-widget .pre-chat-form,
.live-chat-widget .chat-view-error {
    padding: 13px 16px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
    background: var(--chat-bg-gradient);
    overflow-y: auto;
}

.live-chat-widget .pre-chat-form {
    align-items: stretch;
}

.live-chat-widget .pre-chat-form > p {
    font-size: 0.85rem;
    margin-bottom: 12px;
    color: var(--chat-primary-color);
    font-weight: 500;
    line-height: 1.5;
}

.live-chat-widget .form-group {
    margin-bottom: 11px;
    text-align: left;
}

.live-chat-widget .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--chat-text);
    font-size: 0.75rem;
}

.live-chat-widget .form-control {
    width: 100%;
    padding: 9px 11px;
    border: 1.5px solid var(--chat-border);
    border-radius: var(--chat-radius-md);
    background-color: var(--chat-surface);
    font-size: 0.82rem;
    font-family: inherit;
    transition: var(--chat-transition-fast);
    color: var(--chat-text);
    box-sizing: border-box;
}

.live-chat-widget .form-control:focus {
    outline: none;
    border-color: var(--chat-primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    background: var(--chat-surface-elevated);
}

[data-theme="dark"] .live-chat-widget .form-control {
    background-color: #1a1a1a;
    color: #e2e8f0;
}

[data-theme="dark"] .live-chat-widget .form-control::placeholder {
    color: #64748b;
}

.live-chat-widget .btn-primary {
    background: var(--chat-primary-color);
    color: white;
    border: none;
    padding: 10px 14px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: var(--chat-radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.82rem;
    font-family: inherit;
    transition: var(--chat-transition);
    box-shadow: var(--chat-shadow-md);
    position: relative;
    overflow: hidden;
}

.live-chat-widget .btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.live-chat-widget .btn-primary:hover {
    background: var(--chat-primary-hover);
    box-shadow: var(--chat-shadow-lg);
}

.live-chat-widget .btn-primary:hover::before {
    width: 280px;
    height: 280px;
}

.live-chat-widget .btn-primary:active {
    transform: translateY(1px);
}

.live-chat-widget .btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.live-chat-widget .chat-view-error {
    color: var(--chat-error);
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.live-chat-widget .chat-view-error i {
    font-size: 40px;
    margin-bottom: 14px;
    opacity: 0.85;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.live-chat-widget .chat-view-error h6 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--chat-error);
}

.live-chat-widget .chat-view-error .chat-error-message {
    font-size: 0.8rem;
    line-height: 1.55;
    margin-bottom: 14px;
    color: var(--chat-text-secondary);
}


.live-chat-widget .chat-view {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: var(--chat-bg-gradient);
    position: relative;
}

.live-chat-widget .chat-messages {
    flex: 1;
    padding: 13px 11px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 9px;
    scroll-behavior: smooth;
}

.live-chat-widget .chat-messages::-webkit-scrollbar,
.live-chat-widget .pre-chat-form::-webkit-scrollbar {
    width: 3px;
}

.live-chat-widget .chat-messages::-webkit-scrollbar-track,
.live-chat-widget .pre-chat-form::-webkit-scrollbar-track {
    background: transparent;
}

.live-chat-widget .chat-messages::-webkit-scrollbar-thumb,
.live-chat-widget .pre-chat-form::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

[data-theme="dark"] .live-chat-widget .chat-messages::-webkit-scrollbar-thumb,
[data-theme="dark"] .live-chat-widget .pre-chat-form::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
}

.live-chat-widget .message {
    display: flex;
    flex-direction: column;
    max-width: 82%;
    padding: 8px 11px;
    border-radius: var(--chat-radius-md);
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    animation: messageSlideIn 0.2s ease-out;
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.live-chat-widget .message.user {
    background: var(--chat-user-bubble);
    color: var(--chat-user-bubble-text);
    align-self: flex-end;
    border-bottom-right-radius: var(--chat-radius-sm);
    border-top-left-radius: var(--chat-radius-lg);
    border-top-right-radius: var(--chat-radius-lg);
    border-bottom-left-radius: var(--chat-radius-lg);
    box-shadow: var(--chat-shadow-md);
    margin-left: auto;
}

.live-chat-widget .message.support {
    background: var(--chat-support-bubble);
    align-self: flex-start;
    border-bottom-left-radius: var(--chat-radius-sm);
    border-top-left-radius: var(--chat-radius-lg);
    border-top-right-radius: var(--chat-radius-lg);
    border-bottom-right-radius: var(--chat-radius-lg);
    box-shadow: var(--chat-support-shadow);
    border: 1px solid var(--chat-support-border);
}

.live-chat-widget .message .sender {
    font-weight: 700;
    font-size: 0.72rem;
    margin-bottom: 3px;
    color: var(--chat-primary-color);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.live-chat-widget .message .text-content {
    font-size: 0.82rem;
    color: var(--chat-text);
    line-height: 1.5;
}

.live-chat-widget .message.user .text-content {
    color: var(--chat-user-bubble-text);
}

.live-chat-widget .message-time {
    font-size: 0.62rem;
    color: var(--chat-text-light);
    align-self: flex-end;
    margin-top: 3px;
    opacity: 0.7;
}

.live-chat-widget .message.user .message-time {
    color: rgba(255, 255, 255, 0.72);
}

.live-chat-widget .message.system-message {
    align-self: center;
    text-align: center;
    font-size: 0.76rem;
    color: var(--chat-text-secondary);
    background: transparent;
    box-shadow: none;
    max-width: 95%;
    padding: 4px 8px;
}

.live-chat-widget .message.system-message.error {
    background: var(--chat-error-light);
    color: var(--chat-error);
    border-radius: var(--chat-radius-sm);
    padding: 7px 11px;
    font-weight: 500;
    border: 1px solid rgba(239, 68, 68, 0.18);
}

.live-chat-widget .message.system-message.welcome-message {
    background: var(--chat-support-bubble);
    color: var(--chat-text);
    text-align: left;
    border-left: 3px solid var(--chat-primary-color);
    padding: 9px 12px;
    border-radius: var(--chat-radius-sm);
    align-self: stretch;
    max-width: 100%;
    box-shadow: var(--chat-shadow-sm);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.live-chat-widget .attachment-wrapper {
    margin-top: 6px;
}

.live-chat-widget .attachment-wrapper img {
    max-width: 100%;
    max-height: 160px;
    border-radius: var(--chat-radius-sm);
    display: block;
    object-fit: cover;
    cursor: pointer;
    transition: var(--chat-transition-fast);
    box-shadow: var(--chat-shadow-sm);
}

.live-chat-widget .attachment-wrapper img:hover {
    transform: scale(1.02);
    box-shadow: var(--chat-shadow-md);
}

.live-chat-widget .typing-indicator {
    padding: 5px 12px;
    font-style: italic;
    color: var(--chat-text-secondary);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.live-chat-widget .typing-indicator::before {
    content: '●';
    animation: typingDot 1.4s infinite;
}

.live-chat-widget .typing-indicator::after {
    content: '●●';
    animation: typingDot 1.4s infinite 0.2s;
}

@keyframes typingDot {
    0%, 60%, 100% { opacity: 0.25; }
    30% { opacity: 1; }
}

.live-chat-widget .chat-footer {
    padding: 10px 11px;
    background: var(--chat-surface-elevated);
    border-top: 1px solid var(--chat-divider);
    flex-shrink: 0;
}

.live-chat-widget .chat-form {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

.live-chat-widget .chat-form .input-group {
    display: flex;
    align-items: center;
    flex: 1;
    background: var(--chat-surface);
    border-radius: var(--chat-radius-xl);
    padding: 3px 5px;
    border: 1.5px solid var(--chat-border);
    transition: var(--chat-transition-fast);
    min-height: 38px;
}

.live-chat-widget .chat-form .input-group:focus-within {
    border-color: var(--chat-primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.live-chat-widget .chat-input {
    border: none;
    flex: 1;
    padding: 6px 5px;
    background: transparent;
    resize: none;
    overflow-y: hidden;
    min-height: 20px;
    max-height: 90px;
    line-height: 1.45;
    font-family: inherit;
    font-size: 0.82rem;
    color: var(--chat-text);
}

.live-chat-widget .chat-input:focus {
    outline: none;
}

.live-chat-widget .chat-input::placeholder {
    color: var(--chat-text-light);
}

[data-theme="dark"] .live-chat-widget .chat-input {
    color: #e2e8f0;
}

[data-theme="dark"] .live-chat-widget .chat-input::placeholder {
    color: #64748b;
}

.live-chat-widget .menu-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--chat-text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--chat-radius-full);
    transition: var(--chat-transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.live-chat-widget .menu-btn:hover {
    color: var(--chat-primary-color);
    background: rgba(37, 99, 235, 0.07);
    transform: scale(1.1);
}

.live-chat-widget .send-btn {
    background: var(--chat-primary-color);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: var(--chat-radius-full);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: var(--chat-transition);
    box-shadow: var(--chat-shadow-md);
}

.live-chat-widget .send-btn:hover {
    background: var(--chat-primary-hover);
    transform: scale(1.07) rotate(4deg);
    box-shadow: var(--chat-shadow-lg);
}

.live-chat-widget .send-btn:active {
    transform: scale(0.95);
}

.live-chat-widget .send-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.live-chat-widget .char-counter {
    display: none;
    font-size: 0.66rem;
    text-align: right;
    padding: 2px 11px 0;
    color: var(--chat-text-secondary);
}

.live-chat-widget .char-counter.visible {
    display: block;
}

.live-chat-widget .char-counter.error {
    color: var(--chat-error);
    font-weight: 700;
}

.live-chat-widget .image-preview {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    padding: 8px;
    background: var(--chat-divider);
    border-radius: var(--chat-radius-md);
    margin-bottom: 8px;
    gap: 8px;
    cursor: grab;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    border: 1px solid var(--chat-border);
}

.live-chat-widget .image-preview.active {
    cursor: grabbing;
    user-select: none;
}

.live-chat-widget .preview-container {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    border-radius: var(--chat-radius-sm);
    overflow: hidden;
    box-shadow: var(--chat-shadow-sm);
    transition: var(--chat-transition-fast);
}

.live-chat-widget .preview-container:hover {
    transform: scale(1.04);
    box-shadow: var(--chat-shadow-md);
}

.live-chat-widget .preview-img {
    width: 64px;
    height: 64px;
    border-radius: var(--chat-radius-sm);
    object-fit: cover;
    display: block;
}

.live-chat-widget .remove-image-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--chat-error);
    color: white;
    border: 2px solid white;
    border-radius: var(--chat-radius-full);
    width: 18px;
    height: 18px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--chat-transition-fast);
    box-shadow: var(--chat-shadow-sm);
}

[data-theme="dark"] .live-chat-widget .remove-image-btn {
    border-color: #1a1a1a;
}

.live-chat-widget .remove-image-btn:hover {
    transform: scale(1.15) rotate(90deg);
}

.live-chat-widget .chat-watermark {
    text-align: center;
    padding: 6px 16px;
    font-size: 0.68rem;
    color: var(--chat-text-light);
    border-top: 1px solid var(--chat-divider);
    background: var(--chat-surface);
    flex-shrink: 0;
}

.live-chat-widget .chat-watermark a {
    color: var(--chat-primary-color);
    text-decoration: none;
    font-weight: 600;
}

.live-chat-widget .chat-watermark a:hover {
    text-decoration: underline;
}

.spam-cooldown-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--chat-error);
    color: white;
    padding: 9px;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    animation: slideUp 0.25s ease-out;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.jetsunucum-image-modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 10000;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(6px);
    animation: fadeIn 0.2s;
}

.jetsunucum-image-modal img {
    max-width: 88%;
    max-height: 88%;
    border-radius: var(--chat-radius-md);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    animation: zoomIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.jetsunucum-image-modal .close-modal {
    position: absolute;
    top: 16px;
    right: 28px;
    color: #f1f1f1;
    font-size: 38px;
    font-weight: bold;
    transition: var(--chat-transition-fast);
    cursor: pointer;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    line-height: 1;
}

.jetsunucum-image-modal .close-modal:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(90deg);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.82); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.live-chat-widget a[data-nexchat="home-btn"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--chat-primary-color);
    color: #ffffff;
    text-decoration: none;
    border: none;
    padding: 9px 20px;
    width: auto;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.82rem;
    font-family: inherit;
    line-height: 1.4;
    margin-top: 14px;
    align-self: center;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.live-chat-widget a[data-nexchat="home-btn"] i {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    line-height: 1;
}

.live-chat-widget a[data-nexchat="home-btn"] span {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.live-chat-widget a[data-nexchat="home-btn"]:hover {
    background: var(--chat-primary-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
    color: #ffffff;
    text-decoration: none;
}

.live-chat-widget a[data-nexchat="home-btn"]:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .live-chat-widget {
        bottom: 0;
        right: 14px;
    }

    .live-chat-widget .chat-popup {
        width: calc(100vw - 28px);
        max-width: 340px;
        max-height: calc(100vh - 56px);
        height: 440px;
        right: 0;
    }

    .live-chat-widget .chat-open-button {
        height: 36px;
        padding: 0 13px 0 10px;
        min-width: 118px;
    }

    .live-chat-widget .chat-open-button-icon {
        font-size: 12px;
    }

    .live-chat-widget .chat-open-button-label {
        font-size: 0.75rem;
    }

    .live-chat-widget .chat-header {
        padding: 9px 13px;
    }

    .live-chat-widget .chat-messages {
        padding: 11px 9px;
    }

    .live-chat-widget .message {
        max-width: 88%;
        padding: 7px 10px;
    }
}

@media (max-width: 480px) {
    .live-chat-widget {
        bottom: 0;
        right: 10px;
    }

    .live-chat-widget .chat-popup {
        width: calc(100vw - 20px);
        max-width: 100%;
        max-height: calc(100vh - 52px);
        height: 420px;
        border-radius: 10px 10px 0 0;
        right: 0;
    }

    .live-chat-widget .chat-header {
        border-radius: var(--chat-radius-xl) var(--chat-radius-xl) 0 0;
    }

    .live-chat-widget .chat-open-button {
        width: 44px;
        height: 44px;
        font-size: 17px;
        border-radius: 10px 10px 0 0;
        min-width: unset;
        padding: 0;
    }

    .live-chat-widget .chat-open-button-label {
        display: none;
    }

    .live-chat-widget .chat-open-button-dot {
        display: none;
    }
}

.live-chat-widget *:focus-visible {
    outline: 2px solid var(--chat-primary-color);
    outline-offset: 2px;
}

@media print {
    .live-chat-widget { display: none; }
}

.nexchat-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.18s ease-out;
    border-radius: 10px 10px 0 0;
}

.nexchat-modal {
    background: var(--chat-modal-bg);
    border-radius: 13px;
    padding: 22px 22px 18px;
    max-width: 300px;
    width: calc(100% - 40px);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.22);
    animation: zoomIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    border: 1px solid var(--chat-modal-border);
}

.nexchat-modal-icon {
    font-size: 30px;
    margin-bottom: 11px;
    line-height: 1;
}

.nexchat-modal-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--chat-text);
    margin-bottom: 6px;
    line-height: 1.4;
}

.nexchat-modal-message {
    font-size: 0.8rem;
    color: var(--chat-text-secondary);
    line-height: 1.55;
    margin-bottom: 18px;
}

.nexchat-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.nexchat-modal-btn {
    flex: 1;
    padding: 8px 13px;
    border-radius: 8px;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
    font-family: inherit;
}

.nexchat-modal-btn-cancel {
    background: var(--chat-modal-btn-cancel-bg, #f1f5f9);
    color: var(--chat-text-secondary, #64748b);
}

.nexchat-modal-btn-cancel:hover {
    background: var(--chat-modal-btn-cancel-hover, #e2e8f0);
}

.nexchat-modal-btn-confirm {
    background: var(--chat-primary-color, #2563eb);
    color: #ffffff;
}

.nexchat-modal-btn-confirm:hover {
    background: var(--chat-primary-hover, #1d4ed8);
    transform: translateY(-1px);
}

.nexchat-modal-btn-confirm.danger {
    background: var(--chat-error, #ef4444);
}

.nexchat-modal-btn-confirm.danger:hover {
    background: #dc2626;
}

@keyframes chatStatusPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.6); opacity: 0; }
}

.live-chat-widget .chat-status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    position: relative;
}

.live-chat-widget .chat-status-dot::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: rgba(34,197,94,0.4);
    animation: chatStatusPulse 1.6s ease-in-out infinite;
}