/* Compact lesson header. On an iPad (820px tall) the lesson used to start 655px down; the page
   chrome now takes one short line each so the current step is on screen straight away. */
#task-content .lesson-crumbs { margin: 6px 0 4px; }
#task-content .practice-mode-note { padding: 4px 12px; font-size: 15px; line-height: 1.4; border-radius: 10px; }
#task-content .student-lesson-heading { margin: 6px 0 4px; padding: 0; }
#task-content .student-lesson-heading .eyebrow { margin: 0; font-size: 13px; }
#task-content .student-lesson-heading h1 { font-size: clamp(24px, 3vw, 32px); margin: 0; line-height: 1.15; }
#task-content .rec-bar { padding: 4px 12px; margin: 6px 0 2px; min-height: 0; }
#task-content .rec-bar p { margin: 0; }
#task-content .rec-bar + p { margin: 0 0 4px; font-size: 14px; }

/* Step tabs and "Record in" share one sticky row. */
.student-lesson-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 6px 0 10px; }
.student-lesson-toolbar .student-lesson-nav { flex: 1 1 520px; margin: 0; }
.student-lesson-toolbar .student-lesson-nav button { min-height: 44px; }
.student-lesson-toolbar .lesson-recording { flex: 0 0 auto; margin: 0; gap: 0; }
.student-lesson-toolbar .lesson-recording-label { font-size: 14px; margin-right: 6px; color: var(--muted, #4a5b66); }
.student-lesson-toolbar .lesson-recording button { min-height: 44px; padding: 6px 12px; border-radius: 0; margin: 0 0 0 -1px; }
.student-lesson-toolbar .lesson-recording button:first-of-type { border-radius: 10px 0 0 10px; }
.student-lesson-toolbar .lesson-recording button:last-of-type { border-radius: 0 10px 10px 0; }
.student-lesson-toolbar .lesson-recording button[aria-pressed="true"] { background: var(--blue, #1f5f8b); color: #fff; border-color: var(--blue, #1f5f8b); }
.student-lesson-toolbar .recording-help { flex-basis: 100%; font-size: 14px; margin-top: 4px; }
/* On the iPad there is nothing to explain; paper and mixed keep their one-line reminder. */
.lesson-learning[data-recording-mode="digital"] .recording-help { display: none; }

/* Shown from the teacher's slides: the lesson bar already names the lesson and the way back. */
body.lesson-activity #task-content .lesson-crumbs,
body.lesson-activity #task-content .practice-mode-note,
body.lesson-activity #task-content .rec-bar,
body.lesson-activity #task-content .rec-bar + p { display: none; }

/* Second pass: plain lines instead of cards, no wrapping tabs, a visible selected mode. */
#task { margin-top: -24px; }
#task-content .practice-mode-note { background: none; border: 0; padding: 0 2px; font-size: 14px; color: var(--muted, #4a5b66); }
#task-content .rec-bar { background: none; border: 0; box-shadow: none; padding: 0 2px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 15px; }
.student-lesson-toolbar .student-lesson-nav button { font-size: 15px; white-space: nowrap; padding: 6px 8px; }
#task-content .lesson-recording button[aria-pressed="true"],
.lesson-learning .lesson-recording button[aria-pressed="true"] { background: var(--blue, #1f5f8b) !important; color: #fff !important; border-color: var(--blue, #1f5f8b) !important; }
.student-lesson-toolbar .student-lesson-nav button { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1000px) {
  .student-lesson-toolbar .student-lesson-nav button { white-space: normal; text-overflow: clip; line-height: 1.2; }
}
@media (min-width: 1001px) {
  .student-lesson-toolbar .student-lesson-nav { grid-template-columns: minmax(0,1fr) minmax(0,1.3fr) minmax(0,1fr) minmax(0,1fr); }
}

/* Investigate: materials and the fair-test plan are sections, not folds. */
.lesson-materials h3, .lesson-plan h3 { margin: 14px 0 6px; }
.lesson-team-jobs { font-size: 15px; margin: 8px 0; }
.lesson-team-jobs abbr { text-decoration: none; font-weight: 600; }
.lesson-plan .plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 700px) { .lesson-plan .plan-grid { grid-template-columns: 1fr; } }
/* A tap-to-choose row already starts the sentence, so the second "Start my sentence" button goes. */
.answer-choices + .rec-field .starter-btn, .answer-choices + label .starter-btn { display: none; }

/* Investigate on a landscape iPad or wider: what to read on the left (it stays put while you
   scroll), where to record on the right, so the first box is on screen straight away. */
@media (min-width: 1024px) {
  .lesson-investigate-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 20px; align-items: start; }
  .lesson-investigate-read { position: sticky; top: 8px; max-height: calc(100vh - 120px); overflow: auto; padding-right: 6px; font-size: 0.95em; }
  .lesson-investigate-read .results-scroll, .lesson-investigate-record .results-scroll { overflow-x: auto; }
  .lesson-investigate-record > h3:first-child { margin-top: 0; }
}

/* Portrait iPad: the reading part packs into two columns so the first answer box is on screen. */
@media (min-width: 700px) and (max-width: 1023px) {
  .lesson-investigate-read { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; align-items: start; }
  .lesson-investigate-read > * { grid-column: 1 / -1; }
  .lesson-investigate-read > .research-info { grid-column: 1; }
  .lesson-investigate-read > .research-tools { grid-column: 2; }
  .lesson-investigate-read > .research-info, .lesson-investigate-read > .research-tools { margin-top: 0; font-size: 0.95em; }
  .lesson-investigate-read > .lesson-task { margin-bottom: 10px; }
  .lesson-investigate-read .teach-list { columns: 2; column-gap: 24px; }
  .lesson-investigate-read .teach-list li { break-inside: avoid; }
}
@media (min-width: 700px) and (max-width: 1023px) {
  .lesson-investigate-read h3 { margin: 10px 0 4px; }
  .lesson-investigate-read .present-safety { padding: 6px 10px; font-size: 0.9em; margin: 6px 0; }
  .lesson-investigate-read .teach-list { margin: 4px 0; }
  .lesson-investigate-record > h3:first-child { margin-top: 8px; }
  .lesson-investigate-record > .teach-note { margin: 2px 0 6px; }
}
@media (max-width: 600px) {
  .student-lesson-toolbar .lesson-recording { flex: 1 1 100%; flex-wrap: wrap; row-gap: 4px; min-width: 0; }
  .student-lesson-toolbar .lesson-recording-label { flex-basis: 100%; }
  .student-lesson-toolbar .lesson-recording button { flex: 1 1 auto; padding: 6px 8px; }
}

/* Wide tables scroll inside their own box on a phone, never the whole page. */
#task-content .results-scroll, .lesson-learning .results-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lesson-learning .rec-section { min-width: 0; }
/* Long words or links in a source never push the page sideways on a phone. */
.lesson-learning .source-sheet, .lesson-learning .research-card, .lesson-learning .rec-section p, .lesson-learning .rec-section li { overflow-wrap: anywhere; }

/* Words to know: the lesson's science words plus any tricky word students will read. */
.words-to-know { margin: 0 0 12px; padding: 10px 14px; border: 1px solid #c9d9bf; border-radius: 12px; background: #f4f8ef; }
.words-to-know h3 { margin: 0 0 6px; font-size: 1em; }
.words-to-know dl { margin: 0; display: grid; gap: 4px; }
.words-to-know dl > div { display: block; }
.words-to-know dt { display: inline; font-weight: 700; }
.words-to-know dt::after { content: ": "; }
.words-to-know dd { display: inline; margin: 0; }
.words-to-know-compact { padding: 6px 12px; }
.words-to-know-compact > summary { cursor: pointer; }
.words-to-know-compact[open] > summary { margin-bottom: 6px; }
@media (min-width: 700px) { .words-to-know:not(.words-to-know-compact) dl { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; } }
@media (min-width: 1024px) { .lesson-investigate-read .words-to-know:not(.words-to-know-compact) dl { grid-template-columns: 1fr; } }
@media (min-width: 700px) and (max-width: 1023px) {
  .lesson-investigate-read .teach-list { display: block; columns: 2; column-gap: 24px; padding-left: 1.2em; }
  .lesson-investigate-read .teach-list li { margin-bottom: 4px; }
  .lesson-investigate-read > .words-to-know-compact { margin-bottom: 8px; }
}
@media (max-width: 1023px) {
  .lesson-investigate-read > .words-to-know-compact { background: none; border: 0; padding: 0 2px; margin: 0 0 6px; }
}
@media (min-width: 700px) and (max-width: 1023px) {
  .lesson-investigate-read > .research-info, .lesson-investigate-read > .research-tools { padding: 8px 12px; }
  .lesson-investigate-read > .research-info h3, .lesson-investigate-read > .research-tools h3 { margin: 0 0 4px; }
  .lesson-investigate-read > .research-info p { margin: 2px 0; }
  .lesson-investigate-record > h3:first-child { margin-top: 2px; }
}

/* What to do inside each Explore activity, under its button and in the lesson bar. */
.activity-btn .act-task { display: block; font-size: 0.85em; margin-top: 2px; color: inherit; opacity: 0.9; font-weight: 400; }
.lesson-activity-prompt .activity-task { margin: 4px 0; }

/* Student iPad fixes (found walking a class through sign-in, a lesson and hand-in on an iPad). */
/* Step tabs wrap onto two lines instead of cutting words off ("First thoug…"). */
.student-lesson-toolbar .student-lesson-nav button { white-space: normal; text-overflow: clip; overflow: visible; line-height: 1.2; }
/* The save note floats above the step bar, so it never covers Next or Hand in. */
body:has(.student-lesson-footer) .cl-dock { bottom: 104px; }
@media (max-width: 700px) { body:has(.student-lesson-footer) .cl-dock { bottom: 150px; } }
/* Signed in to a class: the class sets the year, so the header drops the year picker and has
   room for My class, Explore and the student's name. */
.student-signed-in .level { display: none; }
/* Moving focus to a heading after a step (for screen readers) shouldn't draw a box around it. */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, h3[tabindex="-1"]:focus { outline: none; }

/* Short launch deck: today's task, shown as information before students start. */
.launch-task { display: grid; gap: 10px; margin: 6px 0 14px; }
.launch-task p { margin: 0; font-size: 1.15em; line-height: 1.35; }
.launch-task-q { font-size: 1.3em !important; }
