/* Text actions share an aligned row; transport controls keep their own grid. */
:is(.reader-actions,.question-actions,.review-actions,.game-next,.self-rating,
    .case-study-actions,.treatment-actions,.treatment-medication-actions,
    .classroom-actions,.classroom-selection-tools,.visual-play-actions,
    .voice-actions):not([hidden]) {
  min-width:0;
  max-width:100%;
  align-items:stretch;
  gap:10px;
}

:is(.reader-actions,.question-actions,.review-actions,.game-next,.self-rating,
    .case-study-actions,.treatment-actions,.classroom-actions,
    .classroom-selection-tools,.visual-play-actions,.voice-actions)
  > :is(button,a.primary,a.secondary,label.secondary):not([hidden]) {
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:0;
  max-width:100%;
  min-height:48px;
  margin:0;
  line-height:1.35;
  white-space:normal;
  overflow-wrap:anywhere;
  text-align:center;
}

.treatment-medication-actions > :is(button,a):not([hidden]) {
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:0;
  max-width:100%;
  min-height:44px;
  margin:0;
  line-height:1.35;
  white-space:normal;
  overflow-wrap:anywhere;
  text-align:center;
}

.game-next:not([hidden]) { flex-wrap:wrap; }
.self-rating > button:not([hidden]) { flex:1 1 140px; }

/* The print toolbar contains labels and full text actions, not icon controls. */
.print-toolbar:not([hidden]) {
  flex-wrap:wrap;
  align-items:stretch;
  gap:10px;
}
.print-toolbar > span { align-self:center; min-width:0; line-height:1.4; }
.print-toolbar > button:not([hidden]) {
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:0;
  max-width:100%;
  min-height:48px;
  margin:0;
  line-height:1.35;
  white-space:normal;
  overflow-wrap:anywhere;
  text-align:center;
}

.print-library-tools:not([hidden]),.print-section-heading:not([hidden]) {
  flex-wrap:wrap;
  gap:8px;
}
.print-section-heading h3 { min-width:0; }
.print-text-button:not([hidden]) { min-height:44px; margin:0; line-height:1.35; }
.print-close:not([hidden]) {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 44px;
  box-sizing:border-box;
  width:44px;
  height:44px;
  min-width:44px;
  min-height:44px;
  padding:0;
  margin:0;
  line-height:1;
}
.print-order li:not([hidden]) { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; }
.print-order li > div:not([hidden]) { justify-self:end; gap:6px; }
.print-order button:not([hidden]) {
  box-sizing:border-box;
  width:44px;
  min-width:44px;
  height:44px;
  min-height:44px;
  padding:0;
  margin:0;
  line-height:1;
}
.print-file-ready a:not([hidden]) {
  box-sizing:border-box;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:48px;
  line-height:1.35;
  overflow-wrap:anywhere;
}

.visual-lesson-navigation:not([hidden]) { flex-wrap:wrap; align-items:stretch; }
.visual-lesson-navigation > button:not([hidden]) {
  min-width:0;
  max-width:100%;
  min-height:48px;
  margin:0;
  line-height:1.35;
  white-space:normal;
}
.visual-lesson-navigation > span { align-self:center; }

@media(max-width:700px) {
  .print-toolbar:not([hidden]) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .print-toolbar > span { grid-column:1/-1; }
  .print-toolbar > button:not([hidden]) { width:100%; }
  .game-next > button:not([hidden]),.review-actions > :is(button,label):not([hidden]) { flex:1 1 170px; }
}
@media(max-width:620px) {
  .visual-lesson-navigation:not([hidden]) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .visual-lesson-navigation > span { grid-column:1/-1; grid-row:1; }
  .visual-lesson-navigation > button:not([hidden]) { width:100%; }
}
@media(max-width:500px) {
  .print-toolbar:not([hidden]) { grid-template-columns:minmax(0,1fr); }
}
