:root {
	--bg-grad-start: #1a1020;
	--bg-grad-end: #0f0d1a;
	--glass-bg: rgba(26, 16, 32, 0.85);
	--border-col: rgba(244, 114, 182, 0.12);
	--primary: #db2777;
	--primary-glow: rgba(219, 39, 119, 0.35);
	--accent: #fbbf24;
	--text-main: #fce7f3;
	--text-muted: #a18fa0;
	--chip-bg: rgba(255, 255, 255, 0.05);
	--btn-text: #fce7f3;
	--option-bg: #1a1020;
	--option-text: #fce7f3;
	color-scheme: dark;
}

/* THEMES */
[data-theme="ram"] {
	--bg-grad-start: #fff1f2;
	--bg-grad-end: #ffe4e6;
	--glass-bg: rgba(255, 255, 255, 0.9);
	--border-col: rgba(244, 63, 94, 0.2);
	--primary: #f43f5e;
	--primary-glow: rgba(244, 63, 94, 0.3);
	--accent: #e11d48;
	--text-main: #881337;
	--text-muted: #be123c;
	--chip-bg: rgba(244, 63, 94, 0.1);
	--option-bg: #fff1f2;
	--option-text: #881337;
	color-scheme: light;
}
[data-theme="rem"] {
	--bg-grad-start: #f0f9ff;
	--bg-grad-end: #e0f2fe;
	--glass-bg: rgba(255, 255, 255, 0.9);
	--border-col: rgba(14, 165, 233, 0.2);
	--primary: #0ea5e9;
	--primary-glow: rgba(14, 165, 233, 0.3);
	--accent: #0284c7;
	--text-main: #0c4a6e;
	--text-muted: #0369a1;
	--chip-bg: rgba(14, 165, 233, 0.1);
	--option-bg: #f0f9ff;
	--option-text: #0c4a6e;
	color-scheme: light;
}
[data-theme="cappuchin"] {
	--bg-grad-start: #fdf6e3;
	--bg-grad-end: #eee8d5;
	--glass-bg: rgba(255, 255, 255, 0.9);
	--border-col: rgba(127, 85, 57, 0.2);
	--primary: #9c6644;
	--primary-glow: rgba(156, 102, 68, 0.3);
	--accent: #7f5539;
	--text-main: #432818;
	--text-muted: #7f5539;
	--chip-bg: rgba(156, 102, 68, 0.1);
	--option-bg: #fdf6e3;
	--option-text: #432818;
	color-scheme: light;
}
[data-theme="miku"] {
	--bg-grad-start: #111827;
	--bg-grad-end: #134e4a;
	--glass-bg: rgba(17, 24, 39, 0.8);
	--border-col: rgba(45, 212, 191, 0.2);
	--primary: #2dd4bf;
	--primary-glow: rgba(45, 212, 191, 0.4);
	--accent: #f59e0b;
	--text-main: #ccfbf1;
	--text-muted: #5eead4;
	--chip-bg: rgba(45, 212, 191, 0.1);
	--option-bg: #111827;
	--option-text: #ccfbf1;
	color-scheme: dark;
}
[data-theme="teto"] {
	--bg-grad-start: #1c1917;
	--bg-grad-end: #450a0a;
	--glass-bg: rgba(28, 25, 23, 0.8);
	--border-col: rgba(225, 29, 72, 0.2);
	--primary: #e11d48;
	--primary-glow: rgba(225, 29, 72, 0.4);
	--accent: #f97316;
	--text-main: #ffe4e6;
	--text-muted: #fda4af;
	--chip-bg: rgba(225, 29, 72, 0.1);
	--option-bg: #1c1917;
	--option-text: #ffe4e6;
	color-scheme: dark;
}
[data-theme="macchiato"] {
	--bg-grad-start: #24273a;
	--bg-grad-end: #1e2030;
	--glass-bg: rgba(36, 39, 58, 0.8);
	--border-col: rgba(183, 189, 248, 0.1);
	--primary: #c6a0f6;
	--primary-glow: rgba(198, 160, 246, 0.4);
	--accent: #f4a261;
	--text-main: #cad3f5;
	--text-muted: #939ab7;
	--chip-bg: rgba(198, 160, 246, 0.1);
	--option-bg: #24273a;
	--option-text: #cad3f5;
	color-scheme: dark;
}
[data-theme="nature"] {
	--bg-grad-start: #0d3320;
	--bg-grad-end: #1f1510;
	--glass-bg: rgba(30, 35, 28, 0.88);
	--border-col: rgba(180, 140, 60, 0.25);
	--primary: #d4384a;
	--primary-glow: rgba(212, 56, 74, 0.45);
	--accent: #d4a843;
	--text-main: #fefce8;
	--text-muted: #c6b88a;
	--chip-bg: rgba(254, 252, 232, 0.08);
	--option-bg: #1a1f18;
	--option-text: #fefce8;
	color-scheme: dark;
}
[data-theme="hina"] {
	--bg-grad-start: #0d0818;
	--bg-grad-end: #1a0f2e;
	--glass-bg: rgba(20, 12, 36, 0.92);
	--border-col: rgba(168, 85, 247, 0.2);
	--primary: #a855f7;
	--primary-glow: rgba(168, 85, 247, 0.45);
	--accent: #dc2626;
	--text-main: #f3e8ff;
	--text-muted: #b794f4;
	--chip-bg: rgba(168, 85, 247, 0.12);
	--option-bg: #120a24;
	--option-text: #f3e8ff;
	color-scheme: dark;
}

