/* Dynamic Prediction section (static/js/dynamic-prediction.js). Builds on the shared viewer styles in
   in-the-wild.css and the column-header pills of dynamic-recon.css; adds the task toolbar, the legend and the
   6-asset grid (one column per asset: name, reference image, prediction video; rows aligned with subgrid). */
.dynamic-prediction-section {
  padding-top: 3rem;
  padding-bottom: 3rem;
  --itw-accent: #00d1b2;
  --itw-accent-dark: #00947e;
  --itw-accent-light: #ebfffc;
  --itw-line: #e3e7ec;
  --itw-muted: #6b7280;
  --itw-stage: #ffffff;   /* the renders have white backgrounds */
}
.pred-toolbar {
  flex-wrap: wrap;
  padding-bottom: 1.2rem;
}
.pred-toolbar .itw-segmented {
  margin-right: auto;
  margin-left: 0.75rem;
}
.pred-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--itw-muted);
}
.pred-legend i {
  display: inline-block;
  width: 1.4rem;
  height: 0.4rem;
  margin-right: 0.4rem;
  border-radius: 999px;
  vertical-align: middle;
}

.pred-grid {
  display: grid;
  grid-template-columns: 6.5rem repeat(6, minmax(0, 1fr));
  grid-template-rows: auto auto auto;
  column-gap: 0.7rem;
  padding: 0 1.6rem;
}
.pred-col,
.pred-labels {
  display: grid;
  grid-row: 1 / span 3;
  grid-template-rows: subgrid;
  row-gap: 0.6rem;
  min-width: 0;
}
.pred-head {
  font-size: 0.9rem;
  padding: 0.4rem 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pred-rowlabel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #363636;
}
.pred-rowlabel small {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--itw-muted);
}
.pred-grid .itw-panel.is-ours {
  border: 2px solid var(--itw-accent);
}
.pred-stage {
  aspect-ratio: 360 / 472;
}
.pred-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media screen and (max-width: 768px) {
  .pred-toolbar .itw-segmented {
    order: 3;
    flex-basis: 100%;
    margin: 0.4rem 0 0;
  }
  .pred-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: none;
    gap: 0.9rem 0.5rem;
    padding: 0 0.9rem;
  }
  .pred-labels {
    display: none;
  }
  .pred-col {
    grid-row: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }
  .pred-head {
    font-size: 0.8rem;
  }
}
