.panel {
	display: flex;
	flex-direction: column;
	width: 420px;
	flex-shrink: 0;
	background-color: var(--background-secondary);
	border-left: 1px solid var(--background-modifier-accent);
	height: 100%;
	overflow: hidden;
}

.header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 3.5rem;
	padding: 0 1rem;
	border-bottom: 1px solid var(--background-modifier-accent);
	flex-shrink: 0;
}

.headerTitle {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--text-primary);
	margin: 0;
}

.closeButton {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: none;
	border-radius: 4px;
	background: transparent;
	color: var(--text-tertiary);
	cursor: pointer;
	transition: background-color 0.12s, color 0.12s;
}

.closeButton:hover {
	background: var(--background-modifier-hover);
	color: var(--text-primary);
}

.resultsList {
	flex: 1;
	overflow-y: auto;
	padding: 0.5rem;
}

/* ── Channel group headers ──────────────────────────────────── */

.channelGroup {
	margin-bottom: 4px;
}

.channelGroupHeader {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 12px 8px 4px;
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--text-primary);
}

.channelGroupIcon {
	color: var(--channel-icon, var(--text-tertiary));
	flex-shrink: 0;
}

.channelGroupName {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.channelGroupCount {
	margin-left: auto;
	font-size: 0.6875rem;
	font-weight: 600;
	color: var(--text-tertiary);
}

/* ── Result row ────────────────────────────────────────────── */

.resultItem {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 0.5rem;
	margin-bottom: 0.5rem;
	width: 100%;
	text-align: left;
	font: inherit;
	border-radius: 0.375rem;
	border: 1px solid var(--background-header-secondary, var(--background-modifier-accent));
	background-color: var(--background-secondary-lighter, var(--background-primary));
	position: relative;
	cursor: pointer;
	transition: background-color 0.15s;
}

.resultItem:hover {
	background-color: var(--background-modifier-hover);
}

.resultItem:hover .jumpButton {
	opacity: 1;
}

.resultAvatar {
	flex-shrink: 0;
	padding-top: 2px;
}

.resultBody {
	flex: 1;
	min-width: 0;
}

.resultHeader {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	flex-wrap: nowrap;
	margin-bottom: 2px;
}

.resultAuthor {
	font-size: 0.9375rem;
	font-weight: 700;
	color: var(--text-primary);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.resultTimestamp {
	font-size: 0.75rem;
	color: var(--text-primary-muted);
	font-weight: 500;
	flex-shrink: 0;
}

.resultContent {
	font-size: 0.875rem;
	color: var(--text-primary);
	line-height: 1.375rem;
	word-wrap: break-word;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
}

.resultAttachments {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 6px;
	min-width: 0;
}

/* Constrain image / video / link-embed inside the 645px column so
   they don't stretch out the result card. */
.resultAttachments > * {
	max-width: 100%;
}

.resultAttachments img,
.resultAttachments video {
	max-width: 100%;
	max-height: 260px;
	border-radius: 6px;
}

.resultEmbeds {
	margin-top: 6px;
}

.highlight {
	background-color: rgba(250, 168, 26, 0.3);
	color: var(--text-primary);
	border-radius: 2px;
	padding: 0 1px;
}

/* Jump button — lives inside the header row right after the
   timestamp (pushed flush-right via `margin-left: auto`) so the
   message content below gets the full width of the result card.
   Matches PinnedMessageRow's muted tile-button look and only
   fades in on card hover to keep the idle state clean. */
.jumpButton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-left: auto;
	padding: 4px 10px;
	background-color: var(--background-primary);
	border: 1px solid var(--background-header-secondary);
	border-radius: 0.375rem;
	color: var(--text-primary-muted);
	font: inherit;
	font-size: 0.75rem;
	font-weight: 700;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.12s ease,
		visibility 0.12s ease,
		background-color 0.1s,
		border-color 0.1s,
		color 0.1s;
	flex-shrink: 0;
	-webkit-tap-highlight-color: transparent;
}

.resultItem:hover .jumpButton,
.resultItem:focus-within .jumpButton {
	opacity: 1;
	visibility: visible;
}

.jumpButton:hover {
	background-color: var(--background-modifier-hover);
	border-color: var(--background-modifier-accent);
	color: var(--text-primary);
}

/* ── Empty / loading states ─────────────────────────────────── */

.emptyState {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 3rem 1.5rem;
	text-align: center;
}

.emptyIcon {
	color: var(--text-tertiary);
	margin-bottom: 12px;
}

.emptyTitle {
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-primary);
	margin: 0 0 4px;
}

.emptyDescription {
	font-size: 0.8125rem;
	color: var(--text-tertiary);
	margin: 0;
}
