.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(var(--nf-text-rgb), .12);
    border-width: 0 0 0 1px;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 18px 48px rgba(var(--nf-text-rgb), .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-actions { display:flex!important; grid-auto-flow:column; align-items:center; gap:5px!important; }
.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 { display:inline-grid; place-items:center; border: 0; padding: 7px 9px; color: #fff; border-radius: 10px; background: rgba(255, 255, 255, .14); text-decoration:none; }
.live-chat__toggle:hover { color:#fff; background:rgba(255,255,255,.24); }
.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: var(--nf-blue-mid); border-radius: 8px; background: transparent; font-size: .7rem; font-weight: 700; }
.live-chat__filters button.is-active { color: #fff; background: var(--nf-navy); }

.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: var(--nf-blue-mid); 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(var(--nf-text-rgb), .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: var(--nf-blue-light); background: linear-gradient(135deg, #f0f9ff, var(--nf-blue-soft)); }
.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: var(--nf-blue-light); font-size: .68rem; }
.live-chat__message p { margin: 0; color: var(--nf-night); font-size: .88rem; line-height: 1.38; overflow-wrap: anywhere; white-space: pre-wrap; }
.live-chat__mention { padding: 0 3px; color: var(--nf-blue-bright); border-radius: 4px; background: var(--nf-silver); 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: var(--nf-blue-mid); 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 var(--nf-border); background: #fff; }
.live-chat__guest > i { color: var(--nf-blue); font-size: 1.15rem; }
.live-chat__guest > div { display: grid; gap: 1px; min-width: 0; }
.live-chat__guest strong { color: var(--nf-ink); font-size: .78rem; }
.live-chat__guest small { color: var(--nf-blue-mid); font-size: .68rem; }
.live-chat__guest a { padding: 7px 10px; color: #fff; border-radius: 8px; background: var(--nf-blue); font-size: .7rem; font-weight: 800; text-decoration: none; }
.live-chat__like-count { color: var(--nf-blue); }
.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 var(--nf-blue-pale); 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__paid-button.is-unavailable { color:var(--nf-blue-mid); background:#e2e8f0; box-shadow:inset 0 0 0 1px var(--nf-blue-pale); opacity:.72; }
.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: var(--nf-blue-light); 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(var(--nf-text-rgb), .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__emoji-picker--paid { position: relative; inset: auto; margin: 7px 0 2px; padding: 6px; box-shadow: none; }
.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(var(--nf-text-rgb), .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: var(--nf-blue-mid); background: transparent; }
.live-chat__paid-panel p { margin: 5px 0 10px; color: var(--nf-blue-mid); 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: var(--nf-blue-hover); font-size: .72rem; font-weight: 800; }
.live-chat__amount-field > div { display: flex; align-items: center; overflow: hidden; border: 1px solid var(--nf-blue-pale); 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: var(--nf-night); outline: none; background: transparent; font-weight: 800; }
.live-chat__paid-panel textarea { width: 100%; resize: none; padding: 9px; color: var(--nf-night); border: 1px solid var(--nf-blue-pale); 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: var(--nf-blue-light); 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__paid-tools { display: flex; align-items: center; gap: 8px; }
.live-chat__paid-footer .live-chat__emoji-button { width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; color: inherit; border: 1px solid var(--nf-blue-pale); background: #fff; font-size: 1rem; }
.live-chat__paid-footer .live-chat__emoji-button:hover { border-color: #d6a800; background: #fff8db; }
.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(var(--nf-text-rgb), .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(var(--nf-text-rgb), .12); }
    .live-chat-open span { writing-mode: horizontal-tb; }
}

/* Ventana independiente */
.chat-popout-page { min-width:280px; min-height:100dvh; margin:0; overflow:hidden; background:var(--nf-ink); }
.chat-popout-shell { width:100%; height:100dvh; display:flex; }
.chat-popout-shell .live-chat { position:relative; width:100%; height:100dvh; flex:1; border:0; }
.chat-popout-shell .live-chat-open { position:relative; width:100%; height:100dvh; flex:1; }

/* Tribute.js suggestion menu shared by the standard and paid composers. */
.tribute-container { z-index:1100; width:min(330px,calc(100vw - 16px)); max-height:260px; overflow:auto; border:1px solid var(--nf-blue); border-radius:12px; background:var(--nf-text); box-shadow:0 14px 35px rgba(var(--nf-deep-rgb), .4); }
.tribute-container ul { margin:0; padding:4px; list-style:none; }
.tribute-container li { display:flex; align-items:center; min-height:42px; gap:9px; padding:7px 9px; border-radius:8px; color:var(--nf-blue-soft); font-size:.82rem; cursor:pointer; }
.tribute-container li.highlight,.tribute-container li:hover { color:#fff; background:var(--nf-blue-hover); }
.live-chat-mention-option__avatar { display:inline-grid; width:27px; height:27px; flex:0 0 27px; place-items:center; border-radius:50%; color:var(--nf-night); background:#eebf42; font-weight:800; text-transform:uppercase; }
.live-chat-mention-option__name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:700; }

@media (max-width: 575.98px) {
    .live-chat { height:min(72dvh,620px); grid-template-rows:auto auto minmax(0,1fr) auto; }
    .live-chat__header { padding:10px 11px; }
    .live-chat__header strong { font-size:.86rem; }
    .live-chat__toggle { padding:6px 8px; border-radius:8px; }
    .live-chat__filters { gap:3px; padding:5px 7px; }
    .live-chat__filters button { padding:6px 2px; font-size:.64rem; }
    .live-chat__messages { gap:8px; padding:9px; }
    .live-chat__message { padding:8px 9px; border-radius:10px; }
    .live-chat__message p { font-size:.82rem; }
    .live-chat__message-actions { flex-wrap:wrap; }
    .live-chat__composer { padding:8px; }
    .live-chat__input-row { gap:5px; }
    .live-chat__emoji-button,.live-chat__paid-button,.live-chat__send { width:35px; height:35px; flex-basis:35px; border-radius:9px; }
    .live-chat__input-row textarea { min-width:0; min-height:35px; padding:7px 8px; font-size:.8rem; }
    .live-chat__paid-panel { inset:auto 5px 5px; max-height:calc(100dvh - 20px); overflow-y:auto; }
    .live-chat__guest { grid-template-columns:auto 1fr; padding:9px 10px; }
    .live-chat__guest a { grid-column:1/-1; text-align:center; }
    .chat-popout-shell .live-chat { height:100dvh; }
}
