/* The one shared select: Figma DL / Select 568:5 (file qCb3RQEVojZl1JuYnJ3xUx, page Foundations · Shared components).
   Kind generic / branch / language (data-variant), size sm 32 / md 36 / lg 40 (data-size), states default / open / disabled (locked).
   Markup: shared/presentation/listbox.html (Angular ui-listbox) and SiteChrome::languageSelect() (PHP pages, same classes).
   Loaded by the ui-listbox component itself (both applications), by angular.json for admin-app, and copied to assets/css/listbox.css
   by design/scripts/static-build.mjs for the PHP pages. Tokens only (design/src/styles/tokens.css); no url() so the copy is portable.
   The list opens in the top layer (Popover API) anchored under the trigger, so a card's overflow never clips it. */
:root .ui-listbox { position: relative; display: block; min-width: 0; }
:root .ui-listbox[data-variant='language'] { display: inline-block; flex: none; }
/* Branch at sm: 220 wide like the admin top bar (Figma 568:38); owners widen it (drawer, forms) with their own layout rules. */
:root .ui-listbox[data-variant='branch'][data-size='sm'] { inline-size: 220px; max-inline-size: 100%; }
:root .ui-listbox .ui-listbox-nav, :root .ui-listbox.ui-listbox-nav { display: block; margin: 0; padding: 0; border: 0; background: transparent; }
:root .ui-listbox .ui-listbox-name { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Trigger */
:root .ui-listbox .ui-listbox-trigger { display: flex; align-items: center; gap: var(--space-2); box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; height: var(--control-md); min-height: 0; margin: 0; padding: 0 var(--space-2) 0 var(--space-3); border: 1px solid var(--outline); border-radius: var(--radius-control); background: var(--surface); box-shadow: none; color: var(--ink); font: 400 var(--text-14) / var(--leading-14) var(--font-body); letter-spacing: 0; text-align: start; text-decoration: none; text-transform: none; cursor: pointer; appearance: none; }
:root .ui-listbox[data-size='sm'] .ui-listbox-trigger { height: var(--control-sm); }
:root .ui-listbox[data-size='md'] .ui-listbox-trigger { height: var(--control-md); }
:root .ui-listbox[data-size='lg'] .ui-listbox-trigger { height: var(--control-lg); }
:root .ui-listbox:is([data-variant='branch'], [data-variant='language']) .ui-listbox-trigger { font-weight: 500; }
:root .ui-listbox[data-variant='language'] .ui-listbox-trigger { width: auto; }
:root .ui-listbox .ui-listbox-trigger:hover { border-color: var(--ink); }
:root .ui-listbox .ui-listbox-trigger:focus-visible { outline: none; border-color: var(--action); box-shadow: 0 0 0 1px var(--action); }
/* Open: 2px action border (Figma State=Open), drawn as border + ring so the text does not move. */
:root .ui-listbox .ui-listbox-trigger:is([aria-expanded='true'], :has(+ .ui-listbox-popup:popover-open)) { border-color: var(--action); box-shadow: 0 0 0 1px var(--action); }
:root .ui-listbox .ui-listbox-trigger[aria-invalid='true'] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
/* Disabled and locked: soft fill, divider border, muted text (Figma State=Disabled; Branch shows the lock instead of the chevron). */
:root .ui-listbox .ui-listbox-trigger:disabled { border-color: var(--divider); background: var(--soft); box-shadow: none; color: var(--muted); -webkit-text-fill-color: var(--muted); opacity: 1; cursor: default; }
:root .ui-listbox .ui-listbox-value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root .ui-listbox[data-variant='language'] .ui-listbox-value { flex: none; overflow: visible; }
:root .ui-listbox .ui-listbox-value.is-placeholder { color: var(--muted); }

/* Icons (ui-icon in Angular, inline <span class="ui-icon"> in PHP): pin 16, chevron 20, lock and check 16. */
:root .ui-listbox .ui-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: var(--space-4); height: var(--space-4); color: currentColor; }
:root .ui-listbox .ui-icon svg { display: block; width: 100%; height: 100%; }
:root .ui-listbox .ui-listbox-pin { color: var(--action); }
:root .ui-listbox .ui-listbox-trigger:disabled .ui-listbox-pin { color: var(--muted); }
:root .ui-listbox .ui-listbox-chevron { width: var(--space-5); height: var(--space-5); color: var(--ink); }
:root .ui-listbox .ui-listbox-trigger:disabled .ui-listbox-chevron { color: var(--muted); }
:root .ui-listbox .ui-listbox-lock { color: var(--muted); }

