/* Let's Manage — light chat widget (fluid UI, typing & seen states) */
.lm-chat {
    position: fixed;
    right: 20px;
    bottom: 90px;
    z-index: var(--lm-z-chat, 9500);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    color: #334155;
    -webkit-font-smoothing: antialiased;
    contain: layout style;
}

.lm-chat:has(.lm-chat-panel.open) .lm-chat-open {
    animation: none !important;
}

.lm-chat .lm-chat-log.lm-chat-resetting {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

/* —— Launcher —— */
.lm-chat .lm-chat-open {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    color: #2563eb;
    width: 58px;
    height: 58px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.18), 0 0 0 1px rgba(226, 232, 240, 0.9);
    cursor: pointer;
    border: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.25s ease;
}
.lm-chat .lm-chat-open:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.28), 0 0 0 1px rgba(147, 197, 253, 0.5);
}
.lm-chat .lm-chat-open i {
    font-size: 22px;
}
.lm-chat.lm-chat-busy .lm-chat-open {
    animation: lmFabPulse 1.5s ease infinite;
}
@keyframes lmFabPulse {
    0%, 100% { box-shadow: 0 6px 24px rgba(37, 99, 235, 0.18); }
    50% { box-shadow: 0 6px 28px rgba(37, 99, 235, 0.35), 0 0 0 4px rgba(37, 99, 235, 0.08); }
}

