/* The enhanced buttons share the native controls' layout; no-JS keeps selects. */
body.search-results-page .rs-select-enhanced > select { display:none !important; }
body.search-results-page .rs-select-enhanced::after,
body.search-results-page .rs-select-enhanced > .rs-sort-icon { display:none !important; }
body.search-results-page .rs-select-trigger {
  display:inline-flex; align-items:center; justify-content:space-between; gap:12px;
  min-width:0; max-width:100%; min-height:44px; height:44px; margin:0;
  padding:0 12px; border:1px solid #d5cbea; border-radius:12px;
  background:#fff; color:#211c3e; font:inherit; font-size:14px; font-weight:550;
  text-align:left; cursor:pointer; box-shadow:0 1px 2px #30244f05;
}
body.search-results-page .rs-select-trigger:hover,
body.search-results-page .rs-select-trigger[aria-expanded="true"] { border-color:#b5a5d6; background:#f6f2ff; }
body.search-results-page .rs-select-trigger:focus-visible { outline:3px solid var(--rs-accent,#4f46e5); outline-offset:3px; }
body.search-results-page .rs-select-trigger-caption { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body.search-results-page .rs-select-trigger-chevron {
  flex:none; width:8px; height:8px; margin:0 3px 4px 1px;
  border-right:2px solid #68529e; border-bottom:2px solid #68529e; transform:rotate(45deg);
}
body.search-results-page .rs-select-trigger[aria-expanded="true"] .rs-select-trigger-chevron { transform:translateY(4px) rotate(225deg); }
body.search-results-page .rs-sort > .rs-select-trigger { width:205px; }

/* Body-hosted popovers avoid clipping by sticky controls and card containers. */
.rs-select-menu {
  position:fixed; inset:auto; z-index:1100; box-sizing:border-box; margin:0;
  display:flex; flex-direction:column; min-width:0; max-width:calc(100vw - 24px);
  padding:6px; border:1px solid #ded6ed; border-radius:17px;
  background:#fff; color:#211c3e; box-shadow:0 15px 42px #30244f24,0 3px 10px #30244f0a;
  font-family:inherit; overflow:hidden; overscroll-behavior:contain;
}
.rs-select-menu[hidden] { display:none !important; }
.rs-select-menu::backdrop { background:transparent; pointer-events:none; }
.rs-select-menu-heading {
  flex:none; padding:10px 10px 11px; color:#7c718f; font-size:11px; line-height:1.4;
  font-weight:600; letter-spacing:.03em; border-bottom:1px solid #efebf5;
}
.rs-select-menu-options { min-height:0; overflow-y:auto; overscroll-behavior:contain; padding-top:5px; scrollbar-width:thin; }
.rs-select-menu-option {
  box-sizing:border-box; display:flex; align-items:center; justify-content:space-between; gap:12px;
  min-height:46px; padding:10px 11px; margin:2px 0; border:1px solid transparent;
  border-radius:11px; color:#3c3355; font-size:14px; line-height:1.4;
  font-weight:500; cursor:pointer; user-select:none;
}
.rs-select-option-copy { display:grid; min-width:0; gap:3px; }
.rs-select-option-count { display:none; }
.rs-select-option-title { overflow-wrap:anywhere; }
.rs-select-option-hint { color:#857b96; font-size:11px; line-height:1.4; font-weight:400; }
.rs-select-option-check { flex:none; width:16px; height:16px; opacity:0; }
.rs-select-option-check::after {
  content:""; display:block; width:5px; height:10px; margin:0 0 0 5px;
  border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg);
}
.rs-select-menu-option[aria-selected="true"] { background:#eee8ff; color:#4c368c; font-weight:650; }
.rs-select-menu-option[aria-selected="true"] .rs-select-option-check { opacity:1; }
.rs-select-menu-option:not([aria-disabled="true"]):hover { background:#f5f1fd; }
.rs-select-menu-option.is-focused:not([aria-disabled="true"]) { border-color:#b4a4d8; background:#f5f1fd; }
.rs-select-menu-option[aria-selected="true"].is-focused { background:#eee8ff; }
.rs-select-menu-option[aria-disabled="true"] { color:#9a91a7; cursor:default; }

@media (max-width:560px) {
  body.search-results-page .rs-type-mobile > .rs-select-trigger {
    width:auto; background:#f5f1ff; font-size:20px; font-weight:650; letter-spacing:-.35px;
    scroll-margin-top:calc(var(--topbar-height,66px) + 16px);
  }
  body.search-results-page .rs-type-mobile > .rs-select-trigger:hover,
  body.search-results-page .rs-type-mobile > .rs-select-trigger[aria-expanded="true"] { background:#eee7ff; }
  body.search-results-page .rs-sort > .rs-select-trigger { width:100%; font-size:16px; }
}
@media (forced-colors:active) {
  body.search-results-page .rs-select-trigger,.rs-select-menu { border-color:ButtonText; background:Canvas; color:CanvasText; box-shadow:none; }
  body.search-results-page .rs-select-trigger-chevron { border-color:ButtonText; }
  .rs-select-menu-heading { color:CanvasText; border-color:ButtonText; }
  .rs-select-menu-option[aria-selected="true"] { border-color:Highlight; color:Highlight; }
  .rs-select-menu-option.is-focused:not([aria-disabled="true"]) { outline:2px solid Highlight; outline-offset:-2px; }
  .rs-select-menu-option[aria-disabled="true"],.rs-select-option-hint { color:GrayText; }
}
