/* Shared native-select enhancement. With no JS, no element has .ab-select-native. */
.ab-select-native { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; clip-path:inset(50%)!important; overflow:hidden!important; white-space:nowrap!important; border:0!important; }

/* Icons are drawn from one 24 px line set (2 px stroke, round joins) and take the text colour. */
.ab-select-icon { flex:none; display:block; width:16px; height:16px; background:currentColor; -webkit-mask:var(--ab-icon) center/contain no-repeat; mask:var(--ab-icon) center/contain no-repeat; }
.ab-select-chevron { --ab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); opacity:.5; transition:transform 140ms ease, opacity 140ms ease; }
.ab-select-check { --ab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); visibility:hidden; }
.ab-select-glass { --ab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); width:15px; height:15px; opacity:.5; }

/* Trigger */
.ab-select-trigger { display:inline-flex; align-items:center; justify-content:space-between; gap:8px; height:36px; width:100%; min-width:0; max-width:320px; padding:0 10px 0 12px; border:1px solid var(--hair-strong,rgba(34,34,34,.2)); border-radius:8px; background:var(--page,#fff); color:var(--ink); font:400 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; text-align:left; cursor:pointer; transition:border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease; }
.ab-select-value { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ab-select-trigger.is-placeholder .ab-select-value { color:var(--ink-soft); }
.ab-select-trigger:hover:not(:disabled) { background:var(--paper-2,#f6f6f4); }
.ab-select-trigger:hover:not(:disabled) .ab-select-chevron,.ab-select-trigger[aria-expanded=true] .ab-select-chevron { opacity:.85; }
.ab-select-trigger:focus-visible,.ab-select-trigger[aria-expanded=true] { outline:0; border-color:var(--ink); box-shadow:0 0 0 3px rgba(34,34,34,.1); }
.ab-select-trigger:disabled { opacity:.5; cursor:not-allowed; background:var(--paper-2,#f6f6f4); }
.ab-select-trigger[aria-expanded=true] .ab-select-chevron { transform:rotate(180deg); }
.ab-select-native:invalid + .ab-select-trigger.was-validated,.ab-select-trigger[aria-invalid=true] { border-color:var(--bad,#c9302c); box-shadow:0 0 0 3px rgba(201,48,44,.12); }

/* Popup */
.ab-select-popup { position:fixed; z-index:10020; display:flex; flex-direction:column; padding:4px; max-height:min(360px,50vh); background:#fff; color:var(--ink); border:1px solid var(--hair,rgba(34,34,34,.14)); border-radius:10px; box-shadow:0 12px 32px -10px rgba(34,34,34,.22),0 2px 6px rgba(34,34,34,.06); font:400 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; transform-origin:top center; animation:ab-select-open 140ms cubic-bezier(.2,.8,.2,1); }
.ab-select-popup[hidden],.ab-select-popup [hidden],.ab-select-backdrop[hidden] { display:none; }
.ab-select-search { display:flex; align-items:center; gap:8px; flex:none; height:36px; margin:-4px -4px 4px; padding:0 12px; border-bottom:1px solid var(--hair,rgba(34,34,34,.14)); }
.ab-select-input { flex:1; width:100%; min-width:0; height:100%; padding:0; border:0; outline:0; background:transparent; color:var(--ink); font:inherit; }
.ab-select-input::placeholder { color:var(--ink-soft); opacity:.8; }
.ab-select-input:focus-visible { outline:0; }
.ab-select-count { flex:none; padding:4px 8px 2px; color:var(--ink-soft); font-size:11px; line-height:16px; letter-spacing:.02em; }
.ab-select-list { min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:rgba(34,34,34,.2) transparent; scroll-padding-block:4px; }
.ab-select-option { position:relative; min-height:32px; padding:6px 8px; display:flex; align-items:center; gap:8px; border-radius:6px; cursor:pointer; user-select:none; }
.ab-select-option-text { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ab-select-option.is-active,.ab-select-option:hover:not([aria-disabled=true]) { background:var(--paper-2,#f3f3f3); }
.ab-select-option[aria-selected=true] .ab-select-option-text { font-weight:500; }
.ab-select-option[aria-selected=true] .ab-select-check { visibility:visible; }
.ab-select-option[aria-disabled=true] { opacity:.4; cursor:not-allowed; }
.ab-select-option mark { color:inherit; background:transparent; font-weight:600; }
.ab-select-group + .ab-select-group,.ab-select-option + .ab-select-group { margin-top:4px; padding-top:4px; border-top:1px solid var(--hair,rgba(34,34,34,.14)); }
.ab-select-group-label { position:sticky; top:0; z-index:1; padding:6px 8px 4px; background:#fff; color:var(--ink-soft); font-size:11px; line-height:16px; font-weight:500; }
.ab-select-empty { padding:22px 8px; text-align:center; color:var(--ink-soft); font-size:13px; }

/* Bottom sheet on small touch screens */
.ab-select-handle { display:none; }
.ab-select-backdrop { position:fixed; inset:0; background:rgba(34,34,34,.28); z-index:10019; animation:ab-select-fade 160ms ease-out; }
.ab-select-popup.is-sheet { inset:auto 0 0; width:100%; max-height:70vh; max-height:70dvh; border-radius:16px 16px 0 0; border-width:1px 0 0; padding:4px 8px max(12px,env(safe-area-inset-bottom)); transform-origin:bottom center; animation:ab-select-sheet 220ms cubic-bezier(.2,.8,.2,1); }
.is-sheet .ab-select-handle { display:block; flex:none; width:36px; height:4px; margin:8px auto 10px; border-radius:2px; background:rgba(34,34,34,.18); }
.is-sheet .ab-select-search { margin:0 -8px 4px; height:44px; padding:0 16px; }
.is-sheet .ab-select-option { min-height:44px; padding:10px 8px; font-size:15px; }
@media(pointer:coarse) { .ab-select-input { font-size:16px; } }

/* Where it is used */
.grid-controls { align-items:center; }
.grid-controls label.grid-control { display:flex; align-items:center; gap:8px; border:0; padding:0; min-width:0; }
.grid-controls label.grid-control[hidden] { display:none; }
.grid-controls .ab-select-trigger { width:200px; }
.grid-controls #personal-brief .ab-select-trigger { width:240px; }
.grid-controls button.grid-control { min-height:36px; }
.board-mobile-sort .ab-select-trigger { width:170px; }
@media(pointer:coarse) { .ab-select-trigger,.grid-controls button.grid-control { min-height:44px; } }
@media(max-width:560px) { .grid-controls label.grid-control { width:100%; } .grid-controls .ab-select-trigger,.grid-controls #personal-brief .ab-select-trigger { flex:1; width:0; max-width:none; } }
@keyframes ab-select-open { from { opacity:0; transform:translateY(-2px) scale(.98); } to { opacity:1; transform:none; } }
@keyframes ab-select-sheet { from { transform:translateY(24px); opacity:0; } to { transform:none; opacity:1; } }
@keyframes ab-select-fade { from { opacity:0; } to { opacity:1; } }
@media(prefers-reduced-motion:reduce) { .ab-select-popup,.ab-select-popup.is-sheet,.ab-select-backdrop { animation:none; } .ab-select-chevron,.ab-select-trigger { transition:none; } }
