/* TÊN TAB: Chat — bố cục điện thoại, chỉ áp trong mô-đun. */
.hc-chat.hc-chat-room-view{display:flex;flex-direction:column;height:var(--hc-room-height,calc(100dvh - 98px));min-height:0}.hc-chat-room-view>*{flex-shrink:0}.hc-chat-room-view #chat-messages{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.hc-chat-room-view .hc-chat-compose{margin:6px 0 0}.hc-chat-room-view .hc-chat-compose textarea{min-height:52px;height:52px}.hc-chat-room-view .hc-chat-status{margin:0;min-height:18px}.hc-chat-room-view .hc-chat-head{margin:0 0 6px}.hc-chat-room-view .hc-chat-head h2{font-size:17px}.hc-chat-room-view .hc-chat-draft-photos{flex-wrap:nowrap;overflow-x:auto;max-height:122px}.hc-chat-room-view .hc-chat-draft-photos>div{flex:0 0 86px}.hc-chat-room-view .hc-chat-compose input[type=file]{min-height:32px;font-size:13px}.hc-chat-room-view .hc-chat-pins{max-height:100px;overflow:auto}.hc-chat-msg-top .hc-chat-avatar{width:20px;height:20px;flex-basis:20px;font-size:11px}
.hc-chat{min-width:0}.hc-chat *{box-sizing:border-box}.hc-chat button,.hc-chat input,.hc-chat select{min-height:44px}.hc-chat input,.hc-chat textarea,.hc-chat select{font:inherit;font-size:16px;max-width:100%}.hc-chat textarea{width:100%;min-height:90px;resize:vertical}.hc-chat button{border:1px solid #d8d8d8;border-radius:9px;background:#fff;padding:8px 12px;color:inherit;cursor:pointer}.hc-chat button:disabled{opacity:.55;cursor:wait}.hc-chat button[aria-pressed=true],.hc-chat button[aria-selected=true]{background:#e8f1fb;border-color:#1565c0;color:#1565c0}.hc-chat .hc-chat-primary{background:#9c2531;border-color:#9c2531;color:#fff}.hc-chat-head,.hc-chat-tools,.hc-chat-tabs,.hc-chat-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:9px}.hc-chat-head h2{font-size:19px;line-height:1.25;flex:1;min-width:0;overflow-wrap:anywhere;margin:0}.hc-chat-tabs{display:grid;grid-template-columns:1fr 1fr 1fr}.hc-chat-tabs button{padding:9px 4px}.hc-chat-note{font-size:13px;color:#666;white-space:pre-wrap;overflow-wrap:anywhere}.hc-chat-error{color:#a22128}.hc-chat-status{min-height:20px;margin:5px 0}.hc-chat-search{display:flex;gap:7px;margin:8px 0}.hc-chat-search input{min-width:0;flex:1}.hc-chat-list{display:flex;flex-direction:column;gap:8px}.hc-chat-room{height:70px;display:flex;align-items:center;gap:9px;width:100%;text-align:left;overflow:hidden}.hc-chat-avatar{display:inline-flex;width:40px;height:40px;flex:0 0 40px;align-items:center;justify-content:center;border-radius:50%;background:#f1e7df;color:#64392a;font-weight:700;overflow:hidden}.hc-chat-avatar img{width:100%;height:100%;object-fit:cover}.hc-chat-room-text{flex:1;min-width:0;display:grid;gap:3px}.hc-chat-room-text strong,.hc-chat-room-text small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.hc-chat-count{min-width:22px;padding:3px;border-radius:12px;background:#a32531;color:white;text-align:center;font-size:12px}.hc-chat-msg{border:1px solid #dedede;border-radius:11px;background:#fff;margin:8px 0;overflow:hidden;scroll-margin:15px}.hc-chat-msg.hc-chat-mine{border-color:#c6d8c6;background:#f4faf4}.hc-chat-msg>summary{height:68px;min-height:68px;display:grid;grid-template-rows:20px 24px;gap:4px;padding:9px 11px;cursor:pointer;list-style:none;user-select:none;touch-action:pan-y}.hc-chat-msg>summary::-webkit-details-marker{display:none}.hc-chat-msg-top{display:flex;align-items:center;gap:8px;min-width:0;font-size:12px;color:#666}.hc-chat-msg-top strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;color:#333;font-size:13px}.hc-chat-msg-summary{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:24px}.hc-chat-msg-body{padding:3px 11px 10px;overflow-wrap:anywhere}.hc-chat-full{white-space:pre-wrap;line-height:1.5;margin:8px 0;user-select:text}.hc-chat-quote{display:block;text-align:left;width:100%;border-left:3px solid #1565c0!important;background:#edf4fa!important;white-space:pre-wrap;overflow-wrap:anywhere;margin:7px 0}.hc-chat-actions{margin-top:10px}.hc-chat-actions button{padding:6px 10px}.hc-chat-emoji{display:flex;flex-wrap:wrap;gap:5px;margin:8px 0}.hc-chat-compose{background:#fff;border:1px solid #ddd;border-radius:12px;padding:10px;margin:12px 0}.hc-chat-compose label{display:block;font-weight:600;margin:0 0 6px}.hc-chat-compose input[type=file]{width:100%}.hc-chat-draft-photos{display:flex;gap:7px;flex-wrap:wrap}.hc-chat-draft-photos>div{width:86px;position:relative}.hc-chat-draft-photos img{width:86px;height:75px;object-fit:cover;border-radius:6px}.hc-chat-draft-photos button{width:100%;padding:2px}.hc-chat-pins{border:1px solid #dac375;border-radius:9px;padding:7px;background:#fff9e8;margin:9px 0}.hc-chat-pins button{display:block;text-align:left;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:transparent;border:0}.hc-chat-form{display:grid;gap:10px;margin:10px 0}.hc-chat-form label{display:grid;gap:5px}.hc-chat-member{padding:10px;border:1px solid #ddd;border-radius:10px;margin:9px 0}.hc-chat-rights{display:flex;flex-wrap:wrap;gap:8px}.hc-chat-rights label{display:flex;align-items:center;gap:5px}.hc-chat-confirm{border:1px solid #d6ac64;background:#fff7e9;padding:10px;border-radius:9px;margin:8px 0}.hc-chat-confirm input,.hc-chat-confirm textarea{width:100%}.hc-chat-media{margin:10px 0}.hc-chat-media button{padding:0;overflow:hidden}.hc-chat-media img{display:block;width:100%;height:100%;object-fit:cover;aspect-ratio:1}.hc-chat-notice{margin:9px 0;border:1px solid #ddd;border-radius:10px;overflow:hidden}.hc-chat-notice>summary{height:68px;min-height:68px;padding:9px 11px;cursor:pointer;list-style:none;display:grid;gap:4px;grid-template-rows:23px 22px}.hc-chat-notice>summary>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hc-chat-notice>div{padding:10px}.hc-chat-viewer{padding:10px;border:0;border-radius:12px;width:min(96vw,800px);max-width:96vw;max-height:94vh;background:#111;color:#fff}.hc-chat-viewer::backdrop{background:#000b}.hc-chat-viewer button,.hc-chat-viewer a{min-height:44px;padding:9px;background:#fff;color:#222;border-radius:7px;border:0;display:inline-flex;align-items:center;text-decoration:none}.hc-chat-viewer-bar{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}.hc-chat-viewer-stage{height:65vh;overflow:auto;touch-action:pan-x pan-y pinch-zoom;display:flex;align-items:center;justify-content:center}.hc-chat-viewer-stage img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}.hc-chat-viewer-stage.hc-chat-zoom{display:block}.hc-chat-viewer-stage.hc-chat-zoom img{max-width:none;max-height:none;width:180%;height:auto}.hc-chat-focus{outline:3px solid #dab853}.hc-chat-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}

.hc-chat label:has(>input[type=file]){position:relative;display:block;min-height:44px;padding:8px;border:1px solid #ddd;border-radius:8px;cursor:pointer}.hc-chat input[type=file]{position:absolute!important;width:1px!important;height:1px!important;min-height:0!important;opacity:0;overflow:hidden}

.hc-chat-menu{border:1px solid #ccc;border-radius:14px;padding:16px;width:min(92vw,420px);max-width:92vw}.hc-chat-menu::backdrop{background:#0007}.hc-chat-msg-top strong{font-size:17px;line-height:20px}

.hc-chat-room-time{display:block;font-size:11px;line-height:14px;white-space:nowrap;color:#666}

/* Compact controls; composer uses the approved 70/95px keyboard states. */
.hc-chat [hidden]{display:none!important}
main:has(>.hc-chat-room-view:not(.hidden)){padding-bottom:0}
.hc-chat-room-view .hc-chat-head{flex-wrap:nowrap;gap:8px;min-height:48px;margin:0 0 6px}
.hc-chat-room-view .hc-chat-head h2{overflow:hidden}
.hc-chat .hc-chat-icon{display:inline-flex;align-items:center;justify-content:center;width:44px;min-width:44px;height:44px;padding:9px;border:0;background:transparent;color:#64625e;flex:none}
.hc-chat-icon svg{display:block;width:26px;height:26px;flex:none}
.hc-chat .hc-chat-room-title{display:block;width:100%;padding:0 2px;text-align:left;border:0;background:transparent;font:inherit;font-weight:700}
.hc-chat-room-title span,#chat-dm-title{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.hc-chat-room-view .hc-chat-status{min-height:0;margin:0}
.hc-chat-room-view .hc-chat-status:not(:empty){padding:3px 0 6px}
.hc-chat-room-view .hc-chat-compose{display:flex;flex-direction:column;height:70px;min-height:70px;max-height:60%;padding:8px;margin-top:6px}
.hc-chat-compose-input{display:flex;gap:6px;flex:1;min-height:52px}
.hc-chat-room-view .hc-chat-compose textarea{flex:1;min-width:0;width:0;height:100%;min-height:52px;resize:none;border:0;border-radius:6px;padding:6px 3px;font-size:16px;line-height:1.5;background:transparent;box-shadow:none}
.hc-chat-compose textarea::placeholder{color:#92928e;opacity:1}
.hc-chat-compose textarea:focus-visible{outline:2px solid #80bfee;outline-offset:-2px}
.hc-chat-compose-rail{display:flex;gap:2px;flex-direction:row;align-items:center;justify-content:space-between;flex:0 0 90px;align-self:stretch}
.hc-chat .hc-chat-send{color:#b42630;border:1px solid #ecd6d7;border-radius:14px;background:#fffafa}
.hc-chat .hc-chat-send:disabled{cursor:default;opacity:.4}
.hc-chat-room-view.hc-chat-compact .hc-chat-compose{height:70px;max-height:60%}
.hc-chat-room-view .hc-chat-compose:has(#chat-reply:not(:empty)),.hc-chat-room-view .hc-chat-compose:has(#chat-draft-photos:not(:empty)),.hc-chat-room-view .hc-chat-compose:has(#chat-check-send:not([hidden])){height:auto;max-height:70%;overflow-y:auto;flex-shrink:1}
.hc-chat-compose #chat-reply,.hc-chat-compose #chat-draft-photos{flex:none}
.hc-chat-compose #chat-reply .hc-chat-quote{margin:0 0 7px;padding:6px 8px;font-size:13px;display:flex;align-items:center;gap:8px}
.hc-chat-compose #chat-reply button{flex:none;font-size:13px;padding:4px 8px}
.hc-chat-compose #chat-draft-photos:not(:empty){padding-bottom:6px}
.hc-chat-compose #chat-check-send{margin-top:8px;flex:none}
.hc-chat .hc-chat-emoji{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px;align-items:center;margin:8px 0 0}
.hc-chat-emoji button{min-width:0;width:100%;padding:6px 1px;min-height:44px;white-space:nowrap;font-size:16px}
.hc-chat-emoji [data-chat=reaction]{font-size:16px}.hc-chat .hc-chat-emoji .hc-chat-icon{min-width:0;width:100%;padding:8px}
.hc-chat-menu{padding:10px;width:max-content;max-width:calc(100vw - 24px)}
.hc-chat-menu .hc-chat-actions{margin:0;gap:6px;max-width:100%;justify-content:center}
.hc-chat-menu .hc-chat-actions button{font-size:14px;padding:8px 10px}
.hc-chat-menu .hc-chat-close-access:not(:focus){position:absolute;width:1px;height:1px;min-height:0;padding:0;border:0;overflow:hidden;clip-path:inset(50%)}
.hc-chat button:focus-visible{outline:2px solid #1565c0;outline-offset:2px}
.hc-chat-emoji button{transition:background-color .12s,color .12s}
.hc-chat-loading svg{animation:hc-chat-spin .7s linear infinite}.hc-chat-sending svg{opacity:.45;animation:hc-chat-pulse .7s ease-in-out infinite alternate}
@keyframes hc-chat-spin{to{transform:rotate(360deg)}}@keyframes hc-chat-pulse{to{opacity:1}}
@media(prefers-reduced-motion:reduce){.hc-chat-loading svg,.hc-chat-sending svg{animation:none}.hc-chat-emoji button{transition:none}}
@media(max-width:359px){.hc-chat-msg-body{padding-left:4px;padding-right:4px}.hc-chat .hc-chat-emoji{gap:2px}}

/* Common Chat V2: main Chat and Trao adapters use the same visual primitives. */
:root{--hc-ui-blue:#176bb3;--hc-ui-ink:#26362d;--hc-ui-own:#f1f8f3;--hc-ui-border:#c6d8cc;--hc-ui-muted:#66736d}
.hc-chat [data-chat=refresh],#ctChatRefresh{color:var(--hc-ui-blue)}
.hc-chat-msg>summary{height:68px;min-height:68px;padding:5px 10px;grid-template-rows:20px 21px 17px;gap:0}
.hc-chat-msg-summary{line-height:21px;font-size:16px}
.hc-chat-msg-top time{font-size:10px;white-space:nowrap}
.hc-chat-msg-top strong{font-size:16px}
.hc-ui-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:17px;min-width:0;font-size:11px;line-height:17px;color:var(--hc-ui-muted)}
.hc-ui-status{display:flex;gap:6px;align-items:center;min-width:0;overflow:hidden;white-space:nowrap}
.hc-ui-chevron{width:18px;height:17px;color:var(--hc-ui-blue);flex:none;display:flex;align-items:center;justify-content:center}
.hc-ui-chevron svg{width:16px;height:16px;transition:transform .15s}
.hc-chat-msg[open]>summary,.ct-tin-gon[open]>summary{height:46px;min-height:46px;grid-template-rows:20px 17px}
.hc-chat-msg[open] .hc-chat-msg-summary,.ct-tin-gon[open] .ct-tin-preview{display:none}
details[open]>summary .hc-ui-chevron svg{transform:rotate(180deg)}
.hc-ui-receipt{display:inline-flex;align-items:center;min-width:0;gap:3px;color:var(--hc-ui-muted);font-size:11px;line-height:17px;overflow:hidden}
.hc-ui-receipt svg{width:15px;height:15px;flex:none}
.hc-ui-receipt.has-read svg{color:var(--hc-ui-blue)}
.hc-ui-names-short{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.hc-ui-receipt .hc-ui-names-all{display:none}
details[open] .hc-ui-names-short{display:none}
details[open] .hc-ui-names-all{display:inline;white-space:normal;overflow-wrap:anywhere}
.hc-chat-mine{background:var(--hc-ui-own)}
#ctTraoLuong{gap:8px}
#ctTraoLuong .trao-dong{margin:0}
#ctTraoLuong .trao-tin.ct-tin-gon{width:100%;background:#fff;border:1px solid #dedede;box-shadow:none;border-radius:11px;color:var(--hc-ui-ink)}
#ctTraoLuong .toi .trao-tin.ct-tin-gon{background:var(--hc-ui-own);border-color:var(--hc-ui-border)}
#ctTraoLuong .trao-tin.thu-hoi{background:#f6f6f6;border-color:#ddd}
#ctTraoLuong .ct-tin-gon>summary{display:grid;height:68px;min-height:68px;padding:5px 10px;grid-template-rows:20px 21px 17px;gap:0;cursor:pointer;user-select:none;list-style:none}
#ctTraoLuong .ct-tin-gon[open]>summary{height:auto;min-height:46px;grid-template-rows:20px auto;overflow:visible}
#ctTraoLuong .ct-tin-gon[open] .hc-ui-meta{align-items:flex-start}
#ctTraoLuong .ct-tin-gon[open] .hc-ui-status{white-space:normal;overflow:visible}
#ctTraoLuong .ct-tin-gon[open] .hc-ui-receipt{flex-wrap:wrap;overflow:visible}
#ctTraoLuong .ct-tin-dau{align-items:center;gap:8px}
#ctTraoLuong .trao-tin-ai{color:#34483d;font-size:16px;line-height:20px}
#ctTraoLuong .trao-dong-gio{color:#737e77;font-size:10px;line-height:16px;margin:0}
#ctTraoLuong .ct-tin-preview{font-size:16px;line-height:21px;color:var(--hc-ui-ink)}
#ctTraoLuong .trao-doc{display:inline-flex;min-width:0;margin:0;font-size:11px;opacity:1;color:var(--hc-ui-muted);text-align:left}
#ctTraoLuong .ct-tin-day-du{padding:3px 10px 10px}
#ctTraoLuong .trao-tin-nd{color:var(--hc-ui-ink);font-size:16px;line-height:1.5;margin:6px 0 10px;white-space:pre-wrap;overflow-wrap:anywhere}
#ctTraoLuong .ct-quote{padding:8px 9px;border:1px solid #d8e2e9;border-left:3px solid var(--hc-ui-blue);border-radius:9px;background:#edf4fa;color:#445561;min-height:44px;font-size:13px;line-height:1.45;max-width:100%;text-align:left}
#ctTraoLuong .ct-ui-toolbar{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px;margin:8px 0 0}
#ctTraoLuong .ct-ui-toolbar button{box-sizing:border-box;min-width:0;width:100%;min-height:44px;height:44px;padding:5px 1px;font-size:16px;white-space:nowrap;border:1px solid #d8d8d8;border-radius:9px;background:#fff;color:#555;cursor:pointer}
#ctTraoLuong .ct-ui-toolbar button[aria-pressed=true]{background:#e8f1fb;border-color:var(--hc-ui-blue);color:var(--hc-ui-blue)}
#ctTraoLuong .ct-ui-toolbar .hc-chat-icon{border:0;background:transparent}
#ctTraoLuong .ct-ui-toolbar:has(>button:only-child){display:flex;justify-content:flex-end}
#ctTraoLuong .ct-ui-toolbar>button:only-child{width:44px}
.hc-ui-thread-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:12px}
.hc-ui-thread-head .trao-luong-tieu{margin:0;font-size:17px;font-weight:700}
.hc-ui-thread-head .hc-chat-icon,.hc-ui-compose .hc-chat-icon{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:9px;border:0;background:transparent;border-radius:9px;cursor:pointer}
.hc-ui-compose .hc-chat-icon{color:#64625e}
#ctTraoSoanVung{box-sizing:border-box;position:relative;bottom:auto;background:#fff;border:1px solid #ddd;border-radius:12px;padding:8px;margin:10px 0 0;min-width:0}
.hc-ui-compose-input{display:flex;gap:6px;height:52px;min-height:52px}
.hc-ui-compose-rail{display:flex;gap:2px;flex-direction:row;align-items:center;justify-content:space-between;flex:0 0 90px}
#ctTraoSoanVung #ctTraoSoan{flex:1;width:0;min-width:0;height:100%!important;min-height:52px;max-height:none;padding:6px 3px;border:0;border-radius:6px;background:transparent;box-shadow:none;font-size:16px;line-height:1.5;resize:none;overflow-y:auto!important}
#ctTraoSoan::placeholder{font-size:16px;color:#92928e;opacity:1}
#ctTraoGuiBtn{margin:0!important;border:1px solid #ecd6d7!important;border-radius:14px!important;background:#fffafa!important;color:#b42630!important;box-shadow:none!important}
#ctTraoGuiBtn svg{width:26px;height:26px}
#ctTraoGuiBtn:disabled{opacity:.4;cursor:default}
#ctCcNhapVung .stt-cc-moc{display:none}
#ctCcNhapVung #ctCcLuuBtn[hidden]{display:none!important}
#ctCcNhap{display:flex;gap:7px;overflow-x:auto;max-height:112px;margin:0 0 6px}
#ctCcNhap .stt-cc-o{flex:0 0 86px;width:86px;height:86px}
#ctTraLoi{margin:0 0 6px;font-size:13px;line-height:1.4;background:#edf4fa;border-left:3px solid var(--hc-ui-blue);padding:6px 8px}
#ctTraoSoanVung.hc-ui-compact .hc-ui-compose-input{height:52px}
#ctTraoSoanVung.hc-ui-keyboard{position:fixed;z-index:90;bottom:var(--hc-ui-bottom,0px);left:16px;right:16px;margin:0;max-height:65dvh;overflow:auto}
#ctTraoSoanVung .stt-cc-tien:empty{display:none}
#ctTinMenu{box-sizing:border-box;position:fixed;inset:0;margin:auto;width:max-content;max-width:calc(100vw - 24px);height:max-content;max-height:calc(100dvh - 24px);padding:10px;border:1px solid #ccc;border-radius:14px;overflow:auto;background:#fff;box-shadow:0 8px 32px #0003}
#ctTinMenu::backdrop{background:#0007}
#ctTinMenu>button{display:inline-flex;width:auto;min-width:0;min-height:44px;padding:8px 10px;border:1px solid #ddd;border-radius:9px;background:#fff;color:#333;font:inherit;font-size:14px;align-items:center;justify-content:center;margin:0 3px 0 0}
#ctTinMenu>.hidden,#ctTinMenu.hidden{display:none!important}
#ctTinMenu #ctTinMenuBao:empty{display:none}
#ctTinMenu .hc-ui-close:not(:focus){position:absolute;width:1px;height:1px;min-height:0;padding:0;border:0;overflow:hidden;clip-path:inset(50%)}
#ctTinMenu #ctTinChepVung{max-width:280px}
#ctTraoLuong button:focus-visible,#ctTinMenu button:focus-visible,.hc-ui-compose button:focus-visible,#ctTraoSoan:focus-visible{outline:2px solid var(--hc-ui-blue);outline-offset:2px}
@media(max-width:359px){#ctTraoLuong .ct-tin-day-du{padding-left:4px;padding-right:4px}#ctTraoLuong .ct-ui-toolbar{gap:2px}}
@media(prefers-reduced-motion:reduce){.hc-ui-chevron svg{transition:none}}
#ctUiImageActions{padding:4px 12px 10px;flex:none;max-width:420px;width:100%;box-sizing:border-box;align-self:center}
#ctUiImageActions .ct-ui-toolbar{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px}
#ctUiImageActions button{min-width:0;min-height:44px;padding:4px 1px;border:1px solid #ddd;border-radius:9px;background:#fff;color:#555;font-size:16px}
#ctUiImageActions button[aria-pressed=true]{background:#e8f1fb;border-color:var(--hc-ui-blue);color:var(--hc-ui-blue)}
#ctUiImageActions .hc-chat-icon{display:flex;align-items:center;justify-content:center}
.hc-chat-msg[open]>summary .hc-ui-status{visibility:hidden}

/* AA / V4: scoped to the active Chat module; legacy Trao styles stay independent. */
body:has(#manChat:not(.hidden)){background:#f8f4e9}
body:has(#manChat:not(.hidden)) #thanhDay{display:none!important}
main:has(>#manChat:not(.hidden)){padding-bottom:0}
#manChat:not(.hidden){display:flex;flex-direction:column;position:relative;min-height:0;height:var(--hc-page-height,calc(100dvh - 140px));color:#302f29;background:#f8f4e9;overflow:hidden}
#manChat>*{flex-shrink:0}
#manChat .hc-chat-head{height:58px;min-height:58px;flex-wrap:nowrap;gap:4px;margin:0}
#manChat .hc-chat-head h2{font-size:23px;line-height:1.3;letter-spacing:-.3px;font-weight:680}
#manChat .hc-chat-head .hc-chat-icon{color:#596451}
#manChat .hc-chat-head [data-chat=refresh]{color:#176bb3}
#manChat .hc-chat-head .hc-chat-add{position:relative;padding:0;isolation:isolate}
.hc-chat-add:before{content:'';position:absolute;inset:4px;border-radius:50%;border:1px solid #dcd7c7;background:#fffdf7;z-index:-1}
.hc-chat-add[aria-expanded=true]:before{background:#e5ede3;border-color:#92ad98}
.hc-chat-add svg{width:17px;height:17px}
#manChat .hc-chat-status{min-height:0;margin:0}
#manChat .hc-chat-status:not(:empty){padding:3px 0 6px}
#manChat #chat-confirm:empty{display:none}
#manChat .hc-chat-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:0;padding:0 0 12px;height:60px}
#manChat .hc-chat-tabs button{height:48px;min-height:48px;min-width:0;display:flex;align-items:center;justify-content:center;gap:5px;padding:0 4px;border:1px solid #d9dfd2;border-radius:15px;background:#fffdf7;box-shadow:0 2px 3px #3c58400a;color:#536458;font-size:13px;line-height:20px;white-space:nowrap}
#manChat .hc-chat-tabs button[aria-selected=true]{background:#e5ede3;border-color:#7f9e8b;color:#31574c;box-shadow:inset 0 0 0 2px #fafbf1,0 2px 3px #3c58400a;font-weight:650}
.hc-chat-tab-gem{width:23px;height:26px;position:relative;display:flex;align-items:center;justify-content:center;flex:none;isolation:isolate}
.hc-chat-tab-gem:before,.hc-chat-tab-gem:after{content:'';position:absolute;inset:0 -1px;z-index:-1;border-radius:8px 11px 7px 11px;background:linear-gradient(145deg,#f8f9ee,#dce6d9);border:1px solid #bbccba;transform:rotate(-8deg)}
.hc-chat-tab-gem:after{inset:3px 2px;border-radius:5px 8px 4px 8px;border:1px solid #fffdf4;background:none}
.hc-chat-tab-gem svg{width:17px;height:17px}
[aria-selected=true] .hc-chat-tab-gem:before{background:linear-gradient(145deg,#f6f8e9,#bfd2bd);border-color:#8aac92}
#chat-main-content{position:relative;flex:1;min-height:0;overflow:hidden}
#chat-list-body,.hc-chat-page-content{height:100%;overflow-y:auto;overscroll-behavior:contain;padding:0 0 18px}
#manChat .hc-chat-page-content{overflow-y:auto}
#manChat .hc-chat-search{height:44px;display:flex;gap:0;align-items:center;border:1px solid #e0daca;background:#fffdf8;border-radius:12px;margin:8px 0 18px;overflow:hidden}
#manChat .hc-chat-search input{height:42px;min-height:0;min-width:0;flex:1;width:100%;border:0;border-radius:0;background:transparent;padding:0 12px 0 1px;color:#383d34;font-size:16px;outline:none;box-shadow:none}
#manChat .hc-chat-search input::placeholder{font-size:16px;color:#777060}
#manChat .hc-chat-search button{width:44px;height:44px;min-width:44px;border:0;background:transparent;display:grid;place-items:center;padding:0;color:#847b66}
.hc-chat-search button svg{width:18px;height:18px}
.hc-chat-search:focus-within{outline:1px solid #849c83;border-color:#849c83}
.hc-chat-section-label{font-size:11px;font-weight:600;letter-spacing:1.25px;line-height:16px;color:#736d59;margin:10px 0 4px}
#manChat .hc-chat-list{gap:0}
#manChat .hc-chat-room{border:0;border-bottom:1px solid #e9e2d3;border-radius:0;background:transparent;width:100%;height:76px;min-height:76px;display:flex;gap:12px;align-items:center;padding:12px 0;text-align:left;color:#302f29}
.hc-chat-room .hc-chat-avatar{width:40px;height:40px;background:#ede1c9;color:#816b48;font-size:14px}
.hc-chat-room-text{gap:5px}
.hc-chat-room-line{display:flex;align-items:baseline;justify-content:space-between;gap:8px;min-width:0}
.hc-chat-room-line strong{min-width:0;font-size:15px;font-weight:600;line-height:21px}
.hc-chat-room-line .hc-chat-room-time{flex:none;font-size:11px;line-height:16px;color:#766e5d}
.hc-chat-room-text small{font-size:13px;line-height:18px;color:#756e60}
.hc-chat-room .hc-chat-count{background:#385c51;flex:none}
#chat-bottom-nav{height:56px;min-height:56px;flex:none;display:grid;grid-template-columns:.8fr 1.1fr 1.1fr;align-items:center;gap:6px;padding:0 2px;background:#f3f3e9;border-top:1px solid #d8ddcd}
.hc-chat-bottom-nav a{height:52px;min-width:44px;min-height:44px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border-radius:13px;text-decoration:none;color:#536953;font-size:11px;line-height:16px;font-weight:600}
.hc-chat-bottom-nav a:first-child{width:100%;justify-self:stretch;color:#b62020}
.hc-chat-bottom-nav a>svg{width:24px;height:24px}
.hc-chat-footer-gem{position:relative;display:grid;place-items:center;width:30px;height:27px;isolation:isolate}
.hc-chat-footer-gem:before{content:'';position:absolute;inset:0 1px;border:1px solid #ccd5c1;border-radius:11px 15px 10px 14px;transform:rotate(-9deg);background:linear-gradient(135deg,#fcfcf2,#e6ecd9);z-index:-1}
.hc-chat-footer-gem svg{width:18px;height:18px}
.hc-chat-bottom-nav a:focus-visible{outline:2px solid #385c51;outline-offset:-2px}
.hc-chat-menu-layer{position:absolute;inset:0;z-index:8;overflow:hidden}
#manChat .hc-chat-menu-dimmer{position:absolute;inset:0;width:100%;height:100%;border:0;border-radius:0;background:#f4f0e5b5;cursor:default}
.hc-chat-group-menu{position:relative;margin:5px 2px 0;padding:14px 15px 8px;border:1px solid #d3d9c6;border-radius:19px;background:#fffdf6;box-shadow:0 9px 22px #514b3214;max-height:calc(100% - 10px);overflow:auto}
.hc-chat-group-menu>p{font-size:11px;line-height:18px;letter-spacing:1.2px;color:#70735d;margin:0 0 5px 4px}
#manChat .hc-chat-group-menu>button{display:flex;align-items:center;width:100%;min-height:54px;border:0;border-bottom:1px solid #ede8da;border-radius:0;background:none;text-align:left;gap:12px;padding:7px 3px;font-size:14px;font-weight:500}
.hc-chat-group-menu>button:last-child{border-bottom:0}
.hc-chat-menu-icon{width:33px;height:33px;color:#62816b;display:grid;place-items:center;border:1px solid #c8d5bd;border-right-color:transparent;transform:rotate(-12deg);border-radius:50%;position:relative;flex:none}
.hc-chat-menu-icon:after{content:'';position:absolute;width:3px;height:3px;right:0;bottom:3px;background:#b49969;border-radius:50%}
.hc-chat-menu-icon svg{width:17px;height:17px;transform:rotate(12deg)}
.hc-chat-group-menu>button>span:nth-child(2){flex:1;min-width:0}
.hc-chat-group-menu>button>svg{width:13px;height:13px;flex:none;color:#858975}
#manChat .hc-chat-notice{border:1px solid #e1d4b8;border-radius:15px;background:#fcf7e9;margin:10px 0}
#manChat .hc-chat-notice>summary{height:auto;min-height:76px;display:flex;align-items:flex-start;gap:10px;padding:15px 12px;grid-template:none;overflow:visible}
#manChat .hc-chat-notice>summary>*{overflow:visible;text-overflow:clip;white-space:normal}
.hc-chat-notice-badge{border:1px solid #d9c698;border-radius:50%;background:#f4ebcf;color:#937641;width:36px;height:36px;display:grid;place-items:center;flex:none}
.hc-chat-notice-badge svg{width:20px;height:20px}
.hc-chat-notice-copy{min-width:0;flex:1}
.hc-chat-notice-title{display:block;font-size:15px;line-height:22px;color:#78562a;font-weight:650;white-space:pre-wrap;overflow-wrap:anywhere}
.hc-chat-notice-copy small{display:block;font-size:12px;line-height:19px;color:#796b51;margin-top:7px;white-space:normal;overflow-wrap:anywhere}
.hc-chat-notice>summary .hc-ui-chevron{margin-top:6px}
#manChat .hc-chat-notice>div{padding:0 12px 12px}
#manChat .hc-chat-form{gap:16px;padding-bottom:15px}
#manChat .hc-chat-form label{gap:7px;font-size:13px;font-weight:600;color:#675f4d}
#manChat .hc-chat-form input:not([type=checkbox]),#manChat .hc-chat-form textarea,#manChat .hc-chat-form select{width:100%;border:1px solid #dfd8c7;background:#fffdf7;color:#393e32;border-radius:12px;padding:11px 12px;font-size:16px;line-height:22px}
#manChat .hc-chat-form textarea{min-height:124px;resize:vertical}
#manChat .hc-chat-form .hc-chat-title-input{min-height:136px;white-space:pre-wrap;overflow-wrap:anywhere}
#manChat .hc-chat-form>.hc-chat-primary{justify-self:end;width:auto;min-width:98px;min-height:44px;background:#385c51;color:#fffef5;border:1px solid #345447;box-shadow:inset 0 0 0 2px #577363;border-radius:13px;padding:9px 20px;font-size:14px}
.hc-chat-avatar-intro{font-size:14px;line-height:1.6;margin:3px 0 0;color:#746c5f}
.hc-chat-art-stage{height:248px;position:relative;margin-top:17px;display:flex;align-items:center;justify-content:center}
.hc-chat-avatar-ornament{position:absolute;width:100%;height:100%;inset:0;color:#bc9a6c;pointer-events:none}
.hc-chat-avatar-portrait{position:relative;width:150px;height:150px;flex:none;margin-left:-26px;box-shadow:0 0 0 8px #f8f4e9,0 0 0 9px #c8b795;border-radius:50%}
#chat-avatar-preview{width:100%;height:100%;border-radius:50%;overflow:hidden;background:#ede7db}
#chat-avatar-preview>img{width:100%;height:100%;object-fit:cover;display:block}
.hc-chat-avatar-empty{height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:6px;color:#736b5f;font-size:13px}
.hc-chat-avatar-empty svg{width:54px;height:54px;color:#829080}
#manChat #chat-avatar-remove{position:absolute;right:-8px;top:-4px;width:44px;height:44px;padding:0;background:transparent;border:0;isolation:isolate;color:#62584d}
#chat-avatar-remove:before{content:'';position:absolute;inset:6px;background:#fffdfa;border:1px solid #dcd2c2;border-radius:50%;z-index:-1}
#chat-avatar-remove svg{width:17px;height:17px}
#manChat .hc-chat-avatar-form{display:block;margin:0;padding:0}
#manChat .hc-chat-avatar-upload{width:100%;height:70px;min-height:70px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:5px 16px;border:1px solid #c2cdbf;border-radius:18px;background:#f2f5ee;color:#302d27}
.hc-chat-avatar-upload img{width:40px;height:36px;object-fit:contain;mix-blend-mode:multiply}
.hc-chat-avatar-upload span{font-size:14px;line-height:18px;font-weight:600}
.hc-chat-avatar-hint{font-size:13px;line-height:1.5;color:#736b5f;text-align:left;margin:11px 0 0}
#manChat .hc-chat-avatar-save{display:flex;align-items:center;justify-content:center;gap:8px;height:46px;min-height:46px;min-width:130px;border:1px solid #567264;border-radius:10px;background:transparent;color:#315447;padding:0 20px;margin:23px 0 0 auto;font-size:15px;font-weight:600}
.hc-chat-avatar-save svg{width:18px;height:18px}
.hc-chat-avatar-original{font-size:13px;line-height:1.55;color:#736b5f;text-align:left;margin:18px 0 0;border-top:1px solid #e2d8c5;padding-top:14px}
@media(max-width:359px){#manChat .hc-chat-tabs button{gap:4px;padding:0 2px}.hc-chat-tab-gem{width:20px;height:24px}#manChat .hc-chat-room{gap:10px}.hc-chat-room-line{gap:5px}}

#manChat.hc-chat-room-view .hc-chat-head{height:48px;min-height:48px}
#manChat.hc-chat-room-view .hc-chat-head h2{font-size:17px}
#manChat .hc-chat-form .hc-chat-title-input{min-height:66px;overflow-y:auto}

/* V2: group controls share the existing Ngoc suong style; no viewport or composer overrides. */
#manChat .hc-chat-confirm .hc-chat-confirm-danger{border:2px solid #b52228;color:#b52228;background:#fffafa}
#manChat .hc-chat-admin-section{border:1px solid #c5d2bf;border-radius:16px;background:#fcfdf7;margin:12px 0;overflow:hidden}
#manChat .hc-chat-admin-section>h3{margin:0;font-size:16px}
#manChat .hc-chat-admin-section>h3>button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:54px;text-align:left;padding:12px;border:0;border-radius:0;background:#f1f6ee;color:#34574a;font-weight:600}
#manChat .hc-chat-admin-section>h3>button:after{content:'⌄';font-size:20px;line-height:20px}
#manChat .hc-chat-admin-section>h3>button[aria-expanded=true]:after{content:'⌃'}
#manChat .hc-chat-admin-section>div{padding:0 12px 12px}
#manChat .hc-chat-admin-row{display:grid;gap:6px;min-height:76px;padding:13px 0;border-bottom:1px solid #e0e4d8;overflow-wrap:anywhere}
#manChat .hc-chat-admin-row:last-child{border-bottom:0}
#manChat .hc-chat-admin-row strong{font-size:15px;line-height:22px;font-weight:650;color:#304f43;white-space:normal}
#manChat .hc-chat-admin-row small{display:block;font-size:12px;line-height:18px;color:#687567;margin-top:3px}
#manChat .hc-chat-admin-row .hc-chat-tools{gap:8px;margin:3px 0 0}
#manChat .hc-chat-admin-row button{font-size:13px;min-height:44px;min-width:44px;padding:8px 10px;border-color:#7b8878;border-radius:11px;background:#fffdf7;color:#365b4c;margin:0}
#manChat .hc-chat-admin-row button:disabled{cursor:default}
#manChat .hc-chat-admin-row .hc-chat-admin-danger,#manChat .hc-chat-admin-danger{color:#b52228;border-color:#b52228}
#manChat .hc-chat-admin-group-state{font-size:12px;line-height:18px;color:#687567}
#manChat .hc-chat-admin-person{display:flex;gap:10px;align-items:center;justify-content:space-between}
#manChat .hc-chat-admin-person>span{flex:1;min-width:0}
#manChat .hc-chat-admin-person>button{flex:none;max-width:112px}
#manChat .hc-chat-admin-target{display:grid;gap:5px;margin:16px 0 8px;padding:12px;border-left:3px solid #62816b;background:#eff5ed;border-radius:10px}
#manChat [data-screen=admin]{min-width:0}
#manChat[data-screen=admin] .hc-chat-search input{border:1px solid #7b8878;border-radius:10px;padding:9px;font-size:16px;background:#fffdf7}
#manChat .hc-chat-admin-toggle{display:flex;gap:10px;align-items:center;min-height:44px}
#manChat .hc-chat-admin-toggle input{width:22px;height:22px;min-height:22px;flex:none}
#manChat .hc-chat-membership{font-size:10px;line-height:14px;color:#576f62;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#manChat .hc-chat-room:has(.hc-chat-membership){min-height:78px;height:auto;padding-top:8px;padding-bottom:8px}

/* V3: same jade controls in TV supervision; full names where an action changes rights. */
.hc-v3-receipt{color:#436656;border-top:1px solid #e2e8dc;margin-top:10px}
.hc-v3-receipt>summary{display:flex;align-items:center;gap:7px;min-height:44px;cursor:pointer;list-style:none}
.hc-v3-receipt>summary::-webkit-details-marker{display:none}.hc-v3-receipt>summary>svg{width:20px;height:20px;flex:none}.hc-v3-receipt .hc-ui-chevron{margin-left:auto}
.hc-v3-receipt[open] .hc-ui-chevron{transform:rotate(180deg)}.hc-v3-readers{display:flex;gap:8px;flex-wrap:wrap;padding:6px 0 12px}.hc-v3-readers>span{padding:6px 10px;background:#edf3e8;border-radius:18px;overflow-wrap:anywhere}
#chat-v3-filters{display:flex;gap:8px;flex-wrap:wrap}#chat-v3-filters button[aria-pressed=true]{background:#e9f1e6;border-color:#436656;color:#365947}
.hc-v3-tabs button{font-size:13px}#chat-v3-list .hc-chat-admin-row{display:grid;gap:5px}#chat-v3-list time{font-size:12px;color:#7d806e}
#manChat[data-screen=supervisor-room] .hc-chat-head h2{white-space:normal}#chat-v3-messages .hc-chat-quote{color:inherit;opacity:1}

.hc-chat-confirm label{display:block;margin:10px 0}.hc-chat-confirm select{display:block;width:100%;max-width:100%;min-height:44px;border:1px solid #80937e;border-radius:10px;background:#fffdf7;padding:8px;font:inherit}.hc-chat-confirm-safe{border:2px solid #436656!important;color:#365947!important}

/* CHAT-M2/V3-B2: scope applies to the three approved Chat surfaces. */
#manChat #chat-messages .hc-chat-msg{width:fit-content;max-width:88%;min-width:0;align-self:flex-start;padding:12px 14px;border:1px solid #ded8c9;border-radius:17px;background:#fff;box-sizing:border-box;cursor:default;}
#manChat #chat-messages .hc-chat-msg.hc-chat-mine{align-self:flex-end;margin-left:auto;background:#e7f4ed;border-color:#bfded2;}
#manChat .hc-chat-msg .hc-m2-content{display:block;min-width:0;}
#manChat .hc-chat-msg .hc-chat-msg-top{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin:0 0 4px;}
#manChat .hc-chat-msg .hc-chat-msg-top strong{font-size:14px;}
#manChat .hc-chat-msg .hc-chat-msg-top time{font-size:12px;margin-left:auto;white-space:nowrap;}
#manChat .hc-chat-msg .hc-chat-full{margin:0;font-size:16px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;}
#manChat .hc-chat-msg:not(.hc-m2-expanded) .hc-chat-full,#ctTraoLuong .trao-tin:not(.hc-m2-expanded) .trao-tin-nd{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;}
#manChat .hc-m2-more,#ctTraoLuong .hc-m2-more{display:block;min-height:44px;border:0;background:transparent;color:#376e62;padding:4px 0;text-align:left;}
#manChat .hc-m2-more[hidden],#ctTraoLuong .hc-m2-more[hidden]{display:none;}
#manChat .hc-m2-selected,#ctTraoLuong .hc-m2-selected{outline:2px solid #2f796d;outline-offset:-1px;min-width:296px!important;}
#manChat .hc-m2-strip,#ctTraoLuong .hc-m2-strip{box-sizing:border-box;display:flex;flex-wrap:nowrap;width:274px;max-width:100%;overflow-x:auto;gap:0;padding:0 4px;margin:8px 0 0;border:1px solid #ded0b7;border-radius:24px;background:#fffdf7;}
#manChat .hc-m2-strip>button,#ctTraoLuong .hc-m2-strip>button{flex:0 0 44px;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;margin:0;border:0;background:transparent;display:flex;align-items:center;justify-content:center;color:#2f796d;}
#manChat .hc-m2-strip button:disabled,#ctTraoLuong .hc-m2-strip button:disabled{opacity:.4;}
.hc-chat-menu.hc-m2-menu{width:366px;max-width:calc(100vw - 24px);padding:12px;background:#fffdf7;border:1px solid #d9c8a9;border-radius:20px;box-sizing:border-box;}
.hc-chat-menu.hc-m2-menu .hc-chat-actions{display:flex;flex-wrap:wrap;gap:0;}
.hc-chat-menu.hc-m2-menu .hc-chat-actions>button{flex:1 1 0;min-width:60px;min-height:64px;padding:6px 2px;border:0;border-radius:8px;background:transparent;display:flex;flex-direction:column;gap:6px;align-items:center;justify-content:center;color:#2f6157;font-size:13px;line-height:1.25;}
.hc-chat-menu.hc-m2-menu .hc-chat-actions>button[data-chat=recall],.hc-chat-menu.hc-m2-menu #ctTinThuHoi{color:#bd252c;}
.hc-chat-menu.hc-m2-menu .hc-chat-actions>button.hc-m2-pin{flex-basis:100%;flex-direction:row;min-height:44px;}
.hc-chat-menu.hc-m2-menu .hc-chat-actions>button[hidden],.hc-chat-menu.hc-m2-menu .hc-chat-actions>button.hidden{display:none;}
#ctTraoLuong .trao-tin{width:fit-content;max-width:100%;padding:12px 14px;}
#ctTraoLuong .ct-tin-dau{display:flex;gap:6px;align-items:center;flex-wrap:wrap;}
#ctTraoLuong .trao-tin-nd{font-size:16px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;}
#ctTinMenu.hc-m2-menu #ctTinCamXuc{display:none;}
#ctTinMenu.hc-m2-menu.ct-tin-confirm .hc-chat-actions>button{flex-basis:40%;}
#chat-bottom-nav .hc-nav-chat-gem,#thanhDay .hc-nav-chat-gem{transform:scale(1.1);}
@media(max-width:340px){#manChat .hc-m2-selected,#ctTraoLuong .hc-m2-selected{min-width:292px!important;max-width:100%!important;}}
@media(prefers-reduced-motion:reduce){#manChat .hc-m2-strip,#ctTraoLuong .hc-m2-strip{transition:none;}}

.hc-chat-menu.hc-m2-menu .hc-chat-close-access:not(:focus){position:static;width:auto;height:auto;min-height:64px;padding:6px 2px;overflow:visible;clip-path:none;}

.hc-notice-file{display:flex;align-items:center;gap:8px;padding:6px;border:1px solid #d8c9a6;border-radius:10px;margin:6px 0}.hc-notice-file span{flex:1;overflow-wrap:anywhere}.hc-notice-file button{width:44px;min-height:44px}.hc-notice-files{display:flex;gap:8px;flex-wrap:wrap}.hc-notice-files button{max-width:100%;overflow-wrap:anywhere;min-height:44px}

#ctTraoLuong .trao-tin.hc-m2-selected{padding-left:8px;padding-right:8px;}

#ctTraoLuong .hc-chat-avatar{display:inline-flex;flex:0 0 24px;width:24px;height:24px;align-items:center;justify-content:center;border-radius:50%;overflow:hidden;background:#eee6d9;}
#ctTraoLuong .hc-chat-avatar img{width:100%;height:100%;object-fit:cover;}

.hc-m2-strip .hc-chat-reaction-count{display:none;}

/* Approved compact action row. Visual sizes shrink, touch targets stay >=44px. */
.hc-chat-menu.hc-m2-menu{width:calc(100% - 32px);max-width:360px;padding:8px 10px 10px;border-radius:18px;background:#fffdf7}
.hc-chat-menu.hc-m2-menu .hc-chat-actions{display:flex;flex-wrap:nowrap;gap:2px}
.hc-chat-menu.hc-m2-menu .hc-chat-actions>button,.hc-chat-menu.hc-m2-menu .hc-chat-actions>button.hc-m2-pin{flex:1 1 0;min-width:0;width:auto;min-height:56px;flex-direction:column;padding:5px 2px;font-size:12px;line-height:16px;border-radius:10px}
.hc-chat-menu.hc-m2-menu .hc-chat-actions>button svg{width:20px;height:20px}
.hc-chat-menu-caption{display:flex;align-items:center;justify-content:space-between;min-height:44px;padding-left:8px;color:#736e66;font-size:12px}
.hc-chat-menu-caption .hc-chat-close-access{display:flex;min-width:44px;width:44px;min-height:44px;height:44px;align-items:center;justify-content:center;padding:0;margin:0}
.hc-chat-menu-caption .hc-chat-close-access span{display:none}
#manChat .hc-chat-compose #chat-text{font-size:18px}
#ctUiSurface #ctTraoSoan{font-size:18px}
.hc-chat-invitation{border-top:1px solid #ccdcd5;margin-top:8px;padding-top:8px;display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:13px}
.hc-chat-invitation>span{display:flex;align-items:center;gap:4px}
.hc-chat-invitation svg{width:18px;height:18px}
.hc-chat-invitation button{min-height:44px;padding:8px 12px;border:1px solid #ccdcd5;border-radius:10px;background:#fff;color:#31685d;font:inherit}
.hc-chat-msg>.hc-ui-receipt{margin-top:6px}
.hc-notice-preview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;min-height:90px;margin:10px 0}
.hc-notice-preview button{border:1px solid #dedbd2;border-radius:10px;min-height:90px;padding:0;overflow:hidden;background:#f8f4e9;font:inherit;font-size:12px}
.hc-notice-preview img{width:100%;height:100px;object-fit:cover;display:block}
.hc-notice-preview .hc-notice-more{display:grid;place-items:center}

.hc-chat-confirm:has(.hc-invitation-dismiss){position:relative;padding-top:44px}.hc-invitation-dismiss{position:absolute;right:0;top:0;width:44px;height:44px;display:grid;place-items:center}.hc-invitation-dismiss svg{width:20px;height:20px}

.hc-chat-menu.hc-m2-menu .hc-chat-menu-caption .hc-chat-close-access{position:static;min-width:44px;width:44px;min-height:44px;height:44px;padding:0;border:0;background:transparent;clip-path:none;overflow:visible;color:#736e66}.hc-chat-menu-caption .hc-chat-close-access svg{width:18px;height:18px}

/* YC02 — TV chốt A. ĐÂY CHỈ LÀ PHẦN VIỀN VÀNG; phần neo giữa vùng nhìn thấy nằm ở
   confirmInline() và CHƯA có trong bản nháp này (xem 03_TICH_HOP §2). */
.hc-chat-confirm{border:3px solid #e8a800;background:#fffaf0}

/* YC08-B — dòng mắt thành nút thật, vùng chạm ≥44px, không đẩy bố cục.
   data-m2-interactive đã nằm sẵn trong `exclude` của messageActions ⇒ bộ bắt chạm tự nhường. */
.hc-chat button.hc-ui-receipt,button.hc-ui-receipt{border:0;background:transparent;font:inherit;font-size:11px;text-align:left;cursor:pointer}
button.hc-ui-receipt.hc-ui-receipt-open{min-height:44px;padding:4px 10px;margin:2px -10px 0;border-radius:9px}
button.hc-ui-receipt.hc-ui-receipt-open:hover{background:#f1faf5}
button.hc-ui-receipt.hc-ui-receipt-open:focus-visible{outline:2px solid #1565c0;outline-offset:2px}
button.hc-ui-receipt[aria-expanded=true]{background:#f1faf5}

/* YC02 — TV chốt A. Hộp xác nhận neo gần GIỮA VÙNG NHÌN THẤY, mở như menu ⋯ (có nền mờ).
   Trước: #chat-confirm nằm NGAY TRÊN #chat-messages (chat.js shell()) nên hộp luôn dính đỉnh màn,
   người dùng đang cuộn ở giữa/đáy phải cuộn ngược lên mới thấy.
   Nay: khi hộp CÓ nội dung thì nó là một lớp phủ căn giữa; textContent='' là tắt (:empty). */
#chat-confirm:not(:empty){position:fixed;left:0;right:0;top:var(--hc-mobile-top,0px);height:var(--hc-mobile-height,100dvh);z-index:1700;display:flex;align-items:center;justify-content:center;padding:16px;background:#17342c5c;overscroll-behavior:contain}
#chat-confirm:not(:empty) .hc-chat-confirm{width:100%;max-width:420px;max-height:100%;overflow-y:auto;margin:0;padding:14px;border-radius:16px;box-shadow:0 18px 50px #102c2445}
#chat-confirm:not(:empty) .hc-chat-confirm>p{margin:0 0 10px;line-height:1.55}
#chat-confirm:not(:empty) .hc-chat-confirm button{min-height:44px;padding:9px 14px;border-radius:11px}
#chat-confirm:not(:empty) .hc-chat-confirm textarea{min-height:76px}
@media(max-height:420px){#chat-confirm:not(:empty){align-items:flex-start;padding-top:8px}}

/* YC08-A — dải gợi ý hai vùng chạm, chỉ hiện khi thẻ đang được chọn hoặc đang giữ. */
.hc-m2-zonehint{position:absolute;left:0;top:0;bottom:0;width:33.333%;pointer-events:none;border-right:1px dashed #2f6b5c55;background:linear-gradient(90deg,#2f6b5c12,#2f6b5c00);border-radius:inherit}
/* YC08 — bảng người đọc dựng TỪ DỮ LIỆU SẴN CÓ (t.luot_xem.nguoi), không thêm API. */
.hc-ui-readers{margin:6px 0 0;padding:8px 10px;border:1px solid #ccdcd5;border-radius:11px;background:#f6fbf8}
.hc-ui-readers>strong{display:block;font-size:12px;color:#31685d;margin-bottom:6px}
.hc-ui-readers ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:5px}
.hc-ui-readers li{font-size:12px;background:#fff;border:1px solid #d7e6df;border-radius:20px;padding:3px 9px}
.hc-ui-readers .hc-chat-note{margin:6px 0 0}

/* YC03 — hàng nhóm trong màn Rời nhóm. Vùng chạm nút ≥44px, tên nhóm không bị nút đè. */
.hc-chat-leave-row{display:flex;align-items:center;gap:10px;padding:9px 10px;border:1px solid #ccdcd5;border-radius:12px;background:#fff;margin-bottom:8px}
.hc-chat-leave-row .hc-chat-room-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.hc-chat-leave-row strong{overflow-wrap:anywhere}
.hc-chat-leave-row small{color:#5d7a71;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hc-chat-leave-btn{flex:0 0 auto;min-height:44px;padding:8px 14px;border:1px solid #b52228;border-radius:11px;background:#fffafa;color:#b52228;font:inherit}
.hc-chat-leave-btn:disabled{opacity:.55}

/* YC04 — thiệp mời trang trọng. Ba nút TÁCH BẠCH: Tham gia · Từ chối lời mời · Để sau.
   "Để sau" chỉ ĐÓNG thiệp (không trả lời máy chủ); "Từ chối lời mời" mới là trả lời. */
.hc-chat-invitation.hc-chat-invite-card{display:block;border:2px solid #d7b552;border-top:2px solid #d7b552;border-radius:16px;background:linear-gradient(180deg,#fffdf4,#fff8e6);padding:12px 14px;margin-top:10px;box-shadow:0 3px 12px #8a6a1a14}
.hc-chat-invite-card .hc-chat-invite-top{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.hc-chat-invite-card .hc-chat-invite-top svg{width:22px;height:22px;color:#9a7415}
.hc-chat-invite-card .hc-chat-invite-kind{font-size:11px;letter-spacing:.09em;text-transform:uppercase;color:#9a7415;font-weight:700}
.hc-chat-invite-card .hc-chat-invite-name{display:block;font-size:17px;line-height:1.35;color:#2b5b4e;margin:2px 0 6px;overflow-wrap:anywhere}
.hc-chat-invite-card .hc-chat-invite-state{display:inline-block;font-size:12px;padding:2px 9px;border-radius:20px;background:#fff;border:1px solid #e0cd93;color:#7d611a}
.hc-chat-invite-card .hc-chat-invite-acts{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.hc-chat-invite-card .hc-chat-invite-acts button{min-height:44px;padding:9px 14px;border-radius:11px;font:inherit;flex:1 1 auto}
.hc-chat-invite-card .hc-chat-invite-yes{background:#2f6b5c;border:1px solid #2f6b5c;color:#fff;font-weight:600}
.hc-chat-invite-card .hc-chat-invite-no{background:#fffafa;border:1px solid #b52228;color:#b52228}
.hc-chat-invite-card .hc-chat-invite-later{background:#fff;border:1px solid #ccdcd5;color:#4a6b63;flex:1 1 100%}

/* P4 (R2, r2/a2): the thong bao vai tro trong tin nhan ca nhan — cung khung the loi moi, khong nut. */
.hc-chat-invite-card.hc-chat-vai-tro .hc-chat-vai-tro-chu{margin:0 0 8px;font-size:15px;line-height:1.45;color:#3a3a2f;overflow-wrap:anywhere}
.hc-chat-invite-card.hc-chat-vai-tro[data-vai-tro="thoi"]{border-color:#b9c9bd;background:linear-gradient(180deg,#f7fbf6,#eef5ee)}
.hc-chat-invite-card.hc-chat-vai-tro[data-vai-tro="thoi"] .hc-chat-invite-kind,.hc-chat-invite-card.hc-chat-vai-tro[data-vai-tro="thoi"] .hc-chat-invite-top svg{color:#4e7561}

/* Group notification C: sibling controls, never nested buttons. */
.hc-chat-room-wrap{display:flex;align-items:center;gap:4px;min-width:0}
.hc-chat-room-wrap>.hc-chat-room{flex:1;min-width:0;width:0}
.hc-chat-room-wrap>.hc-chat-icon{flex:0 0 44px;min-width:44px;min-height:44px}
.hc-chat-room-wrap>.hc-chat-icon svg{transform:rotate(90deg)}
.hc-chat-muted{display:inline-flex;vertical-align:middle;margin-left:6px}
.hc-chat-muted svg{width:16px;height:16px}

.hc-chat-mentions{display:flex;flex-wrap:wrap;gap:4px}.hc-chat-mentions button{font-size:13px;overflow-wrap:anywhere;max-width:100%}.hc-chat-mention-line{color:#315b88;overflow-wrap:anywhere;margin:5px 0}.hc-mention-picker{font-family:system-ui,sans-serif;box-sizing:border-box;position:fixed;inset:auto;left:var(--mention-cx,50vw);top:var(--mention-cy,50dvh);transform:translate(-50%,-50%);margin:0;width:380px;max-width:calc(var(--mention-vw,100vw) - 24px);max-height:min(620px,calc(var(--mention-vh,100dvh) - 24px));padding:18px;border:1px solid #d9dfd0;border-radius:22px;background:#fffdf5;color:#243f32;box-shadow:0 18px 64px #10271940;overflow:hidden}
.hc-mention-picker[open]{display:flex;flex-direction:column;gap:12px}.hc-mention-picker::backdrop{background:#15231d73}.hc-mention-header{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-shrink:0}.hc-mention-header h2{margin:0;font-size:19px;line-height:1.3;color:#214c39}.hc-mention-header h2:focus{outline:none}.hc-mention-picker button{font-family:inherit;min-width:44px;min-height:44px;margin:0;border-radius:12px}.hc-mention-close{width:44px;flex:0 0 44px;padding:0;font-size:24px;line-height:1;background:transparent;border:0;color:#526657}.hc-mention-hint{font-size:13px;line-height:1.45;color:#607065;margin:0;flex-shrink:0}.hc-mention-search{font-family:inherit;display:flex;gap:8px;flex-shrink:0;margin:0}.hc-mention-search input{box-sizing:border-box;min-width:0;width:100%;height:44px;border:1px solid #ccd7c9;border-radius:12px;padding:0 12px;background:#fff;font-size:16px}.hc-mention-search button{border:1px solid #9cad9d;background:#edf2e8;color:#254d37;padding:0 12px}.hc-mention-picker [data-mention-status]{margin:0;font-size:13px;color:#657064;flex-shrink:0}.hc-mention-picker [data-mention-status]:empty{display:none}.hc-mention-scroll{overflow:auto;overscroll-behavior:contain;min-height:44px;flex:1 1 auto}.hc-mention-picker [data-mention-results]{display:grid;gap:7px;margin:0}.hc-mention-row{width:100%;text-align:left;display:flex;align-items:center;gap:10px;min-height:64px;padding:8px 10px;box-sizing:border-box;border:1px solid #e5e9dd;border-radius:14px;background:#fffef9;cursor:pointer}.hc-mention-picker .hc-mention-row[aria-pressed=true]{background:#eaf2e5;border-color:#adc7a8;color:#243f32}.hc-mention-avatar{display:grid;place-items:center;flex:0 0 38px;width:38px;height:38px;border-radius:50%;background:#e4e9db;color:#446346;font-size:13px;font-weight:700}.hc-mention-person{min-width:0;flex:1;display:grid;gap:4px}.hc-mention-person strong{font-size:14px;line-height:1.35;overflow-wrap:anywhere}.hc-mention-person small{font-size:12px;color:#6c796b}.hc-mention-check{display:grid;place-items:center;flex:0 0 22px;width:22px;height:22px;border:1px solid #b5c2ad;border-radius:6px;color:transparent;background:#fff}.hc-mention-row[aria-pressed=true] .hc-mention-check{background:#315a3d;border-color:#315a3d;color:#fff}.hc-mention-picker [data-mention-more]{margin-top:8px;width:100%;background:#f2f4ec;border:1px solid #ced8c8}.hc-mention-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:12px;border-top:1px solid #dfe5d6;flex-shrink:0}.hc-mention-footer span{font-size:13px;color:#526a52}.hc-mention-footer [data-mention-done]{min-width:104px;background:#315a3d;color:#fff;border:1px solid #315a3d;font-weight:600}.hc-mention-picker button:focus-visible,.hc-mention-picker input:focus-visible{outline:3px solid #b1c49c;outline-offset:2px}
@media(max-height:460px){.hc-mention-picker{padding:12px;gap:8px}.hc-mention-hint{display:none}.hc-mention-row{min-height:56px}.hc-mention-footer{padding-top:8px}}
.hc-mention-picker.hc-mention-tight{padding:12px;gap:8px}.hc-mention-tight .hc-mention-hint{display:none}.hc-mention-tight .hc-mention-row{min-height:56px}.hc-mention-tight .hc-mention-footer{padding-top:8px}

#chat-outbox{max-height:38vh;overflow:auto;flex-shrink:0;padding:4px 8px;}
.hc-chat-queued{border:1px solid #c9dfd2;border-radius:12px;background:#f1f8f3;padding:10px;margin:8px 0;}
.hc-chat-queued p{white-space:pre-wrap;overflow-wrap:anywhere;margin:4px 0;}
.hc-chat-queued-photos{display:flex;gap:6px;overflow-x:auto;}
.hc-chat-queued-photos>div{flex:0 0 110px;min-width:0;overflow-wrap:anywhere;}
.hc-chat-queued-photos img{width:100%;height:80px;object-fit:cover;border-radius:8px;}
.hc-chat-queued button{min-height:44px;}

/* Per-photo state reuses the queued preview; no image reload or polling. */
.hc-chat-photo-state{display:block;font-size:.8rem;line-height:1.3;padding:4px 0;min-height:2.6em}
.hc-chat-queued-photos [data-photo-state=failed]{color:#a52a22}
.hc-chat-queued-photos [data-photo-state=uploaded]{color:#276846}
.hc-chat-queued-photos [data-photo-state] img{box-sizing:border-box;border:2px solid transparent}
.hc-chat-queued-photos [data-photo-state=failed] img{border-color:#c34336}
.hc-chat-queued-photos [data-photo-state=uploading] img{border-color:#2780ba}
.hc-chat-queued-photos [data-photo-state=uploaded] .hc-chat-photo-state:before{content:'✓ ';font-weight:bold}
.hc-chat-queued-photos [data-photo-state=failed] .hc-chat-photo-state:before{content:'! ';font-weight:bold}
.hc-chat-queued-photos button{width:100%;font-size:.8rem;padding:4px;border:1px solid currentColor;border-radius:8px;background:#fff;color:#a52a22}
.hc-chat-queued-photos [data-photo-state=uploading] .hc-chat-photo-state:before{content:"";display:inline-block;width:10px;height:10px;margin-right:4px;border:2px solid #bed8ce;border-top-color:#276846;border-radius:50%;animation:hc-photo-turn 1s linear infinite}
@keyframes hc-photo-turn{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.hc-chat-queued-photos [data-photo-state=uploading] .hc-chat-photo-state:before{animation:none}}
