/* ── EMSSelect (assets/js/ems-select.js) ──────────────────────────────────
   The native <select> stays as the value; this is what people see and use.
   The button wears the field look (ems-design.css §8) so a form of inputs and
   dropdowns reads as one family. */
select.ss-native { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden; clip: rect(0 0 0 0); margin: 0 !important; }
label.field > .ss-btn, .field .ss-btn { width: 100%; }
.ss-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; box-sizing: border-box;
  min-height: 44px; padding: 10px 14px; border: 1px solid var(--ems-line-2, #d0d6e6); border-radius: var(--ems-r-md, 10px);
  background: #fff; color: var(--ems-ink, #131a2c); box-shadow: 0 1px 2px rgba(22, 32, 99, .04);
  font-family: var(--ems-font-body, inherit); font-size: var(--ems-fs-base, 15px); font-weight: 400; line-height: 1.4;
  text-align: left; cursor: pointer; text-transform: none; letter-spacing: normal;
  transition: border-color .16s var(--ems-ease, ease), box-shadow .2s var(--ems-ease, ease), background-color .16s var(--ems-ease, ease);
}
.ss-btn[hidden] { display: none !important; }
.ss-btn:hover { border-color: var(--ems-navy-200, #b9c0e3); }
.ss-btn .ss-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-btn .ss-val.is-ph { color: var(--ems-faint, #8a93a8); }
.ss-btn .ss-chev { flex: none; color: var(--ems-navy-500, #2A3890); transition: transform .26s cubic-bezier(.34, 1.4, .64, 1); }
.ss-btn.is-open, .ss-btn:focus-visible { outline: none; border-color: var(--ems-navy-500, #2A3890); box-shadow: 0 0 0 4px rgba(42, 56, 144, .14); }
.ss-btn.is-open .ss-chev { transform: rotate(180deg); }
.ss-btn.is-picked .ss-val { animation: ss-picked .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes ss-picked { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ss-btn:disabled { cursor: not-allowed; background: var(--ems-soft, #f4f6fb); color: var(--ems-mute-2, #6b7489); }

.ss-pop {
  position: fixed; z-index: 10060; box-sizing: border-box; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--ems-line, #e3e7f1); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(22, 32, 99, .06), 0 18px 44px -10px rgba(22, 32, 99, .30);
  font-family: var(--ems-font-ui, system-ui, sans-serif); color: var(--ems-ink, #131a2c);
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top center;
  transition: opacity .16s cubic-bezier(.2, .8, .2, 1), transform .22s cubic-bezier(.18, .9, .2, 1);
}
.ss-pop.is-up { transform-origin: bottom center; transform: translateY(6px) scale(.98); }
.ss-pop.is-in { opacity: 1; transform: none; }
.ss-pop.is-out { opacity: 0; transform: translateY(-4px) scale(.985); transition-duration: .14s; }
.ss-scroll { position: relative; overflow-y: auto; overscroll-behavior: contain; padding: 6px; min-height: 0; }
.ss-hl {
  position: absolute; left: 6px; right: 6px; top: 0; border-radius: 9px; background: var(--ems-navy-50, #eef0fa);
  opacity: 0; pointer-events: none;
  transition: transform .16s cubic-bezier(.2, .8, .2, 1), height .16s cubic-bezier(.2, .8, .2, 1), opacity .12s;
}
.ss-opt {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 42px; padding: 9px 12px; border-radius: 9px; cursor: pointer; font-size: 15px; font-weight: 500; line-height: 1.3;
  user-select: none; -webkit-user-select: none;
}
.ss-opt.is-off { opacity: .45; cursor: default; }
.ss-pop.is-in .ss-opt { animation: ss-opt-in .22s calc(var(--i, 0) * 14ms) cubic-bezier(.2, .8, .2, 1) backwards; }
@keyframes ss-opt-in { from { opacity: 0; transform: translateY(-4px); } }
.ss-opt.is-active { color: var(--ems-navy-700, #162063); }
.ss-opt[aria-selected="true"] { font-weight: 700; color: var(--ems-navy-500, #2A3890); }
.ss-tick { flex: none; color: var(--ems-navy-500, #2A3890); opacity: 0; transform: scale(.5); transition: opacity .16s, transform .24s cubic-bezier(.34, 1.4, .64, 1); }
.ss-opt[aria-selected="true"] .ss-tick { opacity: 1; transform: none; }

/* Phone: a sheet from the bottom, thumb-reachable, over a dim. */
.ss-back { position: fixed; inset: 0; z-index: 10059; background: rgba(15, 22, 60, 0); transition: background-color .2s cubic-bezier(.2, .8, .2, 1); }
.ss-back.is-in { background: rgba(15, 22, 60, .38); }
.ss-pop--sheet {
  left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto !important; max-height: 72vh !important;
  border-radius: 18px 18px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(100%); transform-origin: bottom center;
  transition: opacity .2s cubic-bezier(.2, .8, .2, 1), transform .3s cubic-bezier(.18, .9, .2, 1);
}
.ss-pop--sheet.is-in { transform: none; }
.ss-pop--sheet.is-out { transform: translateY(100%); opacity: 1; transition-duration: .2s; }
.ss-sheet-h { flex: none; padding: 8px 18px 6px; text-align: center; }
.ss-sheet-h b { display: block; margin-top: 8px; font-size: 15px; color: var(--ems-navy-500, #2A3890); font-family: var(--ems-font-display, system-ui, sans-serif); }
.ss-grab { display: block; width: 40px; height: 4px; margin: 0 auto; border-radius: 99px; background: var(--ems-line-2, #d0d6e6); }
.ss-pop--sheet .ss-scroll { padding: 6px 10px 14px; }
.ss-pop--sheet .ss-opt { min-height: 50px; font-size: 16.5px; }

@media (prefers-reduced-motion: reduce) {
  .ss-btn, .ss-btn .ss-val, .ss-chev, .ss-pop, .ss-opt, .ss-hl, .ss-tick, .ss-back { animation: none !important; transition: none !important; }
}
