@layer components {
  /* A few states to choose one from, side by side on a pale ground, the chosen one raised on the canvas.
     As tall as the controls of the row it stands in; where the row is narrow its choices wrap.
     A stage's item answered with one of a few is the same control, its choices fields. */
  .segments,
  .stage .paper__options:has([type=radio]) {
    background-color: var(--color-ink-lightest);
    border-radius: var(--radius-lg);
    box-shadow: inset 0 0 0 1px var(--color-ink-lighter);
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 2px;
  }

  .segments__item,
  .stage .paper__options:has([type=radio]) > .btn {
    align-items: center;
    border-radius: var(--radius-md);
    color: var(--color-ink);
    display: inline-flex;
    font-size: var(--text-control);
    justify-content: center;
    min-block-size: calc(var(--control-size) - 4px);
    padding-inline: 0.85em;
    text-decoration: none;
    white-space: nowrap;

    &:is([aria-current], :has(:checked)) {
      background-color: var(--color-canvas);
      box-shadow: 0 0 0 1px var(--color-ink-light), 0 1px 3px oklch(0% 0 0 / 14%);
      font-weight: 600;
    }

    @media (any-hover: hover) {
      &:hover:not([aria-current], :has(:checked)) {
        background-color: var(--color-ink-lighter);
      }
    }
  }
}
