/* Chuyện Trò — bố cục kiểu WhatsApp, màu kiểu Messenger. */
:root {
  --xanh: #0084ff; --xanh-dam: #0068d6; --xanh-nhat: #e7f3ff;
  --nen: #ffffff; --nen-2: #f0f2f5; --nen-3: #e4e6eb; --chu: #050505; --chu-2: #65676b; --vien: #e4e6eb;
  --bong-toi-tu: #00b2ff; --bong-toi-den: #006aff; --bong-ban: #f0f0f0; --chu-bong-ban: #050505;
  --do: #e41e3f; --xanh-la: #31a24c;
  --thanh-tren: env(safe-area-inset-top); --thanh-duoi: env(safe-area-inset-bottom);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --nen: #000000; --nen-2: #1c1c1e; --nen-3: #2c2c2e; --chu: #f5f5f7; --chu-2: #a1a1a6; --vien: #2c2c2e;
    --bong-ban: #262628; --chu-bong-ban: #f5f5f7; --xanh-nhat: #0b2a4a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --nen: #000000; --nen-2: #1c1c1e; --nen-3: #2c2c2e; --chu: #f5f5f7; --chu-2: #a1a1a6; --vien: #2c2c2e;
  --bong-ban: #262628; --chu-bong-ban: #f5f5f7; --xanh-nhat: #0b2a4a; color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--nen); color: var(--chu); font-family: var(--font); font-size: 16px; }
body { overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; font-size: 16px; } /* 16px để iOS không tự phóng to */
a { color: var(--xanh); text-decoration: none; }
[hidden] { display: none !important; }
svg { display: block; }

/* Khung app co theo visualViewport (iOS không tự co trang khi bật bàn phím) — xem vuaKhung() trong main.js */
html, body { position: fixed; inset: 0; width: 100%; }
#app { position: fixed; top: 0; left: 0; right: 0; height: var(--cao, 100%); display: flex; will-change: transform; }
body.co-phim .soan { padding-bottom: 6px; }
body.co-phim .tab-duoi { display: none; }
@keyframes truot-vao { from { transform: translateX(28%); opacity: .4; } to { transform: none; opacity: 1; } }
@media (max-width: 899px) { .cot-phai.truot { animation: truot-vao .22s cubic-bezier(.2,.8,.2,1); } }
.tin-cuon { scroll-behavior: auto; }
.hang.moi { animation: hien-tin .18s ease-out; }
@keyframes hien-tin { from { transform: translateY(6px); opacity: .3; } }
.ket-loi { margin: auto; text-align: center; padding: 24px; color: var(--chu-2); }
.khoi-dong { margin: auto; animation: nhip 1.4s ease-in-out infinite; }
.khoi-dong img { border-radius: 18px; }
@keyframes nhip { 50% { opacity: .55; transform: scale(.96); } }

/* ---------- đăng nhập ---------- */
.dn { margin: auto; width: 100%; max-width: 380px; padding: 24px 20px calc(24px + var(--thanh-duoi)); text-align: center; }
.dn .logo { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto 14px; box-shadow: 0 8px 24px rgba(0,132,255,.25); }
.dn h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: -.3px; }
.dn p { color: var(--chu-2); margin: 0 0 22px; line-height: 1.45; font-size: 15px; }
.o-nhap { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--vien); background: var(--nen-2); outline: none; margin-bottom: 12px; }
.o-nhap:focus { border-color: var(--xanh); background: var(--nen); }
.o-ma { text-align: center; font-size: 28px; letter-spacing: 10px; font-weight: 600; }
.nut { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border-radius: 12px; background: var(--xanh); color: #fff; font-weight: 600; }
.nut:active { background: var(--xanh-dam); }
.nut[disabled] { opacity: .5; }
.nut.phu { background: var(--nen-2); color: var(--chu); }
.nut.nho { width: auto; padding: 9px 14px; border-radius: 10px; font-size: 15px; }
.nut.do { background: var(--do); }
.loi { color: var(--do); font-size: 14px; min-height: 20px; margin: 4px 0 8px; }
.lien-ket { display: inline-block; margin-top: 14px; color: var(--xanh); font-size: 15px; }

/* ---------- khung chính: 1 cột trên điện thoại, 2 cột trên máy lớn ---------- */
.khung { flex: 1; display: flex; min-width: 0; }
.cot-trai { width: 100%; display: flex; flex-direction: column; background: var(--nen); min-width: 0; }
.cot-phai { display: none; flex: 1; min-width: 0; flex-direction: column; background: var(--nen); border-left: 1px solid var(--vien); }
.khung.dang-chat .cot-trai { display: none; }
.khung.dang-chat .cot-phai { display: flex; }
@media (min-width: 900px) {
  .cot-trai { width: 380px; flex: 0 0 380px; }
  .khung .cot-trai { display: flex !important; }
  .cot-phai { display: flex; }
  .tab-duoi { display: none !important; }
  .cot-trai .tab-ngang { display: flex; }
}
.trong-phai { margin: auto; text-align: center; color: var(--chu-2); padding: 20px; }
.trong-phai img { width: 96px; height: 96px; border-radius: 24px; opacity: .9; margin-bottom: 12px; }

.dau { padding: calc(10px + var(--thanh-tren)) 16px 6px; display: flex; align-items: center; gap: 10px; }
.dau h1 { font-size: 28px; font-weight: 700; margin: 0; flex: 1; letter-spacing: -.4px; }
.nut-tron { width: 38px; height: 38px; border-radius: 50%; background: var(--nen-2); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.nut-tron:active { background: var(--nen-3); }
.nut-tron svg { width: 21px; height: 21px; }
.tim { margin: 4px 16px 8px; position: relative; }
.tim input { width: 100%; padding: 9px 12px 9px 38px; border-radius: 20px; border: 0; background: var(--nen-2); outline: none; }
.tim svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--chu-2); }
.cuon { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

/* danh sách hội thoại */
.dong { display: flex; align-items: center; gap: 12px; padding: 8px 16px; cursor: pointer; position: relative; }
.dong:active, .dong.chon { background: var(--nen-2); }
.dong .giua { flex: 1; min-width: 0; }
.dong .ten { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dong .phu { font-size: 14px; color: var(--chu-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; display: flex; gap: 4px; }
.dong .phu .noi { overflow: hidden; text-overflow: ellipsis; }
.dong.chua-doc .ten, .dong.chua-doc .phu { font-weight: 700; color: var(--chu); }
.dong .phai { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: 0 0 auto; }
.dong .gio { font-size: 12.5px; color: var(--chu-2); }
.dong.chua-doc .gio { color: var(--xanh); font-weight: 600; }
.huy-hieu { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--xanh); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.trong { text-align: center; color: var(--chu-2); padding: 40px 24px; line-height: 1.5; }
.tieu-muc { padding: 14px 16px 6px; font-size: 13px; font-weight: 600; color: var(--chu-2); text-transform: uppercase; letter-spacing: .3px; }

/* ảnh đại diện */
.av { position: relative; flex: 0 0 auto; border-radius: 50%; background: linear-gradient(135deg, #5ab0ff, #0068d6); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; overflow: visible; }
.av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.av.s56 { width: 56px; height: 56px; font-size: 21px; } .av.s40 { width: 40px; height: 40px; font-size: 16px; }
.av.s36 { width: 36px; height: 36px; font-size: 14px; } .av.s28 { width: 28px; height: 28px; font-size: 12px; }
.av.s14 { width: 14px; height: 14px; font-size: 7px; } .av.s96 { width: 96px; height: 96px; font-size: 36px; }
.av.on::after { content: ""; position: absolute; right: 1px; bottom: 1px; width: 26%; height: 26%; min-width: 10px; min-height: 10px; border-radius: 50%; background: var(--xanh-la); border: 2.5px solid var(--nen); }

/* tab dưới (điện thoại) */
.tab-duoi { display: flex; border-top: 1px solid var(--vien); background: color-mix(in srgb, var(--nen) 92%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding-bottom: var(--thanh-duoi); }
.tab-duoi button, .tab-ngang button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0 6px; font-size: 11px; color: var(--chu-2); position: relative; }
.tab-duoi button svg, .tab-ngang button svg { width: 25px; height: 25px; }
.tab-duoi button.chon, .tab-ngang button.chon { color: var(--xanh); }
.tab-duoi .huy-hieu { position: absolute; top: 2px; left: 52%; height: 18px; min-width: 18px; font-size: 11px; }
.tab-ngang { display: none; border-bottom: 1px solid var(--vien); }

/* ---------- màn chat ---------- */
.dau-chat { display: flex; align-items: center; gap: 8px; padding: calc(6px + var(--thanh-tren)) 8px 6px; border-bottom: 1px solid var(--vien); background: color-mix(in srgb, var(--nen) 92%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); z-index: 2; }
.dau-chat .lui { width: 36px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: var(--xanh); }
.dau-chat .lui svg { width: 26px; height: 26px; }
@media (min-width: 900px) { .dau-chat .lui { display: none; } .dau-chat { padding-left: 16px; } }
.dau-chat .ai { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.dau-chat .ai .ten { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dau-chat .ai .tt { font-size: 12.5px; color: var(--chu-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dau-chat .nut-goi { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: var(--xanh); border-radius: 50%; }
.dau-chat .nut-goi:active { background: var(--nen-2); }
.dau-chat .nut-goi svg { width: 24px; height: 24px; }

.tin-cuon { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 10px 10px 6px; display: flex; flex-direction: column; }
.tin-cuon .dem { flex: 1; }
.ngay { align-self: center; font-size: 12px; color: var(--chu-2); margin: 14px 0 8px; font-weight: 500; }
.hang { display: flex; align-items: flex-end; gap: 6px; margin-top: 2px; max-width: 100%; }
.hang.toi { justify-content: flex-end; }
.hang .av-cho { width: 28px; flex: 0 0 28px; }
.hang.dau-nhom { margin-top: 8px; }
.ten-nguoi { font-size: 12px; color: var(--chu-2); margin: 8px 0 2px 46px; }
.goi-bong { display: flex; flex-direction: column; max-width: min(75%, 520px); min-width: 0; position: relative; }
.hang.toi .goi-bong { align-items: flex-end; } .hang.ban .goi-bong { align-items: flex-start; }
.bong { max-width: 100%; padding: 8px 12px; border-radius: 18px; font-size: 16px; line-height: 1.34; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; position: relative; user-select: text; -webkit-user-select: text; }
.hang.ban .bong { background: var(--bong-ban); color: var(--chu-bong-ban); }
/* KHÔNG dùng background-attachment: fixed — Safari iPhone có lúc không vẽ nền ⇒ chữ trắng trên nền trắng, tin "biến mất" (anh dính 20/10) + cuộn giật */
.hang.toi .bong { background-color: var(--bong-toi-den); background-image: linear-gradient(var(--bong-toi-tu), var(--bong-toi-den)); color: #fff; }
.hang.toi .bong a { color: #fff; text-decoration: underline; }
.hang.ban:not(.cuoi-nhom) .bong { border-bottom-left-radius: 4px; } .hang.ban:not(.dau-nhom) .bong { border-top-left-radius: 4px; }
.hang.toi:not(.cuoi-nhom) .bong { border-bottom-right-radius: 4px; } .hang.toi:not(.dau-nhom) .bong { border-top-right-radius: 4px; }
.bong.emoji { background: none !important; font-size: 40px; padding: 0 2px; line-height: 1.15; }
.bong.thu-hoi { background: none !important; border: 1px solid var(--vien); color: var(--chu-2) !important; font-style: italic; font-size: 14.5px; }
.bong.anh { padding: 0; background: none !important; overflow: hidden; }
.bong.anh img { display: block; max-width: 100%; max-height: 340px; border-radius: 18px; min-width: 80px; min-height: 60px; background: var(--nen-2); object-fit: cover; cursor: zoom-in; }
.bong .sua { font-size: 11px; opacity: .7; margin-left: 6px; }
.bong .trich { display: block; font-size: 13.5px; opacity: .85; border-left: 3px solid currentColor; padding: 2px 0 2px 8px; margin: 2px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hang.dang-gui .bong { opacity: .6; }
.hang.loi-gui .bong { opacity: .6; }
.trang-thai { display: flex; justify-content: flex-end; gap: 4px; font-size: 11.5px; color: var(--chu-2); margin: 2px 4px 0; min-height: 0; }
.trang-thai.loi { color: var(--do); cursor: pointer; }
.da-xem { display: flex; justify-content: flex-end; gap: 2px; margin: 2px 2px 0; }

/* tin thoại */
.thoai { display: flex; align-items: center; gap: 8px; min-width: 190px; }
.thoai button { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.25); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.hang.ban .thoai button { background: var(--xanh); color: #fff; }
.thoai button svg { width: 16px; height: 16px; }
.thoai .vach { flex: 1; height: 26px; display: flex; align-items: center; gap: 2px; }
.thoai .vach i { flex: 1; background: currentColor; opacity: .45; border-radius: 2px; min-height: 3px; }
.thoai .vach i.qua { opacity: 1; }
.thoai .giay { font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* tin cuộc gọi */
.tin-goi { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 18px; background: var(--bong-ban); color: var(--chu-bong-ban); min-width: 190px; cursor: pointer; }
.tin-goi .bieu { width: 36px; height: 36px; border-radius: 50%; background: var(--nen-3); display: inline-flex; align-items: center; justify-content: center; }
.tin-goi .bieu.nho { background: var(--do); color: #fff; }
.tin-goi .bieu svg { width: 18px; height: 18px; }
.tin-goi b { display: block; font-size: 15px; } .tin-goi span { font-size: 13px; color: var(--chu-2); }

.dang-go { display: flex; gap: 4px; padding: 12px 14px; background: var(--bong-ban); border-radius: 18px; width: fit-content; margin: 6px 0 2px 34px; }
.dang-go i { width: 7px; height: 7px; border-radius: 50%; background: var(--chu-2); animation: cham 1.2s infinite; }
.dang-go i:nth-child(2) { animation-delay: .15s; } .dang-go i:nth-child(3) { animation-delay: .3s; }
@keyframes cham { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ô soạn tin — kiểu Messenger: nút đặc màu xanh, chạm vào thì thu nút lại thành "›" */
.soan { display: flex; align-items: flex-end; gap: 2px; padding: 6px 6px calc(6px + var(--thanh-duoi)); background: var(--nen); }
.soan .nut-icon { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; color: var(--xanh); flex: 0 0 auto; border-radius: 50%; transition: transform .12s; }
.soan .nut-icon:active { transform: scale(.88); }
.soan .nut-icon svg { width: 25px; height: 25px; }
.soan .cum-nut { display: flex; gap: 2px; overflow: hidden; max-width: 170px; transition: max-width .2s ease, opacity .15s; }
.soan .nut-mo { display: none; }
.soan.mo-rong .cum-nut { max-width: 0; opacity: 0; }
.soan.mo-rong .nut-mo { display: inline-flex; }
.soan .o { flex: 1; min-width: 0; display: flex; align-items: flex-end; background: var(--nen-2); border-radius: 20px; min-height: 38px; padding: 0 4px 0 14px; margin: 0 4px; transition: flex .2s; }
.soan textarea { flex: 1; min-width: 0; border: 0; outline: none; background: none; resize: none; padding: 8px 0; max-height: 132px; line-height: 1.35; }
.soan textarea::placeholder { color: var(--chu-2); }
.soan .nut-mat { width: 32px; height: 38px; display: inline-flex; align-items: center; justify-content: center; color: var(--xanh); flex: 0 0 auto; }
.soan .nut-mat svg { width: 24px; height: 24px; }
.soan .nut-gui .e-nhanh { font-size: 27px; line-height: 1; }
.soan .nut-gui.nay .e-nhanh { animation: nay .35s ease-out; }
@keyframes nay { 40% { transform: scale(1.45); } }
.xt-soan { display: flex; align-items: center; gap: 10px; margin: 0 10px 2px; padding: 8px; border-radius: 14px; background: var(--nen-2); font-size: 13.5px; }
.xt-soan img, .xt-soan .bieu-tep { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.xt-soan .nd { flex: 1; min-width: 0; } .xt-soan b, .xt-soan small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xt-soan small { color: var(--chu-2); }
.xt-soan button { width: 28px; height: 28px; color: var(--chu-2); flex: 0 0 auto; }
.xt-soan button svg { width: 18px; height: 18px; margin: auto; }
.tra-loi-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--vien); font-size: 13.5px; background: var(--nen); }
.tra-loi-bar .noi { flex: 1; min-width: 0; color: var(--chu-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tra-loi-bar b { color: var(--chu); display: block; font-size: 13px; }
.ghi-am { flex: 1; display: flex; align-items: center; gap: 10px; background: var(--xanh); color: #fff; border-radius: 20px; height: 38px; padding: 0 6px 0 14px; }
.ghi-am .cham-do { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: nhip 1s infinite; }
.ghi-am .giay { flex: 1; font-variant-numeric: tabular-nums; font-weight: 600; }
.ghi-am button { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.25); display: inline-flex; align-items: center; justify-content: center; }
.ghi-am button svg { width: 16px; height: 16px; }

/* ---------- menu nhấn giữ, bảng dưới ---------- */
#bang-menu { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.35); display: flex; align-items: flex-end; justify-content: center; animation: hien .15s; }
@keyframes hien { from { opacity: 0; } }
.bang { width: 100%; max-width: 520px; background: var(--nen); border-radius: 16px 16px 0 0; padding: 8px 0 calc(8px + var(--thanh-duoi)); animation: len .2s ease-out; max-height: 85vh; overflow-y: auto; }
@keyframes len { from { transform: translateY(40px); opacity: .5; } }
.bang .keo { width: 36px; height: 5px; border-radius: 3px; background: var(--nen-3); margin: 2px auto 8px; }
.bang .muc { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 20px; font-size: 16px; text-align: left; }
.bang .muc:active { background: var(--nen-2); }
.bang .muc svg { width: 22px; height: 22px; color: var(--chu-2); }
.bang .muc.do { color: var(--do); } .bang .muc.do svg { color: var(--do); }
.bang .tieu-de { padding: 6px 20px 10px; font-weight: 600; font-size: 17px; }
.bang .noi-dung { padding: 0 20px 12px; }
.cam-xuc { display: flex; justify-content: space-around; padding: 6px 12px 10px; font-size: 30px; }

#thong-bao-nho { position: fixed; left: 50%; bottom: calc(80px + var(--thanh-duoi)); transform: translateX(-50%); background: rgba(30,30,30,.92); color: #fff; padding: 10px 16px; border-radius: 20px; font-size: 14.5px; z-index: 80; max-width: 90vw; text-align: center; }

/* ---------- xem ảnh ---------- */
#lop-xem-anh { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; align-items: center; justify-content: center; }
#lop-xem-anh img { max-width: 100%; max-height: 100%; object-fit: contain; }
#lop-xem-anh .dong-x { position: absolute; top: calc(12px + var(--thanh-tren)); right: 12px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; display: flex; align-items: center; justify-content: center; }

/* ---------- cài đặt / hồ sơ ---------- */
.nhom-cd { margin: 8px 16px 16px; background: var(--nen-2); border-radius: 12px; overflow: hidden; }
.nhom-cd .muc { display: flex; align-items: center; gap: 12px; padding: 13px 14px; width: 100%; text-align: left; font-size: 16px; border-bottom: 1px solid var(--vien); }
.nhom-cd .muc:last-child { border-bottom: 0; }
.nhom-cd .muc .giua { flex: 1; min-width: 0; }
.nhom-cd .muc .nhan-phu { color: var(--chu-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.nhom-cd .muc svg { width: 22px; height: 22px; color: var(--chu-2); flex: 0 0 auto; }
.nhom-cd .muc.do { color: var(--do); }
.ho-so { text-align: center; padding: 10px 16px 6px; }
.ho-so .ten { font-size: 22px; font-weight: 700; margin-top: 10px; }
.ho-so .phu { color: var(--chu-2); font-size: 14.5px; margin-top: 4px; }
.ho-so .hanh-dong { display: flex; justify-content: center; gap: 24px; margin: 16px 0 6px; }
.ho-so .hanh-dong button { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--chu); }
.ho-so .hanh-dong button span.vong { width: 48px; height: 48px; border-radius: 50%; background: var(--nen-2); display: inline-flex; align-items: center; justify-content: center; color: var(--xanh); }
.ho-so .hanh-dong svg { width: 22px; height: 22px; }
.goi-y { font-size: 13px; color: var(--chu-2); padding: 0 18px 4px; line-height: 1.45; }
.o-nhan { display: block; font-size: 13px; color: var(--chu-2); margin: 10px 2px 6px; text-align: left; }
.chon-nguoi { display: flex; align-items: center; gap: 12px; padding: 8px 16px; }
.chon-nguoi .o-tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--nen-3); display: inline-flex; align-items: center; justify-content: center; }
.chon-nguoi.chon .o-tick { background: var(--xanh); border-color: var(--xanh); color: #fff; }
.so-lieu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 8px 16px; }
.so-lieu button { background: var(--nen-2); border-radius: 12px; padding: 14px; text-align: left; }
.so-lieu b { display: block; font-size: 24px; color: var(--xanh); }
.so-lieu span { font-size: 13px; color: var(--chu-2); }
.bang-ds { width: 100%; border-collapse: collapse; font-size: 14px; }
.bang-ds td, .bang-ds th { padding: 8px 10px; border-bottom: 1px solid var(--vien); text-align: left; vertical-align: top; }
.bang-ds th { color: var(--chu-2); font-weight: 600; font-size: 12.5px; }

/* ---------- cuộc gọi ---------- */
#lop-goi { position: fixed; inset: 0; z-index: 70; background: #111; color: #fff; display: flex; flex-direction: column; }
#lop-goi .nen-mo { position: absolute; inset: 0; background: radial-gradient(circle at 50% 30%, #2b4a7a 0%, #10141c 70%); }
#lop-goi video.xa { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
#lop-goi video.gan { position: absolute; right: 14px; top: calc(14px + var(--thanh-tren)); width: 108px; height: 160px; object-fit: cover; border-radius: 14px; background: #222; z-index: 3; transform: scaleX(-1); box-shadow: 0 4px 18px rgba(0,0,0,.4); }
#lop-goi .thong-tin { position: relative; z-index: 2; text-align: center; margin-top: calc(70px + var(--thanh-tren)); }
#lop-goi .thong-tin .ten { font-size: 28px; font-weight: 600; margin-top: 16px; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
#lop-goi .thong-tin .tt { font-size: 16px; opacity: .8; margin-top: 6px; font-variant-numeric: tabular-nums; }
#lop-goi.co-video .thong-tin { margin-top: calc(20px + var(--thanh-tren)); }
#lop-goi.co-video .thong-tin .av { display: none; }
#lop-goi .dieu-khien { position: relative; z-index: 2; margin-top: auto; padding: 20px 20px calc(34px + var(--thanh-duoi)); display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; }
#lop-goi .dieu-khien button { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12.5px; color: #fff; }
#lop-goi .dieu-khien .vong { width: 62px; height: 62px; border-radius: 50%; background: rgba(255,255,255,.18); display: inline-flex; align-items: center; justify-content: center; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
#lop-goi .dieu-khien .vong svg { width: 27px; height: 27px; }
#lop-goi .dieu-khien button.tat .vong { background: #fff; color: #111; }
#lop-goi .dieu-khien button.cup .vong { background: #ff3b30; }
#lop-goi .dieu-khien button.nghe .vong { background: #34c759; }
#lop-goi .nhac { position: relative; z-index: 2; text-align: center; font-size: 13.5px; opacity: .8; padding: 0 24px; line-height: 1.45; }
.rung { animation: rung 1.2s infinite; }
@keyframes rung { 0%,100% { transform: rotate(0); } 10%,30% { transform: rotate(-12deg); } 20%,40% { transform: rotate(12deg); } 50% { transform: rotate(0); } }

/* ---------- thẻ xem trước link ---------- */
.the-lk { display: block; width: min(280px, 100%); margin-top: 3px; border-radius: 16px; overflow: hidden; background: var(--bong-ban); color: var(--chu-bong-ban) !important; text-decoration: none !important; }
.the-lk img { display: block; width: 100%; aspect-ratio: 1.91; object-fit: cover; background: var(--nen-3); }
.the-lk .nd { display: block; padding: 8px 12px 10px; }
.the-lk b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; line-height: 1.3; }
.the-lk .nd > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: var(--chu-2); margin-top: 3px; line-height: 1.3; }
.the-lk small { display: block; font-size: 12px; color: var(--chu-2); margin-top: 4px; }

/* ---------- tệp, video, tin hệ thống ---------- */
.bong.tep { display: flex; align-items: center; gap: 10px; min-width: 200px; color: inherit; text-decoration: none; }
.hang.toi .bong.tep { color: #fff; }
.bieu-tep { width: 40px; height: 40px; border-radius: 10px; background: rgba(127,127,127,.18); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.bieu-tep svg { width: 22px; height: 22px; }
.nd-tep { min-width: 0; } .nd-tep b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; } .nd-tep small { font-size: 12.5px; opacity: .8; }
.bong.video { padding: 0; background: #000 !important; overflow: hidden; } .bong.video video { display: block; max-width: 100%; max-height: 360px; border-radius: 18px; }
.tin-he { align-self: center; text-align: center; font-size: 12.5px; color: var(--chu-2); margin: 10px 24px 6px; line-height: 1.4; }

/* ---------- cảm xúc ---------- */
.hang.co-cx { margin-bottom: 14px; }
.cx-vien { position: absolute; bottom: -15px; right: 6px; display: inline-flex; align-items: center; gap: 1px; padding: 1px 5px; border-radius: 12px; background: color-mix(in srgb, var(--nen) 75%, var(--nen-3)); box-shadow: 0 1px 3px rgba(0,0,0,.18); font-size: 14px; line-height: 20px; z-index: 1; }
.cx-vien span { font-size: 12px; color: var(--chu-2); margin-left: 3px; }
#lop-cx { position: fixed; inset: 0; z-index: 55; }
#lop-cx .cx-nen { position: absolute; inset: 0; background: rgba(0,0,0,.28); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: hien .16s; }
#lop-cx .cx-cot { position: absolute; display: flex; flex-direction: column; gap: 10px; max-width: calc(100% - 16px); animation: no-ra .2s cubic-bezier(.2,1.2,.4,1); }
#lop-cx .cx-cot.trai { align-items: flex-start; transform-origin: left center; } #lop-cx .cx-cot.phai { align-items: flex-end; transform-origin: right center; }
#lop-cx.dong .cx-cot, #lop-cx.dong .cx-nen { opacity: 0; transition: opacity .14s; }
@keyframes no-ra { from { transform: scale(.92); opacity: .4; } }
.cx-thanh { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-radius: 30px; background: var(--nen); box-shadow: 0 4px 18px rgba(0,0,0,.18); max-width: calc(100vw - 16px); }
.cx-thanh button { width: 42px; height: 42px; border-radius: 50%; font-size: 30px; line-height: 42px; text-align: center; transition: transform .12s; animation: bat-len .3s backwards; }
.cx-thanh button:nth-child(2) { animation-delay: .03s; } .cx-thanh button:nth-child(3) { animation-delay: .06s; } .cx-thanh button:nth-child(4) { animation-delay: .09s; }
.cx-thanh button:nth-child(5) { animation-delay: .12s; } .cx-thanh button:nth-child(6) { animation-delay: .15s; } .cx-thanh button:nth-child(7) { animation-delay: .18s; }
@keyframes bat-len { from { transform: translateY(10px) scale(.5); opacity: 0; } }
.cx-thanh button:active { transform: scale(1.3); }
.cx-thanh button.chon { background: var(--nen-3); }
.cx-thanh .cx-them { background: var(--nen-2); display: inline-flex; align-items: center; justify-content: center; }
.cx-thanh .cx-them svg { width: 22px; height: 22px; }
.cx-tin { max-height: 42vh; overflow: hidden; border-radius: 18px; pointer-events: none; }
.cx-tin .goi-bong { max-width: 100%; } .cx-tin .hang { margin: 0; }
.cx-menu { min-width: 230px; border-radius: 14px; overflow: hidden; background: color-mix(in srgb, var(--nen) 94%, transparent); box-shadow: 0 4px 18px rgba(0,0,0,.18); }
.cx-menu button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 13px 16px; font-size: 16.5px; border-bottom: 1px solid var(--vien); }
.cx-menu button:last-child { border-bottom: 0; } .cx-menu button.tach { border-top: 7px solid var(--nen-3); }
.cx-menu button:active { background: var(--nen-2); }
.cx-menu svg { width: 21px; height: 21px; } .cx-menu .do { color: var(--do); }
.hang.nhay .goi-bong { animation: nhay 1.6s; }
@keyframes nhay { 0%,40% { filter: brightness(.75); transform: scale(1.03); } }
@media (pointer: coarse) { .hang, .hang .bong { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } }

/* ---------- bảng emoji ---------- */
.bang.bang-cao { height: 70vh; display: flex; flex-direction: column; }
.bang-emoji { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tab-emoji { display: flex; justify-content: space-around; padding: 0 8px 6px; border-bottom: 1px solid var(--vien); }
.tab-emoji button { font-size: 21px; width: 40px; height: 36px; border-radius: 10px; opacity: .55; }
.tab-emoji button.chon { opacity: 1; background: var(--nen-2); }
.luoi-emoji { flex: 1; overflow-y: auto; padding: 0 8px 12px; -webkit-overflow-scrolling: touch; }
.ten-nhom { font-size: 12.5px; font-weight: 600; color: var(--chu-2); padding: 10px 6px 4px; }
.o-emoji { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
.o-emoji button { font-size: 30px; height: 46px; border-radius: 10px; }
.o-emoji button:active, .o-emoji button.chon { background: var(--nen-2); }
.o-emoji.nhanh { padding: 0 14px 8px; }

/* ---------- thông tin đoạn chat ---------- */
.tt-chat .ho-so { padding-top: 4px; }
.tt-chat .hanh-dong { gap: 4px; justify-content: space-around; max-width: 420px; margin-left: auto; margin-right: auto; }
.tt-chat .hanh-dong button { width: 66px; text-align: center; font-size: 12.5px; line-height: 1.25; }
.lien-ket { color: var(--xanh); font-weight: 600; font-size: 15.5px; }
.luoi-anh { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 4px 16px 8px; border-radius: 14px; overflow: hidden; }
.luoi-anh img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--nen-2); cursor: pointer; }
.bang .luoi-anh { margin: 4px 10px; }
.nhom-cd .muc > svg:last-child { width: 18px; height: 18px; }
.tab-pt { display: flex; gap: 6px; padding: 0 16px 10px; }
.tab-pt button { flex: 1; padding: 8px; border-radius: 18px; background: var(--nen-2); font-size: 14.5px; font-weight: 500; }
.tab-pt button.chon { background: var(--xanh-nhat); color: var(--xanh); }
mark { background: #ffe58a; color: inherit; border-radius: 3px; }

/* ---- quản trị */
.tab-qt { padding: 6px 16px 4px; }
.chip-qt { display: flex; gap: 6px; padding: 0 16px 8px; overflow-x: auto; scrollbar-width: none; }
.chip-qt::-webkit-scrollbar { display: none; }
.chip-qt button { flex: 0 0 auto; padding: 6px 12px; border-radius: 16px; background: var(--nen-2); font-size: 14px; white-space: nowrap; }
.chip-qt button i { font-style: normal; color: var(--chu-2); margin-left: 2px; }
.chip-qt button.chon { background: var(--xanh); color: #fff; } .chip-qt button.chon i { color: rgba(255,255,255,.85); }
.nhan-qt { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 8px; background: var(--xanh-nhat); color: var(--xanh); vertical-align: 2px; }
.nhan-qt.sa { background: #fff3d6; color: #b7791f; } .nhan-qt.khoa { background: color-mix(in srgb, var(--do) 14%, transparent); color: var(--do); }
.ben-qt { text-align: right; font-size: 12px; color: var(--chu-2); flex: 0 0 auto; max-width: 30%; }
.ben-qt b { display: block; font-size: 15px; color: var(--chu); }
.the-moi { margin: 0 16px 10px; padding: 12px 14px; border-radius: 12px; background: var(--nen-2); }
.the-moi.het { opacity: .6; }
.the-moi .phu { font-size: 13.5px; color: var(--chu-2); margin-top: 4px; }
.hang-moi { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hang-moi .nut.nho { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; padding: 7px 12px; }
.hang-moi .nut.nho svg { width: 16px; height: 16px; }
.bang.bang-qt { max-height: 92vh; }
.doi-anh-qt { cursor: pointer; display: inline-block; }
.anh-qt { display: flex; justify-content: center; gap: 18px; margin-top: 8px; }
.anh-qt button { color: var(--xanh); font-size: 14.5px; }
.anh-qt button + button { color: var(--do); }
.so-lieu.so-4 { grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 16px 4px; }
.so-lieu.so-4 button { padding: 10px 6px; text-align: center; }
.so-lieu.so-4 b { font-size: 19px; } .so-lieu.so-4 span { font-size: 11.5px; line-height: 1.2; display: block; }
.hang-so { display: flex; gap: 8px; } .hang-so .o-nhap { flex: 1; font-size: 18px; letter-spacing: 1px; font-weight: 600; }
.hang-so .nut { height: 50px; flex: 0 0 auto; }
.chip-so { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 8px; }
.chip-so button { padding: 6px 11px; border-radius: 14px; background: var(--nen-2); font-weight: 600; font-size: 14.5px; letter-spacing: .5px; color: var(--xanh); }
.chip-so button.chon { background: var(--xanh); color: #fff; }
.cong-tac { display: flex; align-items: center; gap: 12px; padding: 12px 2px; cursor: pointer; }
.cong-tac span { flex: 1; font-size: 16px; } .cong-tac small { display: block; font-size: 12.5px; color: var(--chu-2); margin-top: 2px; }
.cong-tac input { position: absolute; opacity: 0; pointer-events: none; }
.cong-tac i { width: 51px; height: 31px; border-radius: 16px; background: var(--nen-3); position: relative; transition: background .2s; flex: 0 0 auto; }
.cong-tac i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.cong-tac input:checked + i { background: var(--xanh-la); } .cong-tac input:checked + i::after { transform: translateX(20px); }
.tab-qt button { white-space: nowrap; font-size: 14px; padding: 8px 4px; }
.nut svg { width: 20px; height: 20px; flex: 0 0 auto; }
.the-moi .nut.phu { background: var(--nen); color: var(--do); }
.tab-qt { overflow-x: auto; scrollbar-width: none; } .tab-qt button { flex: 1 0 auto; padding: 8px 12px; }
/* ---- thiết bị đăng nhập, thành viên nhóm */
.dong.phien { align-items: flex-start; }
.dong.phien .ten { white-space: normal; font-size: 15.5px; }
.dong.phien .phu { white-space: normal; }
.dong.phien .nut.nho { flex: 0 0 auto; font-size: 14px; padding: 7px 11px; color: var(--do); align-self: center; }
.dong.da-ra { opacity: .6; }
.bieu-may { width: 40px; height: 40px; border-radius: 50%; background: var(--nen-2); color: var(--xanh); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.bieu-may svg { width: 22px; height: 22px; }
.ba-cham { color: var(--chu-2); font-size: 20px; padding: 0 4px; }
.dai-nhac { margin: 2px 16px 8px; padding: 12px 10px 12px 14px; border-radius: 12px; background: var(--xanh-nhat); display: flex; gap: 8px; align-items: center; font-size: 14.5px; line-height: 1.4; }
.dai-nhac .giua { flex: 1; min-width: 0; }
.dai-nhac a { display: block; margin-top: 3px; color: var(--xanh); font-size: 13.5px; font-weight: 500; }
.dai-nhac .nut.nho { flex: 0 0 auto; white-space: nowrap; }
.dai-nhac .an { color: var(--chu-2); width: 28px; height: 28px; flex: 0 0 auto; }
.ma-moi { text-align: center; font-size: 34px; font-weight: 800; letter-spacing: 6px; color: var(--xanh); margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.o-ma-moi { text-transform: uppercase; letter-spacing: 3px; text-align: center; font-weight: 600; }
.dn.mo-ngoai p b { color: var(--chu); }
.mo-ngoai .buoc-thoat { display: flex; gap: 12px; text-align: left; margin: 0 0 14px; }
.mo-ngoai .buoc-thoat > div:last-child { flex: 1; min-width: 0; }
.mo-ngoai .buoc-thoat p { margin: 8px 0 0; font-size: 14.5px; color: var(--chu-2); line-height: 1.45; }
.mo-ngoai .so-buoc { flex: 0 0 auto; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 14px; background: var(--xanh-nhat); color: var(--xanh); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; margin-top: 8px; }
.mo-ngoai .nut.xong { background: #1f9d55; }
.mui-ten-menu { position: fixed; top: calc(6px + env(safe-area-inset-top)); right: 14px; color: var(--xanh); font-size: 22px; font-weight: 800; animation: nhay-mt 1.2s ease-in-out infinite; }
@keyframes nhay-mt { 50% { transform: translate(3px, -4px); } }
/* chủ đề đoạn chat */
.tin-cuon { background: var(--nen-chat, transparent); }
/* bảng gắn dưới ô soạn (biểu tượng | nhãn dán) — cao bằng bàn phím */
.bang-soan { flex: 0 0 auto; display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--vien); background: var(--nen); padding-bottom: var(--thanh-duoi); }
.bs-tab { display: flex; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--vien); }
.bs-tab button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border-radius: 17px; font-size: 14px; font-weight: 600; color: var(--chu-2); }
.bs-tab button svg { width: 20px; height: 20px; } .bs-tab .e { font-size: 18px; }
.bs-tab button.chon { background: var(--nen-2); color: var(--chu); }
.bs-than { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bs-than .bang-emoji { flex: 1; min-height: 0; }
.soan .nut-mat.bat { color: var(--chu-2); }
.cuon-nd { flex: 1; overflow-y: auto; padding: 4px 8px 10px; overscroll-behavior: contain; }
.cuon-nd .ten-nhom { padding: 8px 6px 4px; font-size: 13px; color: var(--chu-2); font-weight: 600; }
.luoi-nd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.nd-o { aspect-ratio: 1; border-radius: 12px; position: relative; overflow: hidden; }
.nd-o:active { background: var(--nen-2); }
.nd-o svg { position: absolute; inset: 8%; width: 84% !important; height: 84% !important; }
.nd-cho { font-size: 44px; line-height: 1; display: flex; align-items: center; justify-content: center; height: 100%; }
.da-nap > .nd-cho { display: none; }
.nguon-nd { text-align: center; font-size: 11.5px; padding: 12px 0 0; }
/* tin nhãn dán */
.bong.nhan-dan { background: none !important; padding: 0; }
.nd-phat { width: 128px; height: 128px; position: relative; }
.nd-phat .nd-cho { font-size: 88px; }
.nd-phat svg { position: absolute; inset: 0; }
/* mưa biểu tượng (hiệu ứng từ ngữ) */
.mua-bt { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.mua-bt span { position: absolute; top: -70px; animation: roi-bt linear forwards; will-change: transform; }
@keyframes roi-bt { to { transform: translateY(calc(100vh + 140px)) rotate(25deg); } }
/* bảng tuỳ chỉnh */
.tab-tc { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.tab-tc::-webkit-scrollbar { display: none; }
.tc-than { flex: 1; overflow-y: auto; padding-bottom: 12px; }
.luoi-cd { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 16px; }
.o-cd { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; }
.xem-cd { width: 100%; aspect-ratio: 3/4; border-radius: 14px; position: relative; display: block; border: 2px solid transparent; overflow: hidden; }
.o-cd.chon .xem-cd { border-color: var(--xanh); box-shadow: 0 0 0 2px var(--nen) inset; }
.xem-cd i { position: absolute; height: 14px; border-radius: 7px; }
.xem-cd .b1 { left: 10%; top: 26%; width: 50%; background: var(--bong-ban); }
.xem-cd .b2 { right: 10%; top: 46%; width: 56%; background: linear-gradient(var(--bong-toi-tu), var(--bong-toi-den)); }
.xem-cd .b3 { right: 10%; top: 62%; width: 36%; background: linear-gradient(var(--bong-toi-tu), var(--bong-toi-den)); }
.o-cd.chon .ten-cd { color: var(--xanh); font-weight: 600; }
.nh-hien { display: flex; align-items: center; gap: 14px; padding: 4px 18px 12px; }
.nh-hien > span { font-size: 48px; }
.nh-hien .goi-y { padding: 0; margin: 0; }
.dong-hu { display: flex; align-items: center; gap: 12px; padding: 8px 18px; }
.dong-hu .e { font-size: 28px; width: 40px; }
.dong-hu .giua { flex: 1; font-size: 16px; }
.lien-ket.do { color: var(--do); }
.them-hu { display: flex; gap: 8px; align-items: center; padding: 12px 18px; }
.them-hu .chon-e { font-size: 26px; width: 46px; height: 42px; border-radius: 10px; background: var(--nen-2); flex: 0 0 auto; }
.them-hu input { flex: 1; min-width: 0; height: 42px; border-radius: 10px; border: 1px solid var(--vien); background: var(--nen); color: var(--chu); padding: 0 12px; font-size: 16px; }
.cham-cd { width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto; }
.e-muc { font-size: 20px; width: 22px; text-align: center; flex: 0 0 auto; }
.tab-tc button { flex: 0 0 auto; padding: 8px 14px; }
.ho-so .hanh-dong { gap: 4px; flex-wrap: wrap; }
.ho-so .hanh-dong button { width: 62px; font-size: 12px; text-align: center; line-height: 1.25; }
.mua-bt.roi span { animation-name: roi-bt; }
.mua-bt.bay span { top: auto; bottom: -70px; animation-name: bay-bt; animation-timing-function: ease-in; }
@keyframes bay-bt { to { transform: translate(var(--lac, 0), calc(-100vh - 140px)); } }
.mua-bt.no span { opacity: 0; transform: translate(-50%, -50%) scale(.3); animation-name: no-bt; animation-timing-function: cubic-bezier(.15,.8,.3,1); }
@keyframes no-bt { 10% { opacity: 1; } 75% { opacity: 1; } to { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 30px)) scale(1); } }
/* chặn */
.soan.chan { display: block; padding: 12px 16px calc(12px + var(--thanh-duoi)); }
.bao-chan { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 14px; color: var(--chu-2); }
.bao-chan b { color: var(--chu); font-size: 15px; }
.bao-chan .nut { margin-top: 6px; }
/* tin tự huỷ: đồng hồ nhỏ trên ảnh đại diện đầu khung chat */
.av-huy { position: relative; display: inline-flex; flex: 0 0 auto; }
.dh-huy { position: absolute; right: -4px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; background: var(--xanh); color: #fff; display: flex; align-items: center; justify-content: center; border: 2px solid var(--nen); }
.dh-huy svg { width: 11px; height: 11px; stroke-width: 3; }
.dh-huy[hidden] { display: none; }
/* hiệu ứng gửi */
.nhan-hu { display: block; font-size: 12px; color: var(--chu-2); padding: 3px 6px 0; }
.hang.toi .nhan-hu { margin-left: auto; text-align: right; }
.soan .nut-gui { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }

/* ghim tin — thanh dưới đầu khung chat */
.ghim-bar { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 14px; border-bottom: 1px solid var(--vien); background: var(--nen); }
.ghim-bar .ghim-ic svg { width: 18px; height: 18px; color: var(--xanh); }
.ghim-bar .giua { flex: 1; min-width: 0; text-align: left; display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; }
.ghim-bar .giua b { font-size: 12.5px; color: var(--chu-2); font-weight: 600; }
.ghim-bar .giua span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--chu); }
.ghim-bar .gh-tat-ca { font-size: 13px; color: var(--xanh); font-weight: 600; padding: 4px 6px; white-space: nowrap; }
.bong .trich { cursor: pointer; }
/* báo cáo */
.ds-ly-do { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: var(--nen-2); }
.ly-do { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 15px; border-bottom: 1px solid var(--vien); cursor: pointer; }
.ly-do:last-child { border-bottom: 0; }
.ly-do input { width: 18px; height: 18px; accent-color: var(--xanh); margin: 0; }
.bc-tin { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--nen); font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.bc-tin img { max-width: 160px; max-height: 160px; border-radius: 8px; display: block; }

/* gọi nhóm */
#lop-gn { position: fixed; inset: 0; z-index: 71; background: radial-gradient(circle at 50% 30%, #2b4a7a 0%, #10141c 70%); color: #fff; display: flex; flex-direction: column; }
#lop-gn[hidden] { display: none; }
#lop-gn .gn-dau { padding: calc(14px + var(--thanh-tren)) 16px 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
#lop-gn .gn-dau b { font-size: 18px; } #lop-gn .gn-dau span { font-size: 14px; opacity: .8; font-variant-numeric: tabular-nums; }
#lop-gn .gn-luoi { flex: 1; min-height: 0; display: grid; gap: 6px; padding: 6px; grid-template-columns: 1fr; grid-auto-rows: 1fr; }
#lop-gn .gn-luoi[data-n="3"], #lop-gn .gn-luoi[data-n="4"], #lop-gn .gn-luoi[data-n="5"], #lop-gn .gn-luoi[data-n="6"] { grid-template-columns: 1fr 1fr; }
#lop-gn .o-gn { position: relative; border-radius: 14px; overflow: hidden; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; min-height: 0; }
#lop-gn .o-gn video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; background: #000; }
#lop-gn .o-gn.co-hinh video { display: block; } #lop-gn .o-gn.co-hinh .av-o { display: none; }
#lop-gn .o-gn.lat video { transform: scaleX(-1); }
#lop-gn .ten-o { position: absolute; left: 8px; bottom: 8px; font-size: 13px; padding: 3px 8px; border-radius: 10px; background: rgba(0,0,0,.45); display: inline-flex; align-items: center; gap: 4px; }
#lop-gn .ten-o svg { width: 14px; height: 14px; color: #ff6b61; }
#lop-gn .gn-dk { padding: 14px 16px calc(26px + var(--thanh-duoi)); display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
#lop-gn .gn-dk button { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12.5px; color: #fff; }
#lop-gn .gn-dk .vong { width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,.18); display: inline-flex; align-items: center; justify-content: center; }
#lop-gn .gn-dk .vong svg { width: 26px; height: 26px; }
#lop-gn .gn-dk button.tat .vong { background: #fff; color: #111; }
#lop-gn .gn-dk button.cup .vong { background: #ff3b30; }
#lop-gn .gn-dk button.nghe .vong { background: #34c759; }
#lop-gn .gn-den { margin: calc(80px + var(--thanh-tren)) auto auto; text-align: center; }
#lop-gn .gn-den .ten { font-size: 26px; font-weight: 600; margin-top: 16px; } #lop-gn .gn-den .tt { font-size: 16px; opacity: .85; margin-top: 6px; }
.gn-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 14px; border-bottom: 1px solid var(--vien); background: color-mix(in srgb, var(--xanh-la, #31a24c) 12%, var(--nen)); }
.gn-bar .gn-ic svg { width: 20px; height: 20px; color: var(--xanh-la, #31a24c); }
.gn-bar .giua { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; }
.gn-bar .giua span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--chu-2); }
.gn-bar .nut.nho { background: var(--xanh-la, #31a24c); }
#lop-gn .gn-moi { position: absolute; inset: 0; z-index: 5; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; }
#lop-gn .gn-moi-k { width: 100%; max-height: 75%; overflow-y: auto; background: #1c1f26; border-radius: 18px 18px 0 0; padding: 14px 16px calc(18px + var(--thanh-duoi)); }
#lop-gn .gn-moi .tieu-de { font-weight: 700; font-size: 17px; margin-bottom: 8px; }
#lop-gn .dong-moi { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
#lop-gn .dong-moi .ten-moi { flex: 1; font-size: 15.5px; } #lop-gn .dong-moi .av { flex: none; }
#lop-gn .dong-moi button, #lop-gn .moi-het { background: #34c759; color: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 14px; }
#lop-gn .dong-moi button:disabled, #lop-gn .moi-het:disabled { background: rgba(255,255,255,.15); }
#lop-gn .moi-het { width: 100%; margin-top: 8px; padding: 11px; }
#lop-gn .moi-nhom, #lop-gn .moi-dong { width: 100%; margin-top: 8px; padding: 11px; border-radius: 10px; background: rgba(255,255,255,.1); color: #fff; font-size: 15px; }
#lop-gn .goi-y-moi { opacity: .75; font-size: 14px; }
.dong-ban { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-size: 15px; } .dong-ban .av { flex: none; }
.xt-dan { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }
.xt-dan img { max-width: 100%; max-height: 44vh; border-radius: 14px; object-fit: contain; background: var(--nen-2); }
.xt-dan:has(img + img) img { width: calc(50% - 4px); height: 140px; object-fit: cover; }
.xt-tep { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--nen-2); width: 100%; } .xt-tep svg { width: 24px; flex: none; }
.da-xem .xem-them { font-size: 10px; color: var(--chu-2); line-height: 14px; margin-left: 2px; }

/* MEDIA_v1 — cụm ảnh/video, xem lướt, lưu, chuyển tiếp, giờ gửi */
.bong.anh.album { width: min(264px, 100%); }
.al-luoi { display: grid; grid-template-columns: repeat(var(--cot, 3), 1fr); gap: 2px; border-radius: 18px; overflow: hidden; }
.al-o { position: relative; aspect-ratio: 1; padding: 0; background: var(--nen-2); overflow: hidden; }
.al-o img, .al-o video, .bong.anh .al-o img { width: 100%; height: 100%; max-height: none; min-width: 0; min-height: 0; border-radius: 0; object-fit: cover; display: block; }
.al-v { position: absolute; left: 6px; bottom: 6px; display: flex; align-items: center; gap: 3px; padding: 2px 7px 2px 5px; border-radius: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 11.5px; font-weight: 600; pointer-events: none; }
.al-v svg { width: 12px; height: 12px; fill: currentColor; }
.al-them { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); color: #fff; font-size: 26px; font-weight: 600; }
.al-tai { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 5px 9px 7px; border-radius: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; }
.al-tai i { display: block; height: 3px; margin-top: 4px; border-radius: 2px; background: #fff; transition: width .3s; }
.bong.video { position: relative; } .bong.video video { background: #000; }
.nhan-ct { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--chu-2); margin: 0 6px 3px; }
.nhan-ct svg { width: 13px; height: 13px; }
.gio-tin { font-size: 12px; color: var(--chu-2); margin: 2px 12px 6px; } .gio-tin.phai { align-self: flex-end; text-align: right; } .gio-tin.trai { padding-left: 34px; }
.cx-gio { padding: 10px 16px 9px; font-size: 13px; color: var(--chu-2); border-bottom: 1px solid var(--vien); }
.pt-v { position: relative; padding: 0; aspect-ratio: 1; overflow: hidden; background: #000; } .pt-v img, .pt-v video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* xem lướt */
#lop-xem-anh { display: block; }
#lop-xem-anh[hidden] { display: none; }
.xm-ray { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.xm-ray::-webkit-scrollbar { display: none; }
.xm-o { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; padding: calc(56px + var(--thanh-tren)) 0 calc(64px + var(--thanh-duoi)); }
.xm-o img, .xm-o video { max-width: 100%; max-height: 100%; object-fit: contain; }
.xm-tren { position: absolute; z-index: 2; top: 0; left: 0; right: 0; height: calc(56px + var(--thanh-tren)); padding-top: var(--thanh-tren); display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(rgba(0,0,0,.55), transparent); pointer-events: none; }
#lop-xem-anh .xm-tren .dong-x { position: absolute; left: 12px; right: auto; top: calc(8px + var(--thanh-tren)); pointer-events: auto; }
.xm-dem { font-size: 15px; font-weight: 600; }
.xm-duoi { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 10px; padding: 10px 12px calc(10px + var(--thanh-duoi)); background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.xm-duoi button { display: flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 20px; background: rgba(255,255,255,.16); color: #fff; font-size: 15px; font-weight: 500; }
.xm-duoi svg { width: 19px; height: 19px; }
/* xem trước khi gửi */
.gm-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 4px; max-height: 42vh; overflow-y: auto; margin-bottom: 12px; }
.gm-o { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--nen-2); }
.gm-o img, .gm-o video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gm-o.bo img, .gm-o.bo video { opacity: .25; }
.gm-bo { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; }
.gm-bo svg { width: 14px; height: 14px; }
.gm-o.bo .gm-bo { background: var(--xanh); transform: rotate(45deg); }
.gm-chat { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--nen-2); }
.gm-chat button { flex: 1; padding: 9px 4px; border-radius: 9px; font-size: 15px; font-weight: 600; color: var(--chu-2); }
.gm-chat button[aria-checked="true"] { background: var(--nen); color: var(--xanh); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.gm-mo { margin: 8px 2px 12px; min-height: 2.6em; }
.lv-thanh { height: 4px; border-radius: 2px; background: var(--nen-2); margin: 8px 0 14px; overflow: hidden; } .lv-thanh i { display: block; height: 100%; width: 0; background: var(--xanh); transition: width .2s; }
#lv-luu svg { width: 19px; height: 19px; vertical-align: -4px; margin-right: 4px; }
