/* Keep the native select's interaction and form semantics. Touch devices and
   browsers without customizable pickers retain their platform picker. */
@supports (appearance: base-select) and selector(::picker(select)) {
  @media (hover: hover) and (pointer: fine) and (forced-colors: none) {
    select:not([multiple]):not([size]),
    select:not([multiple])[size="1"] {
      appearance: base-select !important;
    }

    select:not([multiple]):not([size])::picker(select),
    select:not([multiple])[size="1"]::picker(select) {
      appearance: base-select;
      box-sizing: border-box;
      margin-block: 4px;
      padding: 4px;
      max-height: min(18rem, 50vh);
      overflow: auto;
      border: 1px solid #cbd5e1;
      border-radius: 8px;
      background: Canvas;
      color: CanvasText;
      box-shadow: 0 8px 24px rgb(15 23 42 / 0.15);
    }

    select:not([multiple]):not([size]) option,
    select:not([multiple])[size="1"] option {
      padding: 7px 10px;
      border-radius: 5px;
      white-space: normal;
    }

    select:not([multiple]):not([size]) option:hover,
    select:not([multiple])[size="1"] option:hover {
      background: color-mix(in srgb, CanvasText 10%, Canvas);
    }
  }
}

/* Enhanced single-select controls. Native controls remain the form source. */
.rounded-select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #17202b;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.rounded-select-trigger:focus-visible { outline: 2px solid #315cba; outline-offset: 2px; }
.rounded-select-trigger:disabled { opacity: .6; cursor: not-allowed; }
.rounded-select-list {
  z-index: 10000;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 4px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #17202b;
  box-shadow: 0 8px 24px rgb(15 23 42 / .15);
  font: 14px/1.4 Arial, sans-serif;
}
.rounded-select-option { padding: 8px 10px; border-radius: 5px; cursor: pointer; }
.rounded-select-option.is-active { background: #e8eef9; }
.rounded-select-option[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
@media (pointer: coarse) { .rounded-select-option { min-height: 44px; display: flex; align-items: center; } }
