lum-telegram-dialog .ig-tools{display:flex;align-items:center;flex-wrap:wrap;gap:4px}
lum-telegram-dialog form.ig-reply{min-width:0;box-sizing:border-box}
lum-telegram-dialog .ig-reply-row,lum-telegram-dialog .ig-tools,lum-telegram-dialog .ig-sendbar{min-width:0;max-width:100%;box-sizing:border-box}
lum-telegram-dialog .cw-picker:not([hidden]),lum-telegram-dialog .tg-more:not([hidden]){position:static;display:flex;flex-wrap:wrap;gap:4px;max-width:100%;max-height:min(135px,16vh);box-sizing:border-box;overflow:auto;padding:5px;margin:4px 0}
lum-telegram-dialog .cw-picker .ig-attach{min-width:0;max-width:100%;height:auto;white-space:normal;overflow-wrap:anywhere;text-align:left}
lum-telegram-dialog [hidden]{display:none!important}
lum-telegram-dialog .ig-pend:empty{display:none}
lum-telegram-dialog .ig-pend:not(:empty){display:block;max-height:min(110px,14vh);overflow:auto}
lum-telegram-dialog .tg-pending-file{display:flex;align-items:center;flex-wrap:wrap;gap:5px;overflow-wrap:anywhere;min-width:0}
lum-telegram-dialog .tg-pending-count{margin:3px 0;color:var(--muted,#8b98a6);font-size:12px}
lum-telegram-dialog .tg-pending-file a{min-width:0;max-width:100%;overflow-wrap:anywhere;color:inherit;text-decoration:underline}
lum-telegram-dialog .tg-send-separate:not([hidden]){display:flex;flex-wrap:wrap;gap:4px;margin:3px 0}
lum-telegram-dialog .tg-pending-file :is(img,video){max-height:60px;max-width:min(96px,40%);object-fit:contain}
lum-telegram-dialog .tg-pending-file audio{width:min(205px,100%);height:32px}
#npClientWork form .ig-sendbar{align-items:center;gap:5px;margin-top:6px}
#npClientWork form .tg-ai:not([hidden]){display:contents}
#npClientWork form .tg-preview:not([hidden]){flex-basis:100%;order:5}
#npClientWork form .ig-hint{display:none}
#npClientWork form .ig-tools button{overflow:hidden}
#npClientWork .tg-history :is(img,video,audio){max-width:100%;max-height:34vh;object-fit:contain}

#npClientWork form.ig-reply:not([hidden]){overflow:hidden}
#npClientWork form .ig-reply-row{display:flex;flex-direction:column;gap:4px;min-height:0;overflow:auto}
#npClientWork form .ig-reply-row>.ig-sendbar{position:sticky;bottom:0;flex-shrink:0;background:var(--card);z-index:1;margin-top:0}
#npClientWork form .cw-picker:not([hidden]){flex:0 1 auto;min-height:30px}
#npClientWork .ig-tools,.tg-pending-file button{flex-shrink:0}

lum-telegram-dialog .cw-picker[data-mode="emoji"]:not([hidden]){display:grid;grid-template-columns:repeat(auto-fill,minmax(34px,1fr));gap:3px}
lum-telegram-dialog .cw-picker[data-mode="emoji"] button{display:grid;place-items:center;height:34px;padding:0;font-size:20px;line-height:1}
lum-telegram-dialog :is(.ig-tools,.cw-picker[data-mode="emoji"]) button::after{content:none}

lum-telegram-dialog[data-peer] .tg-bind:not(:empty){display:flex;flex-wrap:wrap;gap:6px;padding:8px}lum-telegram-dialog[data-peer] .tg-bind :is(input,select){max-width:100%;min-width:0;box-sizing:border-box;flex:1 1 180px}

lum-telegram-dialog .tg-direct:not([hidden]),lum-telegram-dialog .tg-bind:not(:empty){display:flex;align-items:flex-start;flex-wrap:wrap;gap:6px 10px;padding:8px 10px}
lum-telegram-dialog .tg-direct small,lum-telegram-dialog .tg-bind small{flex:1 0 100%;min-width:0;color:var(--muted);line-height:1.35;font-size:12px}
lum-telegram-dialog .tg-open-chat{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:36px;max-width:100%;padding:6px 12px;border-radius:8px;background:#176d9e;color:white;text-decoration:none;font-weight:650;line-height:1.25}
lum-telegram-dialog .tg-open-chat:hover{background:#135b84;color:white;text-decoration:none}
lum-telegram-dialog .tg-open-chat[aria-busy=true]{opacity:.75}
lum-telegram-dialog .tg-bind-choice{max-width:100%;white-space:normal}

lum-telegram-dialog .tg-room:not([hidden]){display:flex;flex-wrap:wrap;gap:5px;align-items:center;padding:5px 8px;flex:none}
lum-telegram-dialog .tg-room span{font-size:12px;color:var(--muted);flex:1 0 100%;overflow-wrap:anywhere}
lum-telegram-dialog .tg-room select{max-width:100%;min-width:0}
lum-telegram-dialog .tg-room button,lum-telegram-dialog .tg-jobs button{min-height:27px;padding:3px 8px}
lum-telegram-dialog .tg-handoff:not(:empty),#cwTelegramHealth:not([hidden]){margin:5px 8px;padding:6px 8px;font-size:12px;line-height:1.35;border:1px solid var(--line);border-radius:6px;overflow-wrap:anywhere}
lum-telegram-dialog .tg-draft-sources{padding:5px 8px;max-height:130px;overflow:auto;font-size:12px}
lum-telegram-dialog .tg-draft-sources p{margin:5px 0;overflow-wrap:anywhere}
#cwRail .cw-tg-connection-warning{outline:2px solid var(--amber,#bf7600);outline-offset:-2px}
