/* Student Note editor toolbar: preserve desktop layout, wrap only at narrower widths. */
@media (max-width: 900px) {
  .nts-note-toolbar {
    flex-wrap: wrap;
    min-width: 0;
    overflow-x: hidden;
    white-space: normal;
  }
}

@media (max-width: 767px) {
  .nts-note-toolbar {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(32px, auto));
    grid-auto-flow: row;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: hidden;
    white-space: normal;
  }

  .nts-note-toolbar button,
  .nts-note-toolbar select {
    min-width: 0;
    width: 100%;
    max-width: 32px;
    justify-self: center;
    padding-left: 3px;
    padding-right: 3px;
  }

  /* Keep the text-bearing controls usable while fitting all 19 controls in two rows. */
  .nts-note-toolbar > :nth-child(5) {
    grid-column: span 3;
    max-width: 94px;
    justify-self: stretch;
  }

  .nts-note-toolbar > :nth-child(6) {
    grid-column: span 2;
    max-width: 45px;
    justify-self: stretch;
  }

  .nts-note-toolbar > :nth-child(7) {
    grid-column: span 2;
    max-width: 48px;
    justify-self: stretch;
  }
}
