/* iOS-style, accessible popovers for the four library filters only. */
select.ios-select-source,
.select-wrap select.ios-select-source,
.sort-wrap select.ios-select-source {
  display: none !important;
}
.select-wrap.ios-select-host,
.select-wrap.ios-select-host:not(:has(>span)),
.sort-wrap.ios-select-host {
  padding: 0;
  gap: 0;
  min-height: 38px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  flex-shrink: 0;
}
.ios-select-host > span[data-icon] {
  display: none !important;
}
.ios-select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  position: relative;
  min-height: 38px;
  max-width: 190px;
  padding: 0 11px 0 13px;
  border: 1px solid var(--line, #0000000c);
  border-radius: 12px;
  color: var(--body, #424245);
  background: var(--surface, #fff);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.15px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px #00000002;
  transition: background 180ms, color 180ms, box-shadow 180ms, border-color 180ms, transform 220ms cubic-bezier(.22,1,.36,1);
  -webkit-tap-highlight-color: transparent;
}
.ios-select-trigger .ios-select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.ios-select-trigger .ios-select-leading {
  width: 16px;
  height: 16px;
  color: var(--secondary, #86868b);
  flex-shrink: 0;
}
.ios-select-trigger .ios-select-chevron {
  width: 13px;
  height: 13px;
  color: var(--secondary, #86868b);
  flex-shrink: 0;
  margin-left: 1px;
  transition: transform 220ms cubic-bezier(.22,1,.36,1), color 180ms;
}
.ios-select-trigger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--surface, #fff) 96%, var(--ink, #1d1d1f));
  border-color: var(--line-strong, #00000014);
}
.ios-select-trigger:active:not(:disabled) {
  transform: scale(.97);
}
.ios-select-trigger:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent, #fa2d48) 35%, transparent);
  outline-offset: 3px;
}
.ios-select-trigger.has-selection,
.ios-select-trigger[aria-expanded="true"] {
  color: var(--accent, #fa2d48);
  background: var(--accent-soft, #fa2d4810);
  border-color: color-mix(in srgb, var(--accent, #fa2d48) 15%, transparent);
}
.ios-select-trigger.has-selection .ios-select-leading,
.ios-select-trigger[aria-expanded="true"] .ios-select-leading,
.ios-select-trigger[aria-expanded="true"] .ios-select-chevron {
  color: var(--accent, #fa2d48);
}
.ios-select-trigger[aria-expanded="true"] .ios-select-chevron {
  transform: rotate(180deg);
}
.ios-select-sort .ios-select-trigger {
  padding-left: 9px;
  padding-right: 5px;
  border-color: transparent;
  box-shadow: none;
  background: transparent;
  color: var(--secondary, #86868b);
  max-width: 172px;
}
.ios-select-sort .ios-select-trigger[aria-expanded="true"] {
  color: var(--accent, #fa2d48);
  background: var(--accent-soft, #fa2d4810);
}
.ios-select-popover {
  position: fixed;
  z-index: 220;
  display: block;
  width: 224px;
  max-width: calc(100vw - 24px);
  min-height: 68px;
  margin: 0;
  padding: 7px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong, #00000014) transparent;
  border: 1px solid var(--glass-border, #ffffffc9);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface, #fff) 88%, transparent);
  backdrop-filter: blur(38px) saturate(175%);
  -webkit-backdrop-filter: blur(38px) saturate(175%);
  color: var(--ink, #1d1d1f);
  box-shadow: 0 18px 50px #00000018, 0 5px 16px #0000000b, 0 0 0 1px #00000003, inset 0 1px 0 #ffffff80;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
  outline: none;
  opacity: 0;
  transform: translateY(-5px) scale(.96);
  transform-origin: var(--ios-select-origin-x, 50%) top;
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.22,1,.36,1);
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}
.ios-select-popover[data-side="above"] {
  transform: translateY(5px) scale(.96);
  transform-origin: var(--ios-select-origin-x, 50%) bottom;
}
.ios-select-popover.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.ios-select-popover.is-closing {
  opacity: 0;
  transform: translateY(-3px) scale(.98);
  pointer-events: none;
  transition-duration: 180ms;
}
.ios-select-popover[data-side="above"].is-closing {
  transform: translateY(3px) scale(.98);
}
.ios-select-popover[hidden] {
  display: none !important;
}
.ios-select-caption {
  padding: 8px 12px 9px;
  margin-bottom: 3px;
  color: var(--secondary, #86868b);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: .1px;
  user-select: none;
}
.ios-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 11px;
  color: var(--ink, #1d1d1f);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -.25px;
  cursor: pointer;
  user-select: none;
  transition: background 120ms ease, color 120ms ease;
}
.ios-select-option-label {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ios-select-option .ios-select-check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent, #fa2d48);
  opacity: 0;
}
.ios-select-option[aria-selected="true"] {
  color: var(--accent, #fa2d48);
  font-weight: 500;
}
.ios-select-option[aria-selected="true"] .ios-select-check {
  opacity: 1;
}
.ios-select-option.is-active:not([aria-disabled="true"]) {
  background: var(--control, #76768014);
}
.ios-select-option.is-active[aria-selected="true"] {
  background: var(--accent-soft, #fa2d4810);
}
.ios-select-option[aria-disabled="true"] {
  opacity: .35;
  cursor: default;
}
html[data-theme="dark"] .ios-select-popover {
  background: color-mix(in srgb, var(--surface-raised, #2c2c2e) 89%, transparent);
  box-shadow: 0 20px 55px #00000066, 0 4px 18px #00000040, inset 0 1px 0 #ffffff0a;
  border-color: #ffffff14;
}
html[data-theme="dark"] .ios-select-trigger {
  box-shadow: none;
}
@media (max-width: 760px) {
  .select-wrap.ios-select-host,
  .sort-wrap.ios-select-host {
    min-height: 39px;
  }
  .ios-select-trigger {
    min-height: 39px;
    font-size: 13px;
    max-width: 175px;
    padding-left: 11px;
    padding-right: 10px;
  }
  .ios-select-sort .ios-select-trigger {
    max-width: 161px;
    padding: 0 4px 0 7px;
    gap: 5px;
    font-size: 12px;
  }
  .ios-select-sort .ios-select-trigger .ios-select-leading {
    width: 15px;
    height: 15px;
  }
  .ios-select-popover {
    border-radius: 20px;
    padding: 8px;
  }
  .ios-select-option {
    min-height: 46px;
    padding: 11px 12px;
    font-size: 16px;
    border-radius: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ios-select-trigger,
  .ios-select-chevron,
  .ios-select-popover,
  .ios-select-option {
    transition: none !important;
    animation: none !important;
  }
  .ios-select-trigger:active:not(:disabled),
  .ios-select-popover,
  .ios-select-popover.is-open,
  .ios-select-popover.is-closing {
    transform: none !important;
  }
}
