/* The option text can be longer than the entire analysis form. */
:where(select[data-study-tags], #compare-picker) {
  min-inline-size: 0;
  max-inline-size: 100%;
}

:where(select[data-study-tags], #compare-picker) option {
  font-size: .875rem;
}

@supports (appearance: base-select) and selector(::picker(select)) {
  main :is(select[data-study-tags], #compare-picker),
  :is(select[data-study-tags], #compare-picker)::picker(select) {
    appearance: base-select;
  }

  main :is(select[data-study-tags], #compare-picker) {
    width: 100%;
    min-width: 0;
    font-size: .94rem;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  :is(select[data-study-tags], #compare-picker)::picker(select) {
    box-sizing: border-box;
    position-area: block-end span-inline-end;
    position-try-fallbacks: flip-block;
    inline-size: anchor-size(width);
    min-inline-size: 0;
    max-inline-size: anchor-size(width);
    max-block-size: min(19rem, 46dvh);
    margin-block: .25rem;
    padding: .2rem;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #d8cde3;
    border-radius: .6rem;
    background: #fff;
    color: #272037;
    box-shadow: 0 .45rem 1.2rem #24143722;
  }

  :is(select[data-study-tags], #compare-picker) option,
  :is(select[data-study-tags], #compare-picker) optgroup {
    max-inline-size: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: .875rem;
    line-height: 1.35;
  }

  :is(select[data-study-tags], #compare-picker) option {
    gap: .5rem;
    min-block-size: 2rem;
    padding: .35rem .5rem;
    border-radius: .3rem;
  }

  :is(select[data-study-tags], #compare-picker) option:checked {
    background: #eee7f5;
    color: #37214e;
    font-weight: 600;
  }

  :is(select[data-study-tags], #compare-picker) option:enabled:is(:hover,:focus-visible) {
    background: #dfd1ed;
    color: #291736;
  }

  :is(select[data-study-tags], #compare-picker) option:disabled {
    color: #666172;
  }
}

.research-form .analysis-coverage {
  flex: 0 0 100%;
  margin: 0;
}

.research-form label:has(> select[data-study-tags]) {
  flex: 1 1 min(100%, 27rem);
  min-width: min(100%, 14rem);
}
