.topbar {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 0.85rem;
	align-items: center;
	position: relative;
	z-index: 50;

	@media (max-width: 519px) {
		grid-template-columns: auto minmax(0, 1fr);
	}

	@media (min-width: 880px) {
		grid-template-columns: auto minmax(0, 1fr) auto;
	}
}


.menuButton,
.iconButton {
	width: 2.75rem;
	height: 2.75rem;
	display: grid;
	place-items: center;
	border-radius: 1rem;
	border: 1px solid var(--border-soft);
	background: var(--surface-panel);
	color: var(--text-muted);
	box-shadow: var(--shadow-soft);
	cursor: pointer;
	transition:
		transform 0.2s ease,
		background-color 0.2s ease,
		border-color 0.2s ease;

	&:hover {
		transform: translateY(-1px);
		background: var(--surface-panel-strong);
		border-color: var(--border-strong);
	}

	svg {
		width: 1.15rem;
		height: 1.15rem;
		stroke: currentColor;
		fill: none;
		stroke-width: 1.8;
		stroke-linecap: round;
		stroke-linejoin: round;
	}
}

.menuButton {
	position: relative;
	z-index: 70;
}

.menuGlyph {
	position: relative;
	width: 1.1rem;
	height: 0.95rem;
	display: inline-block;
}

.menuLine {
	position: absolute;
	left: 0;
	width: 100%;
	height: 2px;
	border-radius: 9999px;
	background: currentColor;
	transform-origin: center;
	transition:
		transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
		opacity 0.24s var(--transition-ease),
		top 0.38s cubic-bezier(0.22, 1, 0.36, 1),
		background-color 0.2s var(--transition-ease);

	&:nth-child(1) {
		top: 0.05rem;
	}

	&:nth-child(2) {
		top: 0.41rem;
	}

	&:nth-child(3) {
		top: 0.77rem;
	}
}

.menuButtonOpen {
	.menuLine {
		&:nth-child(1) {
			top: 0.41rem;
			transform: rotate(45deg);
		}

		&:nth-child(2) {
			opacity: 0;
			transform: scaleX(0.4);
		}

		&:nth-child(3) {
			top: 0.41rem;
			transform: rotate(-45deg);
		}
	}
}

@media (min-width: 768px) {
	.menuButton,
	.iconButton {
		width: 3rem;
		height: 3rem;
	}
}

.searchField {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	padding: 0 0.85rem;
	border-radius: 1rem;
	border: 1px solid var(--border-soft);
	background: var(--surface-panel-strong);
	box-shadow: var(--shadow-soft);

	input {
		width: 100%;
		padding: 0.82rem 0;
		border: none;
		background: transparent;
		outline: none;
		color: var(--text);
		font-size: 0.9rem;
	}
}

@media (min-width: 768px) {
	.searchField {
		padding: 0 1rem;

		input {
			padding: 0.95rem 0;
			font-size: 0.95rem;
		}
	}
}

.searchIcon {
	display: grid;
	place-items: center;
	color: var(--text-muted);

	svg {
		width: 1rem;
		height: 1rem;
		stroke: currentColor;
		fill: none;
		stroke-width: 1.8;
		stroke-linecap: round;
		stroke-linejoin: round;
	}
}

.actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.55rem;
	grid-column: 1 / -1;
	overflow-x: auto;
	padding-bottom: 0.15rem;
	scrollbar-width: none;

	&::-webkit-scrollbar {
		display: none;
	}

	@media (min-width: 880px) {
		grid-column: auto;
		justify-content: flex-end;
		overflow: visible;
		padding-bottom: 0;
	}
}

.menuGroup {
	position: relative;
	flex: 0 0 auto;
}

.countBadge {
	position: absolute;
	top: -0.15rem;
	right: -0.15rem;
	min-width: 1.1rem;
	height: 1.1rem;
	display: grid;
	place-items: center;
	padding: 0 0.2rem;
	border-radius: 9999px;
	background: var(--primary);
	color: var(--action-primary-text);
	font-size: 0.68rem;
	font-weight: 700;
	line-height: 1;
	box-shadow: var(--shadow-soft);
}

