/* ── stocks/live — live chat widget + admin dock (2026-08-31, #864) ──────
   Visual language borrowed from public/assets/css/stocks-chat.css (the
   Stocks Assistant), but namespaced slc- and shaped as a compact
   bottom-right dock: this widget can appear on ANY stocks page, so it must
   never collide with the assistant's .sc-chat-* FAB/panel. Used by BOTH
   sides — the user widget (live-chat.js) and the admin dock (admin-live.js). */

/* FAB (user side) — offset left of the assistant's spot */
.slc-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #198754;
    color: #fff;
    border: none;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
    transition: background 0.15s, transform 0.15s;
    z-index: 1060;
}
.slc-fab:hover { background: #157347; transform: scale(1.06); }

.slc-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* Dock panel — compact, bottom-right */
.slc-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 370px;
    max-width: calc(100vw - 24px);
    height: 480px;
    max-height: calc(100vh - 40px);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.18);
    z-index: 1061;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.slc-panel.slc-open { display: flex; }

/* Header */
.slc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: #198754;
    color: #fff;
    flex-shrink: 0;
}
.slc-header-title { font-size: 14px; font-weight: 700; line-height: 1.2; }
.slc-header-sub   { font-size: 11px; opacity: 0.85; }
.slc-header-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
}
.slc-header-btn:hover { background: rgba(255, 255, 255, 0.3); }

.slc-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    margin-right: 5px;
    animation: slc-pulse 1.6s infinite;
}
@keyframes slc-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* Messages */
.slc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.slc-messages::before { content: ''; flex: 1; }
.slc-messages::-webkit-scrollbar { width: 5px; }
.slc-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

.slc-msg { margin-bottom: 10px; display: flex; flex-direction: column; }
.slc-msg-mine   { align-items: flex-end; }
.slc-msg-theirs { align-items: flex-start; }

.slc-msg-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #9ca3af;
    margin-bottom: 3px;
}

.slc-bubble {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.slc-msg-mine   .slc-bubble { background: #198754; color: #fff; border-bottom-right-radius: 3px; }
.slc-msg-theirs .slc-bubble { background: #f3f4f6; color: #1e293b; border-bottom-left-radius: 3px; }

.slc-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    padding: 18px 10px;
}

/* Input */
.slc-input-area {
    padding: 10px 12px;
    border-top: 1px solid #e5e7eb;
    background: #f8f9fa;
    flex-shrink: 0;
}
.slc-input-row { display: flex; gap: 8px; align-items: flex-end; }
.slc-input {
    flex: 1;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    resize: none;
    font-family: inherit;
    line-height: 1.4;
    min-height: 38px;
    max-height: 120px;
    overflow-y: auto;
    background: #fff;
}
.slc-input:focus { border-color: #198754; box-shadow: 0 0 0 2px rgba(25, 135, 84, 0.1); }
.slc-send {
    background: #198754;
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.slc-send:hover { background: #157347; }
.slc-send:disabled { background: #9ca3af; cursor: not-allowed; }

@media (max-width: 480px) {
    .slc-panel { bottom: 0; right: 0; width: 100%; height: 70vh; border-radius: 12px 12px 0 0; }
}