/* BASE STYLES */
* {
	box-sizing: border-box;
}
body {
	font-family: "Nunito", system-ui, -apple-system, sans-serif;
	background: linear-gradient(135deg, var(--bg-grad-start), var(--bg-grad-end));
	min-height: 100vh;
	margin: 0;
	color: var(--text-main);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow-x: hidden;
	transition: background 0.3s;
}

.dashboard {
	display: grid;
	grid-template-columns: 320px 1fr;
	gap: 20px;
	width: 95vw;
	height: 90vh;
	max-height: 900px;
	min-height: 600px;
	max-width: 1400px;
	background: var(--glass-bg);
	backdrop-filter: blur(20px);
	border: 1px solid var(--border-col);
	border-radius: 24px;
	box-shadow:
		0 25px 50px -12px rgba(0, 0, 0, 0.5),
		0 0 40px var(--primary-glow);
	padding: 20px;
	position: relative;
	overflow: hidden;
}

.sidebar {
	display: flex;
	flex-direction: column;
	height: 100%;
	border-right: 1px solid var(--border-col);
	padding-right: 20px;
	overflow: hidden;
}

.sidebar-header {
	flex-shrink: 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid var(--border-col);
	padding-bottom: 15px;
	margin-bottom: 10px;
	gap: 10px;
}

.header-actions {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	flex-shrink: 0;
}

.header-select-wrap {
	display: flex;
	gap: 8px;
}

.header-select-item {
	display: flex;
	flex-direction: column;
}

.header-select-item .label {
	font-size: 0.6rem;
	margin-bottom: 3px;
	display: block;
}

.header-select-item .theme-select {
	width: auto;
	min-width: 110px;
	padding: 6px 28px 6px 10px;
	font-size: 0.75rem;
}

.scroll-area {
	flex-grow: 1;
	overflow-y: auto;
	padding-right: 5px;
	min-height: 0;
	display: flex;
	flex-direction: column;
	gap: 15px;
}
.scroll-area::-webkit-scrollbar {
	width: 6px;
}
.scroll-area::-webkit-scrollbar-track {
	background: transparent;
}
.scroll-area::-webkit-scrollbar-thumb {
	background: var(--border-col);
	border-radius: 3px;
}

.sidebar-footer {
	flex-shrink: 0;
	margin-top: 15px;
	text-align: center;
}

.filter-toggle-input {
	display: none;
}

.filter-toggle-label {
	display: none;
}

#rollBtn {
	flex-shrink: 0;
	margin-top: 15px;
	border-top: 1px solid var(--border-col);
}

