#integration-telegram { max-width:1050px; padding-top:20px; }
#integration-telegram[hidden] { display:none; }
.tg-dialog { width:min(860px,calc(100vw - 32px)); max-height:calc(100dvh - 40px); padding:0; border:1px solid var(--line); border-radius:16px; background:var(--paper); color:var(--ink); box-shadow:0 24px 80px #0005; }
.tg-dialog::backdrop { background:#0008; }
.tg-dialog>header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 24px; border-bottom:1px solid var(--line); }
.tg-dialog h2 { font-size:22px; margin:0; }
.tg-dialog h3 { font-size:18px; margin:0 0 16px; }
.tg-body { padding:24px; max-height:calc(100dvh - 225px); overflow:auto; }
.tg-dialog label { display:block; font-size:14px; line-height:1.5; }
.tg-dialog input:not([type=checkbox]),.tg-dialog select { display:block; width:100%; min-width:0; box-sizing:border-box; border:1px solid var(--line); background:var(--paper-soft); color:var(--ink); padding:11px 12px; border-radius:8px; font:inherit; font-size:15px; margin:6px 0 14px; }
.tg-dialog details { margin:18px 0; padding:14px 0; border-top:1px solid var(--line); }
.tg-dialog summary { cursor:pointer; font-weight:600; margin-bottom:12px; }
.tg-dialog footer { padding:10px 24px; border-top:1px solid var(--line); }
.tg-dialog footer p { margin:4px 0; min-height:20px; font-size:14px; overflow-wrap:anywhere; }
.tg-section { margin-top:24px; padding-top:22px; border-top:1px solid var(--line); }
.tg-connection { font-weight:600; padding:12px; border-radius:8px; border:1px solid var(--line); }
.tg-connection.ready { border-color:var(--green); }
.tg-search { display:flex; align-items:baseline; gap:10px; }
.tg-search input { flex:1; }
.tg-chat { display:flex; justify-content:space-between; align-items:center; gap:12px; border-bottom:1px solid var(--line); padding:12px 0; }
.tg-chat label { display:flex; gap:12px; align-items:center; min-width:0; }
.tg-chat input { width:18px; height:18px; flex:none; }
.tg-chat b,.tg-chat small { display:block; overflow-wrap:anywhere; }
.tg-chat small { color:var(--ink-2); margin-top:4px; }
.tg-error,[data-error] { color:var(--red,#b42318); }
.tg-start { width:min(600px,calc(100vw - 32px)); }
.tg-dialog [data-tg-auth]>button { margin:8px 8px 0 0; }
.tg-network-actions { display:flex; flex-wrap:wrap; gap:10px; }
.tg-network p { font-size:14px; line-height:1.5; overflow-wrap:anywhere; }
@media(max-width:650px) { .tg-dialog { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); } .tg-body { padding:16px; } .tg-dialog>header,.tg-dialog footer { padding:14px 16px; } .tg-chat { align-items:flex-start; flex-direction:column; } .tg-search { flex-direction:column; align-items:stretch; } }
