/* entity-picker.css — reusable selected-chips field + picker modal.
   Light theme, matching the app (glass cards, indigo accent, #1f2937 text). */

.ep-field {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
  min-height: 2.4rem; padding: .35rem .4rem; border-radius: 10px;
  border: 1px solid rgba(99,102,241,.18); background: rgba(255,255,255,.75);
}
.ep-chips { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; flex: 1; min-width: 0; }
.ep-chips__empty { color: #9ca3af; font-size: .82rem; padding: 0 .25rem; }
.ep-chip {
  display: inline-flex; align-items: center; gap: .3rem; max-width: 100%;
  padding: .22rem .25rem .22rem .6rem; border-radius: 999px; font-size: .82rem;
  background: #eef2ff; color: #3730a3; border: 1px solid rgba(99,102,241,.22);
}
.ep-chip__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16rem; }
.ep-chip__x {
  border: none; background: rgba(99,102,241,.12); color: #4338ca; cursor: pointer;
  width: 1.15rem; height: 1.15rem; border-radius: 999px; line-height: 1; font-size: .68rem;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.ep-chip__x:hover { background: #fecaca; color: #b91c1c; }
.ep-add {
  border: 1px dashed rgba(99,102,241,.4); background: #fff; color: #4f46e5; cursor: pointer;
  border-radius: 999px; padding: .25rem .7rem; font-size: .82rem; font-weight: 600; white-space: nowrap;
}
.ep-add:hover { background: #eef2ff; border-color: rgba(99,102,241,.7); }

/* --- Modal --- */
body.ep-open { overflow: hidden; }
.ep-modal {
  position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center;
  background: rgba(30, 27, 75, .38); backdrop-filter: blur(3px); padding: 1rem;
}
.ep-modal[hidden] { display: none; }
.ep-modal__dialog {
  display: flex; flex-direction: column; width: min(520px, 100%); max-height: min(80vh, 640px);
  background: rgba(255,255,255,.98);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  color: #1f2937; border: 1px solid rgba(255,255,255,.92); border-radius: 16px;
  padding: 1rem 1.1rem; box-shadow: 0 18px 60px rgba(49,46,129,.22);
}
.ep-modal__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.ep-modal__title { font-size: 1.05rem; font-weight: 700; color: #111827; }
.ep-modal__x { border: none; background: none; color: #6b7280; cursor: pointer; font-size: 1.05rem; line-height: 1; }
.ep-modal__x:hover { color: #111827; }
.ep-modal__search {
  padding: .55rem .7rem; border-radius: 9px; border: 1px solid rgba(99,102,241,.18);
  background: rgba(255,255,255,.9); color: #111827; font-size: .9rem; margin-bottom: .5rem;
}
.ep-modal__search::placeholder { color: #9ca3af; }
.ep-modal__search:focus { outline: none; border-color: rgba(99,102,241,.5); box-shadow: 0 0 0 3px rgba(99,102,241,.08); }
.ep-modal__list {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .1rem;
  border-top: 1px solid rgba(99,102,241,.12); border-bottom: 1px solid rgba(99,102,241,.12);
  padding: .4rem 0; min-height: 120px;
}
.ep-row { display: flex; align-items: center; gap: .6rem; padding: .5rem .55rem; border-radius: 9px; cursor: pointer; }
.ep-row:hover { background: #f5f7ff; }
.ep-row__cb { accent-color: #6366f1; flex: none; width: 1rem; height: 1rem; }
.ep-row__body { min-width: 0; }
.ep-row__name { font-size: .9rem; font-weight: 600; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-row__star { color: #f59e0b; }
.ep-row__meta { font-size: .78rem; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-row__empty { color: #9ca3af; font-size: .85rem; padding: .8rem .5rem; }
.ep-modal__foot { display: flex; align-items: center; gap: .5rem; margin-top: .7rem; }
.ep-modal__count { flex: 1; font-size: .8rem; color: #6b7280; }

@media (max-width: 560px) {
  .ep-modal { padding: 0; }
  .ep-modal__dialog { width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .ep-row { padding: .7rem .55rem; }   /* larger tap targets */
}
