/* PALBON: the theme picker - ONE component, the same on every page (Desk, website, login, launcher, product apps).
   palbon_theme.js renders it into any element [data-pb-theme-picker]; this file is its only style. Every rule is
   scoped to .pb-tp and sets what it needs itself, so no host page (Bootstrap in Desk, the launcher's reset, a
   product app's Tailwind) can change how it looks. Colours are palette variables (palbon_palette.css). */

.pb-tp {
	--pb-tp-size: 40px;
	position: relative;
	display: inline-flex;
	align-items: center;
	font-family: var(--pb-font-sans);
	line-height: 1.3;
}
.pb-tp:empty { display: none; } /* before the script has drawn it */

.pb-tp .pb-tp__btn {
	display: inline-grid;
	place-items: center;
	box-sizing: border-box;
	width: var(--pb-tp-size);
	height: var(--pb-tp-size);
	margin: 0;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 12px;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}
.pb-tp .pb-tp__btn:hover,
.pb-tp .pb-tp__btn[aria-expanded="true"] { background: color-mix(in srgb, currentColor 12%, transparent); }
.pb-tp .pb-tp__btn:focus-visible { outline: 0; box-shadow: var(--pb-focus); }
.pb-tp .pb-tp__btn svg { display: block; width: 18px; height: 18px; }

.pb-tp .pb-tp__menu {
	position: absolute;
	inset-inline-end: 0;
	top: calc(100% + 8px);
	z-index: 1060; /* over Desk's top bar and its menus */
	box-sizing: border-box;
	min-width: 240px;
	max-height: min(72vh, 540px);
	overflow-y: auto;
	margin: 0;
	padding: 6px;
	border: 1px solid var(--pb-border-subtle);
	border-radius: 14px;
	background: var(--pb-bg-overlay);
	box-shadow: var(--pb-shadow-elevation-3);
	color: var(--pb-text-primary);
	text-align: start;
}
.pb-tp .pb-tp__menu[hidden] { display: none; }

.pb-tp .pb-tp__head {
	margin: 0;
	padding: 10px 10px 4px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--pb-text-soft);
}
.pb-tp .pb-tp__head:first-child { padding-top: 6px; }

.pb-tp .pb-tp__opt {
	display: flex;
	align-items: center;
	gap: 10px;
	box-sizing: border-box;
	width: 100%;
	min-height: 36px;
	margin: 0;
	padding: 8px 10px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	box-shadow: none;
	color: var(--pb-text-primary);
	font: inherit;
	font-size: 14px;
	font-weight: 450;
	line-height: 1.3;
	letter-spacing: 0;
	text-align: start;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
}
.pb-tp .pb-tp__opt:hover,
.pb-tp .pb-tp__opt:focus-visible { outline: 0; background: var(--pb-bg-hover); }
.pb-tp .pb-tp__opt[aria-checked="true"] { font-weight: 600; background: var(--pb-bg-tint); color: var(--pb-text-link); }

/* one swatch per theme and mode: that state's accent over its own canvas */
.pb-tp .pb-tp__swatch {
	flex: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px var(--pb-border-strong);
}
.pb-tp [data-palette="classic"][data-mode="light"] > .pb-tp__swatch { background: var(--pb-swatch-classic-light); }
.pb-tp [data-palette="classic"][data-mode="dark"] > .pb-tp__swatch { background: var(--pb-swatch-classic-dark); }
.pb-tp [data-palette="aurora"][data-mode="light"] > .pb-tp__swatch { background: var(--pb-swatch-aurora-light); }
.pb-tp [data-palette="aurora"][data-mode="dark"] > .pb-tp__swatch { background: var(--pb-swatch-aurora-dark); }
.pb-tp [data-palette="midnight"][data-mode="light"] > .pb-tp__swatch { background: var(--pb-swatch-midnight-light); }
.pb-tp [data-palette="midnight"][data-mode="dark"] > .pb-tp__swatch { background: var(--pb-swatch-midnight-dark); }
.pb-tp [data-palette="clarity"][data-mode="light"] > .pb-tp__swatch { background: var(--pb-swatch-clarity-light); }
.pb-tp [data-palette="clarity"][data-mode="dark"] > .pb-tp__swatch { background: var(--pb-swatch-clarity-dark); }

/* Desk's top bar uses 32 px controls */
.navbar .pb-tp { --pb-tp-size: 32px; }
.navbar .pb-tp .pb-tp__btn { border-radius: var(--pb-radius-md); color: var(--text-muted); }
.navbar .pb-tp .pb-tp__btn:hover { color: var(--text-color); }

@media (prefers-reduced-motion: reduce) { .pb-tp .pb-tp__btn { transition: none; } }