.logo-area h1 {
	font-family: "Fredoka", sans-serif;
	font-size: 1.15rem;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin: 0;
	color: var(--primary);
	display: inline-block;
	padding-bottom: 5px;
	line-height: 1.3;
	position: relative;
}
.logo-area h1::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 2px;
	background: linear-gradient(
		90deg,
		var(--primary),
		var(--accent),
		transparent
	);
	border-radius: 1px;
}

.control-group {
	background: rgba(0, 0, 0, 0.05);
	padding: 12px;
	border-radius: 16px;
}

.label {
	display: block;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--text-muted);
	margin-bottom: 8px;
}

.chip-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.chip {
	cursor: pointer;
	position: relative;
	flex: 1 1 auto;
}
.chip input {
	display: none;
}
.chip span {
	display: flex;
	justify-content: center;
	padding: 6px 14px;
	background: var(--chip-bg);
	border: 1px solid transparent;
	border-radius: 50px;
	font-size: 0.8rem;
	font-weight: 600;
	transition: all 0.2s;
	color: var(--text-muted);
}
.chip:hover span {
	border-color: var(--primary);
}
.chip input:checked + span {
	background: var(--primary);
	color: var(--btn-text);
	box-shadow: 0 0 14px var(--primary-glow);
}

.theme-select {
	width: 100%;
	padding: 10px 14px;
	background: var(--chip-bg);
	border: 1px solid var(--border-col);
	color: var(--text-main);
	border-radius: 50px;
	cursor: pointer;
	font-size: 0.85rem;
	transition: border-color 0.15s;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a18fa0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
}
.theme-select:hover {
	border-color: var(--primary);
}
.theme-select option {
	background-color: var(--option-bg);
	color: var(--option-text);
}

.main-stage {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	position: relative;
	overflow: hidden;
	height: 100%;
}

.main-stage::before {
	content: "✦";
	position: absolute;
	top: 8%;
	left: 10%;
	font-size: 2rem;
	opacity: 0.12;
	pointer-events: none;
	color: var(--accent);
}
.main-stage::after {
	content: "✦";
	position: absolute;
	bottom: 12%;
	right: 8%;
	font-size: 1.5rem;
	opacity: 0.12;
	pointer-events: none;
	color: var(--primary);
	animation: sparkle 3s ease-in-out infinite;
}
@keyframes sparkle {
	0%,
	100% {
		opacity: 0.12;
		transform: scale(1);
	}
	50% {
		opacity: 0.25;
		transform: scale(1.15);
	}
}

/* Track Display */
.track-display {
	font-family: "Fredoka", sans-serif;
	font-size: 3.5rem;
	font-weight: 700;
	line-height: 1.1;
	margin: 0;
	color: var(--text-main);
	transition: filter 0.1s;
	max-width: 900px;
	letter-spacing: -0.02em;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 15px;
}
.rolling .track-display {
	filter: blur(5px);
	opacity: 0.7;
}

