/*
 * A picker with a source (0.93.0, Ui::picker()'s `source`; CONTRACT §8.9): compiled on its own (assets/picker.css) and
 * loaded with assets/picker.js by the first such picker a screen prints (0.95.0: or a multiple picker, its tools and
 * its chips' buttons), so the common path pays nothing (the owner's rule). A picker is closed at the first paint, and
 * its chips with buttons are drawn by its script, so this sheet may come with the page's footer. The head's count line
 * keeps its line before the first answer; the chosen are listed first under their heading while the search is empty;
 * the live line ("Searching…", a failure), "Show more" and the capped line close the list; the store (the chosen's
 * hidden inputs) is never seen.
 */

@reference "./chrome.css";

.rooster-admin-picker[data-ra-picker-source] .rooster-admin-picker__sub {
	min-height: 1lh;
}

.rooster-admin-picker__chosen {
	@apply mb-1 border-b border-border pb-1;
}

.rooster-admin-picker__group {
	@apply m-0 px-2 pt-2 pb-1 text-xs font-semibold text-secondary-foreground;
}

.rooster-admin-picker__state,
.rooster-admin-picker__capped {
	@apply m-0 px-3 py-2 text-sm text-secondary-foreground;
}

.rooster-admin-picker__state:empty {
	display: none;
}

.rooster-admin-picker__more {
	@apply px-2 py-1.5;
}

/* 0.94.0 (CONTRACT §8.10): a pick field off the chrome (a post's meta box, in an island) has no script that folds its
   chips into "+N" (the chrome's): the field grows and its chips wrap onto more lines. Here, not in chrome.css: only a
   screen without the chrome needs it (an island's picker loads this sheet). */
.rooster-admin-island .rooster-admin-pickfield {
	@apply h-auto min-h-9 py-1;
}

.rooster-admin-island .rooster-admin-picker-summary {
	@apply flex-wrap whitespace-normal;
}

/* 0.95.0 (CONTRACT §8.11): a multiple picker's tools, a line under its search box (in the sheet's fixed head), and its
   chips' remove buttons: the label clips inside the chip, the button stays in view. Every multiple picker loads this
   sheet. */
.rooster-admin-picker__tools {
	@apply mt-1.5 -mb-1.5 flex flex-wrap items-center gap-x-1;
}

.rooster-admin-picker__said {
	@apply ms-1 text-xs text-secondary-foreground;
}

.rooster-admin-picker-summary .rooster-admin-chip:not([hidden]):has(.rooster-admin-chip__remove) {
	@apply inline-flex overflow-visible;
}

.rooster-admin-picker-summary .rooster-admin-badge__text {
	@apply min-w-0 truncate;
}

:is(
	.rooster-admin-picker__chosen,
	.rooster-admin-picker__more,
	.rooster-admin-picker__capped,
	.rooster-admin-picker__store
)[hidden] {
	display: none;
}
