@layer native-select {
  .native-select-stage {
    align-items: stretch;
  }

  .native-select-showcase {
    width: min(100%, 560px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .native-select-example {
    min-width: 0;
    min-height: 112px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
  }

  .native-select-example[dir="rtl"] {
    align-items: flex-end;
  }

  .native-select-caption {
    color: var(--muted-foreground);
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
  }

  .native-select-wrap {
    position: relative;
    width: max-content;
    max-width: 100%;
    color: var(--foreground);
  }

  .native-select-wrap--wide {
    width: 188px;
  }

  .native-select-control {
    width: 100%;
    min-width: 0;
    height: 32px;
    margin: 0;
    appearance: none;
    border: 1px solid var(--input);
    border-radius: 10px;
    outline: none;
    background: transparent;
    color: var(--foreground);
    padding: 4px 32px 4px 10px;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    text-align: start;
    user-select: none;
    cursor: default;
    transition: color 150ms, background-color 150ms, border-color 150ms, box-shadow 150ms;
  }

  .native-select-control option,
  .native-select-control optgroup {
    background: Canvas;
    color: CanvasText;
  }

  .native-select-control:focus-visible {
    border-color: var(--ring);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent);
  }

  .native-select-control[aria-invalid="true"] {
    border-color: var(--destructive);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 20%, transparent);
  }

  .native-select-control:disabled {
    pointer-events: none;
    cursor: not-allowed;
  }

  .native-select-wrap:has(.native-select-control:disabled),
  .native-select-wrap--disabled {
    opacity: 0.5;
  }

  .native-select-wrap[data-size="sm"] .native-select-control {
    height: 28px;
    padding-block: 2px;
    border-radius: min(var(--radius), 10px);
  }

  .native-select-wrap[dir="rtl"] .native-select-control {
    padding-inline: 32px 10px;
  }

  .native-select-icon {
    position: absolute;
    z-index: 1;
    inset-block-start: 50%;
    inset-inline-end: 10px;
    width: 16px;
    height: 16px;
    color: var(--muted-foreground);
    pointer-events: none;
    user-select: none;
    transform: translateY(-50%);
  }

  @media (prefers-color-scheme: dark) {
    .native-select-control {
      background: color-mix(in srgb, var(--input) 30%, transparent);
    }

    .native-select-control:not(:disabled):hover {
      background: color-mix(in srgb, var(--input) 50%, transparent);
    }

    .native-select-control[aria-invalid="true"] {
      border-color: color-mix(in srgb, var(--destructive) 50%, transparent);
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 40%, transparent);
    }
  }

  @media (max-width: 540px) {
    .native-select-showcase {
      grid-template-columns: minmax(0, 1fr);
    }

    .native-select-example {
      min-height: 96px;
    }
  }
}
