/* Custom select (select.js): the button wears the field's own class (of__input, hl-field__input…), so it looks like every other field.
   Desktop: a popover list under the field. Phones: a bottom sheet. */
.sel { display: contents; }
.sel__native { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; opacity: 0; pointer-events: none; }
.sel__btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; text-align: left; cursor: pointer; font: inherit; color: var(--color-ink); -webkit-user-select: none; user-select: none; }
.sel__btn:disabled { cursor: default; opacity: .55; }
.sel__val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel__val.is-ph { color: var(--color-ink-muted); }
.sel__chev { flex: none; width: 18px; height: 18px; color: var(--color-ink-muted); transition: transform .15s ease; }
.sel__btn[aria-expanded="true"] .sel__chev { transform: rotate(180deg); }
.sel__btn:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px var(--color-ink); }
/* fields that used to draw their own arrow */
.sel__btn.of__input, .sel__btn.hl-field__input { background-image: none; padding-right: 12px; }

/* Desktop popover */
.sel-scrim { position: fixed; inset: 0; z-index: 150; }
.sel-pop { position: fixed; z-index: 151; max-height: 320px; overflow-y: auto; overscroll-behavior: contain; padding: 6px; border-radius: 14px;
  background: var(--color-surface); color: var(--color-ink); box-shadow: var(--shadow-float);
  opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top left; transition: opacity .14s ease, transform .16s cubic-bezier(.2, .8, .2, 1); }
.sel-scrim.is-open .sel-pop { opacity: 1; transform: none; }
.sel-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: none;
  color: var(--color-ink); font: inherit; font-size: 15px; text-align: left; cursor: pointer; white-space: nowrap; }
.sel-opt[aria-selected="true"] { font-weight: 700; }
.sel-opt:focus-visible, .sel-opt.is-hi:focus { outline: none; background: var(--color-hover); }
.sel-opt.is-off { color: var(--color-ink-muted); cursor: default; }
.sel-opt__chk { flex: none; width: 16px; height: 16px; margin-left: auto; color: var(--color-accent); }
@media (hover: hover) { .sel-opt:hover { background: var(--color-hover); } }

/* Phone sheet */
.sel-sheet { position: fixed; inset: 0; z-index: 150; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 10, 14, 0); transition: background-color .18s ease; }
.sel-sheet.is-open { background: rgba(10, 10, 14, .42); }
.sel-sheet__panel { width: 100%; max-width: 440px; max-height: calc(100dvh - 40px); display: flex; flex-direction: column; margin: 8px; margin-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); padding: 6px; border-radius: 16px;
  background: var(--color-surface); color: var(--color-ink); box-shadow: var(--shadow-float); transform: translateY(14px); opacity: 0; transition: transform .2s cubic-bezier(.2, .8, .2, 1), opacity .18s ease; }
.sel-sheet.is-open .sel-sheet__panel { transform: none; opacity: 1; }
.sel-sheet__title { flex: none; margin: 8px 12px 6px; font-size: 13px; line-height: 18px; text-align: center; color: var(--color-ink-muted); }
.sel-sheet__list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.sel-sheet .sel-opt { min-height: 50px; font-size: 16px; }
.sel-sheet__cancel { flex: none; width: 100%; height: 46px; margin-top: 6px; border: 0; border-radius: 12px; background: var(--color-field); color: var(--color-ink); font: inherit; font-weight: 700; }
@media (min-width: 768px) { .sel-sheet { align-items: center; } }
/* inside a form field (.fld span{font-size:12px} would shrink the value) — same size and width as the inputs around it */
.fld .sel__btn { width: 100%; }
.fld .sel__btn .sel__val { font-size: var(--fs-field); color: var(--color-ink); }
.fld .sel__btn .sel__val.is-ph { color: var(--color-ink-muted); }
.fld .place-pick__sel { font-size: inherit; color: inherit; }

/* Filter picker (A.filterPick): ticks, counts and a sticky "Clear · Show N" foot */
.fp__pop { display: flex; flex-direction: column; max-height: 420px; padding: 6px 6px 0; overflow: hidden; }
.fp__list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.fp__opt { gap: 12px; }
.fp__lab { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fp__n { flex: none; margin-left: auto; font-size: 13px; color: var(--color-ink-muted); font-variant-numeric: tabular-nums; }
.fp__opt .sel-opt__chk { margin-left: 8px; }
.fp__box { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--color-line-strong); color: transparent; transition: background-color .12s ease, box-shadow .12s ease; }
.fp__box svg { width: 12px; height: 12px; }
.fp__opt[aria-selected="true"] { font-weight: 700; }
.fp__opt[aria-selected="true"] .fp__box { background: var(--color-accent); box-shadow: none; color: var(--color-on-accent); }
.fp__empty { margin: 16px 12px; color: var(--color-ink-muted); font-size: 14px; text-align: center; }
.fp__foot { position: relative; flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 6px calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--color-surface); }
.fp__foot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--color-accent) 70%, transparent) 30%, color-mix(in srgb, var(--color-accent) 70%, transparent) 70%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--color-accent) 45%, transparent); opacity: .5; }
.fp__clear { flex: none; height: 44px; padding: 0 14px; border: 0; border-radius: 22px; background: none; color: var(--color-ink); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.fp__clear:disabled { opacity: .4; cursor: default; text-decoration: none; }
.fp__go { flex: 1; height: 44px; border-radius: 22px; }
.sel-pop .fp__foot { padding-bottom: 8px; }
