/* Shared single-choice fields: readable labels, restrained motion, native fallback. */
.nx-select {
  --select-bg: #f9fbfc;
  --select-ink: #253c49;
  --select-line: #cedde6;
  --select-hover: #f0f8fc;
  --select-accent: #168ab4;
  display: inline-grid;
  position: relative;
  width: 100%;
  min-width: 0;
  vertical-align: middle;
}
#main:has(.v2-welcome) .nx-select {
  --select-bg: #122432;
  --select-ink: #e7f1f8;
  --select-line: #3b596d;
  --select-hover: #1b3445;
  --select-accent: #70d9fa;
}
.nx-select[hidden] { display: none !important; }
select.nx-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  pointer-events: none !important;
}
label > .nx-select { margin-top: .4rem; }
body .nx-select > button.nx-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 11px 14px;
  color: var(--select-ink);
  background: var(--select-bg);
  border: 1px solid var(--select-line);
  border-radius: 12px;
  box-shadow: 0 2px 5px #142d3d05;
  font: inherit;
  font-weight: 550;
  line-height: 1.4;
  letter-spacing: normal;
  text-align: left;
  cursor: pointer;
  transform: none;
  outline: none;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
/* Override the overview's button palette while preserving its dark field palette. */
body #main .nx-select > .nx-select-trigger { background: var(--select-bg); color: var(--select-ink); border-color: var(--select-line); }
body .nx-select > .nx-select-trigger:hover:not(:disabled),
body #main .nx-select > .nx-select-trigger:hover:not(:disabled) {
  background: var(--select-hover);
  border-color: var(--select-accent);
  box-shadow: 0 3px 12px #32b6de14;
}
body .nx-select > .nx-select-trigger:focus-visible,
body #main .nx-select > .nx-select-trigger:focus-visible,
body .nx-select.is-open > .nx-select-trigger,
body #main .nx-select.is-open > .nx-select-trigger {
  border-color: var(--select-accent);
  box-shadow: 0 0 0 3px #48c9ef20;
  outline: none;
}
body .nx-select > .nx-select-trigger[aria-invalid="true"] { border-color: #cb5466; }
body .nx-select > .nx-select-trigger:disabled { cursor: not-allowed; opacity: .5; }
.nx-select-value { flex: 1; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.nx-select-chevron {
  width: 8px;
  height: 8px;
  border: solid currentColor;
  border-width: 0 1.6px 1.6px 0;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), color .18s;
  flex: 0 0 8px;
  margin: 0 3px;
  opacity: .75;
}
.nx-select.is-open .nx-select-chevron { transform: translateY(2px) rotate(225deg); color: var(--select-accent); opacity: 1; }
.filters > .nx-select, .storage-filters > .nx-select, .report-tools > .nx-select { flex: 1 1 170px; width: auto; font-size: .875rem; }
.price-toolbar > .nx-select { flex: 1 1 190px; width: auto; }
.model-panel .nx-select { flex: 1; }
.v2-welcome { flex-wrap: wrap; }
.v2-welcome > div:first-child { flex: 1 1 360px; min-width: 0; }
.v2-welcome > form { flex: 0 1 240px; width: 240px; max-width: 100%; }
@media (max-width: 1000px) { .v2-welcome { row-gap: 12px; } }

.nx-select-menu {
  --menu-bg: #f9fbfd;
  --menu-ink: #253c49;
  --menu-muted: #708391;
  --menu-line: #d7e4eb;
  --menu-hover: #eaf4fa;
  --menu-selected: #dff2fb;
  --menu-accent: #087ea7;
  position: fixed;
  inset: auto;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--menu-line);
  border-radius: 15px;
  background: var(--menu-bg);
  color: var(--menu-ink);
  box-shadow: 0 18px 48px #071a2d24, 0 3px 9px #071a2d0a;
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  transform-origin: top center;
  animation: nx-select-in .22s cubic-bezier(.16,1,.3,1) both;
}
.nx-select-menu[data-theme="dark"] {
  color-scheme: dark;
  --menu-bg: #152938;
  --menu-ink: #e7f1f8;
  --menu-muted: #a1b8c7;
  --menu-line: #36566c;
  --menu-hover: #213e51;
  --menu-selected: #20485d;
  --menu-accent: #78ddfb;
  box-shadow: 0 20px 48px #0006, 0 2px 8px #0003;
}
.nx-select-menu::backdrop { background: transparent; pointer-events: none; }
.nx-select-menu[data-side="above"] { transform-origin: bottom center; }
.nx-select-menu[data-closing="true"] { animation: nx-select-out .14s ease both; }
.nx-select-options { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--menu-line) transparent; }
.nx-select-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 9px;
  margin: 2px 0;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.nx-select-option-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.nx-select-option[aria-selected="true"] { color: var(--menu-accent); background: var(--menu-selected); font-weight: 650; }
.nx-select-option.is-active { background: var(--menu-hover); box-shadow: inset 0 0 0 1px var(--menu-line); }
.nx-select-check { color: var(--menu-accent); font-size: 16px; opacity: 0; flex: 0 0 16px; }
.nx-select-option[aria-selected="true"] .nx-select-check { opacity: 1; }
.nx-select-option[aria-disabled="true"] { opacity: .42; cursor: not-allowed; }
.nx-select-group { padding: 10px 12px 5px; font-size: 11px; letter-spacing: .06em; color: var(--menu-muted); font-weight: 650; }
.nx-select-search { flex-shrink: 0; padding: 4px 4px 8px; }
.nx-select-menu .nx-select-search-input {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--menu-line);
  border-radius: 9px;
  background: var(--menu-bg);
  color: var(--menu-ink);
  font: inherit;
  outline: none;
  box-shadow: none;
}
.nx-select-menu .nx-select-search-input:focus { border-color: var(--menu-accent); box-shadow: 0 0 0 2px #48c9ef16; }
.nx-select-search-input::placeholder { color: var(--menu-muted); }
.nx-select-empty { padding: 18px 12px; color: var(--menu-muted); text-align: center; }
.nx-select-empty[hidden] { display: none; }
@keyframes nx-select-in { from {opacity: 0; transform: translateY(-5px) scale(.985);} to {opacity: 1; transform: translateY(0) scale(1);} }
@keyframes nx-select-out { from {opacity: 1; transform: translateY(0) scale(1);} to {opacity: 0; transform: translateY(-3px) scale(.985);} }
@media (prefers-reduced-motion: reduce) {
  .nx-select-menu, .nx-select-menu[data-closing="true"] { animation: none; }
  body .nx-select > .nx-select-trigger, .nx-select-chevron, .nx-select-option { transition: none; }
}
@media (forced-colors: active) {
  body .nx-select.is-open > .nx-select-trigger, .nx-select-option.is-active { outline: 2px solid Highlight; }
  .nx-select-option[aria-selected="true"] { border: 1px solid Highlight; }
}
