/* V16.29.16 - CSKH Compact Workspace | Times New Roman | CSS chỉ dùng trên trang hỗ trợ nhân viên. */
#tg-cskh-workspace,#tg-cskh-workspace *{box-sizing:border-box}
#tg-cskh-workspace{color:#eee1c5;font-family:'Times New Roman',Times,serif;min-width:0}
.tg-support-shell:has(#tg-cskh-workspace){max-width:1440px;padding:12px 18px 45px}
.tg-support-shell:has(#tg-cskh-workspace) .tg-support-heading{padding:11px 18px;margin-bottom:12px;border-color:#6b5637;background:#101925}
.tg-support-shell:has(#tg-cskh-workspace) .tg-support-heading>span{font-size:10px}
.tg-support-shell:has(#tg-cskh-workspace) .tg-support-heading h1{font-size:1.15rem;margin:2px 0 0}
.tg-support-shell:has(#tg-cskh-workspace) .tg-support-heading p{display:none}
.tg-support-shell:has(#tg-cskh-workspace) .tg-support-links{justify-content:flex-end}
.tg-support-shell:has(#tg-cskh-workspace) .tg-support-links .simple-btn{padding:6px 10px;font-size:12px}
.tg-cskh-workspace{background:#0d1522;border:1px solid #8e6b39;border-radius:18px;padding:14px;box-shadow:0 17px 45px #06091188}
.tg-cskh-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 4px 12px}
.tg-cskh-top h2{font-size:clamp(19px,2vw,25px);margin:3px 0;color:#f1cb85}
.tg-cskh-top small{font-size:10px;letter-spacing:.11em;color:#c9a66a}
.tg-cskh-top p{font-size:12px;margin:0;color:#bdbaaF}
.tg-cskh-workspace-badge{font-size:12px;border:1px solid #426d5a;color:#b1e1c8;background:#173227;border-radius:999px;padding:8px 11px;white-space:nowrap}
.tg-cskh-tabs{display:flex;gap:8px;border-bottom:1px solid #6b5332;padding-bottom:9px;margin-bottom:12px}
.tg-cskh-tabs button{cursor:pointer;border:1px solid #60533d;background:#172131;border-radius:12px;color:#dbc6a1;font:bold 16px 'Times New Roman',Times,serif;padding:10px 20px;min-height:43px}
.tg-cskh-tabs button.active{background:linear-gradient(115deg,#ffe3a1,#c99547);border-color:#ffdc86;color:#21160a;box-shadow:0 0 16px #d9a64c37}
.tg-cskh-tabs button:focus-visible{outline:2px solid #ffe5a4;outline-offset:2px}
#tg-cskh-workspace [hidden]{display:none!important}
#tg-cskh-chat-panel,#tg-cskh-mail-panel{min-width:0}
.tg-cskh-live-shell{border:1px solid #6b583d;border-radius:13px;background:#0b121e;padding:11px;min-width:0}
.tg-cskh-live-shell .tg-maint-desk-title{padding:1px 3px 10px;margin:0;align-items:center}
.tg-cskh-live-shell .tg-maint-desk-title h2{font-size:18px;margin:0;color:#e9c079}
.tg-cskh-live-shell .tg-maint-desk-title p{font-size:12px;margin:4px 0 0;color:#aab7be}
.tg-cskh-live-shell .tg-maint-desk-title button{font-size:12px;padding:8px 12px}
.tg-cskh-live-toolbar{display:flex;align-items:center;gap:9px;margin:0 0 10px;flex-wrap:wrap}
.tg-cskh-live-toolbar input,.tg-cskh-live-toolbar select{font:14px 'Times New Roman',Times,serif;color:#f7dfae;background:#172234;border:1px solid #6c624e;border-radius:9px;padding:9px 12px;min-height:39px;max-width:100%}
.tg-cskh-live-toolbar .tg-cskh-search-label{min-width:185px;flex:1;max-width:410px}
.tg-cskh-live-toolbar input{width:100%}
.tg-cskh-live-count{font-size:12px;color:#b5bcd1;margin-left:auto}
.tg-cskh-live-shell .tg-maint-chat-staff-grid{display:grid;grid-template-columns:minmax(190px,25%) minmax(280px,1fr) minmax(192px,23%);gap:10px;margin:0;min-width:0;max-height:660px;height:min(65dvh,610px);min-height:440px}
.tg-cskh-live-shell .tg-maint-chat-left,.tg-cskh-live-shell .tg-maint-chat-center,.tg-cskh-live-shell .tg-maint-chat-aside{min-width:0;min-height:0;overflow:hidden;background:#101b2a;border:1px solid #554a3a;border-radius:11px;padding:10px}
.tg-cskh-column-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px;padding:2px}
.tg-cskh-column-heading h3,.tg-cskh-live-shell .tg-maint-chat-aside h3{font:bold 16px 'Times New Roman',serif;color:#edc27a;margin:0}
.tg-cskh-column-heading span{color:#cfa461;font-size:12px}
.tg-cskh-live-shell .tg-maint-chat-left{display:flex;flex-direction:column}
.tg-cskh-live-shell #tg-maint-chat-thread-list{display:grid;gap:7px;align-content:start;flex:1;max-height:none;overflow-y:auto;min-height:0;padding:1px;scrollbar-width:thin}
.tg-cskh-live-shell .tg-maint-chat-thread-link{padding:10px;border:1px solid #4a5669;border-radius:9px;background:#172233;gap:6px;color:#f5dda8}
.tg-cskh-live-shell .tg-maint-chat-thread-link.selected{border-color:#dfb065;background:#30291e;box-shadow:inset 3px 0 0 #f3c576}
.tg-cskh-thread-head{display:flex;gap:5px;justify-content:space-between;align-items:center;font-size:14px}
.tg-cskh-thread-head strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tg-cskh-thread-head time{font-size:11px;white-space:nowrap;color:#c7bda9}
.tg-cskh-thread-excerpt{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#b1b8c2}
.tg-cskh-thread-state{font-size:11px;color:#9b9eaa}
.tg-cskh-thread-state.is-open{color:#a5dfbf}
.tg-cskh-live-shell .tg-maint-chat-center{display:flex;padding:0}
.tg-cskh-live-shell #tg-maint-chat-staff-detail{display:flex;flex-direction:column;gap:0;flex:1;min-height:0;width:100%}
.tg-cskh-conversation-header{padding:12px 14px;border-bottom:1px solid #514837;display:flex;align-items:center;gap:12px;min-height:60px}
.tg-cskh-conversation-header h3{font-size:17px;margin:0 0 4px!important;color:#f1c879}
.tg-cskh-conversation-header small{font-size:12px;color:#a8d9c8}
.tg-cskh-live-shell #tg-maint-chat-staff-detail .tg-maint-chat-messages{height:auto;max-height:none;min-height:140px;flex:1;border:0;border-radius:0;padding:12px 14px;background:radial-gradient(ellipse at bottom,#263147 0%,#0b1320 70%);overflow-y:auto;scrollbar-width:thin}
.tg-cskh-live-shell #tg-maint-chat-staff-detail .tg-maint-chat-compose{border-top:1px solid #534b3d;background:#121b29;margin:0;padding:10px;gap:10px;align-items:end;flex-wrap:nowrap}
.tg-cskh-live-shell .tg-maint-chat-compose textarea{height:48px;min-height:48px;resize:none;flex:1;max-height:90px}
.tg-cskh-live-shell .tg-maint-chat-compose button{min-height:45px;border-radius:8px}
.tg-cskh-live-shell .tg-maint-chat-bubble{max-width:86%}
.tg-cskh-closed-message{text-align:center;color:#b5b6bf;padding:16px}
.tg-cskh-live-shell .tg-maint-chat-aside{overflow-y:auto;scrollbar-width:thin}
.tg-maint-chat-aside h3{padding-bottom:10px;border-bottom:1px solid #605036}
#tg-cskh-chat-customer{display:grid;align-content:start;gap:12px;font-size:13px;color:#e9d3b0;overflow-wrap:anywhere}
.tg-cskh-customer-avatar{width:60px;height:60px;margin:8px 0 0;display:grid;place-items:center;border-radius:50%;border:2px solid #e7c175;background:#302819;color:#ffde9b;font-size:28px}
#tg-cskh-chat-customer>strong{font-size:18px;color:#f4d28d}
#tg-cskh-chat-customer>p{margin:0}
.tg-cskh-status-pill{display:inline-block;border-radius:999px;padding:4px 7px;border:1px solid #65616a;color:#b9b4bd}
.tg-cskh-status-pill.is-open{color:#9ce2b8;border-color:#477c65}
.tg-cskh-customer-actions{display:grid;gap:8px;margin-top:8px}
.tg-cskh-customer-actions .simple-btn{width:100%;font:13px 'Times New Roman',serif;padding:9px 7px;text-align:center}
.tg-cskh-customer-actions .tg-cskh-close-button{border-color:#96724a;color:#f4d4a1}
.tg-cskh-live-shell .tg-maint-chat-staff-status{margin:7px 0 0;min-height:14px}
.tg-cskh-mobile-back,.tg-cskh-mail-back{display:none!important}
/* Hộp thư CSKH chỉ hiển thị ở tab Hộp thư. */
.tg-cskh-mail-panel .tg-cskh-mail-inbox{margin:0;background:#0d1724;padding:12px 14px;border-color:#65543a}
.tg-cskh-mail-panel .tg-support-panel-heading{margin-bottom:9px}
.tg-cskh-mail-panel .tg-support-panel-heading h2{font-size:18px;margin:0}
.tg-cskh-mail-panel .tg-v145-filters{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap;margin:8px 0}
.tg-cskh-mail-panel .tg-v145-filters label{min-width:140px;flex:1;font-size:12px}
.tg-cskh-mail-panel .tg-v145-filters input,.tg-cskh-mail-panel .tg-v145-filters select{width:100%;min-width:0;padding:9px 11px;font-size:13px}
.tg-cskh-mail-panel .tg-support-columns{display:grid;grid-template-columns:minmax(220px,30%) minmax(0,1fr);gap:11px;margin-top:8px;height:min(66dvh,630px);min-height:460px;overflow:hidden}
.tg-cskh-mail-panel .tg-support-ticket-list{max-height:none;height:100%;overflow-y:auto;align-content:start;scrollbar-width:thin;min-width:0}
.tg-cskh-mail-panel .tg-support-ticket{padding:10px;gap:5px}
.tg-cskh-mail-panel .tg-support-ticket strong{font-size:14px}
.tg-cskh-mail-panel .tg-support-ticket small{font-size:11px}
.tg-cskh-mail-panel .tg-support-conversation{max-height:none;height:100%;overflow-y:auto;padding:12px;min-height:0;scrollbar-width:thin}
.tg-cskh-mail-panel .tg-support-thread-heading h2{font-size:18px}
.tg-cskh-mail-panel .tg-support-thread .tg-support-form{margin-bottom:5px}
.tg-cskh-extra{border:1px solid #574a35;border-radius:11px;background:#111b2b;margin:10px 0 0;padding:10px 14px}
.tg-cskh-extra summary{cursor:pointer;font-size:14px;font-weight:bold;color:#edc37f}
.tg-cskh-extra .tg-support-panel{margin:12px 0;padding:12px}
.tg-cskh-extra .tg-v145-stats{margin:12px 0}
@media(max-width:1120px){.tg-cskh-live-shell .tg-maint-chat-staff-grid{grid-template-columns:minmax(175px,32%) minmax(0,1fr)}.tg-cskh-live-shell .tg-maint-chat-aside{display:none}.tg-cskh-top h2{font-size:21px}}
@media(max-width:720px){
 .tg-support-shell:has(#tg-cskh-workspace){padding:9px 7px 22px}
 .tg-support-shell:has(#tg-cskh-workspace) .tg-support-heading{margin-bottom:8px;padding:9px 12px}
 .tg-support-shell:has(#tg-cskh-workspace) .tg-support-heading h1{font-size:1rem}
 .tg-cskh-workspace{padding:8px;border-radius:12px}
 .tg-cskh-top{margin:4px 4px 9px;gap:6px}
 .tg-cskh-top h2{font-size:18px}
 .tg-cskh-top p{display:none}
 .tg-cskh-workspace-badge{display:none}
 .tg-cskh-tabs{gap:6px;margin-bottom:9px}
 .tg-cskh-tabs button{flex:1;padding:10px 6px;font-size:14px}
 .tg-cskh-live-shell{padding:7px}
 .tg-cskh-live-toolbar{gap:6px}
 .tg-cskh-live-toolbar .tg-cskh-search-label{min-width:130px;max-width:none;flex:1}
 .tg-cskh-live-toolbar .tg-cskh-search-label input{font-size:13px;padding:8px}
 .tg-cskh-live-toolbar select{font-size:12px;padding:8px}
 .tg-cskh-live-count{display:none}
 .tg-cskh-live-shell .tg-maint-chat-staff-grid{display:block;height:min(66dvh,610px);min-height:340px;max-height:none}
 .tg-cskh-live-shell .tg-maint-chat-left,.tg-cskh-live-shell .tg-maint-chat-center{height:100%}
 .tg-cskh-live-shell .tg-maint-chat-aside{display:none}
 .tg-cskh-live-shell[data-mobile-view="list"] .tg-maint-chat-center{display:none}
 .tg-cskh-live-shell[data-mobile-view="detail"] .tg-maint-chat-left{display:none}
 .tg-cskh-live-shell #tg-maint-chat-staff-detail .tg-maint-chat-messages{flex:1;min-height:100px}
 .tg-cskh-mobile-back{display:inline-block!important;cursor:pointer;color:#f4ca83;border:1px solid #7a633f;background:#1d2737;border-radius:7px;padding:7px;font-size:12px;white-space:nowrap}
 .tg-cskh-conversation-header{padding:9px 10px;gap:8px}
 .tg-cskh-live-shell .tg-maint-chat-compose{padding:8px}
 .tg-cskh-live-shell .tg-maint-chat-compose textarea{min-height:42px;height:42px}
 .tg-cskh-live-shell .tg-maint-chat-compose button{min-height:42px}
 .tg-cskh-mail-panel .tg-v145-filters label{min-width:130px;flex:1}
 .tg-cskh-mail-panel .tg-support-columns{display:block;height:min(65dvh,600px);min-height:380px}
 .tg-cskh-mail-panel:not(.is-mobile-detail) .tg-support-conversation{display:none}
 .tg-cskh-mail-panel.is-mobile-detail .tg-support-ticket-list{display:none}
 .tg-cskh-mail-panel .tg-support-ticket-list{height:100%;max-height:none}
 .tg-cskh-mail-panel .tg-support-conversation{height:100%;max-height:none}
 .tg-cskh-mail-back{display:inline-flex!important;margin:0 0 9px}
 .tg-cskh-mail-panel .tg-cskh-mail-inbox{padding:9px}
}
@media(max-width:420px){.tg-cskh-live-shell .tg-maint-desk-title h2{font-size:16px}.tg-cskh-top small{font-size:9px}.tg-cskh-workspace .tg-cskh-status-select select{max-width:130px}.tg-cskh-tabs button{font-size:13px}}
@media(prefers-reduced-motion:reduce){.tg-cskh-workspace *{scroll-behavior:auto!important;transition:none!important}}
/* Header gọn: không lặp hai bảng tiêu đề dài. Giữ đường dẫn về trang chủ trong workspace. */
.tg-support-shell:has(#tg-cskh-workspace) .tg-support-heading{display:none}
.tg-cskh-top-actions{display:flex;align-items:center;gap:10px}
.tg-cskh-top-actions a{color:#e7c17d;text-decoration:none;border:1px solid #6c5736;border-radius:8px;padding:7px 10px;font-size:12px;white-space:nowrap}
.tg-cskh-top-actions a:hover{background:#302716}
.tg-cskh-live-shell .tg-maint-desk-title button,
.tg-cskh-live-shell .tg-cskh-customer-actions button,
.tg-cskh-mail-panel .simple-btn{background:#1a2636;border:1px solid #816642;border-radius:9px;color:#edcc91;font-family:'Times New Roman',Times,serif;cursor:pointer}
.tg-cskh-live-shell .tg-cskh-customer-actions .tg-cskh-close-button{border-color:#a16d4a}
.tg-cskh-live-toolbar .tg-cskh-search-label,.tg-cskh-live-toolbar .tg-cskh-status-select{display:block;font-size:0}
.tg-cskh-workspace .sr-only{position:absolute;clip:rect(0 0 0 0);clip-path:inset(50%);width:1px;height:1px;overflow:hidden;white-space:nowrap}
@media(max-width:720px){.tg-cskh-top-actions{gap:4px}.tg-cskh-top-actions a{font-size:11px;padding:6px 7px}.tg-cskh-top h2{font-size:16px}}
