.chat-head-actions{display:flex;gap:5px;margin-left:auto;align-items:center}.chat-head-actions button{min-width:34px;padding:6px 8px}.chat-head-menu{position:absolute;right:10px;top:56px;z-index:30;background:#1c2b38;border:1px solid #49657a;border-radius:10px;box-shadow:0 8px 30px #0008;padding:6px;display:grid;gap:3px}.chat-head-menu button{text-align:left;border:0;background:transparent;color:#eef5fc;padding:9px 12px}.chat-head-menu button:hover{background:#31536a}.chat-inline-search{width:100%;box-sizing:border-box;background:#203442;color:#eef5fc;border:0;border-bottom:1px solid #416278;padding:9px 14px;outline:0}
.telegram-icon{display:inline-flex;align-items:center;justify-content:center;width:42px!important;height:42px!important;padding:9px!important;font-size:0!important;line-height:1}.telegram-icon svg{width:23px;height:23px;display:block}.rich-call-buttons .telegram-icon{width:40px!important;height:40px!important;background:transparent!important;border:0!important;box-shadow:none!important;color:#8fa8ba}.chat-head-actions{align-items:center;height:100%}.chat-head-actions button{border-radius:8px}body.crm-chat-screen #notifications,body.crm-chat-screen #stats,body.crm-chat-screen #registry,body.crm-chat-screen main>header{display:none!important}body.crm-chat-screen main{padding:0!important;margin:0!important}body.crm-chat-screen #chat{margin:0!important;border:0!important;border-radius:0!important}body.crm-chat-screen #chat .chat-layout{border-radius:0!important}

body.crm-chat-screen #chat-form button:not(#attach-proxy):not(#emoji-proxy):not(#chat-send){display:none!important}

body.crm-chat-screen #chat .chat-head-menu{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:3px!important;width:220px!important;min-width:220px!important;padding:6px!important}body.crm-chat-screen #chat .chat-head-menu button{display:block!important;width:100%!important;text-align:left!important;white-space:nowrap!important}body.crm-chat-screen #chat #chat-body{white-space:nowrap!important;overflow:hidden!important;line-height:20px!important}
/* Hide legacy pre-Telegram header control row; the unified row is rich-call-buttons. */
body.crm-chat-screen #chat .chat-conversation-head > div:has(>button[aria-label="Поиск"]){display:none!important}
/* Legacy row can be nested by older chat markup; suppress its four controls explicitly. */
body.crm-chat-screen #chat .chat-conversation-head button[aria-label="Поиск"],
body.crm-chat-screen #chat .chat-conversation-head button[aria-label="Позвонить"],
body.crm-chat-screen #chat .chat-conversation-head button[aria-label="Открыть"],
body.crm-chat-screen #chat .chat-conversation-head button[aria-label="Меню"]{display:none!important}

body.crm-chat-screen #chat #chat-form {
 display: grid !important;
 grid-template-columns: 44px minmax(0, 1fr) 44px 44px !important;
 padding-inline: 8px !important;
 align-items: center !important;
}
body.crm-chat-screen #chat #chat-form > :is(#attach-proxy,#emoji-proxy,#chat-send) {
 position: static !important;
 margin: 0 !important;
 transform: none !important;
 grid-row: 1;
}
body.crm-chat-screen #chat #chat-form > label { grid-column: 2; grid-row: 1; }

body.crm-chat-screen #chat #chat-form > #attach-proxy { grid-column: 1; display: flex !important; }
body.crm-chat-screen #chat #chat-form > #emoji-proxy { grid-column: 3; display: flex !important; }
body.crm-chat-screen #chat #chat-form > #chat-send { grid-column: 4; }

/* Show one header toolbar after chat initialization. */
.chat-conversation-head:has(.rich-call-buttons .telegram-icon[title]) .fallback-chat-head-actions,
.chat-conversation-head:has(.rich-call-buttons .telegram-icon[title]) .hard-chat-actions,
.chat-conversation-head:has(.chat-head-actions) .fallback-chat-head-actions,
.chat-conversation-head:has(.chat-head-actions) .hard-chat-actions,
.chat-conversation-head:has(.fallback-chat-head-actions) .hard-chat-actions {
 display: none !important;
}
