/* Scope the correction to the catalog table that has the presentation order form. */
main:has(input[aria-label="Buscar livros"]) {
  min-inline-size: 0;

  & > .mx-auto > .overflow-x-auto:has(> table > tbody > tr > td:first-child form[aria-label^="Ordem de "]) {
    max-inline-size: 100%;
    overflow-x: auto;

    & > table {
      inline-size: 100%;
      min-inline-size: 44rem;
      table-layout: fixed;

      & > :is(thead, tbody) > tr > :is(th, td) {
        padding-inline: .5rem;
      }

      & > thead > tr > th:nth-child(1) { inline-size: 9.75rem; }
      & > thead > tr > th:nth-child(2) { inline-size: 3.25rem; }
      & > thead > tr > th:nth-child(3) { inline-size: 20%; }
      & > thead > tr > th:nth-child(5) { inline-size: 4.75rem; }
      & > thead > tr > th:nth-child(6) { inline-size: 3.25rem; }
      & > thead > tr > th:nth-child(7) { inline-size: 23%; }

      & > tbody > tr > td:is(:nth-child(3), :nth-child(4), :nth-child(5)) {
        overflow-wrap: anywhere;
      }

      & form[aria-label^="Ordem de "] {
        min-inline-size: 0;

        & > div {
          gap: .25rem;
        }

        & input[type="number"] {
          inline-size: 3.875rem;
          min-inline-size: 0;
        }
      }

      & > tbody > tr > td:last-child > .inline-flex {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: .25rem;

        & > button {
          padding-inline: .5rem;
        }

        & > button[aria-label^="Excluir "] {
          inline-size: 2rem;
          padding-inline: 0;
        }
      }
    }
  }
}