/* --- UPDATED: Dancing GIF is bigger now --- */
.kokura-dance {
	height: 1.5em; /* Increased size to be much more visible */
	width: auto;
	object-fit: contain;
	filter: drop-shadow(0 0 10px var(--primary));
	animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes bounceIn {
	0% {
		transform: scale(0);
		opacity: 0;
	}
	60% {
		transform: scale(1.2);
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

.meta-tags {
	display: flex;
	gap: 10px;
	margin-top: 20px;
	opacity: 0;
	transform: translateY(20px);
	transition: all 0.5s ease;
	flex-wrap: wrap;
	justify-content: center;
}
.main-stage.show .meta-tags {
	opacity: 1;
	transform: translateY(0);
}

.badge {
	padding: 6px 16px;
	border-radius: 50px;
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border: 1px solid var(--primary);
	color: var(--primary);
	background: var(--chip-bg);
}
.badge.highlight {
	background: var(--primary);
	color: var(--btn-text);
}

.track-img-container {
	margin-top: 20px;
	opacity: 0;
	transform: scale(0.9);
	transition: all 0.5s ease 0.1s;
	border-radius: 20px;
	overflow: hidden;
	box-shadow:
		0 10px 30px rgba(0, 0, 0, 0.3),
		0 0 20px var(--primary-glow);
	border: 1px solid var(--border-col);
	width: 100%;
	max-width: 600px;
	height: 350px;
	position: relative;
	background: rgba(0, 0, 0, 0.1);
}

.gate-door {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 50%;
	background: #1a1020;
	z-index: 10;
	transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
	border: 2px solid var(--border-col);
	background-image: repeating-linear-gradient(
		45deg,
		transparent,
		transparent 12px,
		rgba(244, 114, 182, 0.06) 12px,
		rgba(244, 114, 182, 0.06) 24px
	);
}
.gate-door.left {
	left: 0;
	border-right: 2px solid var(--primary);
	transform-origin: left;
}
.gate-door.right {
	right: 0;
	border-left: 2px solid var(--primary);
	transform-origin: right;
}
.rolling .gate-door.left {
	transform: scaleX(1);
}
.rolling .gate-door.right {
	transform: scaleX(1);
}
.main-stage.show .gate-door.left {
	transform: scaleX(0);
}
.main-stage.show .gate-door.right {
	transform: scaleX(0);
}

#imgTarget {
	position: relative;
	width: 100%;
	height: 100%;
}

#imgTarget:empty {
	background: rgba(0, 0, 0, 0.05);
}

#imgTarget.loading::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(255, 255, 255, 0.06) 50%,
		transparent 100%
	);
	background-size: 200% 100%;
	animation: imgPulse 1.8s ease-in-out infinite;
}

@keyframes imgPulse {
	0% {
		background-position: 200% 0;
	}
	100% {
		background-position: -200% 0;
	}
}

#imgTarget img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}
.main-stage.show .track-img-container {
	opacity: 1;
	transform: scale(1);
}

.conditions {
	margin-top: 20px;
	font-size: 1.5rem;
	font-weight: 300;
	color: var(--text-muted);
	opacity: 0;
	transition: opacity 0.5s ease 0.2s;
}
.main-stage.show .conditions {
	opacity: 1;
}
.cond-hl {
	color: var(--text-main);
	font-weight: 700;
	border-bottom: 2px solid var(--primary);
	padding-bottom: 1px;
}

.roll-btn {
	width: 100%;
	padding: 16px;
	border: none;
	border-radius: 50px;
	background: linear-gradient(135deg, var(--primary), var(--accent));
	color: var(--btn-text);
	font-size: 1.25rem;
	font-family: "Fredoka", sans-serif;
	font-weight: 700;
	text-transform: uppercase;
	cursor: pointer;
	letter-spacing: 2px;
	position: relative;
	overflow: hidden;
	box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
	transition:
		transform 0.1s,
		box-shadow 0.15s,
		filter 0.2s;
}
.roll-btn::after {
	content: "";
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: linear-gradient(
		45deg,
		transparent 30%,
		rgba(255, 255, 255, 0.25) 50%,
		transparent 70%
	);
	animation: shimmer 3s infinite;
	pointer-events: none;
}
@keyframes shimmer {
	0% {
		transform: translateX(-100%) rotate(-30deg);
	}
	100% {
		transform: translateX(100%) rotate(-30deg);
	}
}
.roll-btn:hover {
	filter: brightness(1.1);
	box-shadow:
		0 4px 0 rgba(0, 0, 0, 0.25),
		0 0 25px var(--primary-glow);
}
.roll-btn:active {
	transform: translateY(4px);
	box-shadow: none;
}
.roll-btn:disabled {
	filter: grayscale(1);
	cursor: not-allowed;
	box-shadow: none;
	background: var(--text-muted);
}
.roll-btn:disabled::after {
	display: none;
}

.credits {
	font-size: 0.8rem;
	color: var(--text-muted);
	text-align: center;
}
.credits a {
	color: var(--primary);
	text-decoration: none;
}

#confetti {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 100;
}

