/* BF Gerenciador — ajustes PWA/celular */
html,body { min-height:100%; overscroll-behavior-y:none; }
body { -webkit-tap-highlight-color:transparent; }
button,a,input,textarea,select { touch-action:manipulation; }
.instalar-pwa .pwa-icone { width:22px; text-align:center; }

@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .lateral { padding-bottom: env(safe-area-inset-bottom); }
  #cabecalho { top: env(safe-area-inset-top); }
}

@media (max-width: 700px) {
  html { font-size:15px; }
  body { min-height:100dvh; }
  .area { min-width:0; }
  .topo { height:58px; padding-left:max(.55rem,env(safe-area-inset-left)); padding-right:max(.55rem,env(safe-area-inset-right)); }
  .busca-global { min-width:0; flex:1; }
  .busca-global input { min-width:0; font-size:16px; }
  .topo .sino { width:40px; height:40px; flex:none; }
  #assist-topo { display:none; }
  main { padding:.65rem .55rem calc(1rem + env(safe-area-inset-bottom)); min-height:calc(100dvh - 58px); }
  .bloco { padding:.9rem; border-radius:10px; }
  .topo-pagina { align-items:flex-start; }
  h1 { font-size:1.8rem; }
  .btn { min-height:44px; }
  input,select,textarea { font-size:16px; }

  /* Chat passa a ocupar a tela útil inteira no celular */
  body:has(.chat) main { padding:0; max-width:none; }
  .chat { height:calc(100dvh - 58px - env(safe-area-inset-bottom)); min-height:0; border:0; border-radius:0; box-shadow:none; }
  .chat-lista-cab { padding:.75rem .75rem .5rem; }
  .chat-lista > input { margin:0 .75rem .5rem; min-height:44px; }
  .chat-item { min-height:66px; padding:.65rem .75rem; }
  .chat-avatar { width:44px; height:44px; }
  .chat-cab { gap:.45rem; padding:.5rem .55rem; min-height:58px; overflow-x:auto; scrollbar-width:none; }
  .chat-cab::-webkit-scrollbar { display:none; }
  .chat-cab-nome { min-width:100px; }
  .chat-cab-nome small { max-width:140px; }
  .chat-cab > .btn { min-width:42px; height:42px; padding:0 .6rem; flex:none; }
  .chat-chamada-btns { gap:4px; flex:none; }
  .chat-chamada-btns .btn { width:42px; min-width:42px; height:42px; padding:0; }
  #chat-wallpaper { width:42px; padding:0; }
  #chat-cutucar { width:42px; min-width:42px; overflow:hidden; color:transparent; font-size:0; padding:0; }
  #chat-cutucar::before { content:'👋'; color:var(--tinta); font-size:1.15rem; }
  .chat-msgs { padding:.65rem .6rem; gap:.25rem; }
  .chat-msg { max-width:91%; }
  .chat-balao { font-size:.98rem; }
  .chat-balao img { max-height:45dvh; }
  .chat-form { gap:.35rem; padding:.45rem .5rem max(.45rem,env(safe-area-inset-bottom)); background:var(--superficie); }
  .chat-form .btn { min-width:44px; width:44px; height:44px; padding:0; flex:none; }
  .chat-escrever textarea { min-height:44px; max-height:120px; font-size:16px; padding:.62rem .7rem; }
  .chat-anexo-previa { max-width:100%; }

  /* Chamadas realmente em tela cheia no mobile */
  .chamada-overlay { padding:0; align-items:stretch; }
  .chamada-box { width:100vw; height:100dvh; max-width:none; max-height:none; border:0; border-radius:0; }
  .chamada-topo { padding:max(10px,env(safe-area-inset-top)) 12px 10px; }
  .chamada-videos { min-height:0; }
  .chamada-videos .local { width:34vw; height:25vw; max-width:150px; max-height:112px; right:10px; bottom:10px; }
  .chamada-acoes { gap:7px; padding:10px max(8px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left)); overflow-x:auto; justify-content:flex-start; }
  .chamada-acoes button { min-width:50px; width:50px; height:50px; flex:none; }
  .chamada-recebida { left:10px; right:10px; top:auto; bottom:max(10px,env(safe-area-inset-bottom)); width:auto; border-radius:18px; }
  .chamada-recebida .acoes button { min-height:50px; }

  dialog { max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); }
  .modal, .dialogo { max-width:calc(100vw - 16px); }
}

@media (max-width: 390px) {
  .chat-cab { gap:.3rem; }
  .chat-cab .chat-avatar { width:36px; height:36px; }
  .chat-cab-nome small { display:none; }
  .chat-chamada-btns .btn, .chat-cab > .btn { width:40px; min-width:40px; height:40px; }
  .chat-form .btn { width:42px; min-width:42px; }
}
