/* A style-isolation wrapper around a fixed sidebar must not consume a flex
   column. Keep the scope in the DOM for its CSS without reserving page width. */
.ukb-interface-scope:has(> .rp-unified-sidebar) {
  display: contents;
}

/* Calendar shells include sidebar clearance as padding. Include that padding
   inside the available width and keep only the week grid horizontally scrollable. */
#root .admin-dashboard > .main-content:has(> .academic-calendar) {
  box-sizing: border-box !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
#root .main-content > .academic-calendar {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

/* The account bridge adds its link after the notes header has rendered. Leave
   room for it without clipping the profile or logout controls on narrow screens. */
@media (max-width: 700px) {
  #root :is(.ukb-notes-scope, .admin-dashboard:has(.pg-entry-panel)) .dashboard-header {
    height: auto !important;
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap !important;
  }
  #root :is(.ukb-notes-scope, .admin-dashboard:has(.pg-entry-panel)) .dashboard-header .user-profile {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
  }
  #root :is(.ukb-notes-scope, .admin-dashboard:has(.pg-entry-panel)) .dashboard-header .user-profile > a {
    max-width: 100%;
  }
  #root :is(.ukb-notes-scope, .admin-dashboard:has(.pg-entry-panel)) .dashboard-header .dropdown {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap !important;
    justify-content: flex-end;
  }
}