.search-container {
	display: flex;
	gap: 6px;
}
.search-input {
	flex: 1;
	background: var(--chip-bg);
	border: 1px solid var(--border-col);
	color: var(--text-main);
	padding: 6px 12px;
	border-radius: 50px;
	font-size: 0.85rem;
	font-family: inherit;
	outline: none;
	transition: border-color 0.15s;
}
.search-input:focus {
	border-color: var(--primary);
}
.search-input::placeholder {
	color: var(--text-muted);
	opacity: 0.6;
}
/* hide native datalist dropdown arrow to avoid double-dropdown look */
.search-input::-webkit-calendar-picker-indicator {
	opacity: 0;
	display: none;
}
.search-btn {
	background: linear-gradient(135deg, var(--primary), var(--accent));
	border: none;
	padding: 6px 14px;
	border-radius: 50px;
	color: var(--btn-text);
	cursor: pointer;
	font-weight: 700;
	font-size: 0.85rem;
	transition: opacity 0.15s;
	white-space: nowrap;
}
.search-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}
.search-btn:not(:disabled):hover {
	filter: brightness(1.15);
}
.search-btn:not(:disabled):active {
	transform: scale(0.97);
}

.icon-btn {
	background: transparent;
	border: 1px solid var(--border-col);
	color: var(--text-muted);
	font-size: 1.2rem;
	padding: 0;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.2s;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.icon-btn:hover {
	background: var(--chip-bg);
	color: var(--primary);
	border-color: var(--primary);
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
	#confetti {
		display: none;
	}
	.track-display,
	.rolling .track-display {
		filter: none;
		opacity: 1;
	}
	.main-stage.show .gate-door.left,
	.main-stage.show .gate-door.right {
		transform: scaleX(0);
	}
	.rolling .gate-door.left,
	.rolling .gate-door.right {
		transform: scaleX(1);
	}
}

/* --- FOCUS VISIBLE --- */
:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
	border-radius: 50px;
}
.theme-select:focus-visible {
	outline-color: var(--primary);
}
.chip input:focus-visible + span {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}
.roll-btn:focus-visible {
	outline: 3px solid var(--primary);
	outline-offset: 3px;
}
.search-btn:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

@media (min-width: 901px) {
	.sidebar-header {
		flex-wrap: wrap;
		gap: 10px;
	}
	.header-actions {
		width: 100%;
		gap: 8px;
	}
	.header-select-wrap {
		gap: 8px;
	}
	.header-select-item {
		flex: 1;
		min-width: 0;
	}
	.header-select-item .theme-select {
		width: 100%;
		font-size: 0.75rem;
		padding: 6px 28px 6px 10px;
	}
}

@media (max-width: 900px) {
	body {
		display: block;
		overflow-y: auto;
		height: auto;
	}
	.dashboard {
		display: flex;
		flex-direction: column;
		height: auto;
		min-height: 100vh;
		max-height: none;
		width: 100%;
		border-radius: 0;
		overflow: visible;
	}
	.sidebar-header {
		flex-wrap: wrap;
		gap: 10px;
	}
	.header-actions {
		width: 100%;
		gap: 8px;
	}
	.header-select-item {
		flex: 1;
		min-width: 0;
	}
	.sidebar {
		order: 1;
		border-right: none;
		height: auto;
	}
	.scroll-area {
		overflow-y: visible;
		flex-grow: 0;
	}
	.track-display {
		font-size: 2rem;
		flex-direction: column;
		gap: 10px;
	}
	.track-img-container {
		height: 250px;
		max-width: 100%;
	}
	.main-stage {
		order: 0;
		min-height: 45vh;
		padding: 20px 0;
	}
	.main-stage::before,
	.main-stage::after {
		display: none;
	}
}

