/* Custom select presentation. The original select keeps its form identity. */
.rd-select {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  color: var(--text);
}
.rd-select > select[hidden] { display: none !important; }
.rd-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 39px;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.rd-select-trigger:hover:not(:disabled) { border-color: var(--muted); background: var(--surface-2); }
.rd-select-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.rd-select.is-open .rd-select-trigger { border-color: var(--accent); }
.rd-select-trigger[aria-invalid="true"] { border-color: var(--text); border-style: dashed; }
.rd-select-trigger:disabled { opacity: .46; cursor: not-allowed; }
.rd-select-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-select.is-placeholder .rd-select-value { color: var(--muted); }
.rd-select-arrow { display: inline-flex; flex: 0 0 auto; color: var(--muted); transition: transform .12s; }
.rd-select.is-open .rd-select-arrow { transform: rotate(180deg); }
.rd-select-arrow svg, .rd-select-check svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rd-select-popover {
  width: max-content;
  max-width: min(560px, calc(100vw - 24px));
  max-height: min(328px, calc(100vh - 32px));
  max-height: min(328px, calc(100dvh - 32px));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow, 0 12px 36px #0000001f);
  font: inherit;
  font-size: 11px;
  line-height: 1.5;
  outline: none;
}
.rd-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 35px;
  padding: 8px 10px;
  border-radius: 5px;
  color: var(--text);
  cursor: pointer;
  scroll-margin: 5px;
  user-select: none;
  -webkit-user-select: none;
}
.rd-select-option-label { min-width: 0; overflow-wrap: anywhere; }
.rd-select-option.is-selected { background: var(--surface-2); font-weight: 550; }
.rd-select-option.is-active { background: var(--accent); color: var(--accent-text); }
.rd-select-option[aria-disabled="true"] { opacity: .38; cursor: not-allowed; }
.rd-select-check { display: inline-flex; flex: 0 0 auto; visibility: hidden; }
.rd-select-option.is-selected .rd-select-check { visibility: visible; }
.rd-select-group + .rd-select-group { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--border); }
.rd-select-group-label { padding: 7px 10px 5px; color: var(--muted); font-size: 9px; letter-spacing: .03em; }
.rd-select-empty { padding: 14px 12px; color: var(--muted); text-align: center; }
.node-select > .rd-select { width: auto; min-width: 170px; flex: 1; }
.node-select .rd-select-trigger { min-height: 35px; padding: 8px 10px; }
.config-section-heading > .rd-select { width: auto; min-width: 150px; max-width: 240px; }
.config-section-heading > .rd-select .rd-select-trigger { min-height: 33px; padding: 7px 10px; font-size: 10px; }
@media (max-width: 760px) {
  .node-select > .rd-select { min-width: 0; }
  .rd-select-trigger { font-size: 10px; }
  .rd-select-popover { max-width: calc(100vw - 20px); font-size: 11px; }
  .rd-select-option { min-height: 39px; }
  .config-section-heading > .rd-select { min-width: 120px; max-width: 48vw; }
}
@media (prefers-reduced-motion: reduce) {
  .rd-select-trigger, .rd-select-arrow { transition: none; }
}
