/* Global custom select: replaces the native Android picker with the console's neumorphic panel. */
.nselect {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.nselect-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.nselect-host::after {
  content: none !important;
  display: none !important;
}

.nselect-trigger {
  width: 100%;
  min-height: 48px;
  padding: 0 40px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(211, 196, 230, 0.92);
  border-radius: 13px;
  color: var(--ink, #0e1a3e);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 58%),
    linear-gradient(145deg, #f8f2fe, #eee4f8);
  box-shadow:
    inset 2px 2px 5px rgba(58, 42, 86, 0.07),
    inset -2px -2px 5px rgba(255, 255, 255, 0.9),
    0 1px 0 rgba(255, 255, 255, 0.7);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.nselect-trigger:focus-visible {
  border-color: rgba(94, 78, 142, 0.62);
  box-shadow:
    inset 2px 2px 5px rgba(58, 42, 86, 0.07),
    inset -2px -2px 5px rgba(255, 255, 255, 0.9),
    0 0 0 3px rgba(94, 78, 142, 0.1);
}

.nselect-trigger[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.nselect-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nselect-chevron {
  position: absolute;
  right: 15px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: #8d7aa9;
  pointer-events: none;
  transform: translateY(-50%);
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.25, 1);
}

.nselect-trigger[aria-expanded="true"] .nselect-chevron {
  transform: translateY(-50%) rotate(180deg);
}

.nselect-popover {
  position: fixed;
  z-index: 1200;
  padding: 7px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 42%),
    #fbf7ff;
  box-shadow:
    0 22px 48px rgba(42, 29, 68, 0.22),
    0 5px 14px rgba(42, 29, 68, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  -webkit-overflow-scrolling: touch;
}

.nselect-popover[hidden] {
  display: none;
}

.nselect-option {
  width: 100%;
  min-height: 44px;
  padding: 10px 11px 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  color: #4b3d62;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.nselect-option:hover,
.nselect-option:focus-visible {
  background: rgba(232, 220, 245, 0.78);
}

.nselect-option[aria-selected="true"] {
  color: #176f63;
  background: rgba(220, 242, 236, 0.82);
  font-weight: 650;
}

.nselect-option[disabled] {
  color: #b1a3c0;
  cursor: not-allowed;
  opacity: 0.65;
}

.nselect-option-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nselect-option-mark {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1.5px solid #d6c7e7;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

.nselect-option[aria-selected="true"] .nselect-option-mark {
  border-color: #178f7e;
  background: #178f7e;
  box-shadow: inset 0 0 0 4px #fbf7ff;
}

.nselect-group {
  padding: 9px 13px 5px;
  color: #9b8cab;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
}

.nselect-empty {
  margin: 0;
  padding: 14px 13px;
  color: #9b8cab;
  font-size: 12.5px;
  line-height: 1.5;
}

/* Per-surface sizing: keep each control's original footprint. */
.group-select-wrap .nselect-trigger {
  min-height: 46px;
  font-size: 14px;
  font-weight: 600;
}

.qa-select-field .nselect-trigger {
  min-height: 43px;
  padding-left: 12px;
  border-radius: 10px;
  font-size: 13.5px;
}

.admin-select .nselect-trigger {
  height: 50px;
  padding-left: 13px;
  border-radius: 13px;
  font-size: 12.5px;
}

.param-group-select-shell .nselect {
  flex: 1;
}

.param-group-select-shell .nselect-trigger {
  min-height: 34px;
  padding: 0 28px 0 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 650;
}

.task-group-picker .nselect {
  margin: 0;
}

.task-group-picker .nselect-trigger {
  min-height: 30px;
  padding: 0 24px 0 0;
  border: 0;
  border-radius: 0;
  color: #493b60;
  background: transparent;
  box-shadow: none;
  font-size: 13.5px;
  font-weight: 600;
}

.task-group-picker .nselect-trigger:focus-visible {
  box-shadow: none;
}

.task-group-picker .nselect-chevron {
  right: 2px;
}

.sw-group-row .nselect {
  flex: 1;
  min-width: 0;
}

.sw-group-row .nselect-trigger {
  min-height: 44px;
  font-size: 13.5px;
}

@media (max-width: 520px) {
  .nselect-trigger {
    min-height: 50px;
    font-size: 14px;
  }

  .nselect-option {
    min-height: 48px;
    font-size: 14px;
  }

  .qa-select-field .nselect-trigger {
    min-height: 44px;
    font-size: 13.5px;
  }

  .task-group-picker .nselect-trigger {
    min-height: 32px;
    font-size: 14px;
  }
}
