/* P31.4.2 — correções pontuais Android, sem alterar Aurora Glass.
   Seletores intencionalmente específicos para vencer regras gerais antigas. */
html,body{max-width:100%;overflow-x:clip}
html body:has(.request-chat-overlay) #navRevealBtn,
html body:has(.request-chat-overlay) #adminNav,
html body:has(.request-chat-overlay) #managerNav,
html body:has(.request-chat-overlay) #appBackBtn{display:none!important;visibility:hidden!important;pointer-events:none!important}
html body #screen-compras .request-chat-overlay,
html body #screen-gerente .request-chat-overlay{z-index:11010!important;max-width:100vw!important;max-width:100dvw!important}
html body #screen-compras .request-chat-overlay .request-chat-compose,
html body #screen-gerente .request-chat-overlay .request-chat-compose{
  box-sizing:border-box!important;min-width:0!important;width:100%!important;
  display:grid!important;grid-template-columns:44px 44px minmax(0,1fr) 48px!important;
  grid-template-rows:minmax(48px,auto) auto!important;
  gap:8px!important;align-items:center!important;
  padding:10px max(10px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))!important;
}
html body #screen-compras .request-chat-overlay .request-chat-compose textarea,
html body #screen-gerente .request-chat-overlay .request-chat-compose textarea{
  grid-column:3!important;grid-row:1!important;min-width:0!important;box-sizing:border-box!important;
  font-size:16px!important;line-height:1.3!important;min-height:48px!important;max-height:112px!important;
  padding:10px 12px!important;overflow-wrap:break-word!important;
}
html body #screen-compras .request-chat-overlay .request-chat-photo-btn,
html body #screen-compras .request-chat-overlay .request-chat-mic-btn,
html body #screen-compras .request-chat-overlay .request-chat-send-btn,
html body #screen-gerente .request-chat-overlay .request-chat-photo-btn,
html body #screen-gerente .request-chat-overlay .request-chat-mic-btn,
html body #screen-gerente .request-chat-overlay .request-chat-send-btn{
  display:grid!important;place-items:center!important;min-width:0!important;box-sizing:border-box!important;
  margin:0!important;border-radius:14px!important;padding:0!important;
  font-size:21px!important;line-height:1!important;font-weight:850!important;
  white-space:nowrap!important;overflow:hidden!important;overflow-wrap:normal!important;
  word-break:normal!important;text-indent:0!important;letter-spacing:0!important;
}
html body #screen-compras .request-chat-overlay .request-chat-photo-btn,
html body #screen-gerente .request-chat-overlay .request-chat-photo-btn{
  grid-column:1!important;grid-row:1!important;width:44px!important;height:48px!important;min-height:48px!important;
}
html body #screen-compras .request-chat-overlay .request-chat-mic-btn,
html body #screen-gerente .request-chat-overlay .request-chat-mic-btn{
  grid-column:2!important;grid-row:1!important;width:44px!important;height:48px!important;min-height:48px!important;
}
html body #screen-compras .request-chat-overlay .request-chat-send-btn,
html body #screen-gerente .request-chat-overlay .request-chat-send-btn{
  grid-column:4!important;grid-row:1!important;width:48px!important;height:48px!important;min-height:48px!important;
  background:#2563eb!important;color:#fff!important;
}
html body .request-chat-overlay .request-chat-photo-btn::before,
html body .request-chat-overlay .request-chat-mic-btn::before,
html body .request-chat-overlay .request-chat-send-btn::before{content:none!important;display:none!important}
html body #screen-compras .request-chat-overlay .request-chat-help,
html body #screen-gerente .request-chat-overlay .request-chat-help{
  grid-column:1/-1!important;grid-row:2!important;display:block!important;
  padding:0 2px!important;margin:0!important;min-width:0!important;
  font-size:11px!important;line-height:1.35!important;color:#65758c!important;
  white-space:normal!important;overflow-wrap:break-word!important;
}
html body .request-chat-overlay-head{padding-left:max(14px,env(safe-area-inset-left))!important;padding-right:max(14px,env(safe-area-inset-right))!important}
html body .request-chat-overlay-head>div{min-width:0!important;overflow-wrap:anywhere!important}
html body .request-chat-overlay-head strong{font-size:16px!important;line-height:1.25!important}
html body .request-chat-overlay-head small{font-size:11px!important;line-height:1.4!important;letter-spacing:0!important}
html body .request-chat-overlay-head .request-chat-overlay-close{display:flex!important;align-items:center!important;justify-content:center!important;gap:4px!important;width:auto!important;min-width:80px!important;padding:0 12px!important;white-space:nowrap!important;font-size:12px!important}
html body .request-chat-overlay-head .request-chat-overlay-close::before{content:'←';font-size:20px;font-weight:900}
html body #screen-compras .request-responsibility-copy,
html body #screen-gerente .request-responsibility-copy{min-width:0!important;overflow-wrap:anywhere!important}
html body .request-responsibility-band{min-width:0!important;max-width:100%!important;overflow-wrap:anywhere!important}
html body .bem-assignee-photo{width:60px;height:60px;min-width:60px;display:grid;place-items:center;align-self:center;border-radius:50%;overflow:hidden;border:2px solid #d2e6db;background:#fff;color:#286946;font-weight:900;font-size:20px}
html body .bem-assignee-photo img{width:100%;height:100%;object-fit:cover;display:block}
html body .request-responsibility-band .request-responsibility-copy strong{font-size:clamp(14px,3.5vw,18px)!important;line-height:1.3!important}
html body .app-back-btn:not(.hidden){max-width:100%!important;min-height:40px!important;white-space:nowrap!important}
@media(max-width:420px){
 html body #screen-compras .request-chat-overlay .request-chat-compose,
 html body #screen-gerente .request-chat-overlay .request-chat-compose{
  grid-template-columns:42px 42px minmax(0,1fr) 46px!important;gap:6px!important;padding-left:8px!important;padding-right:8px!important
 }
 html body #screen-compras .request-chat-overlay .request-chat-photo-btn,
 html body #screen-gerente .request-chat-overlay .request-chat-photo-btn,
 html body #screen-compras .request-chat-overlay .request-chat-mic-btn,
 html body #screen-gerente .request-chat-overlay .request-chat-mic-btn{width:42px!important}
 html body #screen-compras .request-chat-overlay .request-chat-send-btn,
 html body #screen-gerente .request-chat-overlay .request-chat-send-btn{width:46px!important}
 html body .request-responsibility-band .bem-assignee-photo{width:48px;height:48px;min-width:48px;font-size:17px}
}
@media(prefers-reduced-motion:reduce){html body .request-chat-overlay{animation:none!important}}

