/* One visual language for choices, independent of the owning business module. */
:root {
  --choice-surface: #fff;
  --choice-text: #18334a;
  --choice-muted: #52677b;
  --choice-border: #d4e1ec;
  --choice-accent: #0a5fb4;
  --choice-hover: #f1f7fc;
  --choice-selected: #e9f3ff;
  --choice-focus: #86b9ed;
  --choice-shadow: 0 12px 36px #082b4526, 0 2px 6px #082b450a;
}
:root[data-theme="dark"] {
  --choice-surface: #142230;
  --choice-text: #e8f0f8;
  --choice-muted: #b1c0d1;
  --choice-border: #385064;
  --choice-accent: #83c9ff;
  --choice-hover: #1d3347;
  --choice-selected: #203e58;
  --choice-focus: #4d8cbc;
  --choice-shadow: 0 16px 44px #0006;
}
.filter-native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
  border: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  pointer-events: none !important;
}
:root .portal-select {
  position: relative;
  width: 100%;
  min-width: 0;
}
:root .portal-select[hidden], :root .portal-select-menu[hidden] { display: none !important; }
:root .portal-select .filter-select__button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--choice-border);
  border-radius: 10px;
  background: var(--choice-surface);
  box-shadow: none;
  color: var(--choice-text);
  font: inherit;
  font-family: var(--ds-font-sans, system-ui, "Segoe UI", sans-serif);
  font-size: .875rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  letter-spacing: normal;
  text-transform: none;
  transform: none;
  cursor: pointer;
}
:root .portal-select .filter-select__value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root .portal-select .filter-select__button:hover { border-color: var(--choice-accent); background: var(--choice-hover); }
:root .portal-select.is-open .filter-select__button { border-color: var(--choice-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--choice-accent) 13%, transparent); }
:root .portal-select .filter-select__button:focus-visible,
:root .portal-select-menu :is(button, input):focus-visible { outline: 2px solid var(--choice-focus); outline-offset: 2px; }
:root .portal-select.is-invalid .filter-select__button { border-color: #c54454; }
:root .portal-select .filter-select__button:disabled { opacity: .6; cursor: not-allowed; }
:root .portal-select .filter-select__chevron { display: grid; place-items: center; width: 18px; height: 18px; background: transparent; color: var(--choice-muted); border-radius: 0; font-size: 0; }
:root .portal-select .filter-select__chevron::before { content: ""; width: 7px; height: 7px; border: 0; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
:root .portal-select.is-open .filter-select__chevron { transform: rotate(180deg); color: var(--choice-accent); }
:root .portal-select-menu.filter-select__menu {
  position: fixed;
  inset: var(--filter-menu-top, 0) auto auto var(--filter-menu-left, 0);
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: var(--filter-menu-width, min(360px, calc(100vw - 24px)));
  min-width: 0;
  max-width: calc(100vw - 24px);
  max-height: var(--filter-menu-max-height, min(480px, calc(100dvh - 24px)));
  margin: 0;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--choice-border);
  border-radius: 14px;
  background: var(--choice-surface);
  color: var(--choice-text);
  box-shadow: var(--choice-shadow);
  font-family: var(--ds-font-sans, system-ui, "Segoe UI", sans-serif);
  font-size: .875rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  overscroll-behavior: contain;
}
.portal-select-menu::backdrop { background: transparent; pointer-events: none; }
.portal-select-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; padding: 2px 4px 4px; color: var(--choice-muted); font-size: .75rem; line-height: 1.5; }
.portal-select-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-select-count { flex-shrink: 0; font-variant-numeric: tabular-nums; }
:root .portal-select-menu .filter-select__search {
  width: 100%;
  min-height: 40px;
  flex-shrink: 0;
  margin: 0;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--choice-border);
  border-radius: 8px;
  background-color: var(--choice-hover);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236f879b' stroke-width='1.6'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m16 16 4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  color: var(--choice-text);
  font: inherit;
  font-size: .8125rem;
  box-shadow: none;
}
:root .portal-select-menu .filter-select__search::placeholder { color: var(--choice-muted); opacity: 1; }
:root .portal-select-menu .filter-select__toolbar,
:root .portal-select-menu .filter-select__footer { display: flex; justify-content: space-between; gap: 8px; flex-shrink: 0; padding: 0; background: var(--choice-surface); }
:root .portal-select-menu .filter-select__footer { justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--choice-border); }
:root .portal-select-menu :is(.filter-select__select-all, .filter-select__clear, .filter-select__cancel, .filter-select__apply) {
  min-height: 32px;
  padding: 6px 10px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--choice-hover);
  color: var(--choice-accent);
  font: inherit;
  font-size: .75rem;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
}
:root .portal-select-menu .filter-select__apply { background: #0a5fb4; color: #fff; }
:root .portal-select-menu :is(button):disabled { opacity: .45; cursor: not-allowed; }
:root .portal-select-menu .filter-select__options { display: flex; flex-direction: column; gap: 3px; min-height: 0; max-height: var(--filter-options-max-height, 320px); overflow: auto; flex: 0 1 auto; border-radius: 8px; background: transparent; padding: 2px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--choice-border) transparent; }
:root .portal-select-menu .filter-select__option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  height: auto;
  max-height: none;
  flex: 0 0 auto;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--choice-text);
  font: inherit;
  font-size: .8125rem;
  line-height: 1.5;
  text-align: left;
  transform: none;
  cursor: pointer;
}
:root .portal-select-menu.filter-select__menu--single .filter-select__option { grid-template-columns: minmax(0, 1fr) 18px; }
:root .portal-select-menu .filter-select__option-label { min-width: 0; overflow: visible; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
:root .portal-select-menu .filter-select__check { margin-top: 2px; }
:root .portal-select-menu.filter-select__menu--hiring-column .portal-select-title { white-space: normal; overflow: visible; }
:root .portal-select-menu.filter-select__menu--single .filter-select__option-label { order: 0; }
:root .portal-select-menu.filter-select__menu--single .filter-select__check { order: 1; }
:root .portal-select-menu .filter-select__option:hover,
:root .portal-select-menu .filter-select__option:focus-visible { background: var(--choice-hover); border-color: var(--choice-border); transform: none; }
:root .portal-select-menu .filter-select__option.is-selected { background: var(--choice-selected); border-color: transparent; color: var(--choice-accent); }
:root .portal-select-menu .filter-select__check { display: grid; place-items: center; width: 17px; height: 17px; border: 1px solid var(--choice-border); border-radius: 5px; background: var(--choice-surface); color: #fff; }
:root .portal-select-menu.filter-select__menu--single .filter-select__check { border-color: transparent; background: transparent; }
:root .portal-select-menu .filter-select__option.is-selected .filter-select__check { border-color: #0a5fb4; background: #0a5fb4; }
:root .portal-select-menu .filter-select__option.is-selected .filter-select__check::after { content: ""; width: 8px; height: 5px; border: 0; border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: translateY(-1px) rotate(-45deg); }
:root .portal-select-menu .filter-select__empty { border: 0; border-radius: 0; background: transparent; color: var(--choice-muted); padding: 24px 12px; text-align: center; font-size: .8125rem; }
:root :is(.table-filter-head-cell, .vacancy-head-cell, .role-list-head-cell) .portal-select .filter-select__button { min-height: 30px; padding: 4px 8px; border-radius: 8px; gap: 6px; font-size: .7rem; }
/* Existing suggestions and specialized choice lists retain their own data flow. */
:root :is(.chat-candidate-results, .reports-rhid-timebank-detail-multiselect__menu) { border: 1px solid var(--choice-border); border-radius: 12px; background: var(--choice-surface); color: var(--choice-text); box-shadow: var(--choice-shadow); }
:root :is(.org-chain-result, .dho-fp-person-search__option, .reports-rhid-timebank-detail-multiselect__option) { border-color: transparent; border-radius: 8px; background: var(--choice-surface); color: var(--choice-text); min-height: 40px; }
:root :is(.org-chain-result, .dho-fp-person-search__option, .reports-rhid-timebank-detail-multiselect__option):hover { border-color: var(--choice-border); background: var(--choice-hover); }
:root .reports-rhid-timebank-detail-multiselect__search { border-color: var(--choice-border); border-radius: 8px; background: var(--choice-hover); color: var(--choice-text); }
:root .chat-candidate-results { padding: 6px; }
:root .chat-candidate-results button { border: 0; border-radius: 8px; background: transparent; color: var(--choice-text); min-height: 40px; padding: 9px 12px; margin: 0; }
:root .chat-candidate-results button:hover { background: var(--choice-hover); }
@media (max-width: 700px) {
  :root .portal-select-menu.filter-select__menu { left: 12px; width: calc(100vw - 24px); }
  :root .portal-select .filter-select__button,
  :root .portal-select-menu .filter-select__option,
  :root .portal-select-menu :is(.filter-select__select-all, .filter-select__clear, .filter-select__cancel, .filter-select__apply) { min-height: 44px; }
}
@media (prefers-reduced-motion: no-preference) {
  :root .portal-select .filter-select__button, :root .portal-select-menu .filter-select__option { transition: border-color 120ms ease, background-color 120ms ease; }
}
@media (prefers-reduced-motion: reduce) {
  :root .portal-select .filter-select__button, :root .portal-select .filter-select__chevron,
  :root .portal-select-menu .filter-select__option { transition: none; animation: none; }
}
@media (forced-colors: active) {
  :root .portal-select-menu .filter-select__option.is-selected { outline: 1px solid Highlight; }
  :root .portal-select-menu .filter-select__option.is-selected .filter-select__check { forced-color-adjust: none; }
}
