/* Fix: prevent filter panel from exceeding main width / causing horizontal overflow */

.jfilters,
.jfilters * {
  box-sizing: border-box;
}

.jfilters {
  width: 100%;
  max-width: 100%;
  overflow: hidden;          /* avoid expanding grid beyond container */
  margin: 1px 0 1px;
  padding: 12px;
  border: 0px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

/* Allow grid tracks to shrink within the main column */
.jfilters__row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.jfilters__field { 
  min-width: 0; 
}

.jfilters__label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
}

.jfilters__select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  background: var(--bg);
}

.jfilters__meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.jfilters__clear {
  color: var(--link);
  text-decoration: none;
}

.jfilters__clear:hover { text-decoration: none; }

.jfilters__hint { opacity: 0.9; }

/* Responsive: fewer columns before we hit overflow */
@media (max-width: 1200px) {
  .jfilters__row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .jfilters__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .jfilters__row {
    grid-template-columns: 1fr;
  }
}