/* —— Panel —— */
.lm-chat .lm-chat-panel {
    position: absolute;
    right: 0;
    bottom: 70px;
    width: 400px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 90px);
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e8eef5;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.1), 0 8px 20px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    display: none;
    flex-direction: column;
}
.lm-chat .lm-chat-panel.open {
    display: flex;
    animation: lmPanelIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes lmPanelIn {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* —— Header —— */
.lm-chat-header {
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, #fafbfd 0%, #f4f7fb 100%);
    border-bottom: 1px solid #e8eef5;
    flex-shrink: 0;
}
.lm-chat-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.lm-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}
.lm-chat-header-text {
    min-width: 0;
}
.lm-chat-header-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.lm-chat-header-title {
    font-weight: 600;
    font-size: 15px;
    color: #0f172a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.lm-chat-beta-tag {
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: 5px;
    background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
    line-height: 1.2;
}
.lm-header-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    margin-top: 2px;
}
.lm-header-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}
.lm-header-status[data-state="typing"] {
    color: #2563eb;
}
.lm-header-status[data-state="typing"]::before {
    background: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
    animation: lmStatusBlink 1s ease infinite;
}
@keyframes lmStatusBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}
.lm-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.lm-header-icon-btn,
.lm-chat-close {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lm-header-icon-btn:hover,
.lm-chat-close:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

/* —— Message log —— */
.lm-chat-log {
    flex: 1;
    overflow: auto;
    padding: 16px 14px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    scroll-behavior: smooth;
    position: relative;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300' viewBox='0 0 300 300'%3E%3Cg fill='none' stroke='%23cbd5e1' stroke-width='0.5' opacity='0.3'%3E%3Ccircle cx='40' cy='30' r='8'/%3E%3Cpath d='M38 30h4M40 28v4'/%3E%3Crect x='130' y='20' width='14' height='10' rx='2'/%3E%3Cpath d='M133 24h8M133 27h5'/%3E%3Cpath d='M240 25l6 8h-12z'/%3E%3Ccircle cx='60' cy='90' r='5'/%3E%3Cpath d='M57 90h6'/%3E%3Crect x='150' y='80' width='18' height='14' rx='2'/%3E%3Cpath d='M153 85h12M153 89h8'/%3E%3Cpath d='M250 85c0-4 8-4 8 0s-8 4-8 0'/%3E%3Cpath d='M30 150l10 5-10 5z'/%3E%3Ccircle cx='120' cy='150' r='6'/%3E%3Cpath d='M117 150h6M120 147v6'/%3E%3Crect x='200' y='140' width='12' height='16' rx='2'/%3E%3Cpath d='M203 145h6M203 149h4M203 153h5'/%3E%3Cpath d='M50 210l8-4v8z'/%3E%3Ccircle cx='140' cy='210' r='4'/%3E%3Cpath d='M136 210h8'/%3E%3Crect x='220' y='200' width='16' height='12' rx='2'/%3E%3Cpath d='M223 205h10M223 209h7'/%3E%3Cpath d='M80 270c0-5 10-5 10 0s-10 5-10 0'/%3E%3Crect x='170' y='260' width='14' height='10' rx='2'/%3E%3Cpath d='M173 264h8'/%3E%3Ccircle cx='260' cy='270' r='5'/%3E%3Cpath d='M257 270h6M260 267v6'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 300px 300px;
}
.lm-chat-log::-webkit-scrollbar { width: 5px; }
.lm-chat-log::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* —— Message animations —— */
.lm-msg {
    margin-bottom: 14px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.lm-msg.lm-msg-visible {
    opacity: 1;
    transform: translateY(0);
}
.lm-msg.lm-msg-out {
    opacity: 0;
    transform: translateY(-6px);
    transition-duration: 0.2s;
}
.lm-msg.lm-user {
    justify-content: flex-end;
}
.lm-msg.lm-assistant {
    justify-content: flex-start;
}
.lm-msg-col {
    max-width: 78%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.lm-msg.lm-user .lm-msg-col {
    align-items: flex-end;
}
.lm-msg.lm-assistant .lm-msg-col {
    align-items: flex-start;
}

.lm-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    align-self: flex-end;
    margin-bottom: 18px;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.lm-msg-row-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px;
}
.lm-sender-name {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.lm-typing-tag {
    font-size: 11px;
    font-weight: 500;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-transform: lowercase;
}
.lm-typing-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2563eb;
    animation: lmStatusBlink 1s ease infinite;
}
.lm-error-tag {
    font-size: 10px;
    font-weight: 600;
    color: #dc2626;
    background: #fef2f2;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.lm-msg-body {
    padding: 11px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
}
.lm-msg.lm-user .lm-msg-body {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border-bottom-right-radius: 5px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.22);
}
.lm-msg.lm-incoming .lm-msg-body,
.lm-msg.lm-assistant .lm-msg-body {
    background: #ffffff;
    color: #334155;
    border: 1px solid #e8eef5;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}
.lm-msg.lm-admin .lm-msg-body {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}
.lm-msg.lm-notice .lm-msg-body {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
    font-size: 13px;
}
.lm-msg.lm-notice .lm-avatar {
    background: linear-gradient(135deg, #fef3c7, #fffbeb);
    color: #d97706;
}
.lm-msg.lm-admin .lm-avatar {
    background: linear-gradient(135deg, #d1fae5, #ecfdf5);
    color: #059669;
}
.lm-msg.lm-admin.lm-typing-row .lm-avatar {
    background: linear-gradient(135deg, #d1fae5, #ecfdf5);
    color: #059669;
}
.lm-msg.lm-admin.lm-typing-row .lm-typing-bubble {
    background: #ecfdf5;
    border-color: #a7f3d0;
}
.lm-notice-tag {
    font-size: 10px;
    font-weight: 600;
    color: #d97706;
    background: #fef3c7;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}
.lm-msg-body.lm-body-reveal {
    animation: lmBodyReveal 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes lmBodyReveal {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}
.lm-msg.lm-error .lm-msg-body {
    background: #fff5f5;
    color: #b91c1c;
    border-color: #fecaca;
}

.lm-msg-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px;
    font-size: 11px;
    color: #94a3b8;
}
.lm-msg-time {
    font-variant-numeric: tabular-nums;
}
.lm-msg-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    transition: color 0.25s ease;
}
.lm-msg-status i {
    font-size: 10px;
}
.lm-status-sent { color: #94a3b8; }
.lm-status-delivered { color: #64748b; }
.lm-status-seen { color: #2563eb; }

/* —— Typing bubble —— */
.lm-typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #e8eef5;
    border-radius: 16px;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}
.lm-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #93c5fd;
    animation: lmDotBounce 1.2s ease-in-out infinite;
}
.lm-dot:nth-child(2) { animation-delay: 0.15s; }
.lm-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes lmDotBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
    30% { transform: translateY(-6px); opacity: 1; background: #2563eb; }
}

.lm-msg-read-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #fff;
    color: #94a3b8;
    border: 1px solid #e8eef5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.lm-msg-read-btn:hover {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
    transform: scale(1.05);
}
.lm-msg-read-btn.lm-speaking {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

/* —— Footer / input —— */
.lm-chat-footer {
    background: #fff;
    border-top: 1px solid #e8eef5;
    flex-shrink: 0;
}

.lm-agent-bar {
    padding: 10px 12px 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    transition: opacity 0.25s ease, max-height 0.3s ease, padding 0.25s ease;
    max-height: 80px;
    overflow: hidden;
}
.lm-agent-bar.lm-agent-hidden {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    pointer-events: none;
}
.lm-agent-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #6ee7b7;
    border-radius: 12px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #047857;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.12);
}
.lm-agent-btn i { font-size: 14px; }
.lm-agent-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #34d399;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.18);
}
.lm-agent-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}
.lm-agent-hint {
    margin: 0;
    text-align: center;
    font-size: 10px;
    color: #64748b;
    line-height: 1.3;
}

.lm-chat-input {
    padding: 12px 12px 4px;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.lm-chat-input textarea {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    resize: none;
    padding: 11px 14px;
    border-radius: 14px;
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #e8eef5;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.45;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.lm-chat-input textarea::placeholder { color: #94a3b8; }
.lm-chat-input textarea:focus {
    outline: none;
    border-color: #93c5fd;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.lm-chat-input textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.lm-chat-hint {
    padding: 2px 14px 12px;
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    line-height: 1.5;
}
.lm-chat-hint kbd {
    display: inline-block;
    padding: 1px 5px;
    font-size: 10px;
    font-family: inherit;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #64748b;
}

.lm-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid #e8eef5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    background: #fff;
    color: #64748b;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.lm-icon-btn:hover:not(:disabled) {
    background: #f8fafc;
    color: #2563eb;
    border-color: #bfdbfe;
    transform: translateY(-1px);
}
.lm-icon-btn:active:not(:disabled) {
    transform: translateY(0);
}
.lm-icon-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.lm-voice-btn.lm-recording {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
    animation: lmRecPulse 1.2s ease infinite;
}
@keyframes lmRecPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.2); }
    50% { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); }
}
.lm-send-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.lm-send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.lm-chat.lm-chat-busy .lm-send-btn i {
    animation: lmSendSpin 0.8s linear infinite;
}
@keyframes lmSendSpin {
    to { transform: rotate(360deg); }
}
.lm-speak-btn.lm-speaking {
    background: #eff6ff;
    color: #2563eb;
    border-color: #93c5fd;
}

