/* Keep document actions and dynamic committee columns within the mobile viewport. */
@media screen and (max-width: 767.98px) {
  .unit-page__content,
  .unit-panel,
  .unit-panel__inner,
  .committee-table-stack,
  .committee-table-section,
  .committee-table-wrap,
  .quality-archive-table-wrap {
    min-width: 0;
    max-width: 100%;
  }

  .mobile-stack-table {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border-collapse: collapse;
  }

  .mobile-stack-table > thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .mobile-stack-table > tbody,
  .mobile-stack-table > tbody > tr {
    display: block;
    width: 100%;
  }

  .mobile-stack-table > tbody > tr {
    box-sizing: border-box;
    padding: 12px 14px;
    border-bottom: 2px solid #c8d6e5;
  }

  .mobile-stack-table > tbody > tr:last-child { border-bottom: 0; }

  .mobile-stack-table > tbody > tr > :is(th, td) {
    display: block;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
    padding: 8px 0;
    border: 0;
    text-align: start;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .mobile-stack-table > tbody > tr > [data-label]::before {
    display: block;
    margin-bottom: 4px;
    color: #60718a;
    font-size: .78rem;
    font-weight: 700;
    content: attr(data-label);
  }

  .mobile-stack-table > tbody > tr[data-mobile-group]::before {
    display: block;
    padding-block: 8px;
    font-weight: 700;
    overflow-wrap: anywhere;
    content: attr(data-mobile-group);
  }

  .mobile-stack-table :is(a, button, .quality-document-filetype) {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .mobile-stack-table .quality-document-table__download {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
  }

  :is(.mobile-stack-table.quality-document-table:not(.dw-list-table), .mobile-stack-table.quality-archive-table)
    > tbody > tr > td:last-child::before {
    content: none;
  }

  :is(.quality-document-table:not(.dw-list-table), .quality-archive-table) .quality-document-table__download,
  .guide-document-item__action,
  .quality-report-row a {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    text-align: start;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* Editor content may contain inline desktop widths, including on forms pages. */
  .unit-rich-text { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .unit-rich-text :is(table, figure, col, th, td) {
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .unit-rich-text table {
    display: table !important;
    width: 100% !important;
    table-layout: fixed;
  }
  .unit-rich-text :is(th, td) {
    width: auto !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    padding: 8px;
  }
  .unit-rich-text figure { margin-inline: 0; }
  .unit-rich-text :is(img, video, iframe, object, embed) { max-width: 100% !important; }
  .unit-rich-text :is(img, video) { height: auto !important; }
}
