body { background: #f4f6f9; }

.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* Konsola operatora */
.console { min-height: calc(100vh - 160px); }

.visitor-list { max-height: 45vh; overflow-y: auto; }
.visitor-list .list-group-item { cursor: pointer; }
.visitor-list .list-group-item.waiting { border-left: 4px solid #f59e0b; }
.visitor-list .list-group-item.selected { background: #e7f0ff; }

.chat-panel { display: flex; flex-direction: column; height: calc(100vh - 160px); min-height: 420px; }
.chat-area { flex: 1; overflow-y: auto; padding: 12px; background: #fff; border: 1px solid #dee2e6; border-radius: 6px; }

.chat-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.chat-history li { max-width: 75%; }
.chat-history li.from-guest { align-self: flex-start; }
.chat-history li.from-operator { align-self: flex-end; text-align: right; }
.chat-history li.ended { align-self: center; max-width: 100%; text-align: center; }
.message-meta { font-size: 12px; color: #6c757d; margin-bottom: 2px; }
.message-meta time { margin-left: 6px; }
.message { display: inline-block; padding: 8px 12px; border-radius: 10px; background: #eef1f5; text-align: left; overflow-wrap: anywhere; }
.from-operator .message { background: #dbe8ff; }
.ended .message { background: transparent; color: #6c757d; font-style: italic; }

.s-emboji { width: 28px; height: 28px; vertical-align: middle; }

.chat-input {
    min-height: 44px;
    max-height: 140px;
    overflow-y: auto;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    outline: none;
}

.chat-input:focus { border-color: #86b7fe; box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .25); }
.chat-input[contenteditable="false"] { background: #e9ecef; }

.emoji-picker { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.emoji-picker[hidden] { display: none; }
.emoji { border: 0; background: none; padding: 2px; border-radius: 4px; }
.emoji:hover { background: #e9ecef; }

.history-chat { max-height: 70vh; overflow-y: auto; }
