/* El historial cede espacio a los controles, incluso con teclado móvil. */
.wa-fullscreen{top:var(--crm-viewport-top,0px)!important;bottom:auto!important;height:var(--crm-viewport-height,100dvh)!important;max-height:var(--crm-viewport-height,100dvh)!important;overflow:hidden!important}
.wa-fullscreen *,.wa-web-inbox *{box-sizing:border-box}
.wa-fullscreen .wa-web-inbox,.wa-fullscreen .wa-chat-section,.wa-fullscreen #wa-inbox{height:100%!important;min-height:0!important;max-height:100%!important;overflow:hidden}
.wa-web-inbox .wa-chat-window{grid-template-rows:minmax(0,1fr)!important;min-height:0!important;overflow:hidden}
.wa-fullscreen .wa-web-inbox .wa-chat-window{height:100%!important;max-height:100%!important}
.wa-web-inbox .wa-chat-main{min-height:0!important;min-width:0;overflow:hidden;display:flex;flex-direction:column}
.wa-web-inbox .wa-chat-main>.wa-chat-header,.wa-web-inbox .wa-chat-main>.crm-chat-tools,.wa-web-inbox .wa-chat-main>.crm-quick,.wa-web-inbox .wa-chat-main>.wa-chat-compose{flex:0 0 auto}
.wa-web-inbox .wa-chat-main>.wa-chat-history{flex:1 1 0!important;min-height:0!important;overflow:auto!important;overscroll-behavior:contain;scrollbar-gutter:stable}
.wa-web-inbox .wa-chat-history>*{flex-shrink:0}
.wa-web-inbox .wa-chat-sidebar{min-height:0!important;overflow:hidden}
.wa-web-inbox .wa-chat-sidebar>*{flex-shrink:0}
.wa-web-inbox .wa-chat-sidebar>.wa-chat-contacts{flex:1 1 0;min-height:0;overflow:auto;overscroll-behavior:contain}
.wa-web-inbox .wa-chat-compose{margin:0!important;padding:8px 10px!important;gap:6px;min-height:60px;max-height:45%;overflow:auto}
.wa-web-inbox .wa-chat-compose textarea{min-height:42px!important;max-height:100px!important;height:42px;resize:none;font-size:16px!important;line-height:1.35}
.wa-web-inbox .wa-chat-compose #wa-chat-error:empty{display:none}
.wa-web-inbox .wa-chat-compose small{margin:0;font-size:11px;line-height:1.3}
.wa-web-inbox .crm-chat-tools{flex-wrap:nowrap;min-width:0;gap:6px;padding:6px 10px;overflow-x:auto}
.wa-web-inbox .crm-chat-tools button{flex-shrink:0;white-space:nowrap}
.wa-web-inbox .crm-chat-tools .crm-message-search{min-width:95px;width:0;flex:1 1 160px}
.wa-web-inbox .crm-search-count{flex-shrink:0}
.wa-web-inbox .crm-quick{padding:4px 10px}
.wa-web-inbox .crm-quick select{padding:5px;min-height:30px}
.wa-web-inbox .wa-chat-bubble{min-width:0;overflow-wrap:anywhere;max-width:min(90%,640px)}
.wa-web-inbox .wa-chat-media img,.wa-web-inbox .wa-playback video{max-width:100%;max-height:min(300px,40dvh);object-fit:contain}
.wa-web-inbox .wa-playback audio{max-width:100%}
.wa-web-inbox .wa-chat-header{flex-shrink:0;min-height:54px;gap:8px;padding-block:6px}
.wa-fullscreen .wa-fullscreen-close{width:34px;height:34px;font-size:26px;top:8px;right:8px}
.wa-fullscreen .wa-chat-header{padding-right:50px}
@container wa-inbox (max-width:760px){
 .wa-fullscreen .wa-web-inbox .wa-chat-window{grid-template-columns:minmax(0,1fr)!important}
 .wa-fullscreen .wa-web-inbox .wa-chat-main{display:none!important}
 .wa-fullscreen .wa-web-inbox.wa-mobile-chat-open .wa-chat-sidebar{display:none!important}
 .wa-fullscreen .wa-web-inbox.wa-mobile-chat-open .wa-chat-main{display:flex!important}
 .wa-fullscreen .wa-web-inbox .wa-chat-back{display:inline-grid!important}
 .wa-fullscreen .wa-chat-sidebar-title{padding-right:50px}
}
@media(max-width:480px){
 .wa-web-inbox .crm-chat-tools{gap:4px;padding:4px 6px}
 .wa-web-inbox .crm-chat-tools button{font-size:11px;padding:5px 7px;min-height:32px}
 .wa-web-inbox .crm-search-count{font-size:10px}
 .wa-web-inbox .wa-chat-header .btn{max-width:74px;font-size:10px;padding:5px}
 .wa-web-inbox .wa-chat-history{padding:10px 8px}
 .wa-web-inbox .wa-chat-compose{padding:6px!important;min-height:56px}
 .wa-web-inbox .crm-quick{padding:3px 6px}
}
@media(max-height:550px){
 .wa-web-inbox .wa-chat-header{min-height:44px;padding-block:4px}
 .wa-web-inbox .wa-chat-header .wa-chat-avatar{width:32px;height:32px;flex-basis:32px}
 .wa-web-inbox .crm-chat-tools{padding-block:3px}
 .wa-web-inbox .crm-quick{display:none}
 .wa-web-inbox .wa-chat-history{padding-block:8px}
}
