.wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

/* ----- Trigger button ----- */
.trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  color: var(--text-main);
  font-size: 13.8px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
  min-width: 140px;
}
.trigger:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--primary-soft);
  transform: translateY(-0.5px);
}
.trigger:focus-visible {
  outline: none;
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light), var(--shadow-sm);
}
.wrap[data-open="true"] .trigger {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light), var(--shadow-sm);
}
.trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.trigger_sm {
  font-size: 13.2px;
  padding: 7px 12px;
  min-width: 120px;
}
.trigger_md {
  font-size: 13.8px;
  padding: 9px 14px;
  min-width: 140px;
}

.trigger.placeholder {
  color: var(--text-muted);
  font-weight: 600;
}

.triggerIcon {
  color: var(--text-muted);
  font-size: 14.9px;
  flex-shrink: 0;
}

.triggerLabel {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  font-size: 12.1px;
  color: var(--text-muted);
  margin-left: 4px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.wrap[data-open="true"] .chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

/* ----- Floating panel ----- */
.panel {
  position: absolute;
  top: calc(100% + 6px);
  min-width: 100%;
  max-width: min(320px, calc(100vw - 24px));
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow:
    0 12px 32px -12px rgba(15, 23, 42, 0.18),
    0 4px 8px -4px rgba(15, 23, 42, 0.08);
  z-index: 1100;
  padding: 4px;
  animation: dropIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
/* Smart anchor — panel hugs whichever side has more room */
.wrap[data-anchor="left"] .panel {
  left: 0;
}
.wrap[data-anchor="right"] .panel {
  right: 0;
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----- Option rows ----- */
.option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--text-main);
  font-size: 13.8px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}
.option + .option {
  margin-top: 1px;
}
.option:hover,
.optionActive {
  background: var(--primary-light);
  color: var(--primary);
}

.optionSelected {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}
.optionSelected:hover {
  background: var(--primary-light);
}

.optionMuted {
  color: var(--text-muted);
  font-weight: 600;
}

.optionIcon {
  font-size: 14.3px;
  flex-shrink: 0;
  color: var(--text-muted);
}
.option:hover .optionIcon,
.optionActive .optionIcon,
.optionSelected .optionIcon {
  color: var(--primary);
}

.optionLabel {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.optionHint {
  font-size: 11.6px;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.02em;
}
.option:hover .optionHint,
.optionActive .optionHint,
.optionSelected .optionHint {
  color: var(--primary);
}

.optionCheck {
  font-size: 15.4px;
  font-weight: 700;
  color: var(--primary);
}

.empty {
  padding: 12px 10px;
  text-align: center;
  font-size: 13.2px;
  color: var(--text-muted);
}
