/* Theme-matched selects. Native controls stay usable until the enhancer adds
   .sg-select-native; menus are positioned within the viewport by dropdowns.js. */
:root{
 --select-hover:#edf4f4;
 --select-selected:#e1eded;
 --select-shadow:0 14px 36px #1839421a,0 3px 8px #1839420d;
 --select-error:#984a3b;
}
html[data-theme=dark]{
 --select-hover:#22353e;
 --select-selected:#30342f;
 --select-shadow:0 16px 42px #0006,0 3px 10px #0003;
 --select-error:#edaa96;
}
.sg-select{position:relative;display:block;min-width:0;width:100%;text-align:left}
select.sg-select-native{position:absolute!important;width:1px!important;height:1px!important;min-height:0!important;padding:0!important;margin:-1px!important;border:0!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;pointer-events:none!important}
button.sg-select-trigger{
 display:flex;align-items:center;justify-content:space-between;gap:16px;
 width:100%;min-width:0;min-height:50px;margin:0;padding:12px 14px;
 border:1px solid var(--line);border-radius:2px;box-shadow:none;
 background:var(--surface);color:var(--ink);font:400 16px/1.45 var(--body);
 text-align:left;cursor:pointer;appearance:none;-webkit-appearance:none;
 user-select:none;transition:border-color .16s ease,background-color .16s ease;
}
button.sg-select-trigger:hover:not(:disabled){border-color:var(--accent);background:var(--surface)}
button.sg-select-trigger[aria-expanded=true]{border-color:var(--accent);background:var(--surface)}
button.sg-select-trigger:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
button.sg-select-trigger[aria-invalid=true]{border-color:var(--select-error)}
button.sg-select-trigger[aria-invalid=true]:focus-visible{outline-color:var(--select-error)}
button.sg-select-trigger:disabled{opacity:.55;cursor:not-allowed;background:var(--surface2);color:var(--muted)}
.sg-select-value{display:block;flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sg-select-value.is-placeholder,.sg-select-trigger.is-placeholder .sg-select-value{color:var(--muted)}
.sg-select-chevron{display:grid;place-items:center;flex:0 0 18px;width:18px;height:18px;color:var(--accent);line-height:1;transition:transform .18s ease}
.sg-select-chevron svg{display:block;width:16px;height:16px}
.sg-select-chevron:empty:before{content:"";display:block;width:7px;height:7px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg)}
.sg-select-trigger[aria-expanded=true] .sg-select-chevron{transform:rotate(180deg)}
.sg-select-menu{
 position:fixed;z-index:1000;display:block;box-sizing:border-box;
 width:280px;max-width:calc(100vw - 24px);max-height:min(360px,calc(100dvh - 24px));
 margin:0;padding:5px;border:1px solid var(--line);border-radius:3px;
 background:var(--surface);color:var(--ink);box-shadow:var(--select-shadow);
 overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;
 scrollbar-width:thin;scrollbar-color:var(--line) var(--surface);scroll-padding-block:5px;
 text-align:left;touch-action:pan-y;user-select:none;
}
.sg-select-menu[hidden],.sg-select-error[hidden]{display:none!important}
.sg-select-menu:focus{outline:none}
.sg-select-menu::-webkit-scrollbar{width:7px}
.sg-select-menu::-webkit-scrollbar-track{background:var(--surface)}
.sg-select-menu::-webkit-scrollbar-thumb{background:var(--line);border:2px solid var(--surface);border-radius:5px}
.sg-select-option{
 position:relative;display:flex;align-items:center;justify-content:space-between;gap:15px;
 box-sizing:border-box;min-width:0;min-height:47px;margin:0;padding:11px 12px;
 border:0;border-radius:1px;background:transparent;color:var(--ink);
 font:400 16px/1.45 var(--body);cursor:pointer;outline:none;
}
.sg-select-option+.sg-select-option{margin-top:2px}
.sg-select-option-label{display:block;flex:1 1 auto;min-width:0;white-space:normal;overflow-wrap:anywhere}
.sg-select-option.is-placeholder,.sg-select-option[data-placeholder=true]{color:var(--muted)}
.sg-select-option[aria-selected=true]{background:var(--select-selected);font-weight:500}
.sg-select-option:hover:not([aria-disabled=true]),.sg-select-option.is-active{background:var(--select-hover);box-shadow:inset 2px 0 var(--accent)}
.sg-select-option[aria-disabled=true]{color:var(--muted);opacity:.55;cursor:default}
.sg-select-tick{display:grid;place-items:center;flex:0 0 18px;width:18px;height:18px;color:var(--accent);font:600 16px/1 var(--body);opacity:0}
.sg-select-option[aria-selected=true] .sg-select-tick{opacity:1}
.sg-select-tick svg{display:block;width:16px;height:16px}
.sg-select-error{display:block;margin:8px 0 0;color:var(--select-error);font:400 13px/1.5 var(--body)}
.sg-select-error:empty{display:none}
@media(max-width:760px){
 button.sg-select-trigger{min-height:50px;padding:12px 13px;font-size:16px;gap:10px}
 .sg-select-option{min-height:48px;padding:12px;font-size:16px}
 .sg-select-menu{padding:4px;scroll-padding-block:4px}
}
@media(prefers-reduced-motion:reduce){
 button.sg-select-trigger,.sg-select-chevron{transition:none}
}

