/*
 * command-palette.css — the V2 ⌘K overlay.
 * Tokens come from css/os.css, so the palette follows the theme toggle.
 */

.cmdk-overlay {
	position: fixed;
	inset: 0;
	z-index: 60;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 12vh 16px 16px;
	background: rgba(13, 19, 13, 0.34);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}

.cmdk-box {
	width: min(560px, 100%);
	max-height: 62vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: var(--paper);
	box-shadow: 0 25px 80px rgba(0, 0, 0, 0.28);
}

.cmdk-input {
	flex: none;
	width: 100%;
	padding: 15px 17px;
	border: 0;
	border-bottom: 1px solid var(--line);
	background: transparent;
	color: var(--ink);
	font-size: 15px;
	outline: 0;
}

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

.cmdk-list {
	flex: 1;
	min-height: 0;
	margin: 0;
	padding: 6px;
	list-style: none;
	overflow-y: auto;
}

.cmdk-group {
	padding: 9px 10px 5px;
	color: var(--muted);
	font-size: 10px;
	font-weight: 850;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.cmdk-row {
	display: grid;
	grid-template-columns: 20px minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border-radius: 10px;
	cursor: pointer;
}

.cmdk-row.is-active { background: var(--silver); }
.cmdk-icon { color: var(--aqua-deep); font-size: 12px; text-align: center; }

/* A row is icon | body | trailing. The body is a single column so a row with
 * only a label renders exactly as it did before provider rows existed. */
.cmdk-body {
	display: grid;
	min-width: 0;
}

.cmdk-label {
	font-size: 14px;
	font-weight: 650;
	color: var(--ink);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cmdk-sub {
	color: var(--muted);
	font-size: 11.5px;
	font-weight: 650;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cmdk-kind { color: var(--muted); font-size: 11px; font-weight: 650; }

.cmdk-badge {
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--lime-soft);
	color: var(--lime-deep);
	font-size: 10px;
	font-weight: 850;
}

.cmdk-empty { padding: 18px 12px; color: var(--muted); font-size: 13px; }

/* An honest cap, and an honest "not finished yet" — neither may read as
 * "that's everything". */
.cmdk-more,
.cmdk-hint {
	padding: 8px 12px 12px;
	color: var(--muted);
	font-size: 12px;
	font-weight: 650;
	line-height: 1.45;
}

.cmdk-kbd {
	margin-left: auto;
	padding: 2px 5px;
	border: 1px solid var(--line);
	border-radius: 6px;
	color: var(--muted);
	font-size: 10px;
	font-weight: 750;
}

@media (max-width: 760px) {
	.cmdk-overlay { padding-top: 8vh; }
	/* Touch tap targets (pipeline invariant 8). */
	.cmdk-row { min-height: 44px; }
}

/* ═════════════════════════════════════ the strip the Lumi dock owns ══
 * The palette is on every V2 page, and it is one of the surfaces the dock
 * paints over: on a computer the dock lives in the shell document, above
 * the frame the page is in, so the palette's z-index cannot reach it.
 *
 * The box hangs from the top and is capped, so today it stops short of the
 * strip on any realistic window. That is an accident of two numbers, not a
 * rule — say the rule instead, and the palette stays clear if either of
 * them is ever changed. `--os-dock-inset` is declared in os.css. */

.cmdk-overlay { padding-bottom: calc(16px + var(--os-dock-inset, 0px)); }
