@charset "UTF-8";

section[data-type="select"] {
	--width: max(14rem, 20vw);
	--height-element: 2rem;
	--height-close: var(--height-element);
	--height-open: max-content;
	position: relative;
	width: var(--width);
	height: var(--height-close);
	display: flex;
	flex-direction: column;
	cursor: pointer;
	border-radius: 0.75rem;
	overflow-x: hidden;
	background-color: var(--tg-theme-button-color);
	transition: 0s;
}

section[data-type="select"]>button:has(>i.icon.close) {
	align-self: end;
	height: 100%;
	padding: 0 0.4rem;
}

section[data-type="select"]:has(input[id$="title"]:checked)>button:has(>i.icon.close),
section[data-type="select"]:focus>button:has(>i.icon.close) {
	display: none;
}

section[data-type="select"]:not(:focus, :has(>button>i.icon.close)):after {
	z-index: 30;
	content: '';
	top: calc(50% - 2.5px);
	right: 1rem;
	position: absolute;
	width: 0;
	height: 0;
	pointer-events: none;
	border-left: 5px solid transparent;
	border-top: 5px solid var(--tg-theme-button-text-color, black);
	border-right: 5px solid transparent;
}

section[data-type="select"]>input {
	left: -99999px;
	position: absolute;
	opacity: 0;
}

section[data-type="select"]>label {
	z-index: 10;
	order: 2;
	top: 0;
	position: absolute;
	width: 100%;
	height: var(--height-element);
	padding: 0 1rem;
	display: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	box-sizing: border-box;
	pointer-events: none;
	color: var(--tg-theme-button-text-color);
	transition: 0s;
}

section[data-type="select"]:is([data-select="open"], :focus)>input:not(:checked)+label[for$='title'] {
	display: none;
}

section[data-type="select"]:is([data-select="open"], :focus)>input:not(:checked)+label[for$='all']:not(:hover, :active, :focus) {
	filter: brightness(90%);
}

section[data-type="select"]>input:not(:checked)+label {
	cursor: pointer;
	filter: brightness(80%);
}

section[data-type="select"]:is([data-select="open"], :focus)>input+label:hover {
	filter: brightness(110%);
}

section[data-type="select"]:is([data-select="open"], :focus)>input:checked+label:hover {
	filter: brightness(120%);
}

section[data-type="select"]:is([data-select="open"], :focus)>input+label:is(:active, :focus) {
	filter: brightness(60%);
}

section[data-type="select"]:is([data-select="open"], :focus)>input:checked+label:is(:active, :focus) {
	filter: brightness(70%);
}

section[data-type="select"]>input:checked+label {
	order: 1;
	max-width: calc(var(--width) - 2rem - 10px);
	display: inline;
	line-height: var(--height-element);
	padding-right: 0;
}

section[data-type="select"]:is([data-select="open"], :focus)>input:checked+label {
	max-width: initial;
	padding-right: initial;
}

section[data-type="select"]:is([data-select="open"], :focus) {
	height: var(--height-open, max-content);
}

section[data-type="select"]:is([data-select="open"], :focus)>label {
	position: relative;
	display: inline;
	line-height: var(--height-element);
	pointer-events: all;
}

@media only screen and (max-width: 500px) {
	section[data-type="select"]:only-child {
		--width: 100%
	}
}
