@layer components {
  /* A document's history (documents/versions/index; the History board): the
     versions down the side, the open one beside them. Under the shell
     breakpoint the list stands above the text. */
  .versions {
    display: grid;
    grid-template-columns: 16rem minmax(0, 1fr);
    column-gap: var(--inline-space-double);
    align-items: start;
  }

  @container main (width < 50rem) {
    .versions {
      grid-template-columns: 1fr;
    }
  }

  /* One version: a face, the person and the run's span, and under it what
     the version is — the current text, or its first words. The open one
     wears mizu, the selected voice (segmented.css). */
  .versions__version {
    display: flex;
    gap: var(--inline-space);
    padding: var(--block-space-half) var(--inline-space);
    border-radius: var(--border-radius);
    font-size: var(--text-small);
    text-decoration: none;
    color: inherit;

    &:hover {
      background-color: var(--color-surface);
    }

    &[aria-current] {
      color: var(--color-selected-ink);
      background-color: var(--color-selected);
    }
  }

  .versions__meta {
    display: block;
    font-size: var(--text-x-small);
    color: var(--color-ink-faint);

    [aria-current] & {
      color: inherit;
    }
  }

  /* The open version's head: the row is utilities (the view); only the
     space it keeps from the words is its own. */
  .versions__head {
    padding-block: var(--block-space-half) var(--block-space);
  }
}
