/* 1.0.293 — refinamento do shell persistente, chat e acoes equivalentes. */

@media (max-width: 899px) {
  /* A superficie pode preencher o inset do Android, mas sua borda pertence
     somente ao topo. Assim nao surgem linhas laterais ate os botoes do SO. */
  .bottom-tabs,
  html:not(.cap-native) .bottom-tabs,
  html.cap-native .bottom-tabs,
  body.ol-assistant-active .bottom-tabs,
  body.ol-assistant-active.assistant-keyboard-open .bottom-tabs,
  html.cap-native body.ol-assistant-active.assistant-keyboard-open .bottom-tabs {
    box-sizing: border-box !important;
    border: 0 !important;
    border-top: 1px solid rgba(148, 163, 184, .14) !important;
    border-radius: 20px 20px 0 0 !important;
    background: rgba(5, 12, 27, .985) !important;
    box-shadow: 0 -10px 28px rgba(2, 6, 23, .28), inset 0 1px 0 rgba(255, 255, 255, .025) !important;
  }

  html.cap-native .bottom-tabs,
  html.cap-native body.ol-assistant-active .bottom-tabs,
  html.cap-native body.ol-assistant-active.assistant-keyboard-open .bottom-tabs {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    transform: none !important;
  }

  /* O + continua sendo uma acao permanente, inclusive durante a conversa. */
  body.ol-assistant-active .bottom-tabs .nav-fab-slot,
  body.ol-assistant-active.assistant-keyboard-open .bottom-tabs .nav-fab-slot {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  body.ol-assistant-active #fab,
  body.ol-assistant-active.assistant-keyboard-open #fab {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Com o IME aberto a barra do sistema ja faz parte do teclado. Reservar o
     inset novamente criava a faixa vazia observada sob a Bottom Navigation. */
  body.ol-assistant-active.assistant-keyboard-open .app,
  html.cap-native body.ol-assistant-active.assistant-keyboard-open .app {
    padding-bottom: var(--oliver-bottom-nav-base) !important;
  }
  body.ol-assistant-active.assistant-keyboard-open .bottom-tabs,
  html.cap-native body.ol-assistant-active.assistant-keyboard-open .bottom-tabs {
    height: var(--oliver-bottom-nav-base) !important;
    padding-bottom: 0 !important;
  }

  /* O titulo global e o avatar ja identificam a area. Remover a segunda barra
     libera espaco util para o historico sem apagar o rotulo acessivel do nav. */
  #page-assistant .assistant-conversation-bar,
  body.ol-assistant-active #page-assistant .assistant-conversation-bar {
    display: none !important;
  }

  body.ol-assistant-active #page-assistant .assistant-chat-panel,
  body.ol-assistant-active.assistant-keyboard-open #page-assistant .assistant-chat-panel {
    padding-top: 0 !important;
  }
  body.ol-assistant-active #page-assistant .chat-box,
  body.ol-assistant-active.assistant-keyboard-open #page-assistant .chat-box {
    padding-top: 6px !important;
    padding-bottom: 4px !important;
    scroll-padding-block: 6px !important;
  }
  body.ol-assistant-active #page-assistant .chat-composer,
  body.ol-assistant-active.assistant-keyboard-open #page-assistant .chat-composer,
  html.cap-native body.ol-assistant-active #page-assistant .chat-composer,
  html.cap-native body.ol-assistant-active.assistant-keyboard-open #page-assistant .chat-composer {
    min-height: 0 !important;
    margin: 0 !important;
    padding: 5px 7px !important;
    gap: 0 !important;
  }

  /* Os dois comandos de cada grupo possuem a mesma coluna, hitbox e conteudo
     centralizado. Nenhum texto determina a largura do botao vizinho. */
  #page-wallet .wallet-tool-actions,
  .ofx-invest-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 8px !important;
  }
  #page-wallet .wallet-tool-btn,
  #page-wallet .wallet-clear-btn,
  .ofx-invest-actions > button {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    text-align: center !important;
  }
  .ofx-invest-actions > button > .ui-icon {
    position: static !important;
    width: 17px !important;
    height: 17px !important;
    flex: 0 0 17px !important;
  }
  .ofx-invest-actions > button > span {
    width: auto !important;
    text-align: center !important;
  }

  /* Ver perfil so recebe destaque quando esta rota esta realmente aberta. */
  .sidebar-mobile-profile {
    border-color: rgba(148, 163, 184, .13) !important;
    background: rgba(7, 15, 31, .7) !important;
    box-shadow: none !important;
  }
  .sidebar-mobile-profile.active,
  .sidebar-mobile-profile[aria-current="page"] {
    border-color: rgba(var(--brand-rgb),.34) !important;
    background: linear-gradient(135deg, rgba(76, 29, 149, .3), rgba(15, 23, 42, .78)) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bottom-tabs,
  .sidebar-mobile-profile { transition: none !important; }
}