/* List (Figma Menu): surface, divider border, radius 8, 4px padding, 2px gap, Shadow/Panel. Width: the trigger, at least 240 (160 for language). */
:root .ui-listbox .ui-listbox-popup { box-sizing: border-box; inline-size: 240px; max-inline-size: calc(100vw - var(--space-4)); max-block-size: 320px; margin: auto; padding: var(--space-1); overflow: auto; border: 1px solid var(--divider); border-radius: var(--radius-control); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); font: 400 var(--text-14) / var(--leading-14) var(--font-body); }
:root .ui-listbox[data-variant='language'] .ui-listbox-popup { inline-size: 160px; }
@supports (position-area: block-end) {
  :root .ui-listbox .ui-listbox-popup { position-area: block-end span-inline-end; position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline; inset: auto; margin: var(--space-1) 0; inline-size: anchor-size(inline); min-inline-size: 240px; }
  :root .ui-listbox[data-variant='language'] .ui-listbox-popup { position-area: block-end span-inline-start; inline-size: 160px; min-inline-size: 0; }
}
:root .ui-listbox .ui-listbox-options { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; outline: none; }
/* The focused list shows its active option (inset ring below), not a page-level focus outline. */
:root .ui-listbox .ui-listbox-options:focus-visible { outline: none; }
:root .ui-listbox .ui-listbox-options > li:not(.ui-listbox-option) { display: block; margin: 0; padding: 0; }
/* Option: 32 high, 12 / 8 inline padding, radius 8. Generic Body/14; Branch and Language Label/13. Selected: soft, action text, check. */
:root .ui-listbox .ui-listbox-option { display: flex; align-items: center; gap: var(--space-2); box-sizing: border-box; width: 100%; min-width: 0; min-height: var(--control-sm); height: auto; margin: 0; padding: 0 var(--space-2) 0 var(--space-3); border: 0; border-radius: var(--radius-control); background: transparent; box-shadow: none; color: var(--ink); font: 400 var(--text-14) / var(--leading-14) var(--font-body); letter-spacing: 0; text-align: start; text-decoration: none; text-transform: none; cursor: pointer; }
:root .ui-listbox:is([data-variant='branch'], [data-variant='language']) .ui-listbox-option { font-size: var(--text-13); line-height: var(--leading-13); }
:root .ui-listbox .ui-listbox-label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
:root .ui-listbox .ui-listbox-option:is(.is-active, :hover, :focus-visible) { background: var(--soft); color: var(--ink); text-decoration: none; }
:root .ui-listbox .ui-listbox-option:is([aria-selected='true'], [aria-current='true']) { background: var(--soft); color: var(--action); }
:root .ui-listbox .ui-listbox-option:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--action); }
:root .ui-listbox .ui-listbox-options:focus-visible .ui-listbox-option.is-active { box-shadow: inset 0 0 0 1px var(--action); }
:root .ui-listbox .ui-listbox-option:disabled { color: var(--muted); cursor: not-allowed; opacity: 1; }
:root .ui-listbox .ui-listbox-option:disabled:hover { background: transparent; }
:root .ui-listbox .ui-listbox-check { color: var(--action); }
:root .ui-listbox .ui-listbox-code { flex: none; }
:root .ui-listbox .ui-listbox-separator { flex: none; white-space: pre; }
:root .ui-listbox[data-variant='language'] .ui-listbox-label { flex: 1 1 auto; }
:root .ui-listbox .ui-listbox-footnote { margin: 2px 0 0; padding: var(--space-1) 10px 6px; border-top: 1px solid var(--divider); color: var(--muted); font-size: var(--text-12); line-height: var(--leading-12); }
@media (forced-colors: active) {
  :root .ui-listbox .ui-listbox-option:is(.is-active, :focus-visible) { outline: 2px solid Highlight; outline-offset: -2px; }
  :root .ui-listbox .ui-listbox-option:is([aria-selected='true'], [aria-current='true']) { outline: 1px solid CanvasText; outline-offset: -1px; }
}
