html,body{margin:0;padding:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none;background:#fff}
.tgagg{--bg:#fff;--surface:#fff;--side:#f4f4f5;--border:#dadce0;--text:#111827;--muted:#707579;--blue:#3390ec;--blue2:#2481cc;--incoming:#fff;--outgoing:#d9fdd3;--hover:#e9edf0;--shadow:0 8px 24px rgba(0,0,0,.12);--app-height:100dvh;width:100%;max-width:100%;height:var(--app-height,100dvh);color:var(--text);background:var(--bg);overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}
    .tgagg,.tgagg *{box-sizing:border-box}.tgagg button,.tgagg input,.tgagg select,.tgagg textarea{font:inherit}.tgagg button{cursor:pointer}
    .tgagg .app{width:100%;max-width:100%;height:100%;min-height:0;display:grid;grid-template-columns:390px minmax(0,1fr);background:var(--surface);overflow:hidden}
    .tgagg .sidebar{position:relative;min-width:0;min-height:0;height:100%;display:flex;flex-direction:column;overflow:hidden;background:var(--side);border-right:1px solid var(--border);z-index:20}
    .tgagg .topbar,.tgagg .tabs,.tgagg .chips,.tgagg .screen-title{flex-shrink:0}
    .tgagg .topbar{display:flex;align-items:center;gap:10px;padding:9px 12px 8px;background:#fff;border-bottom:1px solid rgba(218,220,224,.75)}
    .tgagg .menu-btn,.tgagg .icon-btn{width:42px;height:42px;border:0;border-radius:50%;background:transparent;color:var(--muted);display:grid;place-items:center;flex:0 0 auto;transition:.15s}
    .tgagg .menu-btn:hover,.tgagg .icon-btn:hover{background:var(--hover);color:var(--text)}
    .tgagg .hamb{width:21px;display:grid;gap:4px}.tgagg .hamb span{height:2px;border-radius:99px;background:currentColor}
    .tgagg .search{flex:1;min-width:0;height:38px;border:0;outline:0;border-radius:999px;background:#f1f3f4;padding:0 16px;font-size:15px;color:var(--text)}
    .tgagg .tabs,.tgagg .chips{display:flex;gap:8px;padding:9px 12px;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;background:#fff;border-bottom:1px solid rgba(218,220,224,.65);scrollbar-width:none;-webkit-overflow-scrolling:touch}.tgagg .tabs::-webkit-scrollbar,.tgagg .chips::-webkit-scrollbar{display:none}
    .tgagg .chip,.tgagg .tab{border:0;display:inline-flex;align-items:center;gap:7px;padding:7px 10px;border-radius:999px;background:#f1f3f4;color:#4b5563;font-size:13px;white-space:nowrap}.tgagg .chip.chip-all.active,.tgagg .tab.active{color:#fff;background:var(--blue)}.tgagg .chip.account-chip{background:var(--account-color,#64748b);color:#fff;border:1px solid rgba(255,255,255,.18)}.tgagg .chip.account-chip.active{box-shadow:0 0 0 2px rgba(17,24,39,.22)}.tgagg .chip.account-chip .badge{background:rgba(0,0,0,.22);color:#fff}.tgagg .chip .platform-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:rgba(255,255,255,.22);color:#fff;font-size:10px;font-weight:900;letter-spacing:.02em}
    .tgagg .dot{width:9px;height:9px;border-radius:50%;background:var(--dot,var(--blue));flex:0 0 auto}.tgagg .badge{min-width:22px;height:22px;padding:0 7px;border-radius:999px;display:inline-grid;place-items:center;background:var(--blue);color:#fff;font-size:12px;font-weight:800}
    .tgagg .screen-title{padding:12px 12px 2px;font-size:13px;color:#64748b;font-weight:900;text-transform:uppercase;letter-spacing:.04em}
    .tgagg .dialog-list{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;padding:4px 0 12px}
    .tgagg .dialog-list-footer{padding:10px 16px 14px;text-align:center;font-size:12.5px;color:#94a3b8}
    .tgagg .dialog-list-footer-done{color:#cbd5e1}
    .tgagg .dialog-card{display:grid;grid-template-columns:44px minmax(0,1fr);gap:10px;align-items:center;margin:4px 8px;padding:9px 10px;border:1px solid #e5e7eb;width:calc(100% - 16px);text-align:left;border-radius:12px;position:relative;overflow:hidden;background:#fff;box-shadow:0 1px 2px rgba(15,23,42,.06);transition:.16s}
    .tgagg .dialog-card.unread{background:#eef6ff}
    .tgagg .dialog-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--account-accent,#ef4444);opacity:.92;pointer-events:none}.tgagg .dialog-card>*{position:relative;z-index:1}.tgagg .dialog-card:hover{transform:translateY(-1px);box-shadow:0 5px 14px rgba(15,23,42,.12)}.tgagg .dialog-card.active{box-shadow:0 8px 20px rgba(15,23,42,.16);border-color:#cbd5e1}
    .tgagg .avatar{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;color:#fff;font-weight:900;font-size:14px;background:linear-gradient(135deg,#7dd3fc,#2563eb);overflow:hidden;flex:0 0 auto}.tgagg .avatar img{width:100%;height:100%;object-fit:cover;display:block}
    .tgagg .dialog-main{min-width:0;display:grid;gap:3px}.tgagg .dialog-head{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.tgagg .dialog-title{min-width:0;flex:1;font-size:15px;font-weight:900;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.tgagg .dialog-head-meta{display:flex;align-items:center;gap:4px;flex:0 0 auto;min-width:0}.tgagg .dialog-time{flex:0 0 auto;font-size:11.5px;line-height:1;color:var(--muted);white-space:nowrap}.tgagg .dialog-head-meta .client-badge.positive-offer{min-width:14px;height:14px;padding:0 4px;font-size:10px;font-weight:800;border-radius:999px}.tgagg .dialog-head-meta .client-badge.verified{font-size:11px;line-height:1;display:inline-flex;align-items:center}.tgagg .dialog-account-row{min-width:0}.tgagg .dialog-account-row .account-label{display:block;max-width:100%;color:var(--account-accent,#ef4444);font-size:12px;font-weight:900;line-height:1.2;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.tgagg .dialog-subline{display:flex;align-items:center;gap:8px;min-width:0}.tgagg .dialog-preview{font-size:12.5px;color:var(--muted);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0}.tgagg .dialog-unread.badge{flex:0 0 auto;min-width:22px;height:22px;padding:0 7px;border-radius:999px;display:inline-grid;place-items:center;background:#ef4444;color:#fff;font-size:12px;font-weight:800}
    .tgagg .chat-pane{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;height:100%;overflow:hidden;background:linear-gradient(rgba(167,198,217,.88),rgba(167,198,217,.88)),radial-gradient(circle at 20% 20%,rgba(255,255,255,.45) 0 1px,transparent 1px),radial-gradient(circle at 80% 40%,rgba(255,255,255,.35) 0 1px,transparent 1px);background-size:auto,36px 36px,48px 48px}
    .tgagg .chat-header,.tgagg .composer,.tgagg .note-panel{flex-shrink:0}
    .tgagg .chat-pane.empty .chat-header,.tgagg .chat-pane.empty .messages,.tgagg .chat-pane.empty .composer,.tgagg .chat-pane.empty .note-panel,.tgagg .chat-pane.empty .quick-replies{display:none}.tgagg .empty-state{position:absolute;inset:0;display:none;align-items:center;justify-content:center;padding:24px;text-align:center;color:rgba(255,255,255,.92)}.tgagg .chat-pane.empty .empty-state{display:flex}.tgagg .chat-pane.settings-mode,.tgagg .chat-pane.notes-mode{background:#f8fafc}.tgagg .chat-pane.settings-mode .empty-state,.tgagg .chat-pane.settings-mode .chat-header,.tgagg .chat-pane.settings-mode .messages,.tgagg .chat-pane.settings-mode .composer,.tgagg .chat-pane.settings-mode .note-panel,.tgagg .chat-pane.settings-mode .quick-replies,.tgagg .chat-pane.settings-mode .templates-sheet,.tgagg .chat-pane.settings-mode .templates-sheet-backdrop,.tgagg .chat-pane.notes-mode .empty-state,.tgagg .chat-pane.notes-mode .chat-header,.tgagg .chat-pane.notes-mode .messages,.tgagg .chat-pane.notes-mode .composer,.tgagg .chat-pane.notes-mode .note-panel,.tgagg .chat-pane.notes-mode .quick-replies,.tgagg .chat-pane.notes-mode .templates-sheet,.tgagg .chat-pane.notes-mode .templates-sheet-backdrop{display:none}.tgagg .settings-view{display:none;flex:1;min-height:0;overflow-y:auto;padding:22px;background:#f8fafc}.tgagg .chat-pane.settings-mode .settings-view,.tgagg .chat-pane.notes-mode .settings-view,.tgagg .chat-pane.global-templates-mode .settings-view,.tgagg .chat-pane.broadcasts-mode .settings-view{display:block}.tgagg .settings-window{max-width:920px;margin:0 auto}.tgagg .settings-window-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.tgagg .settings-window-title{font-size:20px;font-weight:900}.tgagg .settings-window-subtitle{margin-top:4px;color:var(--muted);font-size:13px}.tgagg .settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:12px}.tgagg .empty-card{max-width:380px;padding:20px 22px;border-radius:20px;background:rgba(0,0,0,.24);backdrop-filter:blur(10px);box-shadow:0 8px 24px rgba(0,0,0,.14)}.tgagg .empty-icon{width:76px;height:76px;margin:0 auto 14px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.2);font-size:34px}.tgagg .empty-title{font-size:19px;font-weight:900;margin-bottom:7px}.tgagg .empty-text{font-size:14px;line-height:1.42;opacity:.86}
    .tgagg .chat-header{min-height:66px;display:flex;align-items:center;gap:12px;padding:8px 16px;background:rgba(255,255,255,.96);border-bottom:1px solid rgba(218,220,224,.85);backdrop-filter:blur(12px);z-index:5}.tgagg .back-btn{display:none}.tgagg .header-info{min-width:0;flex:1}.tgagg .header-title{font-size:16px;font-weight:900;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tgagg .header-subtitle{margin-top:2px;font-size:12.5px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tgagg .header-actions{display:flex;align-items:center;gap:6px}.tgagg .mini-btn{min-height:34px;border:0;border-radius:999px;padding:0 10px;background:#f1f5f9;color:#334155;font-size:12.5px;font-weight:800;white-space:nowrap}.tgagg .mini-btn.primary{background:var(--blue);color:#fff}
    .tgagg .messages{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;padding:12px 10px 9px;display:flex;flex-direction:column;gap:6px}.tgagg .date-chip{align-self:center;margin:2px 0 10px;padding:5px 12px;border-radius:999px;background:rgba(0,0,0,.22);color:#fff;font-size:12.5px;backdrop-filter:blur(6px)}
    .tgagg .message{max-width:min(560px,76%);padding:6px 9px 5px;border-radius:13px;box-shadow:0 1px 1px rgba(0,0,0,.08);font-size:15px;line-height:1.38;position:relative;white-space:pre-wrap;word-break:break-word}.tgagg .message.in{align-self:flex-start;background:var(--incoming);border-bottom-left-radius:4px}.tgagg .message.out{align-self:flex-end;background:var(--outgoing);border-bottom-right-radius:4px}.tgagg .message.message-media{padding:0;background:transparent;box-shadow:none;max-width:min(320px,82%);overflow:visible}.tgagg .message.message-media .message-head{display:none}.tgagg .message.message-media .message-time{float:none;margin:0;padding:2px 6px;border-radius:999px;background:rgba(255,255,255,.86);color:#64748b;font-size:11.5px;box-shadow:0 1px 2px rgba(0,0,0,.08)}.tgagg .media-time-row{display:flex;justify-content:flex-end;margin-top:3px}.tgagg .message-service{align-self:center;max-width:80%;padding:5px 11px;border-radius:999px;background:rgba(0,0,0,.18);color:#fff;font-size:12.5px}.tgagg .message-head{display:flex;align-items:center;gap:6px;margin-bottom:2px;color:var(--blue2);font-size:12px;font-weight:900}.tgagg .message-time{float:right;margin-left:10px;margin-top:2px;color:#6b7280;font-size:11.5px;white-space:nowrap;display:inline-flex;align-items:center;gap:3px}
    .tgagg .media-block{display:block;margin:0;overflow:hidden}.tgagg .media-photo,.tgagg .media-sticker{display:block;max-width:min(280px,100%);max-height:340px;border-radius:12px;object-fit:contain;background:rgba(0,0,0,.04)}.tgagg .media-album-grid{display:grid;gap:2px;max-width:min(300px,100%);border-radius:12px;overflow:hidden}.tgagg .media-album-grid[data-count="1"]{grid-template-columns:1fr}.tgagg .media-album-grid[data-count="2"],.tgagg .media-album-grid[data-count="4"]{grid-template-columns:repeat(2,1fr)}.tgagg .media-album-grid[data-count="3"]{grid-template-columns:1fr 1fr;grid-template-rows:repeat(2,1fr)}.tgagg .media-album-grid[data-count="3"] .media-album-item:first-child{grid-row:span 2}.tgagg .media-album-item{display:block;overflow:hidden;background:rgba(0,0,0,.04);min-height:72px}.tgagg .media-album-photo{display:block;width:100%;height:100%;min-height:72px;max-height:170px;object-fit:cover}.tgagg .message.message-media-album .message-head{display:none}.tgagg .message.message-media-album.message-media{padding:0;background:transparent;box-shadow:none;max-width:min(300px,82%)}.tgagg .message.message-media-album .media-album-caption{padding:6px 9px 4px;border-radius:0 0 13px 13px;background:var(--incoming);box-shadow:0 1px 1px rgba(0,0,0,.08)}.tgagg .message.out.message-media-album .media-album-caption{background:var(--outgoing);border-bottom-right-radius:4px}.tgagg .message.in.message-media-album .media-album-caption{border-bottom-left-radius:4px}.tgagg .media-sticker{max-width:160px;max-height:160px;background:transparent}.tgagg .media-sticker-emoji{display:inline-grid;place-items:center;min-width:58px;min-height:58px;margin:2px 0 6px;border-radius:16px;background:rgba(255,255,255,.72);font-size:42px;line-height:1}.tgagg .media-gif,.tgagg .media-video{display:block;width:min(280px,100%);max-height:340px;border-radius:12px;background:#111}.tgagg .media-video-note{display:block;width:190px;height:190px;border-radius:50%;object-fit:cover;background:#111}.tgagg .media-audio-block{min-width:230px}.tgagg .media-audio{display:block;width:230px;max-width:100%;height:42px}.tgagg .media-file{display:flex;align-items:center;gap:9px;max-width:280px;padding:10px 11px;border-radius:12px;background:rgba(51,144,236,.1);color:#1d4ed8;text-decoration:none;font-weight:800}.tgagg .media-file-icon{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:rgba(51,144,236,.16);flex:0 0 auto}.tgagg .media-file-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tgagg .media-note{color:#64748b;font-size:12px;font-weight:800}
    .tgagg .note-panel{display:none!important;margin:0 12px 8px;padding:10px;border-radius:14px;background:rgba(255,255,255,.92);box-shadow:0 1px 2px rgba(0,0,0,.08)}.tgagg .note-title{font-size:12px;font-weight:900;color:#475569;margin-bottom:6px}.tgagg .note-row{display:flex;gap:8px;align-items:flex-start}.tgagg .note-row textarea{flex:1;min-width:0;border:1px solid #e5e7eb;border-radius:10px;padding:8px 10px;outline:0;font-size:14px;line-height:1.35;resize:vertical;min-height:42px;font-family:inherit;background:#fff}
.tgagg .composer{display:flex;align-items:stretch;gap:10px;padding:8px 12px 12px;position:relative;z-index:6;background:rgba(167,198,217,.96)}.tgagg .composer-main{flex:1;min-width:0}.tgagg .composer-box{min-height:48px;display:flex;align-items:center;gap:8px;padding:8px 8px 8px 14px;border-radius:18px;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.12)}.tgagg .composer-box.composer-box-multiline{align-items:flex-end;padding-top:6px;padding-bottom:6px}.tgagg .composer-box #attachInput{display:none!important}.tgagg .composer-box textarea{flex:1;border:0;outline:0;min-width:0;padding:0;margin:0;font-size:15.5px;background:transparent;font-family:inherit;line-height:21px;min-height:21px;resize:none;max-height:160px;overflow-y:auto;overflow-x:hidden;align-self:center;display:block}.tgagg .composer-box.composer-box-multiline textarea{align-self:auto}.tgagg .send-btn{width:48px;height:48px;border:0;border-radius:50%;display:grid;place-items:center;background:var(--blue);color:#fff;box-shadow:0 2px 8px rgba(51,144,236,.36);flex:0 0 auto}
    .tgagg .drawer-backdrop,.tgagg .modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.35);opacity:0;pointer-events:none;transition:.18s;z-index:90}.tgagg .drawer-backdrop.show,.tgagg .modal-backdrop.show{opacity:1;pointer-events:auto}.tgagg .drawer{position:fixed;inset:0 auto 0 0;width:min(350px,88vw);background:#fff;box-shadow:var(--shadow);transform:translateX(-102%);transition:.22s;z-index:100;display:flex;flex-direction:column}.tgagg .drawer.open{transform:translateX(0)}.tgagg .drawer-profile{min-height:150px;padding:22px 18px 16px;color:#fff;background:linear-gradient(135deg,#3390ec,#1d4ed8);display:flex;flex-direction:column;justify-content:flex-end}.tgagg .drawer-avatar{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.2);font-size:24px;font-weight:900;margin-bottom:13px}.tgagg .drawer-name{font-size:17px;font-weight:900}.tgagg .drawer-hint{margin-top:3px;font-size:13px;opacity:.88}.tgagg .drawer-menu{padding:8px 0}.tgagg .drawer-item{display:flex;align-items:center;gap:14px;width:100%;min-height:48px;border:0;background:#fff;padding:0 20px;font-size:15px;color:#202124;text-align:left}.tgagg .drawer-item:hover{background:#f1f3f4}
    .tgagg .settings-panel{flex:1;overflow-y:auto;padding:14px 16px 18px;border-top:1px solid #eef2f7;background:#fff}.tgagg .settings-card{padding:13px;border-radius:16px;background:#f8fafc;border:1px solid #e5e7eb;margin-bottom:12px}.tgagg .settings-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.tgagg .settings-title{font-weight:900;font-size:14px}.tgagg .settings-subtitle{color:var(--muted);font-size:12.5px;margin-top:2px}.tgagg .toggle{width:48px;height:28px;border:0;border-radius:999px;padding:3px;background:#cbd5e1;transition:.15s}.tgagg .toggle:before{content:"";display:block;width:22px;height:22px;border-radius:50%;background:#fff;transition:.15s;box-shadow:0 1px 2px rgba(0,0,0,.18)}.tgagg .toggle.on{background:var(--blue)}.tgagg .toggle.on:before{transform:translateX(20px)}
    .tgagg .role-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.tgagg .role-btn{border:1px solid #e5e7eb;border-radius:10px;padding:8px;background:#fff;color:#334155;font-size:13px;font-weight:800}.tgagg .role-btn.active{background:var(--blue);border-color:var(--blue);color:#fff}.tgagg .account-row{display:grid;gap:8px;padding:10px 0;border-top:1px solid #e5e7eb}.tgagg .account-row:first-child{border-top:0}.tgagg .account-name-line{display:flex;align-items:center;justify-content:space-between;gap:8px}.tgagg .account-name{font-weight:900;min-width:0}.tgagg .account-phone{color:var(--muted);font-size:12.5px;margin-top:2px}.tgagg .status{display:inline-flex;align-items:center;gap:5px;padding:4px 7px;border-radius:999px;font-size:11.5px;font-weight:900;white-space:nowrap;background:#e2e8f0;color:#334155}.tgagg .status.active{background:#dcfce7;color:#166534}.tgagg .status.needs_login{background:#ffedd5;color:#9a3412}.tgagg .status.disconnected{background:#e5e7eb;color:#374151}.tgagg .status.error{background:#fee2e2;color:#991b1b}.tgagg .account-actions{display:flex;gap:8px;flex-wrap:wrap}.tgagg .color-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}.tgagg .color-dot{position:relative;width:30px;height:30px;border-radius:50%;border:2px solid transparent;background:var(--dot-color,#ef4444);justify-self:center}.tgagg .color-dot.active{border-color:#111827;box-shadow:0 0 0 2px #fff inset}.tgagg .color-dot.locked{opacity:.62;cursor:not-allowed}.tgagg .color-dot.locked.active{border-color:#94a3b8}.tgagg .color-lock{position:absolute;right:-1px;bottom:-1px;width:14px;height:14px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.95);font-size:9px;line-height:1;box-shadow:0 1px 2px rgba(15,23,42,.18)}
    .tgagg .user-form{display:grid;grid-template-columns:1fr 110px;gap:8px;margin-bottom:10px}.tgagg .user-form input,.tgagg .user-form select{min-width:0;border:1px solid #e5e7eb;border-radius:10px;padding:9px 10px;background:#fff;color:var(--text);outline:0}.tgagg .user-form .btn{grid-column:1/-1}.tgagg .user-list{display:grid;gap:6px}.tgagg .user-row{display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:10px;padding:9px 0;border-top:1px solid #e5e7eb}.tgagg .user-row:first-child{border-top:0}.tgagg .user-row .btn{min-height:32px;padding:0 10px;font-size:12px}.tgagg .user-avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;overflow:hidden;background:linear-gradient(135deg,#7dd3fc,#2563eb);color:#fff;font-weight:900}.tgagg .user-avatar img{width:100%;height:100%;object-fit:cover;display:block}.tgagg .user-main{min-width:0}.tgagg .user-name-line{display:flex;align-items:center;gap:7px;min-width:0}.tgagg .user-name-line b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tgagg .role-badge{display:inline-flex;align-items:center;height:22px;padding:0 8px;border-radius:999px;font-size:11.5px;font-weight:900;white-space:nowrap}.tgagg .role-badge.admin{background:#dcfce7;color:#166534}.tgagg .role-badge.operator{background:#ffedd5;color:#9a3412}
    .tgagg .btn{border:0;border-radius:10px;min-height:38px;padding:0 12px;background:var(--blue);color:#fff;font-size:14px;font-weight:900}.tgagg .btn.secondary{background:#eef2f7;color:#334155}.tgagg .btn.danger{background:#fee2e2;color:#991b1b}.tgagg .btn.full{width:100%}
    .tgagg .delete-option{display:flex;align-items:flex-start;gap:9px;margin:14px 0;color:#334155;font-size:13px;font-weight:800;line-height:1.35}.tgagg .delete-option input{margin-top:2px}.tgagg .modal-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:14px}
    .tgagg .modal{position:fixed;left:50%;top:50%;width:min(420px,calc(100% - 28px));max-height:min(720px,calc(var(--app-height) - 28px));overflow:auto;transform:translate(-50%,-50%) scale(.98);opacity:0;pointer-events:none;z-index:120;background:#fff;border-radius:22px;box-shadow:0 18px 60px rgba(0,0,0,.22);transition:.16s}.tgagg .modal.open{opacity:1;pointer-events:auto;transform:translate(-50%,-50%) scale(1)}.tgagg .modal-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 16px 10px}.tgagg .modal-title{font-size:18px;font-weight:900}.tgagg .modal-body{padding:0 16px 16px}.tgagg .field{margin:12px 0}.tgagg .field label{display:block;margin-bottom:6px;color:#475569;font-size:13px;font-weight:900}.tgagg .field input{width:100%;border:1px solid #e5e7eb;border-radius:12px;padding:11px 12px;outline:0;background:#fff;color:var(--text)}.tgagg .field input:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(51,144,236,.14)}.tgagg .helper{color:var(--muted);font-size:12.5px;line-height:1.38}.tgagg .error-text{color:#b91c1c;background:#fee2e2;border-radius:12px;padding:9px 10px;margin-top:10px;font-size:13px;display:none}.tgagg .error-text.show{display:block}.tgagg .success-box{text-align:center;padding:18px 6px 8px}.tgagg .success-icon{width:72px;height:72px;margin:0 auto 12px;border-radius:50%;display:grid;place-items:center;background:#dcfce7;color:#166534;font-size:34px;font-weight:900}.tgagg .profile-modal{width:min(380px,calc(100% - 28px));min-height:380px;max-height:min(620px,calc(var(--app-height) - 28px))}.tgagg .profile-head{display:grid;justify-items:center;gap:8px;padding-top:4px}.tgagg .profile-avatar{width:72px;height:72px;border-radius:50%;overflow:hidden;display:grid;place-items:center;background:linear-gradient(135deg,#7dd3fc,#2563eb);color:#fff;font-size:24px;font-weight:900}.tgagg .profile-avatar img{width:100%;height:100%;object-fit:cover;display:block}.tgagg .profile-name{font-size:17px;font-weight:900;text-align:center;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tgagg .profile-copy-list{display:grid;gap:8px;margin-top:12px}.tgagg .profile-copy-row{display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid #e5e7eb;border-radius:12px;padding:8px 10px;background:#f8fafc}.tgagg .profile-copy-meta{min-width:0}.tgagg .profile-copy-label{font-size:11px;color:#64748b;font-weight:800;text-transform:uppercase;letter-spacing:.03em}.tgagg .profile-copy-value{font-size:13px;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:210px}.tgagg .copy-btn{min-height:30px;border:0;border-radius:10px;padding:0 10px;background:#e2e8f0;color:#334155;font-size:12px;font-weight:900}.tgagg .profile-note{margin-top:12px}.tgagg .profile-note textarea{width:100%;min-height:94px;border:1px solid #e5e7eb;border-radius:12px;padding:10px;outline:0;resize:vertical;font:inherit}.tgagg .profile-note textarea[readonly]{background:#f8fafc;color:#334155}.tgagg .profile-note-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:8px}.tgagg .profile-verify{margin-top:12px;padding:10px;border-radius:12px;border:1px solid #dcfce7;background:#f0fdf4;display:flex;align-items:center;justify-content:space-between;gap:8px}.tgagg .profile-verify-label{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:900;color:#166534}.tgagg .profile-verify-label .check{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#22c55e;color:#fff;font-size:12px}    .tgagg .profile-verify input{width:18px;height:18px}
    .tgagg .template-modal{width:min(440px,calc(100% - 28px));max-height:min(720px,calc(var(--app-height) - 28px))}
    .tgagg .template-slot{display:grid;gap:8px;padding:12px 0;border-top:1px solid #e5e7eb}.tgagg .template-slot:first-child{border-top:0;padding-top:0}
    .tgagg .template-slot-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
    .tgagg .template-slot-num{font-size:13px;font-weight:900;color:#64748b;min-width:18px}
    .tgagg .template-slot-text{flex:1;font-size:14px;line-height:1.4;white-space:pre-wrap;word-break:break-word}
    .tgagg .template-slot-actions{display:flex;gap:6px;flex-wrap:wrap}
    .tgagg .template-slot-actions .btn,.tgagg .template-slot-actions .mini-btn{min-height:32px;padding:0 10px;font-size:12px}
    .tgagg .template-add-row{display:flex;align-items:center;gap:10px;padding-top:8px}
    .tgagg .template-add-row textarea{flex:1;min-height:72px;border:1px solid #e5e7eb;border-radius:12px;padding:10px;outline:0;resize:vertical;font:inherit}
    .tgagg .notes-card-accent{width:10px;height:10px;border-radius:50%;background:var(--account-color,#64748b);display:inline-block;margin-right:6px}
    .tgagg .templates-sheet-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.28);opacity:0;pointer-events:none;transition:.18s;z-index:12}
    .tgagg .templates-sheet-backdrop.show{opacity:1;pointer-events:auto}
    .tgagg .templates-sheet{position:absolute;left:0;right:0;bottom:0;max-height:min(52vh,420px);background:#fff;border-radius:18px 18px 0 0;box-shadow:0 -10px 30px rgba(15,23,42,.18);transform:translateY(102%);transition:.22s;z-index:13;display:flex;flex-direction:column;padding-bottom:env(safe-area-inset-bottom)}
    .tgagg .templates-sheet.open{transform:translateY(0)}
    .tgagg .templates-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px 6px}
    .tgagg .templates-sheet-title{font-size:17px;font-weight:900}
    .tgagg .templates-sheet-sub{padding:0 16px 8px;color:var(--muted);font-size:12.5px}
    .tgagg .templates-sheet-list{flex:1;overflow-y:auto;padding:0 12px 12px;display:grid;gap:8px}
    .tgagg .template-pick-btn{width:100%;text-align:left;border:1px solid #e5e7eb;border-radius:12px;background:#f8fafc;padding:10px 12px;font-size:14px;line-height:1.35;white-space:pre-wrap;word-break:break-word}
    .tgagg .template-pick-btn:hover{background:#eef2f7}
    .tgagg #templateModalBackdrop{z-index:125}.tgagg #templateEditModal{z-index:130}
    .tgagg #globalTemplateModalBackdrop{z-index:125}.tgagg #globalTemplateEditModal{z-index:130}
    .tgagg .chat-header{min-height:56px;gap:8px;padding:6px 12px}.tgagg .header-avatar{width:36px;height:36px;font-size:13px;flex:0 0 36px}.tgagg .header-avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}.tgagg .header-info{min-width:0;flex:1}.tgagg .header-title{font-size:15px}.tgagg .header-subtitle{font-size:11.5px}    .tgagg .icon-action-btn{width:34px;height:34px;border:0;border-radius:50%;display:grid;place-items:center;background:#f1f5f9;color:#334155;font-size:16px;padding:0;flex:0 0 auto}.tgagg .icon-action-btn.primary{background:var(--blue);color:#fff}
    .tgagg .peer-accounts-anchor{position:relative;display:inline-flex;align-items:center;flex:0 0 auto}
    .tgagg .peer-accounts-indicator{width:34px;height:34px;border:0;border-radius:50%;display:grid;place-items:center;background:transparent;padding:0;cursor:pointer;flex:0 0 auto}
    .tgagg .peer-accounts-indicator[hidden]{display:none!important}
    .tgagg .peer-accounts-dot{width:12px;height:12px;border-radius:50%;background:#dc2626;box-shadow:0 0 0 4px rgba(220,38,38,.18);animation:tgaggPeerPulse 1.15s ease-in-out infinite}
    .tgagg .peer-accounts-indicator.is-open .peer-accounts-dot{animation:none;opacity:1;transform:scale(1.08)}
    @keyframes tgaggPeerPulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.82)}}
    .tgagg .peer-accounts-popover{position:absolute;top:calc(100% + 8px);right:0;min-width:min(260px,calc(100vw - 24px));max-width:320px;padding:8px;border-radius:14px;background:#fff;border:1px solid #e5e7eb;box-shadow:0 14px 36px rgba(15,23,42,.18);z-index:40}
    .tgagg .peer-accounts-popover[hidden]{display:none!important}
    .tgagg .peer-accounts-popover-title{padding:4px 8px 8px;font-size:12px;font-weight:900;color:#64748b;text-transform:uppercase;letter-spacing:.03em}
    .tgagg .peer-accounts-item{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;border:0;border-radius:10px;background:#fff;padding:10px 10px;text-align:left;font:inherit;cursor:pointer}
    .tgagg .peer-accounts-item:hover,.tgagg .peer-accounts-item:focus-visible{background:#f8fafc;outline:0}
    .tgagg .peer-accounts-item.is-current{background:#eff6ff}
    .tgagg .peer-accounts-item-label{font-size:14px;font-weight:900;line-height:1.25}
    .tgagg .peer-accounts-item-meta{font-size:11.5px;color:#94a3b8;white-space:nowrap}
    .tgagg .composer{flex-direction:column;align-items:stretch}.tgagg .composer-row{display:flex;align-items:center;gap:10px;width:100%}.tgagg .composer-row:has(.composer-box-multiline){align-items:flex-end}.tgagg .composer-preview{display:flex;flex-wrap:wrap;gap:8px;padding:0 12px 8px;width:100%}.tgagg .composer-preview[hidden]{display:none!important}.tgagg .composer-preview-item{position:relative;width:72px;height:72px;border-radius:10px;overflow:hidden;background:#e5e7eb}.tgagg .composer-preview-item img{width:100%;height:100%;object-fit:cover}.tgagg .composer-preview-item.template-ref{display:flex;align-items:center;justify-content:center;padding:6px;font-size:11px;text-align:center;color:#334155}.tgagg .composer-preview-remove{position:absolute;top:2px;right:2px;width:22px;height:22px;border:0;border-radius:50%;background:rgba(0,0,0,.55);color:#fff;font-size:14px;line-height:1}.tgagg .composer-preview-timer{position:absolute;right:4px;bottom:4px;width:20px;height:20px;border-radius:50%;background:rgba(15,23,42,.72);color:#fff;font-size:11px;line-height:20px;text-align:center;pointer-events:none;box-shadow:0 1px 4px rgba(0,0,0,.25)}.tgagg .composer-preview-voice{display:inline-flex;align-items:center;gap:8px;max-width:100%;padding:6px 10px 6px 6px;border-radius:999px;background:#e5e7eb}.tgagg .composer-preview-voice-play{width:32px;height:32px;border:0;border-radius:50%;background:#fff;color:#334155;font-size:12px;line-height:1;display:grid;place-items:center;cursor:pointer;box-shadow:0 1px 3px rgba(15,23,42,.12)}.tgagg .composer-preview-voice-label{font-size:13px;font-weight:700;color:#334155;white-space:nowrap}.tgagg .composer-preview-voice-duration{font-size:12px;color:#64748b;font-variant-numeric:tabular-nums;white-space:nowrap}.tgagg .composer-preview-voice .composer-preview-remove{position:static;width:22px;height:22px;flex:0 0 22px;margin-left:2px}.tgagg .composer-preview-voice audio{display:none}
    .tgagg .template-kind-toggle{display:flex;gap:8px;margin:8px 0}.tgagg .template-kind-toggle button{flex:1}.tgagg .template-photo-grid{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.tgagg .template-photo-thumb{width:64px;height:64px;border-radius:8px;object-fit:cover;background:#e5e7eb}.tgagg .global-template-title-input{width:100%;min-height:42px;border:1px solid #e5e7eb;border-radius:12px;padding:10px 12px;font-size:15px;margin-bottom:12px}
    .tgagg .chat-pane.global-templates-mode,.tgagg .chat-pane.broadcasts-mode{background:#f8fafc}.tgagg .chat-pane.global-templates-mode .empty-state,.tgagg .chat-pane.global-templates-mode .chat-header,.tgagg .chat-pane.global-templates-mode .messages,.tgagg .chat-pane.global-templates-mode .composer,.tgagg .chat-pane.global-templates-mode .note-panel,.tgagg .chat-pane.global-templates-mode .templates-sheet,.tgagg .chat-pane.global-templates-mode .templates-sheet-backdrop,.tgagg .chat-pane.broadcasts-mode .empty-state,.tgagg .chat-pane.broadcasts-mode .chat-header,.tgagg .chat-pane.broadcasts-mode .messages,.tgagg .chat-pane.broadcasts-mode .composer,.tgagg .chat-pane.broadcasts-mode .note-panel,.tgagg .chat-pane.broadcasts-mode .templates-sheet,.tgagg .chat-pane.broadcasts-mode .templates-sheet-backdrop{display:none!important}
    .tgagg .btn-compact{padding:6px 10px;font-size:12px;border-radius:10px}
    .tgagg .account-label-row{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
    .tgagg .account-label-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
    .tgagg .account-label-edit{display:grid;gap:8px}
    .tgagg .account-label-input{width:100%;border:1px solid #e5e7eb;border-radius:10px;padding:8px 10px;font:inherit}
    .tgagg .account-label-edit-actions{display:flex;gap:8px;flex-wrap:wrap}
    .tgagg .client-badge.positive-offer{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#16a34a;color:#fff;font-size:12px;font-weight:900;line-height:1}
    .tgagg .client-badge.negative-offer{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#dc2626;color:#fff;font-size:12px;font-weight:900;line-height:1}
    .tgagg .dialog-head-meta .client-badge.negative-offer{min-width:14px;height:14px;padding:0 4px;font-size:10px;font-weight:800;border-radius:999px}
    .tgagg .profile-offer,.tgagg .profile-hide,.tgagg .profile-block{margin-top:14px;padding-top:14px;border-top:1px solid #eef2f7}
    .tgagg .profile-offer-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:8px}
    .tgagg .profile-offer-side{display:flex;align-items:center;gap:8px}
    .tgagg .profile-offer-side-positive{justify-content:flex-start}
    .tgagg .profile-offer-side-negative{justify-content:flex-end}
    .tgagg .dialog-head-meta .client-badge.positive-offer{order:1}
    .tgagg .dialog-head-meta .client-badge.negative-offer{order:2}
    .tgagg .dialog-head-meta .client-badge.verified{order:3}
    .tgagg .dialog-head-meta .dialog-time{order:4}
    .tgagg .positive-offer-btn,.tgagg .negative-offer-btn{min-width:72px;color:#fff;font-weight:800}
    .tgagg .positive-offer-btn{background:#16a34a;border-color:#16a34a}
    .tgagg .negative-offer-btn{background:#dc2626;border-color:#dc2626}
    .tgagg .profile-offer-count{min-width:28px;height:28px;font-size:14px}
    .tgagg .offer-entry-list{display:grid;gap:10px;margin-top:12px;max-height:240px;overflow:auto}
    .tgagg .offer-entry-card{padding:12px 14px;border-radius:14px;border:1px solid rgba(15,23,42,.06)}
    .tgagg .offer-entry-card.offer-entry-positive{background:linear-gradient(135deg,#ecfdf5 0%,#d1fae5 100%)}
    .tgagg .offer-entry-card.offer-entry-negative{background:linear-gradient(135deg,#fef2f2 0%,#fee2e2 100%)}
    .tgagg .offer-entry-heading{font-size:13px;font-weight:900;text-transform:uppercase;letter-spacing:.03em;line-height:1.35}
    .tgagg .offer-entry-positive .offer-entry-heading{color:#15803d}
    .tgagg .offer-entry-negative .offer-entry-heading{color:#b91c1c}
    .tgagg .offer-entry-comment{margin-top:6px;font-size:13px;line-height:1.4;color:#334155;white-space:pre-wrap;word-break:break-word;font-style:italic}
    .tgagg .offer-entry-comment.is-empty{color:#94a3b8}
    .tgagg .offer-entry-author{margin-top:8px;font-size:12px;font-weight:700;color:#64748b}
    .tgagg .offer-field-label{display:block;margin:12px 0 6px;color:#475569;font-size:13px;font-weight:900}
    .tgagg .offer-field-label:first-child{margin-top:0}
    .tgagg .offer-field-input,.tgagg .offer-field-textarea{width:100%;border:1px solid #e5e7eb;border-radius:12px;padding:11px 12px;outline:0;background:#fff;color:var(--text);font:inherit;resize:vertical}
    .tgagg .offer-field-input:focus,.tgagg .offer-field-textarea:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(51,144,236,.14)}
    .tgagg .offer-entry-form-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:16px}
    .tgagg .offer-entry-form-modal.positive .modal-title{color:#15803d}
    .tgagg .offer-entry-form-modal.negative .modal-title{color:#b91c1c}
    .tgagg .offer-entry-form-modal.positive #saveOfferEntryBtn{background:#16a34a;border-color:#16a34a}
    .tgagg .offer-entry-empty{font-size:13px;color:#94a3b8;padding:4px 2px}
    .tgagg .profile-block-actions{display:grid;gap:8px;margin-top:8px}
    .tgagg .profile-block-delete{margin-top:10px}
    .tgagg .profile-hide-hint{margin-top:8px}
    .tgagg .profile-offer-badge{margin-left:6px;vertical-align:middle}
    .tgagg .drawer-notify{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 16px 12px;padding:12px 14px;border:1px solid #e5e7eb;border-radius:12px;background:#f8fafc;cursor:pointer;user-select:none}
    .tgagg .drawer-notify-label{font-size:15px;font-weight:600;color:var(--text)}
    .tgagg .drawer-notify input{width:18px;height:18px;cursor:pointer;flex:0 0 auto}
    @media(min-width:861px){.tgagg .app{grid-template-columns:min(420px,34vw) minmax(0,1fr)}}
    @media(max-width:860px){.tgagg .app{display:block;overflow:hidden;background:var(--side)}.tgagg .sidebar{position:fixed;inset:0;width:100%;height:var(--app-height);min-height:0;overflow:hidden;transform:translateX(0);transition:.22s;box-shadow:none;border-right:0;z-index:30}.tgagg .app.chat-open .sidebar{transform:translateX(-102%)}.tgagg .chat-pane{position:fixed;inset:0;width:100%;height:var(--app-height);min-height:0;overflow:hidden;z-index:20}.tgagg .app:not(.chat-open) .chat-pane,.tgagg .chat-pane.empty{display:none}.tgagg .topbar{padding-top:calc(8px + env(safe-area-inset-top))}.tgagg .dialog-list{padding-bottom:calc(16px + env(safe-area-inset-bottom))}.tgagg .dialog-card{grid-template-columns:40px minmax(0,1fr);margin:4px 8px;padding:7px 9px;border-radius:12px}.tgagg .avatar{width:40px;height:40px;font-size:14px}.tgagg .back-btn{display:grid}.tgagg .chat-header{min-height:calc(58px + env(safe-area-inset-top));padding:calc(8px + env(safe-area-inset-top)) 10px 8px}.tgagg .header-actions .mini-btn:not(.primary):not(.header-visible){display:none}.tgagg .messages{padding:14px 10px 10px}.tgagg .message{max-width:88%;font-size:14.5px}.tgagg .quick-replies{padding:7px 10px 0}.tgagg .note-panel{margin:0 10px 8px}.tgagg .composer{padding:8px 8px calc(10px + env(safe-area-inset-bottom));gap:8px}.tgagg .composer-box{min-height:46px;border-radius:17px;padding-left:8px}.tgagg .send-btn{width:46px;height:46px}}
    .tgagg .qr-box{display:grid;justify-items:center;gap:12px;margin:14px 0 8px;padding:14px;border-radius:16px;background:#f8fafc;border:1px solid #e5e7eb}.tgagg .qr-box img{width:260px;max-width:100%;height:auto;border-radius:12px;background:#fff}

.tgagg .message-wrap{display:flex;flex-direction:column;align-items:stretch;width:fit-content;max-width:min(590px,84%);cursor:default}.tgagg .message-wrap{-webkit-touch-callout:none;touch-action:manipulation;user-select:none}
.tgagg .message-wrap audio,.tgagg .message-wrap video,.tgagg .message-wrap a{pointer-events:auto;touch-action:auto;-webkit-user-select:auto;user-select:auto}
.tgagg .media-audio-block{pointer-events:auto}
.tgagg .media-voice-player{display:flex;align-items:center;gap:10px;min-width:220px;max-width:min(280px,100%);padding:8px 10px;border-radius:14px;background:rgba(51,144,236,.12);pointer-events:auto}
.tgagg .message.out .media-voice-player{background:rgba(51,144,236,.16)}
.tgagg .media-voice-play{width:38px;height:38px;border:0;border-radius:50%;display:grid;place-items:center;background:var(--blue);color:#fff;font-size:13px;line-height:1;cursor:pointer;flex:0 0 38px;box-shadow:0 1px 4px rgba(51,144,236,.28)}
.tgagg .media-voice-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
.tgagg .media-voice-track{cursor:pointer;padding:4px 0}
.tgagg .media-voice-progress{height:4px;border-radius:999px;background:rgba(51,144,236,.18);overflow:hidden}
.tgagg .media-voice-progress-fill{height:100%;width:0;border-radius:inherit;background:var(--blue);transition:width .08s linear}
.tgagg .media-voice-meta{display:flex;align-items:center;justify-content:space-between;gap:8px}
.tgagg .media-voice-time{font-size:12px;font-weight:700;color:#475569;font-variant-numeric:tabular-nums;white-space:nowrap}
.tgagg .media-voice-speed{border:0;border-radius:999px;padding:3px 8px;background:rgba(255,255,255,.82);color:var(--blue);font-size:12px;font-weight:900;line-height:1;cursor:pointer;white-space:nowrap}
.tgagg .media-voice-speed:hover{background:#fff}
.tgagg .media-voice-audio{display:none!important}
.tgagg .message.message-media .media-voice-player{margin:2px 0}
.tgagg .media-frame{position:relative;display:block;overflow:hidden;border-radius:12px;background:rgba(0,0,0,.06);min-height:72px}
.tgagg .media-frame .media-photo,.tgagg .media-frame .media-album-photo,.tgagg .media-frame .media-sticker,.tgagg .media-frame .media-gif,.tgagg .media-frame .media-video{position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;min-height:0;object-fit:cover;border-radius:0}
.tgagg .media-album-item .media-frame{width:100%;height:100%;min-height:72px;border-radius:0}
.tgagg .media-sticker-frame .media-sticker{object-fit:contain;background:transparent}
.tgagg .media-video-note-frame{border-radius:50%;width:190px!important;height:190px!important;max-width:190px;aspect-ratio:1/1!important;min-height:190px}
.tgagg .media-video-note-frame .media-video-note{border-radius:50%}
.tgagg .media-frame:not(.media-loaded)::after{content:"";position:absolute;inset:0;background:linear-gradient(110deg,rgba(255,255,255,0) 30%,rgba(255,255,255,.28) 50%,rgba(255,255,255,0) 70%);background-size:200% 100%;animation:tgagg-media-shimmer 1.2s linear infinite;pointer-events:none}
.tgagg .media-frame.media-loaded::after{display:none}
.tgagg .message.message-media .media-file{display:flex;align-items:center;gap:9px;max-width:min(280px,100%);padding:10px 11px;border-radius:12px;background:rgba(255,255,255,.92);color:#1e3a5f;text-decoration:none;font-weight:800;box-shadow:0 1px 2px rgba(15,23,42,.08)}
.tgagg .message.message-media .media-file-icon{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:rgba(51,144,236,.12);color:#1d4ed8;flex:0 0 auto;font-size:11px;text-transform:lowercase}
.tgagg .message.message-media .media-file-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tgagg .message.message-media .media-note{min-height:52px;display:flex;align-items:center;padding:10px 12px;border-radius:12px;background:rgba(255,255,255,.86);color:#64748b;font-size:13px}
.tgagg .message.message-media .media-caption{padding:6px 9px 4px;border-radius:0 0 13px 13px;background:var(--incoming);box-shadow:0 1px 1px rgba(0,0,0,.08);white-space:pre-wrap;word-break:break-word}
.tgagg .message.out.message-media .media-caption{background:var(--outgoing);border-bottom-right-radius:4px}
.tgagg .message.in.message-media .media-caption{border-bottom-left-radius:4px}
.tgagg .message.message-media .reply-quote{margin:0 0 4px}
.tgagg .message.message-media .media-file{min-height:54px;box-sizing:border-box}
.tgagg .media-file{min-height:54px;box-sizing:border-box}
.tgagg .messages-load-indicator{align-self:center;display:grid;place-items:center;padding:6px 0 10px;min-height:40px}
.tgagg .messages-load-spinner{width:28px;height:28px;border:3px solid rgba(51,144,236,.18);border-top-color:var(--blue);border-radius:50%;animation:tgagg-spin .8s linear infinite}
.tgagg .media-photo-open{border:0;padding:0;background:transparent;cursor:zoom-in;text-align:inherit;font:inherit;color:inherit}
.tgagg .media-album-item.media-photo-open{display:block;width:100%}
.tgagg .photo-lightbox,
.photo-lightbox{position:fixed;inset:0;z-index:6000;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100vw;height:100vh;height:100dvh;height:var(--app-height,100dvh);max-width:100vw;max-height:100vh;max-height:100dvh;max-height:var(--app-height,100dvh);padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));overflow:hidden;background:rgba(0,0,0,.92);backdrop-filter:blur(4px)}
.tgagg .photo-lightbox[hidden],
.photo-lightbox[hidden]{display:none!important}
.tgagg .photo-lightbox-img,
.photo-lightbox-img{display:block;box-sizing:border-box;width:auto;height:auto;max-width:100%;max-height:100%;max-width:min(100%,calc(100vw - 32px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px)));max-height:min(100%,calc(100vh - 32px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)));max-height:min(100%,calc(100dvh - 32px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)));max-height:min(100%,calc(var(--app-height,100dvh) - 32px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)));object-fit:contain;object-position:center;flex:0 1 auto;min-width:0;min-height:0;user-select:none;-webkit-user-drag:none}
.tgagg .photo-lightbox-close,
.photo-lightbox-close{position:absolute;top:max(12px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));width:42px;height:42px;border:0;border-radius:50%;background:rgba(255,255,255,.14);color:#fff;font-size:22px;line-height:1;cursor:pointer;z-index:1}
body.photo-lightbox-open{overflow:hidden}
@keyframes tgagg-spin{to{transform:rotate(360deg)}}
@keyframes tgagg-media-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
.tgagg .message-wrap.in{align-self:flex-start;margin-right:auto;margin-left:0}
.tgagg .message-wrap.out{align-self:flex-end;margin-left:auto;margin-right:0}
.tgagg .message-wrap > .message.in,.tgagg .message-wrap > .message.out{align-self:auto}
.tgagg .message-wrap.menu-open .message{box-shadow:0 0 0 2px rgba(51,144,236,.35)}
.tgagg .message-wrap .message{max-width:100%}.tgagg .message{position:relative}
.tgagg .reply-quote{display:grid;gap:1px;margin:1px 0 5px;padding:4px 7px;border-left:3px solid #38bdf8;border-radius:8px;background:rgba(14,165,233,.12);font-size:12.5px;line-height:1.25;color:#334155;overflow:hidden}
.tgagg .reply-quote b{color:#0284c7;font-size:12px}
.tgagg .reply-quote span{display:block;max-width:260px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tgagg .composer-reply[hidden],.tgagg .composer-edit[hidden]{display:none!important}
.tgagg .composer-reply,.tgagg .composer-edit{padding:0 54px 0 8px}
.tgagg .reply-preview-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 10px;border-radius:13px;background:rgba(255,255,255,.78);box-shadow:0 1px 4px rgba(15,23,42,.08);border-left:3px solid #38bdf8;color:#334155}
.tgagg .edit-preview-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 10px;border-radius:13px;background:rgba(255,255,255,.78);box-shadow:0 1px 4px rgba(15,23,42,.08);border-left:3px solid #f59e0b;color:#334155}
.tgagg .edit-preview-bar b{font-size:12px;color:#d97706}
.tgagg .reply-preview-bar div{min-width:0;display:grid;gap:1px}
.tgagg .reply-preview-bar b{font-size:12px;color:#0284c7}
.tgagg .reply-preview-bar span{font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tgagg .reply-preview-bar button,.tgagg .edit-preview-bar button{width:24px;height:24px;border:0;border-radius:50%;background:#e5e7eb;color:#475569;font-size:18px;line-height:1;cursor:pointer}
.tgagg .composer.composer-editing .attach-btn-hidden,.tgagg .composer.composer-editing #attachBtn,.tgagg .composer.composer-editing #voiceBtn{display:none}
.tgagg .message-edited-label{margin-right:2px;color:#6b7280;font-size:10.5px;font-weight:700}
.tgagg .message-read-status{display:inline-flex;align-items:center;flex:0 0 auto;line-height:1;vertical-align:middle}
.tgagg .message-read-status svg{display:block;overflow:visible}
.tgagg .message-read-status.sent{color:#9ca3af}
.tgagg .message-read-status.read{color:var(--blue)}
.tgagg .message-context-menu,#messageContextMenu.message-context-menu{position:fixed;z-index:10000;min-width:148px;padding:6px;border-radius:12px;background:#fff;box-shadow:0 12px 34px rgba(15,23,42,.2);border:1px solid rgba(148,163,184,.28);animation:tgaggMenuIn .12s ease-out}
@keyframes tgaggMenuIn{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}
.tgagg .message-context-menu button,#messageContextMenu.message-context-menu button{width:100%;border:0;background:transparent;border-radius:9px;padding:9px 12px;text-align:left;color:#1f2937;font-size:14px;font-weight:800;cursor:pointer;white-space:nowrap}
.tgagg .message-context-menu button:hover,.tgagg .message-context-menu button:focus-visible,#messageContextMenu.message-context-menu button:hover,#messageContextMenu.message-context-menu button:focus-visible{background:#f1f5f9;outline:none}
.tgagg .message-context-menu button.danger,#messageContextMenu.message-context-menu button.danger{color:#dc2626}
@media(max-width:860px){.tgagg .message-wrap{max-width:91%}.tgagg .composer-reply,.tgagg .composer-edit{padding:0 48px 0 6px}}

.tgagg .message-wrap .message.message-media{max-width:min(320px,100%)}
.tgagg .message-wrap .message.message-media-album{max-width:min(300px,100%);width:fit-content}

/* Compact message layout overrides. */
.tgagg .message-wrap{max-width:min(590px,82%)}
.tgagg .message{padding:4px 7px 4px;border-radius:11px;line-height:1.26}
.tgagg .message-head{margin-bottom:1px;font-size:11.5px;line-height:1.15}
.tgagg .message-time{margin-left:7px;margin-top:1px;font-size:11px;line-height:1.1}
.tgagg .messages{gap:5px;padding-left:9px;padding-right:9px}
.tgagg .reply-quote{margin:0 0 4px;padding:3px 6px;border-radius:7px;font-size:12px;line-height:1.18}
.tgagg .reply-quote b{font-size:11.5px}
@media(max-width:860px){.tgagg .message-wrap{max-width:90%}.tgagg .message{padding:4px 7px 4px}}

/* Voice recording button inside composer. */
    .tgagg .composer-box textarea{min-width:0}
    .tgagg .message-premium-emoji{display:inline-block;padding:0 1px;border-radius:4px;background:linear-gradient(120deg,rgba(255,215,0,.18),rgba(255,105,180,.14));box-shadow:inset 0 0 0 1px rgba(255,193,7,.25)}
.tgagg .voice-btn{width:34px;height:34px;border:1px solid #cbd5e1;border-radius:50%;display:grid;place-items:center;flex:0 0 34px;background:#fff;color:#475569;font-size:16px;touch-action:none;user-select:none}
.tgagg .voice-btn.recording{border-color:#ef4444;background:#fee2e2;color:#dc2626;box-shadow:0 0 0 4px rgba(239,68,68,.16)}
.tgagg .voice-btn:disabled{opacity:.55}
@media(max-width:860px){.tgagg .voice-btn{width:32px;height:32px;flex-basis:32px}}

.tgagg .voice-btn.recording{animation:tgaggVoicePulse 1s ease-in-out infinite}
.tgagg .voice-btn.processing{pointer-events:none;border-color:#3b82f6;background:#eff6ff;color:#2563eb;box-shadow:none}
.tgagg .voice-btn.processing::after{content:"";width:16px;height:16px;border:2px solid rgba(37,99,235,.22);border-top-color:#2563eb;border-radius:50%;animation:tgaggVoiceSpin .75s linear infinite}
.tgagg .voice-btn.processing svg,.tgagg .voice-btn.processing{font-size:0}
@keyframes tgaggVoiceSpin{to{transform:rotate(360deg)}}
@keyframes tgaggVoicePulse{0%,100%{transform:scale(1);box-shadow:0 0 0 4px rgba(239,68,68,.16)}50%{transform:scale(1.08);box-shadow:0 0 0 8px rgba(239,68,68,.08)}}

.tgagg .voice-cancel-btn{width:30px;height:30px;border:1px solid #fecaca;border-radius:50%;display:grid;place-items:center;flex:0 0 30px;background:#fff1f2;color:#dc2626;font-size:20px;font-weight:800;line-height:1;cursor:pointer}
.tgagg .voice-cancel-btn[hidden]{display:none!important}
.tgagg .voice-cancel-btn:hover{background:#ffe4e6;border-color:#fca5a5}

.tgagg .broadcast-draft{margin-bottom:14px;background:#fff}.tgagg .broadcast-target-list{display:grid;gap:8px;margin:10px 0}.tgagg .broadcast-target-list.broadcast-target-check-list{max-height:min(340px,calc(var(--app-height) - 280px));overflow:auto;padding-right:2px}.tgagg .broadcast-target-check.in-pack{background:#f1f5f9;border-color:#dbe3ee;color:#64748b;cursor:pointer}
.tgagg .broadcast-target-check.in-pack:hover{background:#e8eef4}
.tgagg .broadcast-target-check.in-pack.selected{background:#e2e8f0;border-color:#cbd5e1}
.tgagg .broadcast-target-check.in-pack .broadcast-target-main b,.tgagg .broadcast-target-check.in-pack .broadcast-target-check-body>span{color:#64748b}
.tgagg .broadcast-target-check.in-pack input[type=checkbox]{cursor:pointer}
.tgagg .broadcast-target-section-label{margin:10px 0 6px;color:#64748b;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.tgagg .broadcast-pack-section{display:grid;gap:8px;margin-bottom:12px;padding-bottom:12px;border-bottom:1px solid #e5e7eb}
.tgagg .broadcast-pack-section-title{color:#475569;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.tgagg .broadcast-pack-list{display:grid;gap:8px}
.tgagg .broadcast-pack-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:stretch}
.tgagg .broadcast-pack-btn{display:grid;gap:2px;width:100%;border:1px solid #dbeafe;border-radius:12px;background:#eff6ff;padding:10px 12px;text-align:left;color:#1e3a8a;cursor:pointer}
.tgagg .broadcast-pack-btn:hover{background:#dbeafe}
.tgagg .broadcast-pack-title{font-size:14px;font-weight:800;line-height:1.25;word-break:break-word}
.tgagg .broadcast-pack-meta{font-size:12px;font-weight:700;color:#64748b}
.tgagg .broadcast-pack-menu-wrap{position:relative;display:flex;align-items:stretch}
.tgagg .broadcast-pack-menu-btn{width:42px;border:1px solid #e5e7eb;border-radius:12px;background:#fff;color:#475569;font-size:22px;line-height:1;cursor:pointer;padding:0}
.tgagg .broadcast-pack-menu-btn:hover{background:#f8fafc}
.tgagg .broadcast-pack-menu{position:absolute;top:calc(100% + 6px);right:0;min-width:148px;border:1px solid #e5e7eb;border-radius:12px;background:#fff;box-shadow:0 10px 24px rgba(15,23,42,.12);padding:6px;display:grid;gap:4px;z-index:20}
.tgagg .broadcast-pack-menu[hidden]{display:none!important}
.tgagg .broadcast-pack-menu button{width:100%;border:0;border-radius:8px;background:transparent;padding:9px 10px;text-align:left;font:inherit;font-size:13px;font-weight:700;color:#334155;cursor:pointer}
.tgagg .broadcast-pack-menu button:hover{background:#f8fafc}
.tgagg .broadcast-pack-menu button.danger-text{color:#dc2626}
.tgagg .broadcast-target-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:8px 0 6px;flex-wrap:wrap}.tgagg .broadcast-target-counter{color:#64748b;font-size:12.5px;font-weight:700}.tgagg .broadcast-target-check{display:flex;align-items:flex-start;gap:10px;width:100%;border:1px solid #e5e7eb;border-radius:12px;background:#f8fafc;padding:10px 12px;color:#111827;cursor:pointer}.tgagg .broadcast-target-check:hover{background:#eef2f7}.tgagg .broadcast-target-check.selected{border-color:#93c5fd;background:#eff6ff}.tgagg .broadcast-target-check.disabled,.tgagg .broadcast-target-check.busy{opacity:.58;cursor:not-allowed;background:#f1f5f9}.tgagg .broadcast-target-check.busy{border-color:#bbf7d0;background:#f0fdf4}.tgagg .broadcast-target-check input[type=checkbox]{margin-top:3px;flex:0 0 auto}.tgagg .broadcast-target-check-body{display:grid;gap:3px;min-width:0;flex:1}.tgagg .broadcast-target-btn{width:100%;border:1px solid #e5e7eb;border-radius:12px;background:#f8fafc;padding:10px 12px;text-align:left;display:grid;gap:3px;color:#111827}.tgagg .broadcast-target-btn:hover{background:#eef2f7}.tgagg .broadcast-target-btn:disabled,.tgagg .broadcast-target-btn.busy{opacity:.58;cursor:not-allowed;background:#f1f5f9}.tgagg .broadcast-target-btn.busy{border-color:#bbf7d0;background:#f0fdf4}.tgagg .broadcast-target-btn.busy:hover{background:#f0fdf4}.tgagg .broadcast-target-main{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.tgagg .broadcast-target-main b{min-width:0;word-break:break-word}.tgagg .broadcast-target-busy-mark{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;background:#22c55e;color:#fff;font-size:13px;font-weight:800;flex:0 0 22px}.tgagg .broadcast-target-btn span,.tgagg .broadcast-target-check-body>span{color:#64748b;font-size:12.5px}.tgagg .broadcast-selected-summary{margin-bottom:2px;padding:10px 12px;border:1px solid #dbeafe;border-radius:12px;background:#eff6ff;color:#1e3a8a;font-size:13px;font-weight:700}.tgagg .broadcast-selected-list{margin-top:6px;color:#475569;font-size:12px;font-weight:600;line-height:1.4;word-break:break-word}.tgagg .broadcast-textarea{width:100%;min-height:110px;border:1px solid #e5e7eb;border-radius:12px;padding:10px 12px;resize:vertical;font:inherit}
.tgagg .broadcast-photo-section{display:grid;gap:10px;margin:10px 0 4px}
.tgagg .broadcast-photo-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.tgagg .broadcast-photo-add-btn{cursor:pointer;margin:0}
.tgagg .broadcast-photo-preview-grid{display:flex;flex-wrap:wrap;gap:8px}
.tgagg .broadcast-photo-preview-item{position:relative;width:72px;height:72px;border-radius:10px;overflow:hidden;background:#e5e7eb;flex:0 0 72px;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
.tgagg .broadcast-photo-preview-item.dragging{opacity:.58;cursor:grabbing;z-index:2;transform:scale(.96)}
.tgagg .broadcast-photo-preview-item.drag-over{outline:2px solid #3390ec;outline-offset:1px}
.tgagg .broadcast-photo-preview-item img{width:100%;height:100%;object-fit:cover;display:block;pointer-events:none;-webkit-user-drag:none}
.tgagg .broadcast-photo-preview-remove{position:absolute;top:2px;right:2px;width:22px;height:22px;border:0;border-radius:50%;background:rgba(0,0,0,.55);color:#fff;font-size:14px;line-height:1;cursor:pointer;padding:0;z-index:3}
.tgagg .broadcast-buttons-section{display:grid;gap:8px;margin:8px 0 4px}
.tgagg .broadcast-button-list{display:grid;gap:6px}
.tgagg .broadcast-button-row{display:flex;align-items:center;gap:8px;border:1px solid #e5e7eb;border-radius:10px;background:#f8fafc;padding:8px 10px}
.tgagg .broadcast-button-preview{flex:1;min-width:0;font-size:13px;font-weight:700;color:#334155;word-break:break-word}
.tgagg .broadcast-button-remove{width:28px;height:28px;border:0;border-radius:8px;background:#fee2e2;color:#dc2626;font-size:16px;line-height:1;cursor:pointer;padding:0;flex:0 0 auto}
.tgagg .broadcast-button-form{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) minmax(110px,.8fr) auto;gap:8px;align-items:center}
.tgagg .broadcast-button-form input,.tgagg .broadcast-button-form select{width:100%;border:1px solid #e5e7eb;border-radius:10px;padding:10px 12px;font:inherit;font-size:14px;background:#fff}
.tgagg .broadcast-button-style-chip{width:14px;height:14px;border-radius:4px;border:1px solid rgba(15,23,42,.12);flex:0 0 auto}
.tgagg .broadcast-button-style-chip.style-default{background:#f8fafc}
.tgagg .broadcast-button-style-chip.style-primary{background:#3390ec;border-color:#2563eb}
.tgagg .broadcast-button-style-chip.style-success{background:#31b545;border-color:#15803d}
.tgagg .broadcast-button-style-chip.style-danger{background:#e53935;border-color:#b91c1c}
@media (max-width:640px){.tgagg .broadcast-button-form{grid-template-columns:1fr}.tgagg .broadcast-button-form .btn{width:100%}}
.tgagg .broadcast-form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}
.tgagg .broadcast-form-grid select{width:100%;border:1px solid #e5e7eb;border-radius:12px;padding:10px 12px;background:#fff}
.tgagg .broadcast-inline-inputs{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.tgagg .broadcast-inline-inputs input{width:100%;border:1px solid #e5e7eb;border-radius:12px;padding:10px 12px;background:#fff}
.tgagg .broadcast-inline-inputs select{width:auto;min-width:72px;border:1px solid #e5e7eb;border-radius:12px;padding:10px 12px;background:#fff}
.tgagg .broadcast-text{margin-top:8px;padding:9px 10px;border-radius:12px;background:#fff;white-space:pre-wrap;word-break:break-word;color:#334155;font-size:13px}

.tgagg .broadcast-next-times{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin-top:8px;color:#64748b;font-size:12.5px}.tgagg .broadcast-next-times span{display:inline-flex;padding:3px 7px;border-radius:999px;background:#e0f2fe;color:#075985;font-weight:700}

.tgagg .overlay-fab-stack{position:fixed;right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom));z-index:180;display:flex;flex-direction:column;align-items:flex-end;gap:10px;pointer-events:none}
.tgagg .overlay-fab-stack[hidden]{display:none!important}
.tgagg .overlay-fab-stack > *{pointer-events:auto}
.tgagg .overlay-save-fab{min-height:44px;padding:10px 16px;border-radius:999px;box-shadow:0 8px 24px rgba(51,144,236,.22);white-space:nowrap;font-size:14px;font-weight:800}
.tgagg .overlay-save-fab[hidden]{display:none!important}
.tgagg .settings-head-account-actions{display:flex;gap:8px;flex-wrap:nowrap;align-items:stretch;width:100%;max-width:520px}
.tgagg .settings-head-account-actions .btn{flex:1 1 0;min-width:0;white-space:nowrap;padding-left:10px;padding-right:10px;font-size:13px;display:inline-flex;align-items:center;justify-content:center;text-align:center}
.tgagg .settings-metrics{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px;padding:14px 16px;border-radius:16px;background:linear-gradient(135deg,#eff6ff,#f8fafc);border:1px solid #dbeafe}
.tgagg .settings-metric-main{display:grid;gap:2px;min-width:0}
.tgagg .settings-metric-value{font-size:28px;font-weight:900;line-height:1;color:#0f172a}
.tgagg .settings-metric-label{font-size:12.5px;font-weight:700;color:#64748b}
.tgagg .settings-metric-split{display:flex;gap:8px;flex:0 0 auto}
.tgagg .settings-metric-pill{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border-radius:999px;background:#fff;border:1px solid #e2e8f0;color:#334155;font-size:13px;font-weight:800}
.tgagg .settings-accounts-grid{display:grid;gap:10px}
.tgagg .settings-account-accordion{border:1px solid #e5e7eb;border-radius:16px;background:#fff;overflow:hidden;box-shadow:0 4px 14px rgba(15,23,42,.05)}
.tgagg .settings-account-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 14px;border:0;background:#f8fafc;color:inherit;text-align:left;cursor:pointer}
.tgagg .settings-account-toggle-main{display:flex;align-items:center;gap:10px;min-width:0;flex:1}
.tgagg .settings-account-toggle-text{display:grid;gap:2px;min-width:0}
.tgagg .settings-account-toggle-phone{font-size:15px;font-weight:900;color:#0f172a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tgagg .settings-account-toggle-label{font-size:12.5px;font-weight:700;color:#64748b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tgagg .settings-account-toggle-meta{display:inline-flex;align-items:center;gap:8px;flex:0 0 auto}
.tgagg .settings-account-chevron{display:grid;place-items:center;width:24px;height:24px;border-radius:999px;background:#e2e8f0;color:#475569;font-size:18px;line-height:1;transition:transform .18s}
.tgagg .settings-account-accordion.is-open .settings-account-chevron{transform:rotate(90deg)}
.tgagg .settings-account-body[hidden]{display:none!important}
.tgagg .settings-account-body{padding:0 8px 8px}
.tgagg .settings-account-card{margin:0;border:0;border-radius:12px;background:#f8fafc;box-shadow:none}
.tgagg .overlay-back-fab{position:static;right:auto;bottom:auto}
.tgagg .overlay-back-fab{width:52px;height:52px;border:2px solid #3390ec;border-radius:50%;background:#fff;color:#3390ec;font-size:28px;line-height:1;display:grid;place-items:center;cursor:pointer;box-shadow:0 8px 24px rgba(51,144,236,.22);transition:transform .15s,background .15s,color .15s}
.tgagg .overlay-back-fab[hidden]{display:none!important}
.tgagg .overlay-back-fab span{display:block;margin-right:2px;margin-top:-1px}
.tgagg .overlay-back-fab:hover{background:#3390ec;color:#fff}
.tgagg .overlay-back-fab:active{transform:scale(.96)}

.tgagg .broadcast-window-head-main{display:grid;gap:4px;min-width:0;flex:1}
.tgagg .broadcast-window-title-row{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px 12px;min-width:0}
.tgagg .broadcast-window-stats{color:#64748b;font-size:13px;font-weight:700;line-height:1.3;white-space:nowrap}
.tgagg .broadcast-window-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto;flex-wrap:wrap;justify-content:flex-end}
.tgagg .settings-window-head .broadcast-window-actions .btn{white-space:nowrap}
.tgagg .broadcast-round-stack{display:grid;gap:12px}
.tgagg .broadcast-round-block{display:grid;gap:8px}
.tgagg .broadcast-round-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:0 2px}
.tgagg .broadcast-round-title{font-size:13.5px;font-weight:800;color:#0f172a}
.tgagg .broadcast-round-sub{color:#64748b;font-size:12px;line-height:1.35;margin-top:2px}
.tgagg .broadcast-round-head-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.tgagg .broadcast-account-block{background:#fff;border:1px solid #cbd5e1;border-left:4px solid var(--account-color,#3390ec);border-radius:16px;padding:16px;box-shadow:0 8px 24px rgba(15,23,42,.08)}
.tgagg .broadcast-account-head{display:flex;align-items:flex-start;gap:10px;margin-bottom:14px;padding-bottom:12px;border-bottom:1px solid #e5e7eb}
.tgagg .broadcast-account-head-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.tgagg .broadcast-stop-all-btn{white-space:nowrap}
.tgagg .broadcast-account-head-main{min-width:0;flex:1}
.tgagg .broadcast-account-add-btn{flex:0 0 32px;width:32px;height:32px;border:0;border-radius:50%;background:#3390ec;color:#fff;font-size:24px;line-height:1;cursor:pointer;display:grid;place-items:center;padding:0;box-shadow:0 4px 12px rgba(51,144,236,.28);transition:transform .15s,background .15s}
.tgagg .broadcast-account-add-btn:hover{background:#2b7fd4}
.tgagg .broadcast-account-add-btn:active{transform:scale(.96)}
.tgagg .broadcast-account-dot{width:12px;height:12px;border-radius:50%;background:var(--account-color,#3390ec);margin-top:5px;flex:0 0 12px}
.tgagg .broadcast-account-title{font-size:16px;font-weight:800;color:#111827;line-height:1.25}
.tgagg .broadcast-account-sub{margin-top:3px;color:#64748b;font-size:12.5px}
.tgagg .settings-grid.broadcast-groups-grid{display:grid;gap:18px;grid-template-columns:minmax(0,1fr)}
.tgagg .broadcast-compact-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px;align-items:start;background:#eef2f7;border:1px solid #dbe3ee;border-radius:12px;padding:10px}
.tgagg .broadcast-compact-card{border:1px solid #cbd5e1;border-radius:12px;background:#fff;padding:11px 12px;display:grid;gap:7px;min-width:0;height:100%;box-shadow:0 1px 3px rgba(15,23,42,.05)}
.tgagg .broadcast-compact-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.tgagg .broadcast-compact-chat{font-size:13.5px;font-weight:800;color:#111827;line-height:1.25;min-width:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}
.tgagg .broadcast-compact-meta,.tgagg .broadcast-compact-stats{color:#64748b;font-size:12px;line-height:1.35}
.tgagg .broadcast-compact-stats{font-weight:700;color:#475569}
.tgagg .broadcast-text-wrap{display:grid;gap:0}
.tgagg .broadcast-text-wrap.expanded{border:1px solid #cbd5e1;border-radius:10px;background:#fff;overflow:hidden}
.tgagg .broadcast-text-toggle{width:100%;border:1px solid #dbeafe;border-radius:10px;background:#eff6ff;color:#1d4ed8;padding:8px 10px;text-align:left;font:inherit;font-size:12.5px;font-weight:700;cursor:pointer}
.tgagg .broadcast-text-toggle:hover{background:#dbeafe}
.tgagg .broadcast-text-wrap.expanded .broadcast-text-toggle{border:0;border-radius:0;border-bottom:1px solid #e5e7eb;background:#fff;color:#64748b;font-size:11px;text-transform:uppercase;letter-spacing:.02em}
.tgagg .broadcast-text-wrap.expanded .broadcast-text-toggle:hover{background:#f8fafc}
.tgagg .broadcast-text-toggle-label{display:block;pointer-events:none}
.tgagg .broadcast-text-body{padding:8px 10px;white-space:pre-wrap;word-break:break-word;color:#334155;font-size:12.5px;font-weight:400;line-height:1.45;user-select:text;-webkit-user-select:text;cursor:text}
.tgagg .broadcast-modal{width:min(460px,calc(100% - 28px));max-height:min(760px,calc(var(--app-height) - 28px))}
.tgagg .broadcast-modal .modal-body{display:grid;gap:12px;padding-bottom:14px}
.tgagg .broadcast-modal-form{display:grid;gap:12px}
.tgagg .broadcast-field-compact{margin:0}
.tgagg .broadcast-field-compact .field-caption{display:block;margin:0 0 6px;color:#475569;font-size:13px;font-weight:900}
.tgagg .broadcast-field-hint{margin:-2px 0 6px;font-size:12px;line-height:1.35}
.tgagg .broadcast-kind-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:4px 0 0}
.tgagg .broadcast-kind-btn{border:1px solid #dbeafe;border-radius:14px;background:#eff6ff;color:#1d4ed8;padding:14px 12px;font:inherit;font-size:14px;font-weight:800;cursor:pointer;text-align:center}
.tgagg .broadcast-kind-btn:hover{background:#dbeafe}
.tgagg .broadcast-people-textarea{width:100%;min-height:92px;max-height:150px;border:1px solid #e5e7eb;border-radius:12px;padding:10px 12px;resize:vertical;font:inherit;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px;line-height:1.45;box-sizing:border-box}
.tgagg .broadcast-modal .broadcast-textarea{min-height:84px;max-height:130px;box-sizing:border-box}
.tgagg .broadcast-modal .broadcast-textarea.rich-composer{width:100%;border:1px solid #e5e7eb;border-radius:12px;padding:10px 44px 10px 12px;background:#fff;overflow:auto;white-space:pre-wrap;word-break:break-word;outline:none;font:inherit;font-size:14px;line-height:1.45;color:#111827}
.tgagg .broadcast-modal .broadcast-textarea.rich-composer:empty:before{content:attr(data-placeholder);color:#9ca3af;pointer-events:none}
.tgagg .broadcast-modal .broadcast-textarea.rich-composer .composer-premium-emoji{width:1.35em;height:1.35em}
.tgagg .field input[type="radio"],.tgagg .field input[type="checkbox"]{width:auto;padding:0;flex:0 0 auto;margin:0}
.tgagg .broadcast-people-mode{display:grid;gap:6px;margin:0}
.tgagg .field .broadcast-people-mode label{display:flex;align-items:center;gap:10px;width:100%;box-sizing:border-box;margin:0;padding:10px 12px;border:1px solid #e5e7eb;border-radius:12px;background:#f8fafc;font-size:13px;font-weight:700;color:#334155;cursor:pointer;line-height:1.35}
.tgagg .broadcast-people-mode label:has(input:checked){border-color:#93c5fd;background:#eff6ff;color:#1d4ed8}
.tgagg .broadcast-people-option-text{flex:1 1 auto;min-width:0}
.tgagg .broadcast-people-mode-panel{display:grid;gap:8px;margin-top:8px;padding:10px 12px;border:1px solid #e5e7eb;border-radius:12px;background:#fff}
.tgagg .broadcast-people-mode-panel[hidden]{display:none!important}
.tgagg .broadcast-people-mode-panel .field{margin:0}
.tgagg .broadcast-people-mode-panel .broadcast-form-grid{gap:8px}
.tgagg .broadcast-people-count{margin-top:4px;color:#64748b;font-size:12px;font-weight:700}
.tgagg .broadcast-people-limit-error{margin-top:6px;color:#dc2626;font-size:12.5px;font-weight:800}
.tgagg .broadcast-people-mode-caption{margin:0 0 8px;color:#475569;font-size:12px;font-weight:800}
.tgagg .broadcast-msk-mark{color:#1d4ed8;font-weight:900;letter-spacing:.04em}
.tgagg .broadcast-interval-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.tgagg .broadcast-interval-row input{min-width:0}
.tgagg .broadcast-interval-row select{min-width:112px;border:1px solid #e5e7eb;border-radius:10px;padding:9px 10px;background:#fff;color:#111827;font:inherit;font-size:13px;font-weight:700}
.tgagg .broadcast-modal .broadcast-photo-section{margin:0;gap:8px}
.tgagg .broadcast-modal .modal-actions{margin-top:2px}
.tgagg .broadcast-text-photos-mark{color:#dc2626;font-size:16px;font-weight:800;line-height:1.35;margin:0 0 8px}
.tgagg .broadcast-compact-actions{display:flex;justify-content:flex-end;margin-top:2px}
.tgagg .broadcast-finished-row{display:flex;align-items:flex-start;gap:8px;padding:9px 10px;border:1px solid #dbe3ee;border-radius:10px;background:#f8fafc;min-width:0}
.tgagg .broadcast-finished-text{flex:1;min-width:0;color:#475569;font-size:12.5px;font-weight:700;line-height:1.4;word-break:break-word}
.tgagg .broadcast-finished-error{color:#991b1b;font-weight:800}
.tgagg .broadcast-finished-dismiss{flex:0 0 auto;border:0;background:transparent;color:#64748b;font-size:17px;line-height:1;cursor:pointer;padding:2px 4px;border-radius:8px;margin-top:1px}
.tgagg .broadcast-finished-dismiss:hover{background:#e2e8f0;color:#334155}
.tgagg .chat-pane.broadcasts-mode .settings-view{container-type:inline-size;container-name:tgagg-broadcasts}
@container tgagg-broadcasts (min-width:900px){.tgagg .broadcast-compact-grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}}
.tgagg .broadcast-loading-panel{display:grid;justify-items:center;gap:12px;padding:28px 16px;text-align:center;color:#475569}
.tgagg .broadcast-loading-spinner{width:34px;height:34px;border:3px solid #dbeafe;border-top-color:#3390ec;border-radius:50%;animation:tgagg-broadcast-spin .75s linear infinite}
.tgagg .broadcast-loading-text{font-size:14px;font-weight:800;line-height:1.35}
.tgagg .broadcast-modal-form.is-busy{pointer-events:none;opacity:.55;user-select:none}
.tgagg .broadcast-modal-busy-overlay{position:absolute;inset:0;display:grid;place-items:center;background:rgba(255,255,255,.82);border-radius:12px;z-index:4}
.tgagg .broadcast-modal .modal-body{position:relative}
.tgagg .btn.is-loading{opacity:.72;pointer-events:none;cursor:wait}
@keyframes tgagg-broadcast-spin{to{transform:rotate(360deg)}}
.tgagg .chat-pane.settings-mode .settings-view,.tgagg .chat-pane.notes-mode .settings-view,.tgagg .chat-pane.global-templates-mode .settings-view,.tgagg .chat-pane.broadcasts-mode .settings-view{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
.tgagg .chat-pane.settings-admin-mode .settings-view{padding-bottom:calc(132px + env(safe-area-inset-bottom))}

.tgagg .sidebar.explorer-mode .chips{display:none!important}
.tgagg .explorer-banner{display:grid;gap:6px;padding:0 2px 4px}
.tgagg .explorer-back{border:0;background:transparent;color:#2563eb;font:inherit;font-size:13px;padding:0;text-align:left;cursor:pointer}
.tgagg .explorer-banner-title{font-size:14px;font-weight:700;color:#111827;line-height:1.3}
.tgagg .tabs .tab.explorer-folder{font-size:12.5px;padding:7px 10px}
.tgagg .dialog-title-row{display:flex;align-items:center;gap:6px;min-width:0}
.tgagg .dialog-title-row .dialog-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tgagg .entity-kind-badge{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;background:#eef2ff;color:#4338ca;font-size:11px;line-height:1;flex:0 0 auto}
.tgagg .entity-kind-badge.entity-kind-channel{background:#fef3c7;color:#b45309}
.tgagg .entity-kind-badge.entity-kind-group{background:#dcfce7;color:#15803d}
.tgagg .entity-kind-badge.entity-kind-saved{background:#fce7f3;color:#be185d}
.tgagg .entity-kind-badge.entity-kind-archive{background:#f3f4f6;color:#4b5563}
.tgagg .explorer-dialog-card .dialog-head{align-items:flex-start}
.tgagg .composer.composer-disabled{opacity:.55;pointer-events:none}
.tgagg .chat-pane.explorer-mode .note-panel{display:none!important}

.tgagg .numbuster-embed{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;background:#fff;visibility:hidden;pointer-events:none;position:absolute;inset:0;width:100%;height:100%;z-index:0}
.tgagg .numbuster-frame{flex:1;width:100%;min-height:0;border:0;background:#fff}
.tgagg .chat-pane.numbuster-mode{background:#fff}
.tgagg .chat-pane.numbuster-mode .numbuster-embed{visibility:visible;pointer-events:auto;position:relative;z-index:1;padding-bottom:env(safe-area-inset-bottom)}
.tgagg .chat-pane.numbuster-mode .settings-view{display:none!important}
.tgagg .chat-pane.numbuster-mode .empty-state,.tgagg .chat-pane.numbuster-mode .chat-header,.tgagg .chat-pane.numbuster-mode .messages,.tgagg .chat-pane.numbuster-mode .composer,.tgagg .chat-pane.numbuster-mode .note-panel,.tgagg .chat-pane.numbuster-mode .templates-sheet,.tgagg .chat-pane.numbuster-mode .templates-sheet-backdrop{display:none!important}

/* Side alignment: only message-wrap positions bubbles in the chat column. */
.tgagg .messages > .message-wrap{display:flex;flex-direction:column;align-items:stretch;width:max-content;max-width:min(590px,82%)}
.tgagg .messages > .message-wrap.in{align-self:flex-start!important;margin-right:auto!important;margin-left:0!important}
.tgagg .messages > .message-wrap.out{align-self:flex-end!important;margin-left:auto!important;margin-right:0!important}
.tgagg .messages > .message-wrap > .message.in,
.tgagg .messages > .message-wrap > .message.out{align-self:auto!important;width:auto!important;max-width:100%!important}
.tgagg .message.message-album{padding:0;overflow:hidden}
.tgagg .message.message-album .message-head{display:none}
.tgagg .message.message-album .media-album-grid{border-radius:11px 11px 0 0;max-width:100%}
.tgagg .message.message-album > div:not(.message-head):not(.media-album-grid):not(.media-time-row):not(.reply-quote){padding:6px 9px 5px}
.tgagg .message.out.message-album .media-album-grid{border-bottom-right-radius:4px}
.tgagg .message.in.message-album .media-album-grid{border-bottom-left-radius:4px}
.tgagg .message.out.message-album > div:not(.message-head):not(.media-album-grid):not(.media-time-row):not(.reply-quote){border-bottom-right-radius:4px}
.tgagg .message.in.message-album > div:not(.message-head):not(.media-album-grid):not(.media-time-row):not(.reply-quote){border-bottom-left-radius:4px}
.tgagg .team-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.tgagg .team-panel-body{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}
.tgagg .team-panel-body[hidden]{display:none!important}

@media (max-width: 720px) {
  .tgagg .settings-window-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .tgagg .broadcast-window-head-main {
    width: 100%;
    min-width: 0;
  }
  .tgagg .broadcast-window-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .tgagg .broadcast-window-stats {
    white-space: normal;
    font-size: 12px;
    line-height: 1.35;
  }
  .tgagg .broadcast-window-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .tgagg .settings-window-head .broadcast-window-actions .btn,
  .tgagg .settings-window-head > .btn {
    width: 100%;
    white-space: normal;
    text-align: center;
    font-size: 13px;
    min-height: 38px;
    padding: 8px 12px;
  }
}
