.live-chat {
    position: sticky;
    top: 0;
    width: 370px;
    height: calc(100vh - 78px);
    flex: 0 0 370px;
    align-self: flex-start;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .12);
    border-width: 0 0 0 1px;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .2);
}

.live-chat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, #db2777);
}

.live-chat__header > div { display: grid; gap: 2px; }
.live-chat__header strong { display: flex; align-items: center; gap: 8px; }
.live-chat__header small { color: rgba(255, 255, 255, .78); font-size: .72rem; }
.live-chat__header small.is-online::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #86efac; }
.live-chat__toggle { border: 0; padding: 7px 9px; color: #fff; border-radius: 10px; background: rgba(255, 255, 255, .14); }
.live-chat__filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 7px 10px; border-bottom: 1px solid #e2e8f0; background: #fff; }
.live-chat__filters button { border: 0; padding: 6px 4px; color: #64748b; border-radius: 8px; background: transparent; font-size: .7rem; font-weight: 700; }
.live-chat__filters button.is-active { color: #fff; background: #0b3b82; }

.live-chat__messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 14px;
    background: #f8fafc;
    scrollbar-width: thin;
}

.live-chat__empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 5px; color: #64748b; text-align: center; }
.live-chat__empty i { font-size: 2rem; color: #c4b5fd; }
.live-chat__empty small { font-size: .76rem; }
.live-chat__message { flex: 0 0 auto; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 13px; background: #fff; }
.live-chat__message:first-of-type { margin-top: auto; }
.live-chat__message.is-own { border-color: #ddd6fe; background: #f5f3ff; }
.live-chat__message.is-paid { position: relative; overflow: hidden; border-width: 2px; box-shadow: 0 8px 22px rgba(15, 23, 42, .15); }
.live-chat__message.paid-tier-1 { border-color: #eab308; background: linear-gradient(135deg, #fefce8, #fef3c7); }
.live-chat__message.paid-tier-2 { border-color: #16a34a; background: linear-gradient(135deg, #f0fdf4, #dcfce7); }
.live-chat__message.paid-tier-3 { border-color: #0ea5e9; background: linear-gradient(135deg, #f0f9ff, #e0f2fe); }
.live-chat__message.paid-tier-4 { border-color: #7c3aed; background: linear-gradient(135deg, #f5f3ff, #ede9fe); }
.live-chat__message.paid-tier-5 { border-color: #dc2626; background: linear-gradient(135deg, #fff1f2, #ffe4e6); box-shadow: 0 8px 25px rgba(220, 38, 38, .22); }
.live-chat__paid-badge { display: flex; align-items: center; gap: 5px; margin: -2px 0 7px; color: #92400e; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.live-chat__paid-badge strong { margin-left: auto; color: inherit; }
.live-chat__message-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 3px; }
.live-chat__message-meta strong { overflow: hidden; color: #6d28d9; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.live-chat__message-meta time { color: #94a3b8; font-size: .68rem; }
.live-chat__message p { margin: 0; color: #1e293b; font-size: .88rem; line-height: 1.38; overflow-wrap: anywhere; white-space: pre-wrap; }
.live-chat__mention { padding: 0 3px; color: #2563eb; border-radius: 4px; background: #dbeafe; font-weight: 700; }
.live-chat__message-actions { display: flex; align-items: center; gap: 5px; margin-top: 7px; }
.live-chat__action { border: 0; padding: 3px 7px; color: #64748b; border-radius: 7px; background: transparent; font-size: .7rem; font-weight: 700; }
.live-chat__action:hover { color: #6d28d9; background: #f1f5f9; }
.live-chat__like.is-active { color: #6d28d9; background: #ede9fe; }
.live-chat__moderate { margin-left: auto; color: #b91c1c; }
.live-chat__block { color: #9a3412; }
.live-chat__block:hover { color: #fff; background: #c2410c; }
.live-chat__action:disabled { opacity: .5; }

.live-chat__composer { position: relative; padding: 11px 12px 9px; border-top: 1px solid #e2e8f0; background: #fff; }
.live-chat__guest { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid #d8e2ef; background: #fff; }
.live-chat__guest > i { color: #075bc7; font-size: 1.15rem; }
.live-chat__guest > div { display: grid; gap: 1px; min-width: 0; }
.live-chat__guest strong { color: #061329; font-size: .78rem; }
.live-chat__guest small { color: #68758a; font-size: .68rem; }
.live-chat__guest a { padding: 7px 10px; color: #fff; border-radius: 8px; background: #075bc7; font-size: .7rem; font-weight: 800; text-decoration: none; }
.live-chat__like-count { color: #075bc7; }
.live-chat__input-row { display: flex; align-items: flex-end; gap: 7px; }
.live-chat__input-row textarea { flex: 1; min-height: 39px; max-height: 108px; resize: none; padding: 9px 10px; border: 1px solid #cbd5e1; border-radius: 11px; outline: none; font-size: .86rem; }
.live-chat__input-row textarea:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139, 92, 246, .12); }
.live-chat__emoji-button, .live-chat__paid-button, .live-chat__send { width: 39px; height: 39px; flex: 0 0 39px; border: 0; border-radius: 11px; }
.live-chat__emoji-button { background: #f1f5f9; }
.live-chat__paid-button { color: #78350f; background: linear-gradient(135deg, #fde68a, #fbbf24); font-size: 1.1rem; font-weight: 900; }
.live-chat__send { color: #fff; background: #7c3aed; }
.live-chat__send:disabled { opacity: .45; }
.live-chat__composer-footer { display: flex; justify-content: space-between; min-height: 18px; padding: 3px 3px 0; color: #94a3b8; font-size: .68rem; }
#liveChatError { color: #dc2626; }
#liveChatCounter.is-limit { color: #dc2626; font-weight: 700; }
.live-chat__emoji-picker { position: absolute; right: 12px; bottom: 68px; left: 12px; padding: 9px; border: 1px solid #e2e8f0; border-radius: 13px; background: #fff; box-shadow: 0 10px 30px rgba(15, 23, 42, .16); }
.live-chat__emoji-picker button { border: 0; padding: 5px; border-radius: 7px; background: transparent; font-size: 1.25rem; }
.live-chat__emoji-picker button:hover { background: #f1f5f9; }
.live-chat__paid-panel { position: absolute; z-index: 4; right: 8px; bottom: 8px; left: 8px; padding: 13px; border: 1px solid #f59e0b; border-radius: 14px; background: #fff; box-shadow: 0 16px 45px rgba(15, 23, 42, .28); }
.live-chat__paid-panel[hidden] { display: none; }
.live-chat__paid-title { display: flex; justify-content: space-between; align-items: center; color: #92400e; }
.live-chat__paid-title button { border: 0; color: #64748b; background: transparent; }
.live-chat__paid-panel p { margin: 5px 0 10px; color: #64748b; font-size: .72rem; line-height: 1.35; }
.live-chat__amount-field { margin-bottom: 9px; }
.live-chat__amount-field > label { display: block; margin-bottom: 4px; color: #334155; font-size: .72rem; font-weight: 800; }
.live-chat__amount-field > div { display: flex; align-items: center; overflow: hidden; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; }
.live-chat__amount-field span { padding-left: 10px; color: #92400e; font-weight: 900; }
.live-chat__amount-field input { width: 100%; border: 0; padding: 9px 10px 9px 5px; color: #1e293b; outline: none; background: transparent; font-weight: 800; }
.live-chat__paid-panel textarea { width: 100%; resize: none; padding: 9px; color: #1e293b; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; font-size: .82rem; }
.live-chat__paid-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; color: #94a3b8; font-size: .68rem; }
.live-chat__paid-footer button { border: 0; padding: 8px 11px; color: #fff; border-radius: 9px; background: #b45309; font-size: .74rem; font-weight: 800; }
.live-chat__paid-footer button:disabled { opacity: .5; }
.live-chat-open { position: sticky; top: 0; width: 48px; height: calc(100vh - 78px); flex: 0 0 48px; align-self: flex-start; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; border: 0; border-left: 1px solid rgba(15, 23, 42, .12); padding: 18px 8px; color: #fff; border-radius: 0; background: linear-gradient(180deg, #7c3aed, #db2777); box-shadow: none; }
.live-chat-open span { writing-mode: vertical-rl; text-orientation: mixed; font-size: .75rem; font-weight: 700; letter-spacing: .04em; }
.live-chat-open[hidden], .live-chat[hidden] { display: none !important; }

@media (max-width: 767.98px) {
    .live-chat { position: relative; width: 100%; height: min(70vh, 620px); flex-basis: auto; border-width: 1px 0 0; }
    .live-chat-open { position: relative; width: 100%; height: 48px; flex: 0 0 48px; flex-direction: row; justify-content: center; padding: 8px 14px; border-left: 0; border-top: 1px solid rgba(15, 23, 42, .12); }
    .live-chat-open span { writing-mode: horizontal-tb; }
}
