/* The open list of the native <select> on a desktop, drawn with our tokens (WI-12395). A phone keeps the OS picker
   (`not (pointer: coarse)` leaves touch alone, and still
   matches a browser that reports no pointer, such as the headless Chrome of CI), and a browser without `appearance: base-select` keeps its own list. The
   select itself stays the invisible layer over the trigger (application.css): only its picker is seen. */
@supports (appearance: base-select) {
  @media not (pointer: coarse) {
    .wi-select__native,
    .wi-select__native::picker(select) {
      appearance: base-select;
    }

    .wi-select__native::picker-icon {
      display: none;
    }

    .wi-select__native::picker(select) {
      box-sizing: border-box;
      min-inline-size: anchor-size(width);
      margin-block: var(--space-1);
      padding: var(--space-1);
      background: var(--background-raised);
      border: var(--border-1) solid var(--border-default);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-lg);
      font: inherit;
      color: var(--text-primary);
    }

    .wi-select__native option {
      display: flex;
      align-items: center;
      gap: var(--space-2);
      min-block-size: var(--size-button-sm);
      padding: var(--space-2) var(--space-3);
      border-radius: var(--radius-md);
      color: var(--text-primary);
      cursor: pointer;
    }

    /* The placeholder and a disabled choice are `hidden` (SelectComponent): the flex above must not show them. */
    .wi-select__native option[hidden] {
      display: none;
    }

    .wi-select__native option:hover,
    .wi-select__native option:focus {
      background: var(--background-accent-subtle);
    }

    .wi-select__native option:focus-visible {
      outline: var(--border-2) solid var(--border-focus);
      outline-offset: calc(var(--border-2) * -1);
    }

    .wi-select__native option:checked {
      font-weight: var(--font-weight-semibold);
    }

    .wi-select__native option::checkmark {
      order: 1;
      margin-inline-start: auto;
      color: var(--brand-primary);
    }
  }
}
