/* Quick-search command-palette styles (ADR-018/019).

   Co-located with the finder ES modules (assets/finder/) and enqueued site-wide
   alongside the entry module, since the palette can be summoned on any front-end
   screen. Depends on terminal.css for the shared :root tokens (--amber, --bg-panel,
   --crt-surface-*, …); that stylesheet is the enqueue dependency, so it cascades
   first. The palette is a centered modal above the overlay layer (10002). */

.lk-finder-layer {
	position: fixed;
	inset: 0;
	z-index: 10003;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 12vh 16px 16px;
	/* Dimmed, faintly blurred backdrop, like the overlay scrim. */
	background: radial-gradient(120% 120% at 50% 0%, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.7));
	backdrop-filter: blur(2px) brightness(0.85);
}

.lk-finder-layer[hidden] {
	display: none;
}

.lk-finder {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(620px, 100%);
	max-height: 70vh;
	background: color-mix(in srgb, var(--bg-panel), transparent 6%);
	border: 1px solid var(--amber-dim);
	box-shadow:
		0 0 0 1px rgba(0, 0, 0, 0.6),
		0 8px 40px rgba(0, 0, 0, 0.6),
		0 0 36px rgba(255, 176, 0, 0.18);
	overflow: hidden; /* clip the scanline wash to the panel */
	backdrop-filter: blur(6px);
	animation: lk-finder-in 140ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

/* Amber corner bracket, like .lk-panel / .lk-overlay. */
.lk-finder::before {
	content: "";
	position: absolute;
	top: -1px;
	left: -1px;
	width: 10px;
	height: 10px;
	border-top: 2px solid var(--amber);
	border-left: 2px solid var(--amber);
	pointer-events: none;
	z-index: 1;
}

/* Faint CRT scanline wash across the whole panel. */
.lk-finder::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--crt-surface-scan);
	pointer-events: none;
	z-index: 2;
}

@keyframes lk-finder-in {
	from { opacity: 0; transform: translateY(-8px) scale(0.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lk-finder-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-bottom: 1px dashed var(--border);
}

.lk-finder-prompt {
	color: var(--amber);
	font-size: 1.1rem;
	line-height: 1;
}

.lk-finder-input {
	flex: 1 1 auto;
	min-width: 0;
	background: transparent;
	border: 0;
	outline: none;
	color: var(--text);
	font-family: var(--font-mono);
	font-size: 0.95rem;
	letter-spacing: 0.5px;
	caret-color: var(--amber);
}

.lk-finder-input::placeholder {
	color: var(--muted);
}

.lk-finder-list {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: #05050520;
	background-image: var(--crt-surface-sheen);
}

/* Category heading above each group of results. */
.lk-finder-group {
	padding: 8px 14px 4px;
	color: var(--amber-dim);
	text-transform: uppercase;
	font-size: 0.62rem;
	letter-spacing: 2px;
	font-weight: 600;
}

.lk-finder-item {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 14px;
	cursor: pointer;
	border-left: 2px solid transparent;
}

.lk-finder-item.is-active {
	background: rgba(255, 176, 0, 0.1);
	border-left-color: var(--amber);
}

.lk-finder-name {
	color: var(--text);
	font-size: 0.88rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lk-finder-item.is-active .lk-finder-name {
	color: var(--amber);
	text-shadow: 0 0 8px rgba(255, 176, 0, 0.45);
}

.lk-finder-sub {
	flex: none;
	color: var(--muted);
	font-size: 0.66rem;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.lk-finder-empty {
	padding: 14px;
	color: var(--muted);
	font-size: 0.72rem;
	letter-spacing: 2px;
	text-transform: uppercase;
}

/* The footer magnifying-glass trigger. Sits among the .lk-hotkeys hints. */
.lk-find-btn {
	background: transparent;
	border: 1px solid var(--border);
	color: var(--amber-dim);
	font-family: var(--font-mono);
	font-size: 0.85rem;
	line-height: 1;
	padding: 2px 7px 3px;
	cursor: pointer;
}

.lk-find-btn:hover,
.lk-find-btn:focus-visible {
	outline: none;
	border-color: var(--amber);
	color: var(--amber);
	box-shadow: 0 0 6px rgba(255, 176, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
	.lk-finder {
		animation: none;
	}
}
