/* Mobile entry forms: make timetable selection use the full dialog width. */
@media (max-width: 767px) {
  body.workspace-mode #editor-modal .modal-card:not(.confirm-card) {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
  }

  body.workspace-mode #editor-modal .editor-fields {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 9px;
  }

  body.workspace-mode #editor-modal .editor-field:has(.schedule-picker) {
    grid-column: 1 / -1 !important;
    min-width: 0;
  }

  body.workspace-mode #editor-modal .schedule-picker,
  body.workspace-mode #editor-modal .schedule-picker-filters,
  body.workspace-mode #editor-modal .schedule-option-list {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
  }

  body.workspace-mode #editor-modal .schedule-picker-filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 5px;
    padding: 8px;
  }

  body.workspace-mode #editor-modal .schedule-option-list > label {
    grid-template-columns: 22px 38px minmax(0, 1fr) 66px;
    gap: 6px;
    min-height: 48px;
    padding: 7px 8px;
  }
}

/* Keep operating-course options full-width and checkboxes at intrinsic size in mobile editor dialogs. */
body.workspace-mode #editor-modal .editor-field .course-multi {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}
body.workspace-mode #editor-modal .editor-field .course-multi-panel {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}
body.workspace-mode #editor-modal .editor-field .course-multi-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}
body.workspace-mode #editor-modal .editor-field .course-multi-list > label {
  display: flex !important;
  box-sizing: border-box;
  align-items: center;
  flex-direction: row !important;
  width: 100% !important;
  min-width: 0;
  min-height: 36px;
  gap: 8px;
  padding: 5px 6px;
  white-space: normal;
  overflow-wrap: anywhere;
}
body.workspace-mode #editor-modal .editor-field .course-multi-list > label > input[type="checkbox"] {
  display: block !important;
  box-sizing: border-box !important;
  flex: 0 0 16px !important;
  width: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  max-height: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Keep prospect filter checkboxes compact; generic filter input rules must not stretch them. */
body.workspace-mode #records-view #view-filters .type-check-items label {
  display: inline-flex !important;
  width: auto !important;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
body.workspace-mode #records-view #view-filters .type-check-items input[type="checkbox"] {
  display: inline-block !important;
  box-sizing: border-box !important;
  flex: 0 0 18px !important;
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Version 3.42.8 — keep the schedule picker readable on narrow screens. */
@media (max-width: 767px) {
  body.workspace-mode #editor-modal .schedule-option-list {
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.workspace-mode #editor-modal .schedule-option-list > label {
    box-sizing: border-box;
    grid-template-columns: 24px 38px minmax(0, 1fr) 62px;
    grid-template-rows: auto auto;
    min-width: 0;
    width: 100%;
    padding: 9px 8px;
  }

  body.workspace-mode #editor-modal .schedule-option-list > label small {
    grid-column: 2 / -1;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
  }
}