/* Altura apropriada ao texto em fonte acessível, mesmo com zoom do Android. */
html body #screen-compras .request-chat-overlay .request-chat-compose textarea,
html body #screen-gerente .request-chat-overlay .request-chat-compose textarea{height:66px!important;min-height:66px!important;max-height:112px!important;}

/* P31.4.3 — prioridade alta acima do tema antigo, em mobile e desktop.
   A flag JS e o estilo inline formam duas proteções independentes. */
html body.bem-request-chat-open #navRevealBtn,
html body.bem-request-chat-open #navRevealBtn:not(.hidden).is-nav-open,
html body.bem-request-chat-open #navRevealBtn:not(.hidden).is-nav-closed,
html body.bem-request-chat-open #adminNav.bottom-nav,
html body.bem-request-chat-open #managerNav.bottom-nav,
html body.bem-request-chat-open #appBackBtn,
html body:not(.modal-open):has(.request-chat-overlay) #navRevealBtn:not(.hidden).is-nav-open,
html body:not(.modal-open):has(.request-chat-overlay) #navRevealBtn:not(.hidden).is-nav-closed {
 display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important
}
html body .request-chat-overlay{position:fixed!important;inset:0!important;top:0!important;left:0!important;right:0!important;bottom:0!important;box-sizing:border-box!important;width:100vw!important;width:100dvw!important;max-width:100dvw!important;height:100dvh!important;max-height:100dvh!important;transform:none!important;animation:none!important;z-index:2147483000!important}
html body .request-chat-compose{padding-bottom:max(10px,env(safe-area-inset-bottom))!important}
html body .bem-assignee-photo-action{display:inline-flex;align-items:center;justify-content:center;margin-top:7px;max-width:100%;min-height:38px;padding:7px 11px;border-radius:12px;border:1px solid #b7dcca;background:#fff;color:#246346;font:800 12px/1.2 system-ui,sans-serif;white-space:normal;text-align:center;cursor:pointer}
html body .bem-assignee-photo-action:focus-visible{outline:3px solid #6aa88b;outline-offset:2px}

/* Origem exata do modal: superar regras antigas de z-index e animação. */
html body #screen-compras .request-chat-overlay,
html body #screen-gerente .request-chat-overlay {
 position:fixed!important;inset:0!important;top:0!important;bottom:0!important;left:0!important;right:0!important;
 translate:none!important;transform:none!important;animation:none!important;
 z-index:2147483000!important;width:100dvw!important;height:100dvh!important;max-width:100dvw!important;max-height:100dvh!important
}
