/* Stable answer feedback. Keep the equation and controls above variable copy. */
body.times-tables-practice-page .container,
html.student-app-source body.times-tables-practice-page .container {
  grid-template-rows: auto;
  grid-auto-rows: auto;
  align-content: start;
  overflow-anchor: none;
}
body.times-tables-practice-page .times-tables-workspace {
  align-items: start;
  align-content: start;
}
body.times-tables-practice-page .times-tables-equation-panel {
  align-self: start;
  align-content: start;
}
body.times-tables-practice-page .times-tables-answer-panel {
  align-content: start;
  overflow: visible;
}
body.times-tables-practice-page .question,
html.student-app-source body.times-tables-practice-page .question {
  height: auto;
  min-height: clamp(160px, 24vh, 260px);
}
body.times-tables-practice-page .times-tables-feedback-space {
  box-sizing: border-box;
  display: grid;
  align-content: start;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: var(--dmr-feedback-min-height, 0px);
  margin-top: 4px;
}
body.times-tables-practice-page #feedback,
html.student-app-source body.times-tables-practice-page #feedback {
  box-sizing: border-box;
  height: auto;
  min-height: calc(2.7em + 20px);
  align-items: flex-start;
  justify-content: center;
  padding: 8px;
  border: 2px solid transparent;
  line-height: 1.35;
  overflow: visible;
  overflow-wrap: anywhere;
}
body.times-tables-practice-page #feedback:not(:empty) {
  border-color: var(--dmr-ink, #212121);
  background: #eef7fb;
}
body.times-tables-practice-page #feedback.correct { background: #d1e8ca; color: #165832; }
body.times-tables-practice-page #feedback.incorrect { background: #fff2df; color: #8d2525; }
body.times-tables-practice-page #timesTablesRecordingStatus,
body.times-tables-practice-page #timesTablesRecordingStatus:empty {
  box-sizing: border-box;
  display: block;
  min-height: calc(2.8em + 14px);
  border: 0;
  padding: 7px 10px;
  background: transparent;
  color: #3c3c3c;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
body.times-tables-practice-page #enterRow,
html.student-app-source body.times-tables-practice-page #enterRow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}
body.times-tables-practice-page #enterRow :is(#submit, #timesTablesDontKnow) { min-height: 44px; }
html.student-app-source body.times-tables-practice-page .times-tables-answer-panel button.dmr-answer-pad__key { min-height: 44px !important; }
/* The existing outer container scrolls in short views; text is never clipped. */
body.times-tables-practice-page.times-tables-fullscreen-active .times-tables-workspace { overflow: visible; }
@media (max-width: 760px), (max-height: 500px) {
  body.times-tables-practice-page .question,
  html.student-app-source body.times-tables-practice-page .question { min-height: 120px; }
}
/* Fullscreen's shared frame normally centers its natural height. Pin this
   activity to the top so extra feedback cannot recenter the entire frame. */
body.times-tables-practice-page.times-tables-fullscreen-active [data-dmr-focus-host]:not([data-dmr-focus-frame]),
body.times-tables-practice-page [data-dmr-focus-host]:fullscreen:not([data-dmr-focus-frame]),
body.times-tables-practice-page [data-dmr-focus-host]:-webkit-full-screen:not([data-dmr-focus-frame]) {
  place-items: start center !important;
}
/* Loading dots and one/two-digit operands share a stable slot, so issuing the
   next question cannot move the answer box horizontally. */
body.times-tables-practice-page #displayquestion :is(#number1, #number2) {
  min-width: 2ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
