.wp-block-ralify-topbar,
.ralify-topbar {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	width: 100%;
	min-width: 0;
	min-height: 56px;
	gap: var(--ralify-space-5, 24px);
	color: var(--ralify-color-text, #f8fafc);
	font-family: var(--ralify-font, "Sora", sans-serif);
}

.ralify-topbar__search {
	display: flex;
	flex: 1 1 540px;
	align-items: center;
	min-width: 180px;
	height: 46px;
	gap: var(--ralify-space-3, 12px);
	padding-inline: var(--ralify-space-4, 16px);
	border: 1px solid rgba(148, 163, 184, 0.18);
	border-radius: var(--ralify-radius-md, 12px);
	background: rgba(11, 15, 23, 0.72);
	transition: border-color var(--ralify-transition, 180ms ease), box-shadow var(--ralify-transition, 180ms ease);
}

.ralify-topbar__search:focus-within {
	border-color: var(--ralify-color-purple, #885cf6);
	box-shadow: 0 0 0 3px rgba(136, 92, 246, 0.12);
}

.ralify-topbar__search-icon {
	display: grid;
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	place-items: center;
	color: var(--ralify-color-text-muted, #94a3b8);
}

.ralify-topbar__search-icon svg,
.ralify-topbar__icon-button svg,
.ralify-topbar__profile svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.ralify-topbar__search-input {
	flex: 1;
	width: 100%;
	min-width: 0;
	padding: 0;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--ralify-color-text, #f8fafc);
	font: inherit;
	font-size: 0.875rem;
}

.ralify-topbar__search-input::placeholder {
	color: var(--ralify-color-text-muted, #94a3b8);
	opacity: 0.8;
}

.ralify-topbar kbd {
	display: grid;
	min-width: 26px;
	height: 26px;
	padding-inline: 7px;
	place-items: center;
	border: 1px solid var(--ralify-color-border, #273142);
	border-radius: 7px;
	background: rgba(255, 255, 255, 0.035);
	color: var(--ralify-color-text-muted, #94a3b8);
	font: 600 0.75rem/1 var(--ralify-font, "Sora", sans-serif);
	box-shadow: inset 0 -1px rgba(255, 255, 255, 0.04);
}

.ralify-topbar__actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: var(--ralify-space-2, 8px);
}

.ralify-topbar__icon-button {
	position: relative;
	display: grid;
	width: 40px;
	height: 40px;
	padding: 0;
	place-items: center;
	border: 0;
	border-radius: var(--ralify-radius-md, 12px);
	background: transparent;
	color: var(--ralify-color-text-muted, #94a3b8);
	cursor: pointer;
	transition: background-color var(--ralify-transition, 180ms ease), color var(--ralify-transition, 180ms ease);
}

.ralify-topbar__icon-button:hover {
	background: rgba(255, 255, 255, 0.06);
}

.ralify-topbar__notification-count {
	position: absolute;
	top: -4px;
	right: -4px;
	display: grid;
	min-width: 18px;
	height: 18px;
	padding-inline: 4px;
	place-items: center;
	border: 2px solid var(--ralify-color-surface, #111827);
	border-radius: var(--ralify-radius-pill, 999px);
	background: var(--ralify-color-cyan, #00e5ff);
	color: #071017;
	font-size: 0.6rem;
	font-weight: 800;
}

.ralify-topbar__rally-plus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 40px;
	padding-inline: 18px;
	border-radius: var(--ralify-radius-pill, 999px);
	background: var(--ralify-gradient-brand, linear-gradient(135deg, #2563eb, #885cf6));
	color: #fff;
	font-size: 0.78rem;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.ralify-topbar__rally-plus svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
	stroke: none;
}

.ralify-topbar__profile {
	display: flex;
	align-items: center;
	min-height: 40px;
	gap: 9px;
	padding: 0;
	border: 0;
	border-radius: var(--ralify-radius-md, 12px);
	color: inherit;
	text-decoration: none;
}

.ralify-topbar__avatar {
	display: grid;
	overflow: hidden;
	width: 34px;
	height: 34px;
	place-items: center;
	border-radius: 999px;
	background: var(--ralify-color-surface-raised, #182233);
	color: var(--ralify-color-cyan, #00e5ff);
	font-size: 0.75rem;
	font-weight: 800;
}

.ralify-topbar__avatar-image {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 999px;
	object-fit: cover;
}

.ralify-topbar__profile-label {
	max-width: 112px;
	overflow: hidden;
	font-size: 0.75rem;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ralify-topbar__profile > svg {
	width: 15px;
	height: 15px;
	color: var(--ralify-color-text-muted, #94a3b8);
}

.ralify-topbar__icon-button:hover,
.ralify-topbar__icon-button:focus-visible,
.ralify-topbar__profile:hover,
.ralify-topbar__profile:focus-visible {
	border-color: rgba(136, 92, 246, 0.55);
	color: var(--ralify-color-text, #f8fafc);
	outline: none;
}

@media (max-width: 900px) {
	.ralify-topbar__profile-label,
	.ralify-topbar__profile > svg {
		display: none;
	}
}

@media (max-width: 640px) {
	/*
	 * Previously the topbar wrapped into two full-width rows on a phone: the
	 * search on one line, the icon actions on another. Stacked under the launch
	 * banner and the logo row, that pushed the first actual story roughly 400px
	 * down the screen, and the search field still ran out of room because the
	 * "/" shortcut hint was eating the end of the placeholder. One row, no
	 * wrapping, and the desktop-only affordances dropped.
	 */
	.wp-block-ralify-topbar,
	.ralify-topbar {
		flex-wrap: nowrap;
		min-height: 48px;
		gap: var(--ralify-space-2, 8px);
		padding: var(--ralify-space-2, 8px) 0;
	}

	.ralify-topbar__search {
		flex: 1 1 auto;
		order: 0;
		min-width: 0;
		height: 42px;
		gap: 8px;
		padding-inline: 12px;
	}

	/* min-width:auto is the flex default and would stop the input shrinking
	   below its placeholder width, forcing the whole row to overflow. */
	.ralify-topbar__search-input {
		min-width: 0;
	}

	/* Keyboard shortcut hint: meaningless without a keyboard. */
	.ralify-topbar__search kbd {
		display: none;
	}

	.ralify-topbar__actions {
		flex: 0 0 auto;
		width: auto;
		gap: 4px;
	}

	.ralify-topbar__icon-button {
		width: 38px;
		height: 38px;
	}

	.ralify-topbar__avatar {
		width: 30px;
		height: 30px;
	}

	.ralify-topbar__rally-plus {
		display: none;
	}
}
