/* public/css/select.css — the custom dropdown drawn by js/select.js (replaces the browser's own <select> popup). */
/* =====================  custom dropdown (js/select.js)  ===================== */
select.sx-native { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; border: 0; opacity: 0; pointer-events: none; overflow: hidden; clip: rect(0 0 0 0); }
.sx { position: relative; width: 100%; }
.sx-btn { width: 100%; min-height: 42px; height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 12px; text-align: left; justify-content: flex-start;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: .97rem; font-weight: 500; cursor: pointer; }
.sx-btn:hover { background: var(--surface); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.sx-btn:focus-visible, .sx.is-open .sx-btn { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--surface); }
.sx-btn.is-empty { color: var(--muted); font-weight: 400; }
.sx-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-caret { flex: none; width: 18px; height: 18px; display: grid; place-items: center; color: var(--muted); transition: transform .18s; }
.sx-caret svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sx.is-open .sx-caret { transform: rotate(180deg); color: var(--brand); }
/* The popup ("sheet") is moved into <body> while open (js/select.js), so nothing around the field can clip or shift it. */
.sx-sheet[hidden] { display: none; }
.sx-sheet { position: fixed; z-index: 1001; display: flex; flex-direction: column; box-sizing: border-box; max-height: 360px; overflow: hidden;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 44px rgba(0,0,0,.20), 0 3px 10px rgba(0,0,0,.08); transform-origin: top center; animation: sxIn .14s ease-out; }
.sx-sheet.is-up { transform-origin: bottom center; }
.sx-back { position: fixed; inset: 0; z-index: 1000; background: transparent; }
.sx-back[hidden] { display: none; }
.sx-grab, .sx-title { display: none; }
.sx-list { position: relative; flex: 1 1 auto; min-height: 0; padding: 6px 6px 6px 8px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
.sx-list[hidden] { display: none; }
/* slim, rounded scrollbar that floats clear of the rounded corners */
.sx-list::-webkit-scrollbar { width: 10px; }
.sx-list::-webkit-scrollbar-track { background: transparent; margin: 10px 0; }
.sx-list::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 40%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; min-height: 44px; }
.sx-list::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--brand) 70%, transparent); background-clip: padding-box; }
.sx-search { display: flex; align-items: center; gap: 8px; margin: 8px 10px 2px; padding: 0 12px; height: 42px; flex: none; border-radius: 12px; background: var(--surface-2); border: 1px solid transparent; color: var(--muted); }
.sx-search[hidden] { display: none; }
.sx-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--surface); }
.sx-search svg { flex: none; width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sx-q { flex: 1; min-width: 0; height: 100%; border: 0 !important; outline: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; margin: 0; font: inherit; font-size: 16px; color: var(--text); }
.sx-q::placeholder { color: var(--muted); }
.sx-none { padding: 26px 16px 30px; text-align: center; color: var(--muted); font-size: .95rem; }
.sx-none[hidden] { display: none; }
@keyframes sxIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.sx-opt { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: .95rem; line-height: 1.3; color: var(--text); -webkit-tap-highlight-color: transparent; }
.sx-opt[hidden] { display: none; }
.sx-opt-text { flex: 1; min-width: 0; }
.sx-tick { flex: none; width: 18px; height: 18px; display: none; place-items: center; color: var(--brand); }
.sx-tick svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sx-opt.is-active { background: var(--surface-2); }
.sx-opt.is-sel { color: var(--brand); font-weight: 600; background: var(--brand-soft); }
.sx-opt.is-sel .sx-tick { display: grid; }
@media (prefers-reduced-motion: reduce) { .sx-sheet { animation: none !important; } .sx-caret { transition: none; } }
html.sx-lock, html.sx-lock body { overflow: hidden; }

/* inside a toolbar / flex row (admin filters) the dropdown is a normal-sized control, not full width */
.toolbar .sx { width: auto; flex: 0 0 auto; min-width: 150px; }
.toolbar .sx-btn { min-width: 150px; }
.sx.is-disabled .sx-btn { opacity: .55; cursor: not-allowed; }

/* =====================  phones: same popup as on a computer (as wide as the field), just roomier to tap  ===================== */
@media (max-width: 640px) {
  .toolbar .sx, .toolbar .sx-btn { min-width: 0; }
  .toolbar .sx { flex: 1 1 100%; width: 100%; }
  .sx-btn { min-height: 48px; font-size: 16px; }
}
@media (pointer: coarse) {
  .sx-opt { min-height: 46px; padding: 11px 12px; font-size: 1rem; }
  .sx-search { height: 46px; }
}
