/*
  PORQUE EXISTE: diagramar o topo do chat e as abas do editor sem
  botões a sobrepor-se — filas claras, gaps e trilho horizontal.
*/
.topo-acoes {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.topo-fila {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  flex-wrap: nowrap;
}

.topo-fila .seletor-pc,
.topo-fila .seletor-janela {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  margin: 0;
}

.topo-fila .seletor-pc select,
.topo-fila .seletor-janela select {
  flex: 1 1 auto;
  min-width: 0;
}

.topo-fila .btn-icone {
  flex-shrink: 0;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px;
  min-height: 40px;
}

.topo-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.topo-extras {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topo-extras .btn-instalar-app {
  white-space: nowrap;
  padding: 6px 10px;
  min-height: 36px;
  font-size: 11px;
}

.zoom-ctrl {
  margin-left: 0;
}

.topo-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.rodape-linha #btn-ux-prefs {
  flex-shrink: 0;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px;
  min-height: 40px;
}

/* Abas do editor: trilho rolável + ações fixas à direita */
.editor-abas {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 42px;
  padding-left: 0;
  overflow: hidden;
}

.abas-trilho {
  display: flex;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.abas-trilho .aba {
  flex: 0 0 auto;
  scroll-snap-align: start;
  max-width: min(220px, 55vw);
}

.editor-abas > .abas-acoes,
.editor-abas > .painel-chrome {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 0;
  padding: 4px 6px;
  border-left: 1px solid var(--borda);
  background: color-mix(in srgb, var(--fundo-painel) 85%, transparent);
}

.editor-abas > .painel-chrome {
  margin-left: 0;
}

.editor-abas .painel-chrome .btn-icone,
.editor-abas .abas-acoes .btn-icone {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  min-height: 36px;
}

.chat-topo .painel-chrome {
  flex-shrink: 0;
}

@media (max-width: 820px) {
  .topo-fila {
    flex-wrap: wrap;
  }

  .topo-fila .seletor-pc,
  .topo-fila .seletor-janela {
    flex: 1 1 100%;
  }

  .topo-tools {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .topo-fila .btn-icone {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    min-height: 44px;
  }

  .abas-trilho .aba {
    max-width: min(180px, 70vw);
  }
}