/* ── Quick-reply starters + talk-to-human (redesign v2) ── */
.lm-starters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 4px 10px;
    animation: lmStartersIn .3s ease;
}
@keyframes lmStartersIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.lm-starter-chip {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: all .15s ease;
    line-height: 1.2;
}
.lm-starter-chip:hover { background: #dbeafe; border-color: #93c5fd; }
.lm-starter-chip.lm-human-chip {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.lm-starter-chip.lm-human-chip:hover { background: #d1fae5; border-color: #6ee7b7; }

/* ── Message feedback thumbs (redesign v2) ── */
.lm-feedback {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.lm-fb-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #94a3b8;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s ease;
}
.lm-fb-btn:hover:not(:disabled) { color: #2563eb; border-color: #93c5fd; background: #eff6ff; }
.lm-fb-btn:disabled { cursor: default; opacity: .9; }
.lm-fb-btn.lm-fb-active { color: #2563eb; border-color: #2563eb; background: #eff6ff; }
.lm-feedback.lm-fb-sent .lm-fb-btn:not(.lm-fb-active) { opacity: .35; }

@media (max-width: 640px) {
    .lm-chat { right: 12px; bottom: 80px; }
    .lm-chat .lm-chat-panel {
        width: calc(100% - 24px);
        max-width: calc(100dvw - 24px);
        height: min(78vh, 580px);
        bottom: 66px;
    }
    .lm-msg-col { max-width: 88%; }
}

/* Markdown bullet lists in bot replies */
.lm-md-list { margin: 6px 0; padding-left: 18px; }
.lm-md-list li { margin: 2px 0; }

/* Higher-contrast hint text (WCAG AA) */
.lm-chat-hint { color: #64748b; }

/* Queue / live status */
.lm-header-status[data-state="queue"] { color: #0369a1; }
.lm-header-status[data-state="queue"]::before { background: #0ea5e9; animation: lm-queue-pulse 1.2s ease-in-out infinite; }
.lm-header-status[data-state="offline"] { color: #64748b; }
.lm-header-status[data-state="offline"]::before { background: #94a3b8; }

.lm-queue-banner {
    display: none;
    align-items: center;
    gap: 12px;
    margin: 10px 12px 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    box-shadow: 0 4px 18px rgba(14, 165, 233, 0.12);
}
.lm-queue-banner.lm-queue-visible { display: flex; animation: lm-queue-in 0.45s ease; }

.lm-hold-banner {
    display: none;
    align-items: center;
    gap: 12px;
    margin: 10px 12px 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #fde047;
    box-shadow: 0 4px 18px rgba(234, 179, 8, 0.12);
}
.lm-hold-banner.lm-hold-visible { display: flex; animation: lm-queue-in 0.45s ease; }
.lm-hold-pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #eab308;
    animation: lm-queue-pulse 1.4s ease-out infinite;
    flex-shrink: 0;
}
.lm-hold-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lm-hold-copy strong { font-size: 14px; color: #854d0e; }
.lm-hold-text { font-size: 13px; color: #713f12; line-height: 1.4; }
.lm-hold-timer { font-size: 13px; font-weight: 600; color: #a16207; }

.lm-queue-pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #0ea5e9;
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.45);
    animation: lm-queue-pulse 1.4s ease-out infinite;
    flex-shrink: 0;
}
.lm-queue-copy { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #0c4a6e; flex: 1; min-width: 0; }
.lm-queue-copy strong { font-size: 13px; color: #075985; }
.lm-queue-timer {
    font-size: 12px;
    font-weight: 700;
    color: #0369a1;
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}
.lm-queue-actions { margin-top: 8px; }
.lm-queue-actions-lead { margin: 0 0 8px; font-size: 12px; color: #0c4a6e; }
.lm-queue-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.lm-queue-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    line-height: 1.2;
}
.lm-queue-btn-wait { background: #0ea5e9; color: #fff; }
.lm-queue-btn-callback { background: #fff; color: #0369a1; border: 1px solid #7dd3fc; }
.lm-queue-btn-whatsapp { background: #22c55e; color: #fff; }
.lm-queue-btn:hover { filter: brightness(0.96); }
.lm-msg.lm-queue-notice .lm-msg-body {
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
    border-color: #7dd3fc;
    color: #0c4a6e;
}
.lm-chat.lm-chat-ended .lm-chat-input textarea { background: #f1f5f9; cursor: not-allowed; }
.lm-chat.lm-chat-ended .lm-send-btn { opacity: 0.45; pointer-events: none; }
#lm-chat-widget.lm-chat-ended .lm-chat-form,
.lm-chat.lm-chat-ended .lm-chat-form { display: none !important; }
#lm-chat-widget.lm-chat-ended .lm-agent-bar,
.lm-chat.lm-chat-ended .lm-agent-bar { display: none !important; }
#lm-chat-widget.lm-chat-ended .lm-ended-bar,
.lm-chat.lm-chat-ended .lm-ended-bar { display: block !important; pointer-events: auto; }

#lm-chat-widget .lm-ended-bar,
.lm-ended-bar {
    display: none;
    padding: 14px 14px 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-top: 1px solid #e2e8f0;
}
#lm-chat-widget .lm-ended-bar.lm-ended-visible,
.lm-ended-bar.lm-ended-visible {
    display: block !important;
    animation: lmEndedIn 0.28s ease;
}
@keyframes lmEndedIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
#lm-chat-widget .lm-ended-card,
.lm-ended-card {
    text-align: center;
    padding: 18px 16px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
#lm-chat-widget .lm-ended-icon,
.lm-ended-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.15);
}
#lm-chat-widget .lm-ended-title,
.lm-ended-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}
#lm-chat-widget .lm-ended-text,
.lm-ended-text {
    margin: 0 0 16px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.55;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}
#lm-chat-widget button.lm-ended-new-btn,
#lm-chat-widget .lm-ended-new-btn,
.lm-ended-new-btn {
    box-sizing: border-box;
    width: 100%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px !important;
    margin: 0;
    border: none !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: inherit;
    line-height: 1.3;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
#lm-chat-widget button.lm-ended-new-btn:hover,
#lm-chat-widget .lm-ended-new-btn:hover,
.lm-ended-new-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.34);
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: #ffffff !important;
}
#lm-chat-widget button.lm-ended-new-btn:active,
.lm-ended-new-btn:active {
    transform: translateY(0);
}
#lm-chat-widget .lm-ended-new-btn i {
    font-size: 13px;
    color: #ffffff !important;
}
#lm-chat-widget .lm-ended-new-btn span {
    color: #ffffff !important;
}

.lm-header-icon-btn.lm-end-chat-btn:hover {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

@keyframes lm-queue-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.45); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(14, 165, 233, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}
@keyframes lm-queue-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .lm-chat,
    .lm-chat *,
    .lm-chat *::before,
    .lm-chat *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
