/* ByProfu — chatul live (inc/chat.php, assets/chat.js). Se încarcă doar când chatul e pornit; tot el se folosește și în chatul pus pe alte site-uri. */
/* =====================================================================
   Chat live (inc/chat.php, assets/chat.js) — Setări temă → Chat
   ===================================================================== */
.w-chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.w-chat.is-sheet-only:not(.is-open) { display: none; }
.w-chat .ch-h { display: flex; align-items: center; gap: 8px; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.w-chat .ch-h .w-title { margin: 0; }
.ch-on { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: #46d369; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ch-on i { width: 8px; height: 8px; border-radius: 50%; background: #46d369; box-shadow: 0 0 0 3px rgba(70, 211, 105, .2); }
.ch-x { display: none; margin-left: auto; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--panel2); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; }
.ch-on + .ch-x { margin-left: 8px; }
.ch-list { position: relative; height: 380px; overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; }
.ch-empty { margin: auto; color: var(--muted); font-size: 13px; text-align: center; }
.ch-m { display: grid; grid-template-columns: 30px 1fr; gap: 8px; }
.ch-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; }
.ch-b { min-width: 0; }
.ch-hd { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; }
.ch-n { font-size: 13px; }
.ch-m.is-adm .ch-n { color: var(--accent); }
.ch-m.is-me .ch-n::after { content: " (tu)"; color: var(--muted); font-weight: 500; }
.ch-badge { padding: 1px 5px; border-radius: 3px; background: var(--accent); color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .5px; }
.ch-t { color: var(--muted); font-size: 11px; }
.ch-mod { margin-left: 2px; padding: 0 4px; border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; opacity: .55; }
.ch-mod:hover { opacity: 1; color: var(--text); }
.ch-tx { margin: 2px 0 0; color: var(--text); opacity: .9; font-size: 13.5px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.ch-film { display: inline-flex; align-items: center; gap: 7px; margin-top: 5px; padding: 4px 9px 4px 4px; border-radius: 6px; background: var(--panel2); color: var(--text); font-size: 12px; font-weight: 600; text-decoration: none; max-width: 100%; }
.ch-film:hover { background: rgba(var(--accent-rgb), .14); color: var(--text); }
.ch-film img { width: 22px; height: 33px; border-radius: 3px; object-fit: cover; flex: 0 0 auto; }
.ch-film span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-re { position: relative; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ch-rb, .ch-radd { height: 22px; padding: 0 7px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel2); color: var(--text); font-size: 12px; line-height: 20px; cursor: pointer; }
.ch-rb.is-on { border-color: var(--accent); background: rgba(var(--accent-rgb), .16); }
.ch-radd { color: var(--muted); opacity: 0; transition: opacity .15s; }
.ch-m:hover .ch-radd, .ch-radd:focus-visible, .ch-re:has(.ch-pop) .ch-radd { opacity: 1; }
@media (hover: none) { .ch-radd { opacity: .7; } }
.ch-pop { position: absolute; z-index: 5; left: 0; bottom: 26px; display: flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.ch-pop button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; font-size: 18px; cursor: pointer; transition: transform .12s; }
.ch-pop button:hover { transform: scale(1.25); background: var(--panel2); }
.ch-new { position: relative; align-self: center; margin: -42px 0 10px; z-index: 2; padding: 6px 14px; border: 0; border-radius: 16px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 16px rgba(0, 0, 0, .4); }
.ch-form { position: relative; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.ch-row { display: flex; align-items: flex-end; gap: 6px; }
.ch-row textarea { flex: 1; min-width: 0; min-height: 38px; max-height: 110px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 19px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px; line-height: 1.35; resize: none; }
.ch-row textarea:focus { outline: none; border-color: rgba(var(--accent-rgb), .6); }
.ch-send { flex: 0 0 38px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--accent); color: #fff; font-size: 16px; cursor: pointer; }
.ch-send:disabled { opacity: .5; }
.ch-emo-btn { flex: 0 0 34px; width: 34px; height: 38px; border: 0; background: none; font-size: 20px; cursor: pointer; filter: grayscale(.3); }
.ch-emo-btn:hover, .ch-emo-btn[aria-expanded=true] { filter: none; }
.ch-emo { position: absolute; z-index: 6; left: 10px; right: 10px; bottom: calc(100% - 4px); display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 -8px 28px rgba(0, 0, 0, .5); }
.ch-emo[hidden] { display: none; }
.ch-emo button { aspect-ratio: 1; border: 0; border-radius: 8px; background: none; font-size: 20px; cursor: pointer; }
.ch-emo button:hover { background: var(--panel2); }
.ch-name { display: flex; gap: 6px; margin-bottom: 8px; }
.ch-name[hidden] { display: none; }
.ch-name input { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border: 1px solid rgba(var(--accent-rgb), .6); border-radius: 18px; background: var(--bg); color: var(--text); font: inherit; }
.ch-name-ok { padding: 0 14px; border: 0; border-radius: 18px; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; }
.ch-me, .ch-note { margin: 6px 2px 0; color: var(--muted); font-size: 11.5px; }
.ch-me b { color: var(--text); }
.ch-me:empty { display: none; }
.ch-rename { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
.ch-err { margin: 6px 2px 0; color: #ff7676; font-size: 12px; font-weight: 600; }
/* telefon: pe tot ecranul */
.ch-sheet[hidden] { display: none; }
.ch-sheet { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; background: var(--panel); }
.ch-sheet .w-chat { flex: 1; min-height: 0; border: 0; border-radius: 0; }
.ch-sheet .ch-x { display: block; }
.ch-sheet .ch-list { flex: 1; height: auto; }
.ch-sheet .ch-form { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
body.chat-open { overflow: hidden; }
body.chat-open .bnav { display: none; }
.bnav .ch-count { position: absolute; top: 0; left: 55%; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }
/* reacțiile: butonul ☺+ stă în colțul mesajului (nu mai lasă un rând gol sub fiecare mesaj) */
.ch-m { position: relative; }
.ch-re { position: static; }
.ch-re:not(:has(.ch-rb)) { margin: 0; }
.ch-radd { position: absolute; top: -2px; right: 0; height: 22px; }
.ch-pop { left: auto; right: 0; top: 22px; bottom: auto; }
.ch-emo { grid-template-columns: repeat(8, minmax(0, 1fr)); overflow: hidden; }
.ch-emo button { font-size: 18px; padding: 0; }
/* intrarea în chat: întâi numele */
.ch-name { display: block; margin-bottom: 4px; }
.ch-name-t { margin: 0 2px 8px; color: var(--text); font-size: 13px; font-weight: 600; }
.ch-name-r { display: flex; gap: 6px; }
.ch-row[hidden], .ch-me[hidden] { display: none; }
/* poza / avatarul din chat */
.ch-av { overflow: hidden; flex: 0 0 auto; }
.ch-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-av.is-emo { font-size: 17px; font-weight: 400; }
.ch-me .ch-av { display: inline-grid; width: 18px; height: 18px; margin-right: 5px; font-size: 10px; vertical-align: -4px; }
.ch-me .ch-av.is-emo { font-size: 11px; }
.ch-avbtn { position: relative; flex: 0 0 38px; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.ch-avbtn .ch-av { width: 38px; height: 38px; font-size: 20px; border: 2px dashed rgba(var(--accent-rgb), .55); }
.ch-avbtn i { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 9px; font-style: normal; line-height: 16px; }
.ch-avp { margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.ch-avp[hidden] { display: none; }
.ch-avp-g { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.ch-avp-g .ch-av { width: 100%; height: auto; aspect-ratio: 1; border: 0; border-radius: 50%; font-size: 20px; cursor: pointer; transition: transform .12s; }
.ch-avp-g .ch-av:hover { transform: scale(1.12); }
.ch-avp-up { display: flex; gap: 6px; margin-top: 8px; }
.ch-avp-up:first-child { margin-top: 0; }
.ch-avp-file, .ch-avp-rm { flex: 1; padding: 8px 6px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel2); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; text-align: center; cursor: pointer; }
.ch-avp-rm { flex: 0 0 auto; color: var(--muted); }
.ch-avp-note { margin: 6px 2px 0; color: var(--muted); font-size: 11px; }
/* butoanele de moderare (doar tu le vezi): apar când treci cu mouse-ul peste mesaj */
@media (hover: hover) {
	.ch-mod { opacity: 0; }
	.ch-m:hover .ch-mod { opacity: .55; }
	.ch-m:hover .ch-mod:hover { opacity: 1; }
}
/* bara de derulare din chat: subțire, în culoarea site-ului */
.ch-list { scrollbar-width: thin; scrollbar-color: rgba(var(--accent-rgb), .55) transparent; }
.ch-list::-webkit-scrollbar { width: 4px; }
.ch-list::-webkit-scrollbar-track { background: transparent; }
.ch-list::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), .55); border-radius: 4px; }
.ch-list::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.ch-list::-webkit-scrollbar-button { display: none; height: 0; }
/* chatul pus pe alt site */
.ch-via { color: var(--muted); font-size: 10.5px; opacity: .8; }
.w-chat.is-embed { display: flex; flex-direction: column; overflow: hidden; }
.w-chat.is-embed .ch-x { display: none; }
