.native-select-hidden {
  display: none;
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  background: var(--muted);
  color: var(--foreground);
  padding: 10px 12px;
  text-align: left;
  outline: none;
  font-weight: 700;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.custom-select-button:hover {
  background: #eef2f7;
}

.custom-select.open .custom-select-button,
.custom-select-button:focus-visible {
  background: #fff;
  box-shadow: 0 0 0 2px var(--primary);
}

.custom-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-icon {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.custom-select.open .custom-select-icon {
  transform: rotate(225deg) translateY(-1px);
}

.custom-select-menu {
  position: fixed;
  z-index: 90;
  top: 0;
  left: 0;
  display: none;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 40px rgb(17 24 39 / 0.18);
  padding: 6px;
}

.custom-select.open .custom-select-menu {
  display: grid;
  gap: 3px;
}

.custom-select-option {
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--foreground);
  padding: 8px 10px;
  text-align: left;
  font-weight: 700;
  outline: none;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
  background: #eff6ff;
  color: var(--primary);
}

.custom-select-option.selected,
.custom-select-option[aria-selected="true"] {
  background: var(--primary);
  color: #fff;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  background: #fff;
  box-shadow: 0 0 0 2px var(--primary);
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
}
