/*--------------------------------------------------------------
# Command search (⌘K)
--------------------------------------------------------------*/

.cs-dialog {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: none;
}
.cs-dialog.is-open {
	display: block;
}
.cs-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(40, 40, 40, 0.75);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}
.cs-panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(600px, calc(100% - 32px));
	max-height: 76vh;
	margin: 12vh auto 0;
	background: #000000;
	color: #ffffff;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	overflow: hidden;
	font-family: var(--theme-font-family-main);
	opacity: 0;
	transform: translateY(-8px) scale(0.98);
	transition: opacity 160ms ease, transform 160ms ease;
}
.cs-dialog.is-open .cs-panel {
	opacity: 1;
	transform: translateY(0) scale(1);
}
@media (prefers-reduced-motion: reduce) {
	.cs-panel {
		transition: none;
	}
}

.cs-inputrow {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 18px 20px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	flex: none;
}
.cs-search-icon {
	color: rgba(255, 255, 255, 0.5);
	flex: none;
}
.cs-input {
	flex: 1;
	min-width: 0;
	background: transparent;
	border: 0;
	outline: 0;
	color: #ffffff;
	font-family: var(--theme-font-family-main);
	font-size: 17px;
}
.cs-input::placeholder {
	color: rgba(255, 255, 255, 0.4);
}
.cs-close {
	display: flex;
	flex: none;
	background: transparent;
	border: 0;
	color: rgba(255, 255, 255, 0.5);
	cursor: pointer;
	padding: 6px;
	line-height: 0;
	border-radius: 6px;
}
.cs-close:hover {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.08);
}
.cs-close:focus-visible,
.cs-view-all:focus-visible,
.cs-result:focus-visible {
	outline: 2px solid var(--theme-color-quaternary);
	outline-offset: 2px;
}

.cs-progress {
	display: block;
	height: 2px;
	flex: none;
	position: relative;
	overflow: hidden;
}
.cs-progress.is-loading::after {
	content: '';
	position: absolute;
	inset: 0;
	width: 40%;
	background: var(--theme-color-quaternary);
	animation: cs-progress-slide 900ms ease-in-out infinite;
}
@keyframes cs-progress-slide {
	0% {
		transform: translateX(-100%);
	}
	100% {
		transform: translateX(350%);
	}
}
@media (prefers-reduced-motion: reduce) {
	.cs-progress.is-loading::after {
		animation: none;
		opacity: 0.6;
	}
}

.cs-results {
	overflow-y: auto;
	padding: 8px;
	flex: 1 1 auto;
}
.cs-results.cs-state-empty,
.cs-results.cs-state-none {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 160px;
	padding: 24px;
}
.cs-hint {
	color: var(--theme-color-text-secondary);
	text-align: center;
	font-size: 14px;
	line-height: 1.5;
	margin: 0;
	max-width: 320px;
}

.cs-group {
	margin-bottom: 4px;
}
.cs-group:last-child {
	margin-bottom: 0;
}
.cs-group-label {
	padding: 10px 12px 6px;
	font-size: 13px;
	color: var(--theme-color-text-secondary);
}
.cs-result {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 12px;
	border-radius: 8px;
	text-decoration: none;
	color: #ffffff;
	border-bottom: none !important;
}
.cs-result.is-active,
.cs-result:hover {
	background: rgba(255, 255, 255, 0.08);
}
.cs-thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 6px;
	overflow: hidden;
	flex: none;
	background: var(--theme-color-neutral-on-dark);
}
.cs-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.cs-thumb-fallback {
	background: var(--theme-color-quaternary);
	color: #000000;
	font-family: var(--theme-font-family-alternate);
	font-size: 16px;
}
.cs-text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.cs-title {
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cs-subtitle {
	font-size: 13px;
	color: var(--theme-color-text-secondary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cs-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 16px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	flex: none;
}
.cs-shortcuts {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}
.cs-kbd-group {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--theme-color-text-secondary);
}
.cs-kbd-group kbd {
	font-family: inherit;
	font-size: 11px;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 4px;
	padding: 2px 6px;
	color: rgba(255, 255, 255, 0.8);
}
.cs-view-all {
	font-size: 13px;
	color: var(--theme-color-quaternary);
	text-decoration: none;
	white-space: nowrap;
	border-bottom: none !important;
}
.cs-view-all:hover {
	text-decoration: underline;
}
.cs-view-all[hidden] {
	display: none;
}

body.cs-locked {
	overflow: hidden;
}

@media only screen and (max-width: 744px) {
	.cs-panel {
		margin: 0;
		width: 100%;
		height: 100%;
		max-height: none;
		border-radius: 0;
	}
	.cs-inputrow {
		padding: 16px;
	}
	.cs-footer {
		padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
	}
}
