/* Telegram dialogs: header bar, the agent's pending reply, delivery marks, badges on deals and in settings */
.tg-icon{width:1em;height:1em;flex:none;vertical-align:-.125em}
.tg-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:8px 20px;border-bottom:1px solid var(--line,#e3e8f2);background:var(--surface,#fff);font-size:var(--fs-sm,13px)}
.tg-chip,.tg-deal-chip,.chat-list-tags .tg-tag{display:inline-flex;align-items:center;gap:5px;color:#1c8adb;font-weight:600}
.tg-mode{border-radius:999px;padding:2px 10px;font-size:var(--fs-xs,12px);font-weight:600}
.tg-mode-ai{background:#e4f6ee;color:#14724c}
.tg-mode-manager{background:#fff1dc;color:#8a5300}
.tg-deal-link{margin-left:auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.tg-warn{color:var(--danger,#b42318);font-weight:600}
.tg-pending-slot:empty{display:none}
.tg-pending{margin:0 0 10px;padding:12px 14px;border:1px solid #b9dcf5;border-radius:var(--r-md,12px);background:#f0f8ff;display:grid;gap:8px}
.tg-pending-head{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline}
.tg-pending-head small{color:var(--muted,#5d6b82)}
.tg-pending textarea{width:100%;min-height:72px;resize:vertical;font:inherit;line-height:1.45}
.tg-pending-text{margin:0;white-space:pre-wrap}
.tg-pending .row{display:flex;flex-wrap:wrap;gap:8px}
.tg-ai-label{display:inline-block;margin-right:6px;padding:0 6px;border-radius:6px;background:#e7e2fb;color:#4b3aa8;font-weight:600}
.tg-failed{display:inline-block;margin-right:6px;color:var(--danger,#b42318);font-weight:600;cursor:help}
.tg-deal-chip{border:1px solid #b9dcf5;border-radius:999px;background:#f0f8ff;padding:2px 10px;font:inherit;font-size:var(--fs-xs,12px);cursor:pointer}
.tg-deal-chip:hover,.tg-deal-chip:focus-visible{background:#dff0ff}
.tg-deal-mark{display:inline-flex;margin-right:5px;color:#1c8adb;vertical-align:-.1em}
.ai-telegram h2{display:flex;align-items:center;gap:8px}
.ai-telegram h2 .tg-icon{color:#1c8adb}
.tg-status{padding:8px 12px;border-radius:10px;background:#f4f6fb}
.tg-status.on{background:#e4f6ee;color:#14724c}
.tg-status.off{color:var(--muted,#5d6b82)}
.tg-link{font-family:ui-monospace,Consolas,monospace;user-select:all}
:root[data-theme="dark"] .tg-bar{background:var(--surface,#1b2133);border-color:var(--line,#2d3550)}
:root[data-theme="dark"] .tg-pending{background:#16263a;border-color:#2c4f73}
:root[data-theme="dark"] .tg-mode-ai,:root[data-theme="dark"] .tg-status.on{background:#163a2b;color:#8fe3bd}
:root[data-theme="dark"] .tg-mode-manager{background:#3a2c12;color:#f3c77a}
:root[data-theme="dark"] .tg-ai-label{background:#2f2a52;color:#cbc2ff}
:root[data-theme="dark"] .tg-deal-chip{background:#16263a;border-color:#2c4f73}
:root[data-theme="dark"] .tg-chip,:root[data-theme="dark"] .tg-deal-chip,:root[data-theme="dark"] .tg-deal-mark,:root[data-theme="dark"] .chat-list-tags .tg-tag{color:#6cc0ff}
:root[data-theme="dark"] .tg-status{background:#1f2638}
@media (max-width:640px){.tg-bar{padding:8px 12px}.tg-deal-link{margin-left:0}}
