/* Phone width (about 390 px): nothing overlaps and the page does not scroll sideways (#80) */
@media (max-width: 600px) {
  .top-nav { flex-wrap: wrap; }
  .topbar, .stage-head { flex-wrap: wrap; }
  .stage-head > * { min-width: 0; }
  .stage { padding-left: 12px; padding-right: 12px; }
  .stage-title { flex: 1 1 100%; flex-wrap: wrap; }
  /* the title keeps its size; the lesson line and the loop hint wrap onto their own lines (#87) */
  .stage-title .lesson-title { flex: 0 0 auto; max-width: 100%; }
  .stage-title .hint { flex: 1 1 100%; white-space: normal; overflow: visible; }
  /* tempo line above the title, drum key / focus buttons on their own row at the top of the score */
  .score-head { padding-top: 36px; }
  .score-tempo { position: static; text-align: left; margin-bottom: 4px; }
  .score-title { font-size: 20px; }
  /* Focus bottom bar: section names in a row that scrolls sideways, none cut to a letter (#86) */
  body.focus-mode .fm-progress { height: auto; padding-bottom: 22px; }
  body.focus-mode .fm-progress::before, body.focus-mode .fm-fill { top: auto; bottom: 9px; }
  body.focus-mode .fm-markers { position: static; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; pointer-events: auto; }
  body.focus-mode .fm-marker { position: static; transform: none; flex: none; padding: 3px 8px; }
  body.focus-mode .fm-title { max-width: 100%; flex: 1 1 100%; }
  /* People head buttons wrap and are easy to tap (#109) */
  .people-head { gap: 8px; }
  .people-head button { min-height: 44px; }
  /* Practice plan button on a student's Progress page, and the way back (#110) */
  .prog-plan { margin-top: 8px; }
  .prog-plan button, #planBackProgress { min-height: 44px; }
  /* Progress on a phone: bar wraps (no sideways overflow), compact 2x2 tiles, swipe hint (#111) */
  /* the cause of the 4 px: .stage has 12 px side padding here, the dashboard pulled out 16 px */
  .stage > .dashboard { margin-left: -12px; margin-right: -12px; }
  .dash-bar { flex-wrap: wrap; gap: 8px; }
  .dash-bar h2 { flex: 1 1 100%; order: -1; }
  .dash-body { padding-top: 12px; }
  .dash-body > * + * { margin-top: 12px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 8px 10px; }
  .tile b { font-size: 22px; }
  .swipe-hint { display: block; }
}
