.multi-staff-picker {
  position: relative;
  width: 100%;
}

.multi-staff-native {
  display: none !important;
}

.multi-staff-trigger {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line, #dce7ef);
  border-radius: 12px;
  background: #fff;
  color: var(--ink, #172033);
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.multi-staff-trigger:hover,
.multi-staff-trigger[aria-expanded="true"] {
  border-color: var(--teal, #078ea5);
  box-shadow: 0 0 0 3px rgba(7, 142, 165, .10);
}

.multi-staff-summary {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #6b778c;
}

.multi-staff-trigger.has-selection .multi-staff-summary {
  color: var(--ink, #172033);
  font-weight: 700;
}

.multi-staff-count {
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e8f6f8;
  color: var(--teal2, #056f82);
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}

.multi-staff-chevron {
  color: #6b778c;
  font-size: 16px;
  line-height: 1;
}

.multi-staff-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.multi-staff-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 5px 7px 5px 9px;
  border: 1px solid #cfe7eb;
  border-radius: 999px;
  background: #f1fafb;
  color: #174b56;
  font-size: 12px;
  font-weight: 700;
}

.multi-staff-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-staff-chip-remove {
  border: 0;
  background: transparent;
  color: #54727a;
  padding: 0 2px;
  line-height: 1;
  font-size: 16px;
  cursor: pointer;
}

.multi-staff-popover {
  position: absolute;
  z-index: 80;
  left: 0;
  right: 0;
  top: calc(100% + 7px);
  max-height: min(var(--multi-staff-space, 280px), 280px);
  overflow: hidden;
  border: 1px solid #cfdee7;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(23, 43, 95, .18);
  overscroll-behavior: contain;
}

.multi-staff-popover.open-up {
  top: auto;
  bottom: calc(100% + 7px);
}

.multi-staff-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 7px;
  padding: 8px;
  border-bottom: 1px solid #e7eef3;
  background: #fff;
}

.multi-staff-search {
  flex: 1;
  min-width: 0;
  height: 36px;
  border: 1px solid #d5e1e8;
  border-radius: 9px;
  padding: 0 10px;
  outline: none;
}

.multi-staff-search:focus {
  border-color: var(--teal, #078ea5);
  box-shadow: 0 0 0 3px rgba(7, 142, 165, .09);
}

.multi-staff-clear {
  border: 1px solid #d5e1e8;
  border-radius: 9px;
  background: #f8fbfd;
  color: #42536a;
  padding: 0 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.multi-staff-option-list {
  max-height: calc(min(var(--multi-staff-space, 280px), 280px) - 53px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 3px 0 7px;
  min-width: 0;
  max-width: 100%;
}

.multi-staff-group-title {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px 11px 5px;
  background: #fff;
  color: #586a80;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.multi-staff-option {
  position: relative;
  display: block;
  min-height: 36px;
  padding: 6px 11px;
  cursor: pointer;
  color: var(--ink, #172033);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.multi-staff-option:hover {
  background: #f4fafc;
}

.multi-staff-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.multi-staff-option-head {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.multi-staff-checkmark {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  border: 1.3px solid #b7c7d2;
  border-radius: 4px;
  background: #fff;
  display: inline-grid;
  place-items: center;
  transition: border-color .14s ease, background .14s ease;
}

.multi-staff-option input:checked ~ .multi-staff-option-copy .multi-staff-checkmark {
  border-color: var(--teal, #078ea5);
  background: var(--teal, #078ea5);
}

.multi-staff-option input:checked ~ .multi-staff-option-copy .multi-staff-checkmark::after {
  content: "✓";
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.multi-staff-option-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 1px;
}

.multi-staff-option-name {
  min-width: 0;
  max-width: calc(100% - 22px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 750;
  color: var(--ink, #172033);
}

.multi-staff-option-meta {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  line-height: 1.25;
  color: #748396;
  font-size: 10px;
  font-weight: 600;
}

.multi-staff-picker:has(.multi-staff-popover:not([hidden])) {
  z-index: 90;
}

@media (max-width: 720px) {
  .multi-staff-popover {
    position: fixed;
    left: 14px;
    right: 14px;
    top: auto;
    bottom: 14px;
    max-height: min(62vh, 360px);
    z-index: 250;
  }

  .multi-staff-option-list {
    max-height: calc(min(62vh, 360px) - 53px);
  }
}
