/* Bit2Beat · menus (ui/combo.js): a button like the old select, and a list that opens below it. */
select.combo-native {
  display: none !important;
}
.combo-btn {
  position: relative;
  display: flex;
  align-items: center;
  width: auto;
  max-width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 6px 30px 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  text-align: left;
}
.combo-btn::after {
  content: '';
  position: absolute;
  right: 11px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  opacity: 0.65;
  transition: transform 0.15s;
}
.combo-btn.is-open::after {
  transform: translateY(-25%) rotate(-135deg);
}
.combo-btn:hover:not(:disabled) {
  border-color: var(--amber);
}
.combo-btn:focus-visible,
.combo-btn.is-open {
  outline: none;
  box-shadow: var(--focus);
  border-color: var(--amber);
}
.combo-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.combo-value {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}
/* where selects were full width, so are the buttons */
.field .combo-btn,
.form-grid .combo-btn,
.source-pick .combo-btn,
.eic-form .eic-dataset .combo-btn {
  width: 100%;
}
.channel-inst .combo-btn {
  min-height: 30px;
  font-size: 0.8rem;
  padding: 3px 26px 3px 8px;
  max-width: 140px;
}
:root.big-targets .combo-btn {
  min-height: 46px;
}

.combo-pop {
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  max-width: min(480px, calc(100vw - 16px));
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 32px rgba(20, 33, 61, 0.22);
  animation: combo-in 0.12s ease-out;
}
.combo-pop.is-up {
  animation-name: combo-in-up;
}
@keyframes combo-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
@keyframes combo-in-up {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
.combo-search {
  flex: none;
  margin: 2px 2px 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}
.combo-search:focus {
  outline: none;
  border-color: var(--amber);
}
.combo-list {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.combo-list:focus {
  outline: none;
}
.combo-opt {
  padding: 7px 10px 7px 26px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.3;
  cursor: pointer;
  position: relative;
}
.combo-opt.is-active {
  background: var(--surface-2);
}
.combo-opt[aria-selected='true'] {
  font-weight: 600;
}
.combo-opt[aria-selected='true']::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  transform: translateY(-50%);
}
.combo-opt[aria-disabled='true'] {
  opacity: 0.5;
  cursor: default;
}
.combo-group {
  padding: 8px 10px 3px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--muted);
}
.combo-none {
  margin: 0;
  padding: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}
:root.big-targets .combo-opt {
  padding-top: 12px;
  padding-bottom: 12px;
}
:root[data-theme='dark'] .combo-pop {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
:root.contrast .combo-opt.is-active {
  outline: 2px solid var(--amber);
  outline-offset: -2px;
}
@media (prefers-reduced-motion: reduce) {
  .combo-pop {
    animation: none;
  }
}
