/* A panel's search and its options (Forms::PanelOptionsComponent): the search above, then the options, each a finger's height
   with its check at the end when selected, a long name wrapping onto more lines. On a wider screen the list scrolls inside its
   own height, so the dialog stays within the screen; on a phone it takes what the sheet has left. */
.wi-panel-options {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 0;
}
.wi-panel-options .wi-filter-select__search {
  flex: none;
  margin-bottom: 0;
}
.wi-panel-options__list {
  gap: 0;
  min-height: 0;
  max-height: min(20rem, 50vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* A button, not a link: the row's look without the browser's own. Specific enough to follow Popover.css, which loads after. */
.wi-panel-options .wi-popover__item.wi-panel-options__option {
  width: 100%;
  min-height: var(--size-control-lg);
  padding-block: var(--space-2);
  padding-inline: var(--space-3);
  border: 0;
  background-color: transparent;
  font-family: inherit;
  font-size: var(--font-size-base);
  line-height: var(--font-line-height-base);
  text-align: start;
}
.wi-panel-options .wi-popover__item.wi-panel-options__option[data-hovered] {
  background-color: var(--background-sunken);
}
/* Selected (a toggle button or a radio's row): the pale row, kept when pointed at. */
.wi-panel-options .wi-popover__item.wi-panel-options__option:is([aria-pressed="true"], :has(input:checked)) {
  background-color: var(--background-accent-subtle);
  font-weight: var(--font-weight-semibold);
}
.wi-panel-options__option .wi-menu-option__label {
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}
.wi-panel-options__option:is([aria-pressed="false"], :has(input:not(:checked))) .wi-menu-option__check {
  display: none;
}
/* A radio row shows the radio's focus on the row, as a button's does. */
.wi-panel-options__option:has(input:focus-visible) {
  box-shadow: inset 0 0 0 var(--border-2) var(--border-focus);
}
label.wi-panel-options__option {
  cursor: pointer;
}
.wi-panel-options__option .wi-menu-option__check {
  width: var(--size-icon-md);
  height: var(--size-icon-md);
}
@media (max-width: 767.98px) {
  .wi-panel-options__list {
    flex: 1;
    max-height: none;
  }
}
