/* PredictorGrid (shared/js/predictor_grid.js) — the shared "pick your predictors" grid.
   Visual intent follows the Neural Network Lab's predictor rows; every rule is scoped
   under .predictor-grid so a tool that still carries its own .predictor-row styles is
   not affected. */

.predictor-grid {
  margin: 0;
  padding: 0.75rem;
  min-width: 0;
  border: 1px solid var(--app-border, #d6dfea);
  border-radius: 10px;
  background: var(--app-card-bg, #ffffff);
  color: var(--app-text, #1f2a37);
}

.predictor-grid__legend {
  padding: 0 0.35rem;
  font-weight: 600;
  color: var(--app-text, #1f2a37);
}

.predictor-grid__list {
  display: grid;
  gap: 0.4rem;
}

.predictor-grid__empty {
  margin: 0;
  color: var(--app-muted, #5f6b7a);
}

.predictor-grid .predictor-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  min-height: 44px;
  padding: 0.25rem 0.75rem;
  background: var(--app-bg, #f5f7fb);
  border: 1px solid var(--app-border, #d6dfea);
  border-radius: 8px;
}

.predictor-grid .predictor-row--included {
  border-color: var(--app-accent, #2a7de1);
}

.predictor-grid .predictor-row--disabled .predictor-name {
  color: var(--app-muted, #5f6b7a);
}

.predictor-grid .predictor-check {
  flex: 0 0 auto;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  accent-color: var(--app-accent, #2a7de1);
  cursor: pointer;
}

.predictor-grid .predictor-check:disabled { cursor: not-allowed; }

/* The label is the large touch target: clicking anywhere on the name toggles the box. */
.predictor-grid .predictor-name {
  flex: 1 1 9rem;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.predictor-grid .predictor-badge {
  flex: 0 0 auto;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  background: #e2e8f0;
  color: #334155;
}

.predictor-grid .predictor-badge--numeric { background: #dbeafe; color: #1d4ed8; }
.predictor-grid .predictor-badge--categorical { background: #ede9fe; color: #6d28d9; }
.predictor-grid .predictor-badge--id { background: #e2e8f0; color: #334155; }
.predictor-grid .predictor-badge--warn { background: #fef3c7; color: #92400e; }

.predictor-grid .predictor-type,
.predictor-grid .predictor-reference {
  min-height: 44px;
  max-width: 100%;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--app-border, #d6dfea);
  border-radius: 6px;
  background: var(--app-card-bg, #ffffff);
  color: var(--app-text, #1f2a37);
  font: inherit;
}

.predictor-grid .predictor-type:disabled {
  color: var(--app-muted, #5f6b7a);
  cursor: not-allowed;
}

.predictor-grid .predictor-reference-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.predictor-grid .predictor-reference-wrap[hidden] { display: none; }

.predictor-grid .predictor-reference-label {
  font-size: 0.85rem;
  color: var(--app-muted, #5f6b7a);
}

.predictor-grid .predictor-check:focus-visible,
.predictor-grid .predictor-type:focus-visible,
.predictor-grid .predictor-reference:focus-visible {
  outline: 3px solid var(--app-accent, #2a7de1);
  outline-offset: 2px;
}

/* Phones: the controls drop under the name and take the full row width. */
@media (max-width: 640px) {
  .predictor-grid .predictor-name { flex-basis: calc(100% - 2rem); }
  .predictor-grid .predictor-type,
  .predictor-grid .predictor-reference-wrap { flex: 1 1 100%; }
  .predictor-grid .predictor-reference { flex: 1 1 auto; }
}
