@layer components {
  /* What is pinned or waits is a row: its icon, its name, then its details in quiet words. */
  .tray__card {
    --row-padding-inline: 0.375rem;

    align-items: center;
    border-radius: var(--radius-md);
    color: var(--color-ink);
    column-gap: 0.6em;
    display: flex;
    font-size: var(--text-row);
    line-height: var(--leading-snug);
    margin-inline: calc(-1 * var(--row-padding-inline));
    min-block-size: 2.2em; /* 35px at a row's 16px on a phone, 40px at its 18px */
    padding: 0.25rem var(--row-padding-inline);
    text-align: start;
    text-decoration: none;

    @media (any-hover: hover) {
      &:hover .tray__card-title {
        text-decoration: underline;
      }
    }

    @media (any-pointer: coarse) {
      min-block-size: 2.75rem;
    }

    [open] [aria-selected] > & {
      background-color: var(--tint-ink-5);
    }

    /* Room for the button that takes the pin off. */
    .tray__item--pin > & {
      padding-inline-end: 2.75rem;
    }
  }

  .tray__card-icon {
    --icon-size: 1.1em;

    flex: none;
  }

  .tray__card-title {
    font-weight: 400;
    min-inline-size: 0;
  }

  .tray__card-meta {
    color: var(--color-meta);
    flex: 0 100 auto;
    font-size: var(--text-pill);
    min-inline-size: 3ch;
  }

  .tray__remove-pin-btn {
    --btn-background: transparent;
    --btn-size: var(--control-size);

    font-size: var(--text-control);
    inset: 50% 0 auto auto;
    opacity: 0.66;
    position: absolute;
    translate: 0 -50%;

    &:hover {
      opacity: 1;
    }

    [aria-busy] & {
      position: absolute !important;
    }
  }

  /* Nothing pinned, nothing waiting: said once, in the page's blank slate. */
  .tray__empty {
    turbo-frame:has(> .tray__item) > & {
      display: none;
    }

    .tray__dialog & {
      margin: 0;
    }
  }
}
