#ch.tg .tg-composer-host{position:relative}
#ch.tg .tg-composer{position:relative;display:flex;align-items:flex-end;gap:8px;max-width:760px;margin:0 auto;padding:0 16px 14px}
#ch.tg .tg-input-box{position:relative;flex:1;min-width:0;display:flex;flex-direction:column;background:var(--tg-input-surface);border-radius:var(--tg-radius) var(--tg-radius) var(--tg-radius) 0;box-shadow:0 1px 8px 1px rgba(0,0,0,.12)}
#ch.tg[data-theme="light"] .tg-input-box{box-shadow:0 1px 2px rgba(16,35,47,.15)}
#ch.tg .tg-input-box::after{content:"";position:absolute;bottom:0;left:-8.4px;width:11px;height:20px;background:var(--tg-input-surface);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 11 20%22%3E%3Cg transform=%22translate(9 -14)%22%3E%3Cpath d=%22M-6 16h6v17c-.193-2.84-.876-5.767-2.05-8.782-.904-2.325-2.446-4.485-4.625-6.48A1 1 0 01-6 16z%22 transform=%22matrix(1 0 0 -1 0 49)%22/%3E%3C/g%3E%3C/svg%3E") no-repeat 0 0/11px 20px;mask:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 11 20%22%3E%3Cg transform=%22translate(9 -14)%22%3E%3Cpath d=%22M-6 16h6v17c-.193-2.84-.876-5.767-2.05-8.782-.904-2.325-2.446-4.485-4.625-6.48A1 1 0 01-6 16z%22 transform=%22matrix(1 0 0 -1 0 49)%22/%3E%3C/g%3E%3C/svg%3E") no-repeat 0 0/11px 20px}
#ch.tg .tg-input-bars{display:flex;flex-direction:column}
#ch.tg .tg-input-bar{position:relative;display:flex;align-items:center;gap:12px;height:50px;padding:6px 6px 0 12px;animation:tg-bar-in .2s var(--tg-ease)}
@keyframes tg-bar-in{from{opacity:0;height:0}to{opacity:1;height:50px}}
#ch.tg .tg-input-bar.clickable{cursor:pointer}
#ch.tg .tg-bar-ic{font-size:24px;color:var(--tg-primary);margin-inline-start:4px}
#ch.tg .tg-bar-thumb{width:36px;height:36px;border-radius:5px;object-fit:cover}
#ch.tg .tg-bar-main{flex:1;min-width:0;padding-inline-start:10px;border-inline-start:2px solid var(--tg-primary);display:flex;flex-direction:column}
#ch.tg .tg-bar-title{font-size:14px;font-weight:600;color:var(--tg-primary);line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#ch.tg .tg-bar-text{font-size:14px;line-height:18px;color:var(--tg-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#ch.tg .tg-bar-x{width:36px;height:36px}
#ch.tg .tg-input-row{display:flex;align-items:flex-end;min-height:54px;padding:0 4px}
#ch.tg .tg-input-btn{width:40px;height:40px;margin:7px 0;color:var(--tg-text-3)}
#ch.tg .tg-input-btn:hover{color:var(--tg-text-2)}
#ch.tg .tg-input-btn.active{color:var(--tg-primary)}
#ch.tg .tg-input-btns{display:flex;align-items:flex-end}
#ch.tg .tg-input{position:relative;flex:1;min-width:0;min-height:54px;max-height:min(280px,40vh);padding:16px 6px 16px 8px;font-size:var(--tg-msg-size);line-height:22px;color:var(--tg-text);outline:none;white-space:pre-wrap;word-break:break-word;overflow-y:auto;user-select:text;unicode-bidi:plaintext;text-align:start;caret-color:var(--tg-primary)}
#ch.tg .tg-input.is-empty::before{content:attr(data-placeholder);position:absolute;top:16px;inset-inline-start:8px;color:var(--tg-text-3);pointer-events:none;transition:opacity .12s,transform .12s}
#ch.tg .tg-input:focus.is-empty::before{opacity:.8}
#ch.tg .tg-input *{user-select:text}
#ch.tg .tg-composer.too-long .tg-input{color:var(--tg-danger)}
#ch.tg .tg-send{position:relative;flex:none;width:54px;height:54px;border-radius:50%;background:var(--tg-input-surface);color:var(--tg-primary);box-shadow:0 1px 8px 1px rgba(0,0,0,.12);display:grid;place-items:center;overflow:hidden;transition:background-color .15s,transform .15s}
#ch.tg[data-theme="light"] .tg-send{box-shadow:0 1px 2px rgba(16,35,47,.15)}
#ch.tg .tg-send:hover{background:var(--tg-primary);color:var(--tg-primary-text)}
#ch.tg .tg-composer:not(.has-text):not(.has-bar) .tg-send:not(.is-ext){color:var(--tg-text-2)}
#ch.tg .tg-composer:not(.has-text):not(.has-bar) .tg-send:not(.is-ext):hover{color:var(--tg-primary-text)}
#ch.tg .tg-send-ic{position:absolute;inset:0;display:grid;place-items:center;z-index:1;transition:transform .18s var(--tg-ease),opacity .18s}
#ch.tg .tg-send-ic.in{animation:tg-send-in .18s var(--tg-ease)}
#ch.tg .tg-send-ic.out{opacity:0;transform:scale(.4)}
@keyframes tg-send-in{from{opacity:0;transform:scale(.4)}to{opacity:1;transform:none}}
#ch.tg .tg-send-i{font-size:26px}
#ch.tg .tg-send.is-edit{background:var(--tg-primary);color:var(--tg-primary-text)}
#ch.tg .tg-emoji-panel{position:absolute;bottom:calc(100% + 6px);right:16px;width:min(420px,calc(100% - 32px));height:min(420px,52vh);display:flex;flex-direction:column;background:var(--tg-surface);border-radius:var(--tg-radius-big);box-shadow:0 2px 18px rgba(0,0,0,.28);z-index:20;opacity:0;visibility:hidden;transform:scale(.85);transform-origin:right bottom;transition:opacity .2s var(--tg-ease),transform .2s var(--tg-ease),visibility .2s}
#ch.tg .tg-emoji-panel.open{opacity:1;visibility:visible;transform:none}
#ch.tg .tg-ep-content{flex:1;min-height:0;position:relative}
#ch.tg .tg-ep-pane{position:absolute;inset:0;display:flex;flex-direction:column}
#ch.tg .tg-ep-tabs{flex:none;display:flex;justify-content:center;gap:6px;height:48px;align-items:center;border-top:1px solid var(--tg-border)}
#ch.tg .tg-ep-tab{color:var(--tg-text-3)}
#ch.tg .tg-ep-tab.active{color:var(--tg-primary);background:rgba(var(--tg-primary-rgb),.12)}
#ch.tg .tg-ep-cats{flex:none;display:flex;gap:2px;padding:6px 8px 2px;overflow-x:auto;scrollbar-width:none;border-bottom:1px solid var(--tg-border)}
#ch.tg .tg-ep-cats::-webkit-scrollbar{display:none}
#ch.tg .tg-ep-cat{width:36px;height:36px;color:var(--tg-text-3)}
#ch.tg .tg-ep-cat .tgico{font-size:22px}
#ch.tg .tg-ep-cat.active{color:var(--tg-primary);background:rgba(var(--tg-primary-rgb),.12)}
#ch.tg .tg-ep-search{flex:none;height:36px;margin:8px 10px 2px;border-radius:18px}
#ch.tg .tg-ep-search .tg-search-ic{font-size:20px}
#ch.tg .tg-ep-search-input{flex:1;border:0;background:none;font-size:14.5px;color:var(--tg-text);min-width:0}
#ch.tg .tg-ep-search-input::placeholder{color:var(--tg-text-3)}
#ch.tg .tg-ep-scroll{flex:1;min-height:0;padding:0 6px 8px}
#ch.tg .tg-ep-cap{position:sticky;top:0;z-index:1;padding:10px 8px 6px;font-size:14px;font-weight:500;color:var(--tg-text-2);background:var(--tg-surface)}
#ch.tg .tg-ep-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(42px,1fr));gap:0}
#ch.tg .tg-ep-e{width:42px;height:42px;border-radius:10px;font-size:28px;line-height:42px;text-align:center;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;transition:background-color .1s,transform .1s}
#ch.tg .tg-ep-e:hover{background:var(--tg-hover)}
#ch.tg .tg-ep-e:active{transform:scale(.88)}
#ch.tg .tg-ep-none{padding:30px;text-align:center;color:var(--tg-text-2);font-size:14px}
#ch.tg .tg-ep-tones{display:flex;gap:2px;padding:4px}
#ch.tg .tg-menu.tg-ep-tone-menu,#ch.tg .tg-menu.tg-react-menu{min-width:0}
#ch.tg .tg-react-grid{grid-template-columns:repeat(8,40px);padding:6px;max-height:220px;overflow-y:auto}
#ch.tg .tg-react-grid .tg-ep-e{width:40px;height:40px;font-size:24px;line-height:40px}
#ch.tg .tg-ac{position:absolute;bottom:calc(100% + 6px);left:86px;right:16px;max-height:260px;overflow-y:auto;background:var(--tg-surface);border-radius:var(--tg-radius);box-shadow:0 2px 14px rgba(0,0,0,.24);padding:4px;z-index:15;animation:tg-slide-up .15s var(--tg-ease)}
#ch.tg .tg-ac-item{display:flex;align-items:center;min-height:44px;padding:4px 10px;border-radius:8px;cursor:pointer}
#ch.tg .tg-ac-item.active,#ch.tg .tg-ac-item:hover{background:var(--tg-surface-2)}
#ch.tg .tg-ac-user{display:flex;align-items:center;gap:12px;min-width:0}
#ch.tg .tg-ac-user-t{display:flex;flex-direction:column;min-width:0}
#ch.tg .tg-ac-user-t b{font-size:15px;font-weight:500}
#ch.tg .tg-ac-user-t span{font-size:13px;color:var(--tg-text-2)}
#ch.tg .tg-ac-emoji{display:flex;align-items:center;gap:12px}
#ch.tg .tg-ac-emoji-e{font-size:24px}
#ch.tg .tg-ac-emoji-c{font-size:14px;color:var(--tg-text-2)}
#ch.tg .tg-drop{position:absolute;inset:0;display:flex;flex-direction:column;gap:10px;padding:14px 16px 10px;background:rgba(0,0,0,.25);animation:tg-fade-in .15s}
#ch.tg .tg-drop-box{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;border-radius:14px;border:2px dashed rgba(var(--tg-primary-rgb),.5);background:var(--tg-surface);color:var(--tg-text-2);transition:border-color .15s,background-color .15s}
#ch.tg .tg-drop-box .tgico{font-size:72px;color:var(--tg-text-3);transition:color .15s}
#ch.tg .tg-drop-box b{font-size:20px;font-weight:500;color:var(--tg-text)}
#ch.tg .tg-drop-box span{font-size:14px}
#ch.tg .tg-drop-box:hover{border-color:var(--tg-primary)}
#ch.tg .tg-drop-box:hover .tgico{color:var(--tg-primary)}
#ch.tg .tg-drop-box *{pointer-events:none}
#ch.tg .tg-sp-popup{width:min(420px,calc(100% - 32px))}
#ch.tg .tg-send-preview{display:flex;flex-direction:column;gap:12px}
#ch.tg .tg-sp-media{display:flex;flex-direction:column;align-items:center;gap:8px;max-height:52vh;overflow-y:auto}
#ch.tg .tg-sp-album{position:relative;border-radius:10px;overflow:hidden}
#ch.tg .tg-sp-cell{position:absolute;overflow:hidden;background:rgba(0,0,0,.2)}
#ch.tg .tg-sp-cell img{width:100%;height:100%;object-fit:cover;display:block}
#ch.tg .tg-sp-rm{position:absolute;top:6px;left:6px;width:30px;height:30px;background:rgba(0,0,0,.45);color:#fff;opacity:0;transition:opacity .15s}
#ch.tg .tg-sp-rm .tgico{font-size:18px}
#ch.tg .tg-sp-cell:hover .tg-sp-rm{opacity:1}
#ch.tg .tg-sp-file{display:flex;align-items:center;gap:12px;width:100%}
#ch.tg .tg-sp-fthumb{width:100%;height:100%;object-fit:cover;border-radius:inherit}
#ch.tg .tg-sp-file .tg-file-ic{overflow:hidden}
#ch.tg .tg-sp-cap-wrap{border-bottom:2px solid var(--tg-input-border);transition:border-color .2s}
#ch.tg .tg-sp-cap-wrap:focus-within{border-color:var(--tg-primary)}
#ch.tg .tg-sp-caption{min-height:40px;max-height:140px;padding:9px 2px;line-height:22px}
#ch.tg .tg-sp-caption.is-empty::before{top:9px;inset-inline-start:2px}
#ch.tg .tg-menu.tg-attach-menu{min-width:200px}
