.objective-target-reference {
  max-width: 100%;
  min-width: 0;
  margin-block: 0.5rem;
  overflow-wrap: anywhere;
}
.objective-target-reference ol { padding-inline-start: 1.5rem; }
.objective-target-reference li { margin-block: 0.4rem; }
.objective-target-name, .objective-target-id { display: block; }
.objective-target-id { font-size: 0.85em; }

/* Keep native table elements and manual controls. Only reference-bearing mobile
   objective tables stack; desktop, minimap and no-reference tables stay unchanged. */
@media (max-width: 600px) {
  .task-modal-objectives .task-objectives-table:has(.objective-condition-reference),
  .task-modal-objectives .task-objectives-table:has(.objective-condition-reference) tbody {
    display: block;
    width: 100%;
  }

  .task-modal-objectives .task-objectives-table:has(.objective-condition-reference) thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .task-modal-objectives .task-objectives-table:has(.objective-condition-reference) tbody tr {
    display: block;
    width: 100%;
    padding: 0.5rem 0;
  }

  .task-modal-objectives .task-objectives-table:has(.objective-condition-reference) tbody tr > td {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: 0.25rem 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .task-modal-objectives .task-objectives-table:has(.objective-condition-reference) .objective-counter {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .task-modal-objectives .objective-condition-reference {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .task-modal-objectives .objective-condition-reference ul {
    padding-inline-start: 1.25rem;
  }
}
