/* A select keeps its intrinsic width, form value and label in every layout. */
html body select:not([multiple]):not([size]), html body select[size="1"]:not([multiple]) {
  appearance: none;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  min-height: 40px;
  padding-inline: 12px 35px;
  border: 1px solid var(--choice-line, #aab4c4);
  border-radius: 9px;
  background-color: var(--choice-paper, #fff);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m3.75 6 4.25 4.25L12.25 6' stroke='%2359657b' stroke-width='1.65' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 11px center;
  background-size: 15px;
  background-repeat: no-repeat;
  color: var(--choice-ink, #1d2739);
  font-family: var(--brand-font);
  cursor: pointer;
  text-overflow: ellipsis;
}
html body select:enabled:is(:hover, [aria-expanded="true"]) { border-color: var(--brand-blue); }
html body select:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
html body select:disabled { opacity: .63; cursor: default; }

.fth-choice-menu {
  position: fixed;
  z-index: 10000;
  inset: auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: max-content;
  min-width: 0;
  margin: 0;
  padding: 5px;
  border: 1px solid var(--choice-line, #c0c9d6);
  border-radius: 12px;
  background: var(--choice-paper, #fff);
  color: var(--choice-ink, #1d2739);
  box-shadow: 0 8px 26px rgb(22 37 75 / 14%);
  font: 400 14px/1.35 var(--brand-font);
  text-align: left;
}
.fth-choice-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; outline: none; }
.fth-choice-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 7px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.fth-choice-option[aria-selected="true"] { color: var(--choice-accent, var(--brand-blue)); font-weight: 600; }
.fth-choice-option[aria-selected="true"]::after { content: ""; justify-self: center; width: 9px; height: 5px; border: solid currentColor; border-width: 0 0 2px 2px; transform: translateY(-2px) rotate(-45deg); }
.fth-choice-option[data-active], .fth-choice-option:not([aria-disabled="true"]):hover { background: var(--choice-wash, #edf2ff); }
.fth-choice-option[aria-disabled="true"] { opacity: .54; cursor: default; }
.fth-choice-menu .fth-choice-search {
  flex: none;
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  margin: 0 0 4px;
  padding: 7px 10px;
  border: 1px solid var(--choice-line, #aab4c4);
  border-radius: 7px;
  background: var(--choice-paper, white);
  color: inherit;
  font: inherit;
}
.fth-choice-menu .fth-choice-search:focus-visible { outline: 2px solid var(--choice-accent, var(--brand-blue)); outline-offset: -2px; }
.fth-choice-note { margin: 0; padding: 8px 10px; color: var(--choice-muted, #536077); }
body[data-theme="dark"] { --choice-paper: #182232; --choice-ink: #f0f3f9; --choice-line: #657185; --choice-wash: #263757; --choice-accent: #abc2ff; --choice-muted: #bdc9db; }
@media (pointer: coarse) {
  html body select:not([multiple]):not([size]), html body select[size="1"]:not([multiple]), .fth-choice-option { min-height: 44px; }
  .fth-choice-menu .fth-choice-search { font-size: 16px; }
}
@media (forced-colors: active) {
  html body select:not([multiple]) { appearance: auto; }
  .fth-choice-option[data-active] { outline: 2px solid Highlight; outline-offset: -2px; }
}