.dropdown {
	position: absolute;
	top: calc(100% + 0.6rem);
	right: 0;
	width: min(22rem, calc(100vw - 2rem));
	display: grid;
	gap: 0.85rem;
	padding: 0.95rem;
	border-radius: 1.25rem;
	border: 1px solid var(--border-strong);
	background: var(--surface-raised);
	box-shadow: var(--shadow-elevated);
	backdrop-filter: blur(18px);
	z-index: 20;
}

.dropdownHeader {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;

	strong {
		font-size: 1rem;
		line-height: 1.1;
	}
}

.dropdownEyebrow {
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-muted);
	margin-bottom: 0.12rem;
}

.dropdownLink {
	color: var(--primary);
	font-size: 0.85rem;
	font-weight: 600;
	white-space: nowrap;
}

.dropdownList {
	display: grid;
	gap: 0.65rem;
}

.dropdownItem {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: start;
	gap: 0.7rem;
	padding: 0.8rem;
	border-radius: 1rem;
	background: var(--surface-panel);
	border: 1px solid var(--border-soft);
	transition:
		transform 0.2s ease,
		border-color 0.2s ease,
		background-color 0.2s ease;

	&:hover {
		transform: translateY(-1px);
		border-color: var(--border-strong);
		background: var(--surface-panel-strong);
		text-decoration: none;
	}

	small {
		color: var(--text-muted);
		font-size: 0.74rem;
		white-space: nowrap;
	}
}

.itemCopy {
	min-width: 0;
	display: grid;
	gap: 0.2rem;

	strong {
		font-size: 0.92rem;
		line-height: 1.15;
	}

	p {
		font-size: 0.82rem;
		line-height: 1.35;
		color: var(--text-muted);
		overflow: hidden;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}
}

.itemTone,
.messageAvatar {
	width: 2.15rem;
	height: 2.15rem;
	border-radius: 9999px;
	flex-shrink: 0;
}

.itemTone {
	display: inline-block;
	margin-top: 0.1rem;
	border: 1px solid var(--border-soft);
}

.tone-blue {
	background: var(--surface-info-emphasis);
}

.tone-yellow {
	background: var(--surface-warning-emphasis);
}

.tone-teal {
	background: var(--surface-success-emphasis);
}

.messageAvatar {
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, var(--surface-accent-emphasis), var(--surface-info-emphasis));
	color: var(--text-accent-strong);
	font-size: 0.8rem;
	font-weight: 700;
	margin-top: 0.1rem;
}

.profile {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.4rem 0.5rem 0.4rem 0.8rem;
	border-radius: 9999px;
	border: 1px solid var(--border-soft);
	background: var(--surface-panel);
	box-shadow: var(--shadow-soft);
	white-space: nowrap;
}

.profileButton {
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	color: inherit;

	&:hover {
		text-decoration: none;
	}

	.profile {
		transition:
			transform 0.2s ease,
			border-color 0.2s ease,
			background-color 0.2s ease;
	}

	&:hover .profile,
	&:focus-visible .profile,
	&.profileButtonOpen .profile {
		transform: translateY(-1px);
		background: var(--surface-panel-strong);
		border-color: var(--border-strong);
	}
}

.profileChevron {
	display: grid;
	place-items: center;
	color: var(--text-muted);
	transition: transform 0.24s var(--transition-ease);

	svg {
		width: 0.95rem;
		height: 0.95rem;
		stroke: currentColor;
		fill: none;
		stroke-width: 1.9;
		stroke-linecap: round;
		stroke-linejoin: round;
	}
}

.profileButtonOpen .profileChevron {
	transform: rotate(180deg);
}

@media (min-width: 768px) {
	.profile {
		padding: 0.45rem 0.55rem 0.45rem 0.95rem;
	}
}

.profileName {
	font-weight: 500;
	font-size: 0.9rem;
}

.profileRole {
	font-size: 0.85rem;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

@media (max-width: 519px) {
	.profileRole {
		display: none;
	}
}

.profileBadge {
	width: 2.2rem;
	height: 2.2rem;
	display: grid;
	place-items: center;
	border-radius: 9999px;
	background: var(--surface-accent-emphasis);
	color: var(--text-accent-strong);
	font-weight: 600;
}

.profileMenuBadge {
	width: 2.2rem;
	height: 2.2rem;
	display: grid;
	place-items: center;
	border-radius: 9999px;
	background: var(--surface-accent-emphasis);
	color: var(--text-accent-strong);
	font-size: 0.9rem;
	font-weight: 700;
	flex-shrink: 0;
}
