/* ViaOn Conecta 0.3.5.3: navegação móvel permanente Chat / Rádio / SOS. */
.mobile-view-shortcut{display:none!important}
@media(max-width:959px){
  body main:not([hidden]){padding-bottom:calc(83px + env(safe-area-inset-bottom))!important}
  body.is-admin.admin-chat-mode main:not([hidden]){padding-bottom:calc(83px + env(safe-area-inset-bottom))!important}
  main:not([hidden])>.chat-nav{
    position:fixed!important;bottom:0!important;left:0!important;right:0!important;
    z-index:80!important;display:flex!important;align-items:center;justify-content:center;
    gap:8px!important;margin:0!important;padding:9px max(12px,env(safe-area-inset-left)) calc(9px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-right))!important;
    background:rgba(255,255,255,.97)!important;
    border-top:1px solid #e5e7eb;box-shadow:0 -7px 22px #212b3814;
    overflow:visible!important;width:100%!important;max-width:none!important;
  }
  .chat-nav button{flex:1 1 0!important;min-width:0!important;max-width:210px;min-height:48px!important;padding:8px 6px!important;font-size:clamp(11px,2.8vw,13px)!important;
    border-radius:11px!important;touch-action:manipulation;white-space:normal!important;line-height:1.3!important}
  .chat-nav #filesTab{display:none!important} /* Anexos disponíveis dentro do chat. */
  body[data-conecta-view="chat"] #radioPanel,
  body[data-conecta-view="chat"] .actions,
  body[data-conecta-view="chat"] #peoplePanel,
  body[data-conecta-view="radio"] #chatPanel,
  body[data-conecta-view="radio"] .actions,
  body[data-conecta-view="alerts"] #chatPanel,
  body[data-conecta-view="alerts"] #radioPanel,
  body[data-conecta-view="alerts"] #peoplePanel{display:none!important}
  body[data-conecta-view="alerts"] .actions{display:grid!important;margin-top:13px;}
  body[data-conecta-view="alerts"] .actions::before{content:"Emergência e localização";grid-column:1/-1;font-size:14px;font-weight:800;padding:7px 3px 3px;}
  .mobile-view-shortcut{display:inline-flex!important;align-items:center;justify-content:center;min-height:41px;cursor:pointer;
    background:#fff8f1;color:#a34c0e;border:1px solid #f2c39f;border-radius:11px;
    padding:9px 12px;font-size:12px;font-weight:800;touch-action:manipulation}
  .chat .chat-open-radio{margin-left:auto;flex-shrink:0}
  .desktop-only-chat-symbol{display:none!important}
  .radio .radio-return-chat{grid-column:1/-1;grid-row:1;justify-self:start;margin:0 0 2px}
  .radio .radiohead{grid-row:2!important;grid-column:1!important}
  .radio .ptt{grid-row:2!important;grid-column:2!important}
  .radio .hint,.radio .consent{grid-column:1/-1!important}
  .chat{scroll-margin-top:10px}
  #radioPanel{scroll-margin-top:12px}
  .actions{scroll-margin-top:14px}
  .chathead{gap:9px}
  /* Composer stays above bottom navigation, even on short phones. */
  body[data-conecta-view="chat"] #msgForm{
    display:flex!important;position:fixed!important;
    left:max(8px,env(safe-area-inset-left))!important;
    right:max(8px,env(safe-area-inset-right))!important;
    bottom:calc(68px + env(safe-area-inset-bottom))!important;
    z-index:78!important;max-width:680px;margin:0 auto!important;
    padding:8px!important;background:#fff;border:1px solid #e7e8ea;
    border-radius:14px;box-shadow:0 -5px 18px #15202d13;
  }
  body[data-conecta-view="chat"] #chatPanel{padding-bottom:73px!important}
  body[data-conecta-view="chat"] #messages{scroll-padding-bottom:80px}
  [data-theme="dark"] body[data-conecta-view="chat"] #msgForm{background:#252b34;color:#fff;border-color:#434d59}
}
@media(max-width:380px){.chat-nav button{font-size:11px!important;min-height:51px!important}.chat .chat-open-radio{padding:8px 9px;font-size:11px}}
[data-theme="dark"] main:not([hidden])>.chat-nav{background:rgba(24,28,35,.98)!important;border-color:#3a414b}
[data-theme="dark"] .mobile-view-shortcut{background:#34291f;color:#ffc18a;border-color:#734e30}

@media(min-width:761px) and (max-width:959px){
  body.is-admin.admin-chat-mode main:not([hidden]){display:block!important}
  body.is-admin.admin-chat-mode #chatPanel,body.is-admin.admin-chat-mode #radioPanel{width:100%;height:auto;min-height:0;margin:0 0 10px}
}
