/* Chat-only density: do not change administrative forms or media permissions. */
#workspace-dialog:has(.contact-compose221) { padding:12px; box-sizing:border-box; }
.workspace-dialog:has(.contact-compose221) { box-sizing:border-box; width:min(820px,calc(100vw - 24px)); max-width:100%; }
.workspace-dialog:has(.contact-compose221) .dialog-body { box-sizing:border-box; min-width:0; }
.contact-compose221 { max-width:760px; width:100%; min-width:0; font-size:14px; line-height:1.5; }
.contact-compose221 * { box-sizing:border-box; }
.contact-compose221 .compose-step221 { color:#63745c; font-size:12px; margin:0 0 12px; }
.contact-compose221 .compose-search221,.contact-compose221 .dialog-form label { display:flex; flex-direction:column; gap:6px; font-weight:600; }
.contact-compose221 input,.contact-compose221 select { display:block; width:100%; min-width:0; min-height:42px; padding:9px 12px; border:1px solid #cfdac8; border-radius:8px; font:inherit; background:white; }
.contact-compose221 button { min-height:40px; padding:9px 12px; font-size:14px; white-space:normal; overflow-wrap:anywhere; }
.contact-compose221 .entity-options { display:grid; gap:8px; }
.contact-compose221 .entity-options button { display:flex; flex-direction:column; align-items:flex-start; gap:4px; text-align:left; width:100%; }
.contact-compose221 small { color:#65745f; font-weight:400; overflow-wrap:anywhere; }
.contact-compose221 .compose-recipient221,.contact-compose221 .compose-alternative221 { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.contact-compose221 .compose-alternative221 { border-top:1px solid #e1e7dd; padding-top:16px; margin-top:16px; }
.contact-compose221 h3 { font-size:16px; margin:0 0 10px; overflow-wrap:anywhere; }
.contact-compose221 .compose-channels221 { display:grid; gap:12px; }
.contact-compose221 .compose-channels221 > section { padding:14px; border:1px solid #dce5d6; border-radius:12px; background:#fafcf8; min-width:0; }
.contact-compose221 .compose-unavailable221 { margin:0; color:#65745f; }
.contact-compose221 .dialog-form { display:grid; gap:12px; margin-top:12px; }
.contact-compose221 :focus-visible { outline:2px solid #438920; outline-offset:3px; }
.emoji-picker221 { position:relative; flex:0 0 auto; align-self:center; }
.emoji-picker221 summary { cursor:pointer; list-style:none; display:grid; place-items:center; width:40px; height:40px; border:1px solid #dce5d6; border-radius:10px; font-size:23px; color:#438920; }
.emoji-picker221 summary::-webkit-details-marker { display:none; }
.emoji-picker221 > div { position:absolute; bottom:48px; left:0; z-index:20; display:grid; grid-template-columns:repeat(4,40px); gap:4px; padding:8px; background:white; border:1px solid #dce5d6; border-radius:12px; box-shadow:0 4px 20px #263b2626; }
.chat-pane .composer .emoji-picker221 button { min-height:40px; padding:4px; font-size:23px; background:white; }
.emoji-picker221 :focus-visible { outline:2px solid #438920; outline-offset:2px; }
#messages.messages { padding:16px 20px; }
#messages .message {
  box-sizing:border-box;
  width:fit-content;
  min-width:0;
  max-width:min(680px,88%);
  padding:10px 12px;
  margin-bottom:10px;
  border-radius:12px;
  box-shadow:none;
}
#messages .message.incoming { background:#f0f5eb; border-color:#dce5d5; }
#messages .message.mine { background:#eaf5e8; margin-left:auto; }
#messages .message-identity { gap:7px; margin-bottom:5px; align-items:flex-start; }
#messages .message-identity > div { display:flex; flex-wrap:wrap; align-items:center; gap:4px 7px; min-width:0; }
#messages .message-identity .avatar { width:26px; height:26px; min-width:26px; font-size:11px; }
#messages .message-author { font-size:13px; line-height:1.4; margin:0; overflow-wrap:anywhere; }
#messages .identity-badge { font-size:10px; padding:2px 6px; }
#messages .identity-detail { font-size:11px; }
#messages .message-text { font-size:14px; line-height:1.5; overflow-wrap:anywhere; }
#messages .message-footer { font-size:11px; gap:6px; margin-top:5px; flex-wrap:wrap; }
#messages .message-tools { display:flex; flex-wrap:wrap; gap:2px 6px; margin-top:4px; opacity:1; }
#messages .message-tools button { min-height:28px; padding:4px 6px; font-size:12px; line-height:1.3; border-radius:6px; }
#messages .message-tools button:hover { background:#dfead8; }
#messages button:focus-visible,#messages a:focus-visible { outline:2px solid #438920; outline-offset:2px; }
#messages .telegram-attachment,#messages .protected-attachment { min-width:0; max-width:100%; gap:7px; margin-top:8px; }
#messages .telegram-attachment button,#messages .protected-attachment button,
#messages .attachment-actions a,#messages .attachment-actions button {
  box-sizing:border-box; min-height:34px; max-width:100%; padding:6px 10px;
  font-size:13px; line-height:1.35; font-weight:600; border-radius:8px; overflow-wrap:anywhere; white-space:normal;
}
#messages .attachment-actions { display:flex; flex-wrap:wrap; gap:6px; }
#messages .attachment-actions a { align-items:center; gap:6px; }
#messages .attachment-actions svg { width:16px; height:16px; flex-shrink:0; }
#messages [data-telegram-player] { min-width:0; max-width:100%; }
#messages [data-telegram-player] strong { font-size:12px; overflow-wrap:anywhere; }
#messages audio { width:320px; max-width:100%; height:42px; }
#messages video { width:420px; max-width:100%; max-height:300px; object-fit:contain; border-radius:8px; }
.chat-pane .channel-tabs button { min-width:180px; max-width:260px; padding:9px 12px; }
.chat-pane .channel-tabs button span { font-size:13px; overflow-wrap:anywhere; }
.chat-pane .channel-tabs button small { font-size:11px; line-height:1.4; }
.chat-pane .composer { padding:10px 14px; gap:8px; }
.chat-pane .composer textarea { font-size:14px; line-height:1.45; min-width:0; }
.chat-pane .composer button { font-size:14px; padding:9px 14px; min-height:40px; }
@media (max-width:700px) {
  #messages.messages { padding:12px; }
  #messages .message { max-width:96%; }
  #messages .message-tools button { min-height:36px; }
  #messages .attachment-actions a,#messages .attachment-actions button { min-height:40px; }
  .chat-pane .composer { flex-wrap:wrap; padding:8px; }
  .chat-pane .composer textarea { flex-basis:65%; }
}
