/* Messenger workspace: dynamic viewport, compact chrome, independently scrolling panes. */
main > div:has([role="tablist"]):has(h1) {height:calc(100dvh - 3.5rem);overflow:hidden;min-width:0;}
main > div:has([role="tablist"]):has(h1) > div:first-child {padding:6px 16px;min-height:48px;gap:8px;}
main > div:has([role="tablist"]):has(h1) > div:first-child h1 {font-size:20px;line-height:28px;}
main > div:has([role="tablist"]):has(h1) > div:first-child p,
main > div:has([role="tablist"]):has(h1) > div:first-child > div:first-child > div {display:none;}
[aria-label="Instagram мессенджер"] {min-width:0;overflow:hidden;}
[aria-label="Instagram мессенджер"] > header.flex {padding:6px 12px;gap:8px;flex-shrink:0;}
[aria-label="Instagram мессенджер"] > header.flex > span {display:none;}
[aria-label="Instagram мессенджер"] > nav.flex {padding:4px 12px;align-items:center;flex-shrink:0;position:relative;}
[aria-label="Instagram мессенджер"] > .grid {grid-template-columns:240px minmax(0,1fr);overflow:hidden;}
[aria-label="Instagram мессенджер"] .ig-chat-list {min-width:0;overflow:hidden;}
[aria-label="Instagram мессенджер"] .ig-chat-list > div {max-height:none;flex:1;overflow:auto;}
[aria-label="Instagram мессенджер"] .ig-chat-main {overflow:hidden;}
[aria-label="Instagram мессенджер"] .ig-conversation-header {padding:6px 10px;gap:8px;flex-shrink:0;min-width:0;}
[aria-label="Instagram мессенджер"] .ig-conversation-header > div {min-width:0;}
[aria-label="Instagram мессенджер"] .ig-conversation-header strong {overflow-wrap:anywhere;}
[aria-label="Instagram мессенджер"] .ig-conversation-header a {font-size:11px;}
.ig-back {display:none;}
.ig-settings {margin-left:auto;font-size:12px;}
.ig-settings > summary {padding:10px;cursor:pointer;min-height:40px;}
.ig-settings > div {position:absolute;right:8px;top:100%;z-index:40;width:min(320px,calc(100vw - 32px));max-height:60dvh;overflow:auto;padding:16px;background:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:12px;box-shadow:0 12px 32px #0006;}
[aria-label="Instagram мессенджер"] [role="log"] {min-height:0;overflow:auto;padding:12px;overscroll-behavior:contain;overflow-wrap:anywhere;}
[aria-label="Instagram мессенджер"] [role="log"] img,[aria-label="Instagram мессенджер"] [role="log"] video {max-width:100%;max-height:55dvh;object-fit:contain;}
[aria-label="Instagram мессенджер"] form.border-t {padding:6px 10px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;flex-shrink:0;max-height:45dvh;overflow:auto;}
[aria-label="Instagram мессенджер"] form.border-t > details,[aria-label="Instagram мессенджер"] form.border-t > p,[aria-label="Instagram мессенджер"] form.border-t > .mb-2 {grid-column:1/-1;margin:0;}
[aria-label="Instagram мессенджер"] form.border-t > details {padding:4px 8px;}
[aria-label="Instagram мессенджер"] form.border-t details > div {max-height:72px;overflow:auto;}
[aria-label="Instagram мессенджер"] form.border-t > div:last-child {margin:0;align-self:end;}
[aria-label="Instagram мессенджер"] form.border-t > div:last-child > span {display:none;}
[aria-label="Instagram мессенджер"] .ig-composer {position:relative;min-width:0;display:flex;align-items:center;padding:4px;border-radius:16px;}
[aria-label="Instagram мессенджер"] .ig-composer textarea {min-height:44px;height:54px;max-height:120px;padding:6px 8px;flex:1;min-width:0;}
[aria-label="Instagram мессенджер"] .ig-composer > button {min-width:44px;min-height:44px;}
[aria-label="Instagram мессенджер"] .ig-composer [role="group"] {position:fixed;bottom:150px;right:20px;z-index:60;background:hsl(var(--background));border:1px solid hsl(var(--border));max-width:280px;border-radius:12px;}
body:has([aria-label="Instagram мессенджер"]) #wa-archive-open {display:none;}
@media(max-width:767px){
 main > div:has([role="tablist"]):has(h1) > div:first-child {padding:4px 8px;min-height:44px;}
 main > div:has([role="tablist"]):has(h1) > div:first-child h1 {font-size:17px;}
 main > div:has([role="tablist"]):has(h1) > div:first-child button,main > div:has([role="tablist"]):has(h1) > div:first-child a {padding:6px;font-size:11px;}
 [aria-label="Instagram мессенджер"] > header.flex {padding:4px 8px;}
 [aria-label="Instagram мессенджер"] > header.flex h2 {font-size:13px;}
 [aria-label="Instagram мессенджер"] > header.flex p {max-width:210px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
 [aria-label="Instagram мессенджер"] > nav.flex {padding:2px 8px;}
 [aria-label="Instagram мессенджер"] > .grid {display:flex;flex-direction:column;}
 [aria-label="Instagram мессенджер"][data-chat-selected="true"] .ig-chat-list {display:none;}
 [aria-label="Instagram мессенджер"][data-chat-selected="false"] .ig-chat-main {display:none;}
 .ig-chat-list,.ig-chat-main {flex:1;min-height:0;}
 .ig-back {display:block;min-width:44px;min-height:44px;font-size:12px;padding:4px;}
 .ig-conversation-header {flex-wrap:wrap;gap:4px;}
 .ig-conversation-header > div {flex:1;}
 .ig-conversation-header a {display:none;}
 .ig-conversation-header > button:last-child {font-size:11px;padding:6px;min-height:44px;}
 [aria-label="Instagram мессенджер"] input,[aria-label="Instagram мессенджер"] textarea {font-size:16px;}
 [aria-label="Instagram мессенджер"] [role="log"] {padding:8px;}
 [aria-label="Instagram мессенджер"] [role="log"] article {max-width:95%;padding:10px;}
 [aria-label="Instagram мессенджер"] form.border-t {padding:4px 6px;gap:4px;}
 [aria-label="Instagram мессенджер"] form.border-t button {min-height:44px;}
 [aria-label="Instagram мессенджер"] form.border-t > details {font-size:11px;}
}

@media(max-width:767px){
 [aria-label="Instagram мессенджер"][data-chat-selected="true"] > header,
 [aria-label="Instagram мессенджер"][data-chat-selected="true"] > nav {display:none;}
 [aria-label="Instagram мессенджер"] .ig-chat-main > details > summary {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
}
[aria-label="Instagram мессенджер"] [role="dialog"] {position:fixed;left:50%;top:50%;bottom:auto;right:auto;transform:translate(-50%,-50%);width:min(520px,calc(100vw - 24px));max-height:75dvh;overflow:auto;z-index:80;background:hsl(var(--background));border:1px solid hsl(var(--border));box-shadow:0 0 0 100vmax #0008,0 16px 48px #0008;}
@media(min-width:768px){
 [aria-label="Instagram мессенджер"] form.border-t {grid-template-columns:minmax(0,1fr) auto;}
 [aria-label="Instagram мессенджер"] form.border-t > details {grid-column:1;align-self:center;}
 [aria-label="Instagram мессенджер"] form.border-t > .mb-2 {grid-column:2;grid-row:1;}
 [aria-label="Instagram мессенджер"] form.border-t > .ig-composer {grid-column:1;}
}
@media(max-height:550px){
 main > div:has([role="tablist"]):has(h1) > div:first-child {display:none;}
 [aria-label="Instagram мессенджер"][data-chat-selected="true"] > header,
 [aria-label="Instagram мессенджер"][data-chat-selected="true"] > nav {display:none;}
 [aria-label="Instagram мессенджер"] form.border-t {max-height:48dvh;}
}
@media(max-width:767px){
 [role="tabpanel"] div.flex-1.flex.min-h-0:has(> .w-72) {flex-direction:column;overflow:hidden;}
 [role="tabpanel"] div.w-72:has([aria-label="Поиск чата WhatsApp по имени или номеру"]) {width:100%;max-height:160px;min-height:120px;border-right:0;border-bottom:1px solid hsl(var(--border));}
 [role="tabpanel"]:has([aria-label="Поле сообщения WhatsApp"]) textarea {font-size:16px;min-width:0;}
 body:has([aria-label="Поле сообщения WhatsApp"]) #wa-archive-open {bottom:3px;right:6px;padding:4px 10px;min-height:28px;font-size:11px;}
}
@media(max-height:650px){
 body:has([aria-label="Instagram мессенджер"][data-chat-selected="true"]) header:has(button[aria-label="Уведомления"]) {display:none;}
 body:has([aria-label="Instagram мессенджер"][data-chat-selected="true"]) main > div:has([role="tablist"]):has(h1) {height:100dvh;}
 body:has([aria-label="Instagram мессенджер"][data-chat-selected="true"]) main > div:has([role="tablist"]):has(h1) > div:first-child {display:none;}
 [aria-label="Instagram мессенджер"] .ig-back {display:block;min-width:44px;min-height:44px;}
}
[aria-label="Instagram мессенджер"] .ig-chat-main > details {flex-shrink:0;max-height:30dvh;overflow:auto;}
[aria-label="Instagram мессенджер"] .ig-chat-main > aside {flex-shrink:0;max-height:22dvh;overflow:auto;}
[aria-label="Instagram мессенджер"] > aside {flex-shrink:0;max-height:22dvh;overflow:auto;}