@media (max-width: 600px) {
	body {
		display: block;
		overflow-y: auto;
		height: auto;
	}

	.dashboard {
		display: flex;
		flex-direction: column;
		padding: 0;
		gap: 0;
		min-height: 100vh;
		max-height: none;
		height: auto;
		width: 100%;
		border-radius: 0;
		overflow: visible;
	}

	.sidebar {
		display: contents;
	}

	.sidebar-header {
		order: 0;
		display: flex;
		flex-wrap: nowrap;
		align-items: center;
		gap: 8px;
		padding: 8px 12px;
		margin: 0;
		border-bottom: 1px solid var(--border-col);
		border-radius: 0;
		background: var(--glass-bg);
	}

	.logo-area h1 {
		font-size: 0.85rem;
		margin: 0;
	}
	.logo-area h1::after {
		display: none;
	}

	.header-actions {
		width: auto;
		align-items: center;
		margin-left: auto;
		gap: 6px;
	}

	.header-select-wrap {
		gap: 4px;
	}

	.header-select-item .theme-select {
		width: auto;
		min-width: 70px;
		padding: 5px 20px 5px 8px;
		font-size: 0.7rem;
		background-position: right 5px center;
		background-size: 10px;
	}
	.header-select-item .label {
		display: none;
	}

	.icon-btn {
		width: 32px;
		height: 32px;
		font-size: 0.95rem;
	}

	.main-stage {
		order: 1;
		min-height: 30vh;
		padding: 15px 12px;
	}
	.main-stage::before,
	.main-stage::after {
		display: none;
	}

	.track-display {
		font-size: 1.4rem;
		flex-direction: column;
		gap: 8px;
	}
	.track-img-container {
		height: 180px;
		margin-top: 12px;
		max-width: 100%;
	}
	.badge {
		font-size: 0.6rem;
		padding: 3px 8px;
	}
	.meta-tags {
		gap: 5px;
		margin-top: 10px;
	}
	.conditions {
		font-size: 1rem;
		margin-top: 10px;
	}

	#rollBtn {
		order: 2;
		width: calc(100% - 24px);
		margin: 8px 12px;
		padding: 14px;
		font-size: 1.1rem;
		border-top: none;
	}

	.filter-toggle-input {
		display: none;
	}

	.filter-toggle-label {
		order: 3;
		display: flex;
		align-items: center;
		justify-content: center;
		width: calc(100% - 24px);
		gap: 6px;
		padding: 10px 12px;
		margin: 0 12px 4px;
		background: var(--chip-bg);
		border: 1px solid var(--border-col);
		border-radius: 50px;
		font-size: 0.8rem;
		font-weight: 700;
		color: var(--text-muted);
		text-transform: uppercase;
		letter-spacing: 0.5px;
		cursor: pointer;
		user-select: none;
		-webkit-tap-highlight-color: transparent;
	}
	.filter-toggle-label:hover {
		border-color: var(--primary);
	}
	.filter-toggle-label::after {
		content: "▾";
		font-size: 0.7rem;
		margin-left: 4px;
		transition: transform 0.25s;
	}
	.filter-toggle-input:checked ~ .filter-toggle-label::after {
		transform: rotate(180deg);
	}

	.scroll-area {
		order: 4;
		display: none;
		flex-direction: column;
		width: calc(100% - 24px);
		gap: 8px;
		margin: 0 12px;
		padding: 12px;
		flex-grow: 0;
		overflow-y: visible;
		background: var(--chip-bg);
		border: 1px solid var(--border-col);
		border-radius: 16px;
	}
	.filter-toggle-input:checked ~ .scroll-area {
		display: flex;
	}

	.control-group {
		padding: 8px 10px;
	}
	.label {
		font-size: 0.6rem;
		margin-bottom: 4px;
	}
	.chip-grid {
		flex-wrap: nowrap;
		overflow-x: auto;
		gap: 4px;
		padding-bottom: 2px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}
	.chip-grid::-webkit-scrollbar {
		display: none;
	}
	.chip {
		flex: 0 0 auto;
	}
	.chip span {
		padding: 8px 12px;
		font-size: 0.72rem;
		white-space: nowrap;
	}
	.search-input {
		font-size: 0.78rem;
		padding: 8px 10px;
	}
	.search-btn {
		padding: 8px 12px;
		font-size: 0.78rem;
	}

	.sidebar-footer {
		order: 5;
		display: block;
		padding: 12px;
		padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		text-align: center;
		border-top: none;
	}
	.sidebar-footer .credits {
		display: block;
		font-size: 0.7rem;
	}
}
