.feg-container {
  max-width: 800px;
  margin: 0 auto;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}
.feg-form {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-end;
  background: #fdfdfd;
  padding: 20px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.feg-form-group {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
}
.feg-form-group label {
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 5px;
}
.feg-form-group select,
.feg-form-group input {
  padding: 10px 12px;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s ease;
  background: #fafafa;
}
.feg-form-group select:focus,
.feg-form-group input:focus {
  border-color: #0073aa;
  background: #fff;
}
#feg-search-btn {
  padding: 12px 24px;
  background: #0073aa;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}
#feg-search-btn:hover {
  background: #005f8d;
}
#feg-loading {
  margin-left: 10px;
  font-style: italic;
  color: #555;
}
.feg-results {
  margin-top: 25px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.feg-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.feg-table td, .feg-table th {
  border: 1px solid #ccc;
  padding: 10px;
  font-size: 0.95rem;
}
.feg-table tr:nth-child(1) {
  background: #f1f1f1;
  font-weight: bold;
}
#feg-recents-container {
  margin-top: 40px;
  padding: 15px;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}
.feg-recent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.feg-recent-tags .feg-recent-item {
  padding: 7px 14px;
  background: #f5f5f5;
  border-radius: 20px;
  font-size: 0.9rem;
  color: #333;
  text-decoration: none;
  transition: background 0.2s ease;
}
.feg-recent-tags .feg-recent-item:hover {
  background: #e0e0e0;
}
@media (max-width: 600px) {
  .feg-form {flex-direction: column;}
  .feg-form-group {flex: 1 1 100%;}
  #feg-search-btn {width: 100%;}
}
/* RESPONSIVE OPTIMIZADO */
@media (max-width: 1024px) {
  /* Ajuste de formulario para tablets */
  .feg-form {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .feg-form-group {
    flex: 1 1 45%;
  }
  #feg-search-btn {
    flex: 1 1 100%;
  }
}

@media (max-width: 768px) {
  /* Para pantallas de móvil estándar */
  .feg-form {
    flex-direction: column;
    gap: 15px;
  }
  .feg-form-group {
    flex: 1 1 100%;
  }
  #feg-search-btn {
    width: 100%;
    font-size: 1.1rem;
    padding: 14px;
  }

  /* Títulos y margenes más compactos */
  .feg-container h3, .feg-container h4 {
    font-size: 1rem;
    margin-bottom: 10px;
  }
}

@media (max-width: 480px) {
  /* Ajustes en móviles chicos */
  .feg-form-group label {
    font-size: 0.85rem;
  }
  .feg-form-group input,
  .feg-form-group select {
    font-size: 0.9rem;
    padding: 8px 10px;
  }
  #feg-search-btn {
    font-size: 1rem;
    padding: 12px;
  }

  /* Chips de últimas búsquedas: scroll horizontal */
  .feg-recent-tags {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
  }
  .feg-recent-tags::-webkit-scrollbar {
    height: 6px;
  }
  .feg-recent-tags::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
  }
  .feg-recent-tags .feg-recent-item {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}