.choice-control {
  position: relative;
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}
.choice-control select[hidden], .choice-list[hidden], .choice-control .choice-error[hidden] { display: none !important; }
.choice-control input.choice-input[role="combobox"] {
  grid-area: 1 / 1 / 2 / -1;
  box-sizing: border-box;
  appearance: none;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 39px 9px 12px;
  border: 1px solid var(--control-border, #bdcbd7);
  border-radius: 9px;
  color: var(--ink, #20334b);
  background: linear-gradient(180deg, #fcfdfe, #fff 60%);
  box-shadow: var(--field-shadow, 0 1px 2px #18384c0e);
  font: inherit;
  font-size: 14px;
  font-weight: 480;
  line-height: 1.45;
  cursor: pointer;
  text-overflow: ellipsis;
}
.choice-control input.choice-input[role="combobox"]:hover { border-color: var(--accent, #315d80); }
.choice-control input.choice-input[role="combobox"]:focus-visible, .choice-control input.choice-input[role="combobox"][aria-expanded="true"] {
  border-color: var(--accent, #315d80);
  outline: 2px solid var(--accent, #315d80);
  outline-offset: 1px;
}
.choice-control input.choice-input[role="combobox"][aria-expanded="true"] { cursor: text; }
.choice-control input.choice-input[role="combobox"]:disabled { color: var(--muted); background: var(--paper); cursor: not-allowed; }
.choice-control input.choice-placeholder { color: var(--muted); }
.choice-control input.choice-input[role="combobox"][aria-invalid="true"] { border-color: #aa443e; }
.choice-control .choice-toggle {
  grid-area: 1 / 2;
  position: relative;
  display: grid;
  align-self: stretch;
  justify-self: end;
  place-items: center;
  width: 36px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0 8px 8px 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.choice-toggle::after {
  content: '';
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 1.6px 1.6px 0;
  transform: translateY(-2px) rotate(45deg);
}
.choice-input[aria-expanded="true"] ~ .choice-toggle { color: var(--field-accent); }
.choice-toggle:focus-visible { outline: 2px solid var(--field-accent); outline-offset: -3px; }
.choice-input[aria-expanded="true"] ~ .choice-toggle::after { transform: translateY(2px) rotate(225deg); }
.choice-error { grid-column: 1 / -1; margin-top: 4px; color: #a03a34; font-size: 13px; }
.choice-list {
  position: fixed;
  z-index: 60;
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 5px;
  border: 1px solid var(--control-border, #bdcbd7);
  border-radius: 11px;
  background: var(--white, white);
  box-shadow: 0 4px 8px #172c4912, 0 14px 36px #172c492b;
  color: var(--ink);
  font: 450 14px/1.5 var(--font, sans-serif);
  scrollbar-width: thin;
}
.choice-option, .choice-empty {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 6px;
  overflow-wrap: anywhere;
}
.choice-option { cursor: pointer; }
.choice-option[aria-selected="true"] { color: var(--accent, #315d80); font-weight: 650; }
.choice-option[aria-selected="true"]::after {
  content: '';
  flex: 0 0 auto;
  width: 4px;
  height: 8px;
  margin-inline: 4px;
  border: solid currentColor;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg);
}
.choice-option.choice-active { background: var(--accent-soft, #e9f0f6); }
@media (hover: hover) {
  .choice-option:not([aria-disabled]):hover { background: var(--accent-soft, #e9f0f6); }
}
.choice-option[aria-disabled="true"], .choice-empty { color: var(--muted); cursor: default; }
.choice-option[aria-disabled="true"] { opacity: .65; }
@media (forced-colors: active) {
  .choice-option.choice-active { outline: 2px solid Highlight; outline-offset: -2px; }
  .choice-option[aria-selected="true"] { color: Highlight; }
}
.filter-bar > .choice-control { width: 9.5em; }
.fn-filters .choice-control { width: 10.5em; }
.period .choice-control { width: 6.4em; }
.period .choice-control input.choice-input[role="combobox"] { min-height: 36px; padding-left: 6px; border: 0; background: transparent; box-shadow: none; }
@media (pointer: coarse), (max-width: 640px) {
  .choice-control input.choice-input[role="combobox"] { min-height: 44px; padding-right: 45px; font-size: 16px; }
  .choice-control .choice-toggle { width: 44px; }
  .choice-option { min-height: 44px; }
}
@media (max-width: 640px) {
  .filter-bar > .choice-control { flex: 1 1 100px; }
  .fn-filters .choice-control { width: 100%; }
  .period .choice-control input.choice-input[role="combobox"] { min-height: 42px; }
}
