/* ==========================================================================
   Contenedor Principal del Chat (Usa el 100% del alto disponible)
   ========================================================================== */
.chat-container {
  flex: 1 1 0%;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  margin: 0;
  height: 100%;
  max-height: 100%;
  position: relative;
  padding: 0;
  background-color: var(--bg-app);
}

.messages-list {
  flex: 1 1 0%;
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 1rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
}

/* Estado de Bienvenida */
.welcome-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto auto;
  text-align: center;
  padding: 3rem 1.5rem;
  max-width: var(--max-content-width, 68rem);
  width: 100%;
  align-self: center;
  animation: fadeIn 0.3s ease-out;
}

.welcome-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.25rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-light), var(--bg-surface));
  color: var(--primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.welcome-banner h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

.welcome-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.welcome-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}

.welcome-help-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: fit-content;
  margin: 0.75rem auto 0;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.welcome-help-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.execution-info-body {
  display: grid;
  gap: 0.85rem;
}

.execution-info-body p {
  margin: 0;
  line-height: 1.5;
}

.execution-info-dialog [hidden] {
  display: none;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--success);
  display: inline-block;
  box-shadow: 0 0 6px var(--success);
}



/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 640px) {




  .messages-list {
    padding: 0.5rem;
  }

  .message-content-wrapper {
    max-width: 100%;
  }

  .message-content {
    padding: 0.75rem 0.9rem;
  }

  .modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 0.75rem;
  }

  .footer-actions-left,
  .footer-actions-right {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
}
