/* ─────────────────────────────────────────────────────────────
   Slate custom select — a styled, animated dropdown that progressively
   enhances native <select>. The real <select> stays in the DOM (hidden)
   as the source of truth, so every existing onchange / .value keeps
   working. Fully token-themed → adapts to light & dark automatically.
   ───────────────────────────────────────────────────────────── */
.ss-wrap { position: relative; display: inline-flex; vertical-align: middle; max-width: 100%; font-family: var(--ff-sans, inherit); }
/* Native select kept for state/value but visually hidden (still focusable-ish). */
.ss-native {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); border: 0; opacity: 0; pointer-events: none;
}

/* Trigger — mirrors .f-input / .ed-stage-select so it sits in existing layouts. */
.ss-trigger {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  background: var(--s2, var(--bg2)); border: 1.5px solid var(--b1); border-radius: var(--radius-md, 8px);
  color: var(--tx); padding: 10px 12px 10px 14px; font-size: 14px; font-family: inherit; line-height: 1.45;
  cursor: pointer; outline: none; text-align: left; -webkit-appearance: none; appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.ss-trigger.ss-compact { padding: 8px 11px 8px 12px; font-size: 13px; }
.ss-trigger:hover { border-color: var(--b2); }
.ss-wrap.open > .ss-trigger,
.ss-trigger:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,53,3,.12); }
.ss-trigger:disabled { opacity: .55; cursor: not-allowed; }

.ss-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.ss-value.ss-placeholder { color: var(--t4); }

.ss-arrow { display: inline-flex; flex-shrink: 0; color: var(--t3); transition: transform .22s cubic-bezier(.4,0,.2,1); }
.ss-arrow svg { width: 14px; height: 14px; display: block; }
.ss-wrap.open > .ss-trigger .ss-arrow { transform: rotate(180deg); color: var(--accent); }

/* Menu — fixed & body-mounted (so it never clips inside scroll containers). */
.ss-menu {
  position: fixed; z-index: 4000; box-sizing: border-box;
  min-width: 160px; max-height: 320px; overflow-y: auto;
  background: var(--bg2); border: 1px solid var(--b1); border-radius: 12px;
  box-shadow: 0 16px 44px rgba(0,0,0,.34); padding: 6px;
  opacity: 0; transform: translateY(-6px) scale(.985); transform-origin: top center;
  visibility: hidden; pointer-events: none;
  transition: opacity .16s ease, transform .17s cubic-bezier(.34,1.15,.64,1), visibility .16s;
}
.ss-menu.ss-up { transform-origin: bottom center; transform: translateY(6px) scale(.985); }
.ss-menu.open { opacity: 1; transform: translateY(0) scale(1); visibility: visible; pointer-events: auto; }

.ss-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left;
  border: none; background: none; cursor: pointer; color: var(--t2); font-size: 13.5px; font-family: inherit;
  padding: 9px 10px; border-radius: 8px; line-height: 1.35;
}
.ss-opt:hover, .ss-opt.hi { background: var(--bg3); color: var(--tx); }
.ss-opt.selected { color: var(--tx); font-weight: 600; }
.ss-opt.disabled { opacity: .5; cursor: default; }
.ss-opt.disabled:hover { background: none; }
.ss-opt-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-check { color: var(--accent); flex-shrink: 0; display: inline-flex; }
.ss-check svg { width: 15px; height: 15px; display: block; }
