@layer modules {
  /* Full-height flex layout for the slaughter list page
  /* ======================================================================== */

  .slaughter-list {
    display: flex;
    flex-direction: column;
    min-block-size: 0;
  }

  /* Under the page-menu mechanism the body lives in .page__content. The
     slaughter-list manages its own scroll (pinned header + scrolling table +
     pinned action bar), so its column is a flex column with overflow:hidden —
     not the usual scrolling .page__content. */
  .page__content:has(> .slaughter-list) {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-block-size: 0;
    overflow: hidden;
    padding-block-end: calc(var(--footer-height) + env(safe-area-inset-bottom));
  }

  @media (max-width: 639px) {
    /* No sidebar on mobile and .page isn't a flex row there, so make it a flex
       column to pass the contained-scrolling viewport height to .page__content. */
    .page:has(.slaughter-list) {
      display: flex;
      flex-direction: column;
      min-block-size: 0;
      overflow: hidden;
    }

    .page__content:has(> .slaughter-list) {
      padding-block-end: 0;
    }
  }

  .page__content > .slaughter-list {
    flex: 1;
    min-block-size: 0;
  }

  /* Header: search (pinned at top, never scrolls)
  /* ------------------------------------------------------------------------ */

  .slaughter-list__header {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: var(--block-space-half);
    margin-block-end: var(--block-space);
  }

  /* Scrollable table area
  /* ------------------------------------------------------------------------ */

  .slaughter-list__scroll {
    -webkit-overflow-scrolling: touch;
    flex: 1;
    margin-block-start: var(--block-space-half);
    min-block-size: 0;
    overflow-y: auto;
  }

  .slaughter-list__scroll thead {
    background: var(--color-canvas);
    position: sticky;
    inset-block-start: 0;
    z-index: 1;
  }

  /* Booking action bar (bottom)
  /* ------------------------------------------------------------------------ */

  .slaughter-list__action {
    background: var(--color-canvas);
    border-block-start: 1px solid var(--color-ink-lighter);
    flex-shrink: 0;
    padding-block: var(--block-space-half);
  }

  .slaughter-list__action-buttons {
    display: flex;
    gap: var(--block-space-half);
  }

  .slaughter-list__action-buttons > *,
  .slaughter-list__action-buttons > form {
    flex: 1;
  }

  .slaughter-list__action-buttons .btn {
    inline-size: 100%;
  }

  /* Pickup-not-before warning (shown when entry is not yet eligible)
  /* ------------------------------------------------------------------------ */

  .slaughter-list__not-before {
    color: var(--color-negative);
    display: block;
    font-size: 0.75em;
  }

  /* Claimed-by badge (shown when another user has selected the entry)
  /* ------------------------------------------------------------------------ */

  .slaughter-list__claimed {
    color: var(--color-ink-light);
    display: block;
    font-size: 0.75em;
  }
}
