.tgagg .rich-composer{flex:1;min-width:0;min-height:21px;max-height:160px;overflow:auto;padding:0;margin:0;font:inherit;font-size:15.5px;line-height:21px;white-space:pre-wrap;word-break:break-word;outline:none;border:0;background:transparent;align-self:center}
.tgagg .composer-box.composer-box-multiline .rich-composer{align-self:auto;padding:2px 0}
.tgagg .rich-composer:empty:before{content:attr(data-placeholder);color:#9ca3af;pointer-events:none}
.tgagg .rich-composer.is-disabled{opacity:.55;pointer-events:none}
.tgagg .rich-composer b,.tgagg .rich-composer strong,.tgagg .message b,.tgagg .message strong,.tgagg .broadcast-text-body b,.tgagg .broadcast-text-body strong{font-weight:700}
.tgagg .rich-composer i,.tgagg .rich-composer em,.tgagg .message i,.tgagg .message em,.tgagg .broadcast-text-body i,.tgagg .broadcast-text-body em{font-style:italic}
.tgagg .rich-composer u,.tgagg .message u,.tgagg .broadcast-text-body u{text-decoration:underline}
.tgagg .rich-composer s,.tgagg .rich-composer del,.tgagg .message s,.tgagg .message del,.tgagg .broadcast-text-body s,.tgagg .broadcast-text-body del{text-decoration:line-through}
.tgagg .rich-composer code,.tgagg .message code,.tgagg .broadcast-text-body code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.92em;background:rgba(15,23,42,.06);border-radius:4px;padding:0 .22em}
.tgagg .rich-composer pre,.tgagg .message pre,.tgagg .broadcast-text-body pre{display:block;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.92em;background:rgba(15,23,42,.06);border-radius:8px;padding:6px 8px;margin:2px 0;white-space:pre-wrap}
.tgagg .composer-premium-emoji,.tgagg .message-premium-emoji{display:inline-flex;align-items:center;justify-content:center;width:1.25em;height:1.25em;vertical-align:-0.2em;line-height:1;overflow:hidden}
.tgagg .message-premium-emoji.is-placeholder{color:transparent;background:rgba(148,163,184,.28);border-radius:4px;box-shadow:inset 0 0 0 1px rgba(148,163,184,.25)}
.tgagg .message-premium-emoji.is-placeholder::after{content:"";display:block;width:55%;height:55%;border-radius:2px;background:rgba(255,255,255,.45)}
.tgagg .rich-composer .composer-premium-emoji,.tgagg .broadcast-textarea.rich-composer .composer-premium-emoji{display:inline-block;user-select:text;-webkit-user-select:text;-webkit-touch-callout:default;cursor:text}
.tgagg .rich-composer .composer-premium-emoji img,.tgagg .rich-composer .composer-premium-emoji video,.tgagg .rich-composer .composer-premium-emoji svg,.tgagg .broadcast-textarea.rich-composer .composer-premium-emoji img,.tgagg .broadcast-textarea.rich-composer .composer-premium-emoji video,.tgagg .broadcast-textarea.rich-composer .composer-premium-emoji svg{pointer-events:none;user-select:none;-webkit-user-select:none}
.tgagg .composer-premium-emoji:not([data-asset-loaded="1"]){opacity:.92}
.tgagg .message-premium-emoji img,.tgagg .message-premium-emoji video,.tgagg .composer-premium-emoji img,.tgagg .composer-premium-emoji video,.tgagg .message-premium-emoji svg,.tgagg .composer-premium-emoji svg,.tgagg .emoji-cell.premium svg,.tgagg .emoji-cell.premium video,.tgagg .emoji-cell.premium img{width:100%;height:100%;object-fit:contain}
.tgagg .emoji-trigger-btn{font-size:18px;line-height:1;flex:0 0 auto;position:relative;z-index:2;touch-action:manipulation;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none}
.tgagg .dialog-preview{display:flex;align-items:center;gap:4px;min-width:0}
.tgagg .dialog-preview>span{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.tgagg .dialog-read-status{flex:0 0 auto}
.tgagg .emoji-picker-portal{position:fixed;z-index:12000}
.tgagg .emoji-picker-panel{background:#fff;border:1px solid #e5e7eb;border-radius:14px;box-shadow:0 12px 40px rgba(15,23,42,.18);overflow:hidden;display:flex;flex-direction:column;max-height:min(420px,70vh)}
.tgagg .emoji-picker-toolbar{display:flex;align-items:center;gap:4px;padding:4px 6px;border-bottom:1px solid #eef2f7;background:#fff;flex:0 0 auto;min-height:0}
.tgagg .emoji-picker-toolbar .emoji-set-nav{flex:1 1 auto;min-width:0;border-bottom:0;padding:0}
.tgagg .emoji-picker-toolbar .emoji-pack-search{margin-left:0;flex:0 0 auto}
.tgagg .emoji-pack-search{margin-left:auto;display:flex;align-items:center;gap:6px;min-width:28px}
.tgagg .emoji-pack-search-btn{border:0;background:#f3f4f6;border-radius:8px;width:28px;height:28px;display:grid;place-items:center;font-size:12px;cursor:pointer;flex:0 0 auto}
.tgagg .emoji-pack-search-btn:hover{background:#e5e7eb}
.tgagg .emoji-pack-search-input{width:0;opacity:0;pointer-events:none;border:1px solid #e5e7eb;border-radius:999px;padding:0;font:inherit;font-size:12px;transition:width .18s ease,opacity .18s ease,padding .18s ease}
.tgagg .emoji-pack-search.is-open .emoji-pack-search-input{width:min(170px,42vw);opacity:1;pointer-events:auto;padding:6px 9px;background:#fff}
.tgagg .emoji-pack-modal{position:fixed;inset:0;z-index:14000;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(15,23,42,.35)}
.tgagg .emoji-pack-modal-card{width:min(420px,100%);max-height:min(560px,86vh);background:#fff;border-radius:16px;border:1px solid #e5e7eb;box-shadow:0 20px 50px rgba(15,23,42,.28);display:flex;flex-direction:column;overflow:hidden}
.tgagg .emoji-pack-modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:14px 14px 10px;border-bottom:1px solid #eef2f7}
.tgagg .emoji-pack-modal-title{font-size:16px;font-weight:900;color:#0f172a}
.tgagg .emoji-pack-modal-sub{margin-top:2px;font-size:12px;color:#64748b}
.tgagg .emoji-pack-modal-body{padding:10px 12px;overflow:auto;min-height:220px;max-height:min(360px,52vh)}
.tgagg .emoji-pack-modal-actions{padding:12px 14px 14px;border-top:1px solid #eef2f7}
.tgagg .emoji-pack-modal-add{width:100%;justify-content:center}
.tgagg .emoji-picker-body{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;padding:6px 8px;padding-bottom:calc(8px + env(safe-area-inset-bottom,0px));-webkit-overflow-scrolling:touch;background:#fff}
.tgagg .emoji-section{margin-bottom:10px}
.tgagg .emoji-section-title{font-size:11px;font-weight:800;color:#6b7280;margin:0 0 6px}
.tgagg .emoji-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px}
.tgagg .emoji-grid.premium.emoji-grid-virtual{display:block;position:relative;width:100%}
.tgagg .emoji-grid-virtual-window{position:absolute;left:0;right:0;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px}
.tgagg .emoji-cell{border:0;background:#f8fafc;border-radius:10px;min-height:40px;font-size:22px;line-height:1;padding:0;display:grid;place-items:center;position:relative;overflow:hidden;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-user-drag:none;user-drag:none;touch-action:manipulation}
.tgagg .emoji-cell img,.tgagg .emoji-cell video,.tgagg .emoji-cell svg,.tgagg .emoji-set-icon img,.tgagg .emoji-set-icon video,.tgagg .emoji-preview-stage img,.tgagg .emoji-preview-stage video,.tgagg .emoji-preview-stage svg{-webkit-user-drag:none;user-drag:none;pointer-events:none;-webkit-touch-callout:none}
.tgagg .emoji-cell.premium{background:#eef2f7;content-visibility:auto;contain-intrinsic-size:40px 40px}
.tgagg .emoji-cell.premium.is-placeholder{background:#e8edf3}
.tgagg .emoji-cell.premium.is-loaded{background:#f8fafc}
.tgagg .emoji-cell-frame{position:absolute;inset:4px;border-radius:8px;background:rgba(0,0,0,.05);overflow:hidden}
.tgagg .emoji-cell-frame::after{content:"";position:absolute;inset:0;background:linear-gradient(110deg,rgba(255,255,255,0) 30%,rgba(255,255,255,.45) 50%,rgba(255,255,255,0) 70%);background-size:200% 100%;animation:tgagg-emoji-shimmer 1.2s linear infinite;pointer-events:none}
@keyframes tgagg-emoji-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
.tgagg .emoji-cell:active,.tgagg .emoji-cell:hover{background:#e2e8f0}
.tgagg .emoji-set-nav{display:flex;gap:4px;overflow-x:auto;overflow-y:hidden;padding:0 2px;touch-action:pan-x;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
.tgagg .emoji-set-btn{border:0;background:#f3f4f6;border-radius:8px;padding:3px;font-size:10px;font-weight:700;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;gap:4px;flex:0 0 auto;min-width:30px;min-height:30px;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.tgagg .emoji-set-btn.active{background:#dbeafe;color:#1d4ed8}
.tgagg .emoji-set-btn.emoji-set-special{min-width:30px}
.tgagg .emoji-set-icon{width:18px;height:18px;border-radius:5px;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;background:#e5e7eb;flex:0 0 auto}
.tgagg .emoji-set-icon img,.tgagg .emoji-set-icon video{width:100%;height:100%;object-fit:contain;display:block}
.tgagg .emoji-set-icon-fallback{font-size:12px;font-weight:800;line-height:1}
.tgagg .emoji-set-icon-unicode{font-size:16px;font-weight:400;line-height:1;background:transparent}
.tgagg .emoji-set-icon-media{background:transparent}
.tgagg .emoji-set-btn.active .emoji-set-icon{background:#dbeafe}
.tgagg .emoji-set-btn.active .emoji-set-icon-unicode{background:transparent}
.tgagg .emoji-set-title{display:none}
.tgagg .emoji-set-count{display:none}
.tgagg .emoji-set-heading{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin:0 0 8px;font-size:12px;font-weight:800;color:#334155}
.tgagg .emoji-set-heading-count{color:#64748b;font-weight:700}
.tgagg .rich-composer.is-keyboard-suppressed{caret-color:transparent}
.tgagg.emoji-picker-open .composer{position:relative;z-index:7}
.tgagg .composer.emoji-keyboard-mode{padding-bottom:0}
.tgagg .emoji-keyboard-slot{width:100%;flex:0 0 auto;overflow:hidden;background:#fff}
.tgagg .emoji-keyboard-slot.is-keyboard-reserved{display:block!important;background:#fff;border-top:1px solid #e5e7eb}
.tgagg .emoji-keyboard-slot[hidden]{display:none!important}
.tgagg .emoji-keyboard-slot .emoji-picker-portal{position:static!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;width:100%!important;max-width:none!important;z-index:1}
.tgagg .emoji-keyboard-slot .emoji-picker-panel{height:var(--emoji-keyboard-height,min(42dvh,360px));max-height:var(--emoji-keyboard-height,min(42dvh,360px));min-height:var(--emoji-keyboard-height,min(42dvh,360px));border-radius:0;border:0;border-top:1px solid #e5e7eb;box-shadow:none;display:flex;flex-direction:column;overflow:hidden}
.tgagg .emoji-keyboard-slot .emoji-picker-body{flex:1 1 auto;min-height:0;height:auto!important;max-height:none!important;overflow-y:auto}
.tgagg .emoji-trigger-btn.is-keyboard-mode{display:grid;place-items:center;color:#334155}
.emoji-picker-portal.is-docked{left:0!important;right:0!important;top:auto!important;width:100%!important;max-width:none!important;z-index:12050}
.emoji-picker-portal.is-docked .emoji-picker-panel{max-height:min(42dvh,360px);border-radius:14px 14px 0 0;border-bottom:0;box-shadow:0 -8px 32px rgba(15,23,42,.16)}
.tgagg .emoji-loading{padding:16px;text-align:center;color:#6b7280;font-size:13px}
.tgagg .emoji-picker-portal,.tgagg .emoji-picker-portal .emoji-picker-panel,.tgagg .emoji-picker-portal .emoji-picker-body,.tgagg .emoji-picker-portal .emoji-grid,.tgagg .emoji-picker-portal .emoji-picker-toolbar,.tgagg .emoji-picker-portal .emoji-set-nav,.tgagg .emoji-picker-portal .emoji-set-btn,.tgagg .emoji-picker-portal .emoji-pack-search-btn{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.tgagg .emoji-picker-portal.is-long-pressing,.tgagg .emoji-picker-portal.is-long-pressing *{-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important}
.tgagg .emoji-picker-portal .emoji-pack-search-input{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
.tgagg .emoji-preview-pop,.tgagg .emoji-preview-pop *,.tgagg .emoji-preview-fav,.tgagg .emoji-preview-stage{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:manipulation}
.tgagg .emoji-preview-pop::selection,.tgagg .emoji-preview-pop *::selection,.tgagg .emoji-preview-fav::selection{background:transparent;color:inherit}
.tgagg .emoji-preview-backdrop{position:fixed;inset:0;z-index:13040;background:transparent;touch-action:none;pointer-events:auto}
.tgagg .emoji-preview-pop{position:fixed;z-index:13050;pointer-events:auto;width:148px;height:148px;border-radius:18px;background:#fff;border:1px solid #e5e7eb;box-shadow:0 16px 40px rgba(15,23,42,.22);overflow:hidden;animation:tgagg-emoji-pop .16s ease-out;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:manipulation}
.tgagg.is-preview-open .emoji-picker-portal,.tgagg.is-preview-open .emoji-picker-portal *{pointer-events:none!important}
.tgagg.is-preview-open .emoji-preview-backdrop,.tgagg.is-preview-open .emoji-preview-pop,.tgagg.is-preview-open .emoji-preview-pop *{pointer-events:auto!important}
.tgagg .emoji-preview-fav{position:absolute;right:8px;bottom:8px;z-index:2;border:0;border-radius:999px;padding:6px 10px;font-size:11px;font-weight:800;background:#1d4ed8;color:#fff;box-shadow:0 6px 16px rgba(29,78,216,.28);pointer-events:auto;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:manipulation}
.tgagg .emoji-preview-stage{position:absolute;inset:10px 10px 44px 10px;display:flex;align-items:center;justify-content:center;background:#f8fafc;border-radius:14px;overflow:hidden}
.tgagg .emoji-preview-stage.is-placeholder{background:#eef2f7}
.tgagg .emoji-preview-stage .emoji-cell-frame{inset:0;border-radius:14px}
.tgagg .emoji-preview-stage img,.tgagg .emoji-preview-stage video,.tgagg .emoji-preview-stage svg{width:100%!important;height:100%!important;max-width:100%;max-height:100%;object-fit:contain;display:block}
@keyframes tgagg-emoji-pop{from{opacity:0;transform:translate(10px,10px) scale(.86)}to{opacity:1;transform:translate(0,0) scale(1)}}
.tgagg .broadcast-text-wrap{position:relative}
.tgagg .broadcast-emoji-btn{position:absolute;right:8px;bottom:8px;z-index:2}
.tgagg .web-login-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.96);z-index:20000;padding:24px}
.tgagg .web-login-overlay[hidden]{display:none!important}
.tgagg .web-login-card{max-width:420px;width:100%;background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:24px;box-shadow:0 10px 30px rgba(15,23,42,.08)}
.tgagg .web-login-title{font-size:22px;font-weight:900;margin-bottom:8px}
.tgagg .web-login-sub{color:#6b7280;margin-bottom:16px;line-height:1.45}
.tgagg .web-login-actions{display:flex;flex-direction:column;gap:10px}
.tgagg .web-login-btn{width:100%;justify-content:center;text-align:center;text-decoration:none;box-sizing:border-box}
.tgagg .web-login-status{margin-top:14px;padding:12px 14px;border-radius:12px;background:#eff6ff;color:#1e3a8a;font-size:14px;line-height:1.45}
.tgagg .web-login-status[hidden]{display:none!important}
.tgagg .web-login-hint{margin-top:12px;color:#991b1b;font-size:13px;min-height:0}
.tgagg .web-login-lang{margin:16px auto 0}
.tgagg .drawer-logout{margin:4px 16px 16px;width:calc(100% - 32px);box-sizing:border-box;border:1px solid #fecaca;background:#fff5f5;color:#b91c1c;border-radius:12px;padding:12px 14px;font:inherit;font-size:15px;font-weight:800;text-align:left;cursor:pointer}
.tgagg .drawer-logout:hover{background:#fee2e2}
.tgagg .drawer-logout[hidden]{display:none!important}

.tgagg .drawer{overflow-y:auto;overscroll-behavior:contain}
.tgagg .drawer-lang{display:flex;gap:0;align-items:center;justify-content:center;margin:0 16px 12px;padding:3px;border:1px solid #e5e7eb;border-radius:999px;background:#f1f5f9;flex-shrink:0;width:fit-content;align-self:center}
.tgagg .drawer-avatar{padding:0;background:#fff;overflow:hidden}
.tgagg .drawer-avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block}
.tgagg .lang-btn{min-width:52px;height:34px;border:0;border-radius:999px;background:transparent;font-size:11px;line-height:1;cursor:pointer;transition:background .15s,box-shadow .15s;display:inline-flex;align-items:center;justify-content:center;padding:0 14px}
.tgagg .lang-btn:hover{background:rgba(255,255,255,.65)}
.tgagg .lang-btn.is-active{background:#fff;box-shadow:0 1px 3px rgba(15,23,42,.12)}
.tgagg .lang-label{font-size:11px;font-weight:800;letter-spacing:.04em;color:#334155}
.tgagg .lang-btn.is-active .lang-label{color:#1e293b}
.emoji-picker-portal{position:fixed;z-index:12000}
.emoji-picker-portal[hidden]{display:none!important}
.emoji-picker-panel{background:#fff;border:1px solid #e5e7eb;border-radius:14px;box-shadow:0 12px 40px rgba(15,23,42,.18);overflow:hidden;display:flex;flex-direction:column;max-height:min(420px,70vh)}
.emoji-picker-body{flex:1 1 auto;min-height:0;overflow:auto;padding:8px;-webkit-overflow-scrolling:touch;background:#fff}
