/* Shared smart-search single-select widget — used wherever a list of
   options needs a type-to-search dropdown (v8.84.4). Mirrors the
   `.ss-*` and `.mp-menu` styles already used by the investment edit
   form so all picker surfaces look and behave identically.
   [[feedback_ux_consistency]]. */
.sp { position: relative; display: inline-block; }
.sp-block { display: block; }
.sp-trigger {
    width: 100%; min-width: 170px;
    font-size: 0.86rem; font-weight: 500;
    padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 7px;
    background: #fff; color: #1e293b; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    gap: 6px; transition: border-color .12s ease;
}
.sp-trigger:hover { border-color: #94a3b8; }
.sp-trigger.placeholder { color: #94a3b8; }
.sp-trigger:after {
    content: "▾"; font-size: 0.72rem; color: #94a3b8; flex-shrink: 0;
}
.sp-menu {
    position: absolute; left: 0; right: 0; top: calc(100% + 3px);
    background: #fff; border: 1px solid #cbd5e1; border-radius: 7px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    max-height: 280px; overflow: hidden; z-index: 1500; display: none;
    min-width: 230px;
}
.sp-menu.open { display: flex; flex-direction: column; }
.sp-search {
    border: 0; border-bottom: 1px solid #e2e8f0; outline: 0;
    padding: 7px 10px; font-size: 0.85rem; color: #1e293b;
    background: #fff;
}
.sp-list { overflow-y: auto; max-height: 240px; }
.sp-opt {
    padding: 7px 10px; font-size: 0.84rem; cursor: pointer;
    color: #1e293b; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; display: flex; align-items: center; gap: 6px;
}
.sp-opt:hover { background: #eef2ff; color: #4338ca; }
.sp-opt.on { background: #eef2ff; font-weight: 700; color: #4338ca; }
.sp-empty { padding: 9px 10px; font-size: 0.78rem; color: #94a3b8; }
.sp-swatch {
    display: inline-block; width: 9px; height: 9px; border-radius: 50%;
    background: currentColor; flex-shrink: 0;
}
/* v8.84.14 — multi-select chips inside the trigger. */
.sp-trigger.sp-multi {
    flex-wrap: wrap; gap: 4px; padding: 4px 9px; min-height: 32px;
}
.sp-chip {
    display: inline-flex; align-items: center; gap: 3px;
    background: #eef2ff; color: #4338ca;
    font-size: 0.72rem; font-weight: 700;
    padding: 1px 4px 1px 8px; border-radius: 999px;
}
.sp-chip.sp-more {
    background: #f1f5f9; color: #475569; padding-right: 8px;
}
.sp-chip button {
    border: 0; background: none; cursor: pointer;
    color: #4338ca; font-size: 0.9rem; line-height: 1;
    padding: 0 4px;
}
body.dark-mode .sp-chip { background: rgba(99,102,241,0.2);
    color: #c7d2fe; }
body.dark-mode .sp-chip button { color: #c7d2fe; }
/* Dark-mode forces a light surface for the dropdown text so we never
   inherit white-on-white. Bg stays light (the dropdown is meant to
   "pop"); text stays dark; the trigger stays themed. */
body.dark-mode .sp-trigger {
    background: #1e293b; border-color: #334155; color: #e2e8f0;
}
body.dark-mode .sp-trigger.placeholder { color: #94a3b8; }
body.dark-mode .sp-menu { background: #0f172a; border-color: #334155; }
body.dark-mode .sp-search { background: #0f172a; color: #e2e8f0;
    border-bottom-color: #334155; }
body.dark-mode .sp-opt { color: #e2e8f0; }
body.dark-mode .sp-opt:hover, body.dark-mode .sp-opt.on {
    background: rgba(99,102,241,0.22); color: #c7d2fe;
}
