/* Keep the real select: one value, native form validation and keyboard behavior.
   Supporting engines render the picker in the top layer, including in dialogs. */
body.oko-next select {
  color-scheme: dark;
  font: inherit;
  min-width: 0;
  max-width: 100%;
}
body.oko-next select :is(option, optgroup) {
  color: var(--ink, #f3f5f8);
  background-color: var(--surface, #131c26);
}
body.oko-next select[multiple],
body.oko-next select[size]:not([size="0"]):not([size="1"]) {
  background-image: none !important;
  padding-inline-end: 13px !important;
}

@supports (appearance: base-select) and selector(select::picker(select)) {
  body.oko-next :is(select:not([multiple]):not([size]), select:not([multiple])[size="1"], select:not([multiple])[size="0"]),
  body.oko-next :is(select:not([multiple]):not([size]), select:not([multiple])[size="1"], select:not([multiple])[size="0"])::picker(select) {
    appearance: base-select;
  }
  body.oko-next :is(select:not([multiple]):not([size]), select:not([multiple])[size="1"], select:not([multiple])[size="0"]) {
    align-items: center;
    gap: 14px;
    padding-inline-end: 13px !important;
    background-image: none !important;
    cursor: pointer;
  }
  body.oko-next select::picker-icon {
    content: "";
    flex: none;
    width: 15px;
    height: 15px;
    margin-inline-start: auto;
    background: currentColor;
    color: var(--muted, #adbfca);
    mask: url('/assets/chevron-down.svg') center / 15px 15px no-repeat;
    transition: transform 160ms var(--ease, cubic-bezier(.23, 1, .32, 1)), color 140ms ease;
  }
  body.oko-next select:open::picker-icon { color: var(--accent); transform: rotate(180deg); }
  body.oko-next select::picker(select) {
    box-sizing: border-box;
    min-inline-size: anchor-size(width);
    max-inline-size: calc(100vw - 24px);
    max-block-size: min(360px, calc(100dvh - 32px));
    overflow: auto;
    overscroll-behavior: contain;
    padding: 6px;
    margin-block: 6px;
    border: 1px solid var(--line, #adc9e033);
    border-radius: 10px;
    background: linear-gradient(135deg, #233340, #14212c 70%);
    color: var(--ink, #f3f5f8);
    box-shadow: inset 0 1px #ffffff0c, 0 18px 45px #00000066, 0 3px 8px #00000040;
    font: inherit;
    line-height: 1.45;
    scrollbar-width: thin;
    scrollbar-color: #647582 transparent;
    opacity: 1;
  }
  body.oko-next select::picker(select)::-webkit-scrollbar { width: 8px; height: 8px; }
  body.oko-next select::picker(select)::-webkit-scrollbar-track { background: transparent; }
  body.oko-next select::picker(select)::-webkit-scrollbar-thumb { background: #647582; border: 2px solid #182633; border-radius: 5px; }
  body.oko-next select option {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 10px 12px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--ink, #f3f5f8);
    font: inherit;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
  }
  body.oko-next select option:checked {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, #1b2b37);
  }
  body.oko-next select option:is(:hover, :focus-visible) {
    background: #acc9df1c;
    color: var(--ink, #f3f5f8);
    outline: none;
  }
  body.oko-next select option:checked:is(:hover, :focus-visible) {
    background: color-mix(in srgb, var(--accent) 16%, #1b2b37);
    color: var(--accent);
  }
  body.oko-next select option::checkmark { color: var(--accent); width: 15px; flex: none; margin: 0; font-size: 13px; }
  body.oko-next select :is(option, optgroup):disabled { color: #718590; cursor: not-allowed; }
  body.oko-next select optgroup { padding: 8px 0 4px; font-weight: 600; font-size: .92em; color: var(--muted, #adbfca); }
  body.oko-next select optgroup > option { font-weight: 400; }
  body.oko-next select optgroup + optgroup { border-top: 1px solid var(--line, #adc9e033); margin-top: 6px; }
  body.oko-next select:disabled { cursor: not-allowed; }
  @media (prefers-reduced-motion: no-preference) {
    body.oko-next:not(.next-keyboard-motion) select::picker(select) {
      transition: opacity 140ms var(--ease, cubic-bezier(.23, 1, .32, 1)), transform 140ms var(--ease, cubic-bezier(.23, 1, .32, 1)), display 140ms allow-discrete, overlay 140ms allow-discrete;
      transform-origin: center top;
    }
    @starting-style {
      body.oko-next:not(.next-keyboard-motion) select::picker(select) { opacity: 0; transform: translateY(-3px); }
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  body.oko-next select::picker-icon, body.oko-next select::picker(select) { transition: none !important; }
}
@media (forced-colors: active) {
  body.oko-next select, body.oko-next select::picker(select), body.oko-next select option { border-color: ButtonText; background: Canvas; color: CanvasText; box-shadow: none; }
  body.oko-next select option:checked { background: Highlight; color: HighlightText; }
  body.oko-next select option::checkmark { color: HighlightText; }
  body.oko-next select::picker-icon { color: ButtonText; forced-color-adjust: none; }
}
