/* Dentro de Softr, el iframe ya recibe la altura disponible. */
html.vizlo-embedded,
.vizlo-embedded body {
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.vizlo-embedded body {
  overflow: hidden;
}

.vizlo-embedded .app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 10px 12px 6px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  /* Formularios de acceso y perfil pueden crecer con el teclado. */
  overflow: auto;
}

.vizlo-embedded .app:has(#chat:not([hidden])) {
  overflow: hidden;
}

.vizlo-embedded .app > :not(#chat):not([hidden]),
.vizlo-embedded #chat > :where(:not(#messages):not([hidden])) {
  flex: 0 0 auto;
}

.vizlo-embedded #chat:not([hidden]) {
  order: 1;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
}

.vizlo-embedded #messages {
  flex: 1 1 0;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin-bottom: 6px;
  scrollbar-width: none;
}

.vizlo-embedded #messages::-webkit-scrollbar {
  display: none;
}

.vizlo-embedded .page-title,
.vizlo-embedded .chat-heading {
  margin-block: 5px;
}

.vizlo-embedded .page-title h2,
.vizlo-embedded .chat-heading h3 {
  margin-block: 0;
}

.vizlo-embedded #status:not(:empty),
.vizlo-embedded .realtime-indicator {
  margin-block: 4px 0;
}

.vizlo-embedded #status:empty {
  margin: 0;
}

.vizlo-embedded #logoutBtn {
  margin-top: 5px;
  padding-block: 5px;
}

@media (max-height: 530px) {
  .vizlo-embedded .form-group {
    margin-bottom: 8px;
  }

  .vizlo-embedded .vizlo-header {
    padding-right: 20px;
  }

  .vizlo-embedded #chat:not([hidden]) .chat-heading {
    margin-block: 3px;
  }
}

/* El código del chat envuelve el historial para el botón de mensajes nuevos. */
.vizlo-embedded #chat > div:has(> #messages) {
  order: 1;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
}

.vizlo-embedded .app {
  padding: 6px 8px 3px;
}

.vizlo-embedded .vizlo-header {
  min-height: 27px;
  padding-right: 22px;
}

.vizlo-embedded .logo {
  gap: 6px;
}

.vizlo-embedded .logo-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 14px;
}

.vizlo-embedded .vizlo-header h1 {
  font-size: 17px;
  letter-spacing: 1px;
}

.vizlo-embedded .connection-badge {
  gap: 3px;
  font-size: 10px;
}

.vizlo-embedded .check-icon {
  width: 14px;
  height: 14px;
}

.vizlo-embedded .page-title {
  padding: 2px 0;
  margin-block: 4px 2px;
}

.vizlo-embedded .page-title h2 {
  font-size: 16px;
}

.vizlo-embedded .page-title p {
  font-size: 11px;
}

.vizlo-embedded .chat-heading {
  margin-bottom: 4px !important;
}

.vizlo-embedded .chat-heading h3 {
  font-size: 13px;
}

.vizlo-embedded #vizloBarraChat {
  margin-bottom: 5px;
}

.vizlo-embedded #vizloBarraChat #openSharedFilesBtn {
  padding-block: 6px !important;
}

.vizlo-embedded #vizloBarraChat #vizloSOSButton,
.vizlo-embedded #vizloBarraChat #vizloSearchMessagesBtn,
.vizlo-embedded #vizloBarraChat #vizloGroupOptionsBtn {
  height: 34px !important;
}

.vizlo-embedded #messages {
  padding: 7px;
  margin-bottom: 4px;
}

.vizlo-embedded #replyPreview {
  order: 2;
}

.vizlo-embedded #messageForm {
  order: 3;
  gap: 5px;
}

.vizlo-embedded #messageInput,
.vizlo-embedded #sendBtn,
.vizlo-embedded #attachBtn {
  min-height: 40px;
  padding: 6px 9px;
}

.vizlo-embedded #logoutBtn {
  margin: 0 0 4px auto;
  width: auto;
  font-size: 11px;
}

.vizlo-embedded #status:not(:empty),
.vizlo-embedded .realtime-indicator {
  min-height: 0;
  margin: 2px 0 0;
  padding-top: 0;
  font-size: 10px;
}

.vizlo-embedded .realtime-indicator svg {
  width: 13px;
  height: 13px;
}
