/* ============================================================================
   商机详情页「客户单位」模糊匹配下拉（覆盖层，排在主 CSS 之后）
   —— 只服务 .ns-unit* 这一组新类名，不改动既有的 .ns-f / .input / detail-v5 规则。
   加载顺序：本文件必须排在 detail-v5-*.css 之后（index.html 末尾追加 link）。
   ============================================================================ */
.ns-unit { position: relative; min-width: 0; }

.ns-unit-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* 输入框吃掉剩余宽度；flex 行里的 .input 必须显式改宽 + minWidth:0，否则溢出 */
.ns-unit-inp { flex: 1 1 auto; min-width: 0; width: auto; }

.ns-unit-tag {
  flex: 0 0 auto;
  border-radius: 9999px;
  padding: 1px 7px;
  font-size: 11px;
  line-height: 1rem;
  font-weight: 500;
  white-space: nowrap;
}
.ns-unit-tag-ok { background: #ecfdf5; color: #047857; }
.ns-unit-tag-new { background: #fffbeb; color: #b45309; }

.ns-unit-pop {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  max-height: 236px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid rgb(229 231 235);
  border-radius: .75rem;
  background: #fff;
  box-shadow: 0 10px 30px -12px rgba(15, 23, 42, .28);
}

.ns-unit-pop-h { padding: 4px 8px 6px; font-size: 11px; line-height: 1rem; color: rgb(156 163 175); }
.ns-unit-pop-e { padding: 8px 8px 10px; font-size: 12px; line-height: 1.5; color: rgb(107 114 128); }

.ns-unit-opt {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: .5rem;
  padding: 6px 8px;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.ns-unit-opt:hover, .ns-unit-opt-on { background: #eff6ff; }

.ns-unit-opt-n { display: block; font-size: 13px; line-height: 1.25rem; color: rgb(31 41 55); }
.ns-unit-opt-m { display: block; margin-top: 1px; font-size: 11px; line-height: 1rem; color: rgb(156 163 175); }

@media (max-width: 767px) {
  .ns-unit { width: 100%; }
  .ns-unit-pop { max-height: 44vh; }
}
/* --- @hw193 「客户单位」关联识别增强新增类 --- */
.ns-unit-tag-amb { background: #fef2f2; color: #b91c1c; }

.ns-unit-hint {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1rem;
  color: rgb(107 114 128);
  word-break: break-all;
}
.ns-unit-hint-w { color: #b45309; }

.ns-unit-opt-hit { background: #f0fdf4; }
.ns-unit-opt-hit:hover, .ns-unit-opt-hit.ns-unit-opt-on { background: #dcfce7; }

.ns-unit-opt-tag {
  margin-left: 6px;
  border-radius: 9999px;
  padding: 0 6px;
  font-size: 10px;
  line-height: 1rem;
  font-weight: 500;
  color: #047857;
  background: #d1fae5;
  white-space: nowrap;
  vertical-align: 1px;
}
