/* Each popup inherits the active site palette, including every dark theme. */
.checker-select {
  position: relative;
  min-width: 0;
}

.checker-select.is-open {
  z-index: 20;
}

.checker-select-trigger {
  scroll-margin-top: calc(var(--site-header-height, 53px) + 1rem);
  scroll-margin-bottom: 1rem;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .85rem;
  width: 100%;
  min-height: 48px;
  padding: .75rem .875rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--ink);
  font: 400 .875rem/1.45 var(--font-body);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 3%, transparent);
  transition: border-color var(--motion-fast, 160ms), background var(--motion-fast, 160ms);
}

.checker-select-trigger:hover:not(:disabled),
.checker-select-trigger[aria-expanded="true"] {
  border-color: var(--accent);
}

.checker-select-trigger:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.checker-select-trigger:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: var(--surface-sunken);
}

.checker-select-value {
  overflow-wrap: anywhere;
}

.checker-select-chevron,
.checker-select-check {
  display: block;
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.checker-select-chevron {
  color: var(--muted);
  transition: transform var(--motion-fast, 160ms);
}

.checker-select-trigger[aria-expanded="true"] .checker-select-chevron {
  color: var(--accent);
  transform: rotate(180deg);
}

.checker-select-options {
  position: absolute;
  z-index: 1;
  top: calc(100% + 7px);
  inset-inline: 0;
  max-height: min(18rem, 45vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) var(--surface-raised);
  padding: .35rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: 0 8px 30px color-mix(in srgb, var(--ink) 12%, transparent),
    0 2px 6px color-mix(in srgb, var(--ink) 5%, transparent);
}

.checker-select.opens-above .checker-select-options {
  top: auto;
  bottom: calc(100% + 7px);
}

.checker-select.is-compact .checker-select-options {
  max-height: min(10rem, 30vh);
}

.checker-select.is-short .checker-select-options {
  max-height: min(6rem, 20vh);
}

.checker-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 44px;
  padding: .65rem .65rem;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--body);
  font: 400 .8125rem/1.5 var(--font-body);
  cursor: pointer;
  user-select: none;
}

.checker-select-option > span {
  overflow-wrap: anywhere;
}

.checker-select-option .checker-select-check {
  visibility: hidden;
  width: 16px;
  height: 16px;
}

.checker-select-option[aria-selected="true"] {
  color: var(--ink);
  font-weight: 500;
}

.checker-select-option[aria-selected="true"] .checker-select-check {
  visibility: visible;
  color: var(--accent);
}

.checker-select-option.is-active {
  background: var(--surface-sunken);
  border-color: var(--rule);
  color: var(--ink);
}

.checker-select-option[aria-disabled="true"] {
  color: var(--muted);
  opacity: .55;
  cursor: not-allowed;
}

.checker-select-group {
  padding: .75rem .7rem .35rem;
  font: 500 .625rem/1.5 var(--font-body);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .checker-select-trigger,
  .checker-select-chevron {
    transition: none;
  }
}
