@charset "UTF-8";

div[data-type="select"] {
	--filter-width: max(14rem, 30vw);
	--filter-button-width: 2.5rem;
	--filter-height-element: var(--filters-height, 2rem);
	--filter-height-close: var(--filter-height-element);
	--filter-height-open: max-content;
	--filter-row-padding-x: 1rem;
	--filter-row-gap: 10px;
	position: relative;
	width: var(--filter-width);
	min-width: var(--width);
	height: var(--height-close);
	display: flex;
	cursor: pointer;
	border-radius: 0.75rem;
	overflow-x: hidden;
	background-color: var(--select-background-color, var(--button-background-color, var(--tg-theme-button-color)));
	transition: 0s;
}

div[data-type="select"] :is(button, :is(a, label)[type="button"]) {
	background-color: var(--select-background-color, var(--button-background-color, var(--tg-theme-button-color)));
}

div[data-type="select"]>section {
	position: relative;
	height: var(--filter-height-close);
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	cursor: pointer;
	overflow: hidden;
	border-radius: 0 0 0.75rem 0.75rem;
	background-color: var(--select-background-color, var(--button-background-color, var(--tg-theme-button-color)));
	transition: 0s;
}


div[data-type="select"]:has(>section:is([data-select="open"], :focus)) {
	>button:has(>i.icon.close) {
		border-radius: 0 0.75rem 0 0;
	}
}

div[data-type="select"]>button:has(>i.icon.close) {
	z-index: 100;
	/* position: fixed; */
	position: absolute;
	/* right: calc((var(--filter-button-width) + 0.4rem * 2) / 2); */
	right: 0;
	/* align-self: start; */
	width: var(--filter-button-width);
	height: var(--filter-height-close);
	padding: 0 0.4rem;
	border-radius: 0 0.75rem 0.75rem 0;
}


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

div[data-type="select"]:not(>section:focus, >section: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(--select-text-color, var(--button-text-color, var(--tg-theme-button-text-color, black)));
	border-right: 5px solid transparent;
}

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

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

div[data-type="select"]>section>a {
	height: var(--filter-height-element);
	box-sizing: border-box;
}

div[data-type="select"]>section:not(:focus)>a {
	display: none;
	pointer-events: none;
}

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

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

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

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

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

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

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

div[data-type="select"]>section>input:checked+label {
	z-index: 20;
	order: 1;
	max-width: calc(var(--filter-width) - var(--filter-row-padding-x, 1rem) * 2 - var(--filter-row-gap, 10px));
	display: inline;
	line-height: var(--filter-height-element);
	padding-right: 0;
}

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

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

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

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