
/* Multiselect dropdown with checkboxes - form factor matches single input width */
.ms.field { position: relative; width: 100%; }
.ms-toggle {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  line-height: 1.3;
  cursor: pointer;
}
.ms-toggle:focus { outline: 2px solid rgba(0,0,0,0.35); outline-offset: 2px; }
.ms-panel {
  position: absolute;
  z-index: 30;
  left: 0; right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 10px;
  display: none;
  max-height: 260px;
  overflow: auto;
}
.ms.field[aria-open="true"] .ms-panel { display: block; }
.ms-option { display: flex; align-items: flex-start; gap: 8px; padding: 6px 4px; cursor: pointer; user-select: none; }
.ms-option input[type="checkbox"] { margin-top: 2px; }
.ms-placeholder, .ms-tags { display: inline-block; }
.ms-tag {
  display: inline-block; margin: 2px 6px 2px 0; padding: 2px 6px;
  border-radius: 999px; background: rgba(0,0,0,0.06);
  font-size: 0.9rem;
}
/* Keep consistent height with other inputs even when many selected */
.ms-toggle.has-values { min-height: 40px; }


/* Align checkbox directly on the left of each option */
.ms-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  cursor: pointer;
}
.ms-option input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
}
.ms-option span {
  flex: 1;
}


/* --- Multiselect: match site form factor & align checkboxes left --- */
.ms.field { position: relative; width: 100%; }

/* Make the closed control look like other inputs */
.ms-toggle {
  width: 100%;
  background: #fff;
  border: 1px solid #dce3eb;
  border-radius: 12px;
  padding: .8rem .9rem;
  font: inherit;
  color: inherit;
  text-align: left;
  line-height: 1.3;
  cursor: pointer;
}
.ms-toggle:focus {
  outline: 2px solid rgba(0,0,0,0.15);
  outline-offset: 2px;
}

/* Dropdown panel styled like menu */
.ms-panel {
  position: absolute;
  z-index: 30;
  left: 0; right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid #dce3eb;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  padding: 8px;
  display: none;
  max-height: 260px;
  overflow: auto;
}
.ms.field[aria-open="true"] .ms-panel { display: block; }

/* Options: checkbox flush-left, text to the right */
.ms-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  cursor: pointer;
}
.ms-option input[type="checkbox"] {
  margin: 0; /* remove default left margin */
  width: 16px; height: 16px;
  justify-self: start;
}
.ms-option span {
  display: block;
}

/* Placeholder & value summary */
.ms-placeholder { display: inline-block; opacity: .85; }
.ms-toggle.has-values .ms-placeholder { opacity: 1; }

/* Keep a consistent minimum height similar to inputs */
.ms-toggle { min-height: 44px; }
