/* Track Mishnah UI 2.17.22
 * Content-aware dashboard proportions after the v2.17.21 overcorrection.
 * Presentation-only: no database/schema, assignment, reminder, permission,
 * export, or messaging-data behavior changes.
 */

@media (min-width: 1220px) {
  /* Keep the left dashboard aligned with My Learning and let page-wheel
   * gestures pass through normally. Do not create a nested scroller. */
  body.app-theme-jewel .dashboard-primary-workspace > .project-overview {
    height: var(--tm-dashboard-workspace-height) !important;
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    overscroll-behavior: auto !important;
    overscroll-behavior-y: auto !important;
    scrollbar-gutter: auto !important;
    touch-action: pan-y;
  }

  /* v2.17.21 made the top and bottom cards visually large by assigning empty
   * space, while the middle rows were allowed to shrink below their content.
   * Use a modest top card and content-aware grid minimums instead. */
  body.app-theme-jewel .dashboard-primary-workspace .project-overview-heading {
    flex: 0 0 145px !important;
    min-height: 145px !important;
    align-content: center;
  }

  body.app-theme-jewel .dashboard-primary-workspace .dashboard-command-grid {
    min-height: 0;
    flex: 1 1 auto !important;
    grid-template-rows:
      minmax(min-content, .95fr)
      minmax(min-content, .9fr)
      minmax(min-content, 1.15fr) !important;
    align-content: stretch;
  }

  body.app-theme-jewel .dashboard-primary-workspace .dashboard-command-card {
    height: auto !important;
    min-height: min-content !important;
    overflow: visible !important;
  }

  /* The larger cards should use their extra room intentionally instead of
   * leaving all of it under the content. */
  body.app-theme-jewel .dashboard-primary-workspace .project-progress-card {
    align-content: center;
    padding-block: 9px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .continue-learning-card,
  body.app-theme-jewel .dashboard-primary-workspace .personal-dashboard-summary {
    align-content: center;
    padding-block: 8px;
  }
}

@media (min-width: 1220px) and (max-height: 760px) {
  body.app-theme-jewel .dashboard-primary-workspace .project-overview-heading {
    flex-basis: 132px !important;
    min-height: 132px !important;
  }

  body.app-theme-jewel .dashboard-primary-workspace .dashboard-command-grid {
    grid-template-rows:
      minmax(min-content, .98fr)
      minmax(min-content, .92fr)
      minmax(min-content, 1.1fr) !important;
  }
}
