/* ===== Top bar, right cluster — bell + Vera (40px circles), cash card, account
   card — and the account menu that drops from the account card. Colours are
   theme tokens; the one solid-accent surface is the wallet card. Icons come
   from /img/phosphor-rail.svg. The Vera toggle itself (.cp-navtoggle) keeps
   its own styling in style.css. ===== */
/* Height the rail brand mirrors (rail.css) so the mark centres on the search bar. */
:root {
	--topbar-h: 80px;
}
.topbar {
	min-height: var(--topbar-h);
}
.topbar .nav-right {
	gap: 10px;
	align-items: center;
}
.tb-ic {
	width: 20px;
	height: 20px;
	flex: none;
	fill: currentColor;
}
.topbar-bell {
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--border);
	background: var(--cardcolor);
	color: var(--txt-2);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition:
		background 0.14s,
		color 0.14s;
}
.topbar-bell:hover {
	background: var(--hover);
	color: var(--txt);
}
/* Theme toggle: sun while dark (press for light), moon while light. */
.theme-toggle .ic-moon {
	display: none;
}
html[data-theme="light"] .theme-toggle .ic-sun {
	display: none;
}
html[data-theme="light"] .theme-toggle .ic-moon {
	display: inline;
}
/* The two cards share one surface; the circles next to them stay 40px. */
.tb-card {
	display: flex;
	align-items: center;
	height: 52px;
	border-radius: 14px;
	border: 1px solid var(--border);
	background: var(--cardcolor);
	color: var(--txt);
	font: inherit;
	cursor: pointer;
	transition:
		background 0.14s,
		border-color 0.14s;
}
.tb-card:hover {
	background: var(--hover);
	border-color: var(--border-2);
}
.tb-card:focus-visible,
.topbar-bell:focus-visible,
.profile-menu button:focus-visible {
	outline: 2px solid var(--ring);
	outline-offset: 2px;
}
#nav-deposit {
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 2px;
	padding: 0 16px;
	line-height: 1.15;
}
.tb-cash-line {
	display: flex;
	align-items: baseline;
	gap: 6px;
}
.tb-cash-line b {
	font-family: var(--num);
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}
.tb-cash-line small {
	font-size: 11.5px;
	color: var(--muted);
}
.tb-link {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--link);
}
#nav-deposit:hover .tb-link {
	text-decoration: underline;
}
.nav-profile {
	position: relative;
}
.profile-btn {
	gap: 12px;
	padding: 0 6px 0 16px;
	max-width: 260px;
	text-align: left;
}
.profile-id {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	min-width: 0;
	line-height: 1.15;
}
.profile-role {
	font-size: 11.5px;
	color: var(--muted);
}
.profile-email {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--txt);
	max-width: 180px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.topbar .avatar,
.am-wallet .avatar {
	width: 40px;
	height: 40px;
	font-size: 14px;
}
/* Social swaps the monogram for a photo element; it fills the circle. */
.avatar > * {
	width: 100%;
	height: 100%;
	border-radius: inherit;
	object-fit: cover;
}

/* ----- Account menu ----- */
.profile-menu {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	width: 320px;
	padding: 12px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 22px;
	box-shadow: var(--shadow);
	z-index: 60;
	animation: am-in 0.14s cubic-bezier(0.23, 1, 0.32, 1);
}
.profile-menu[hidden] {
	display: none;
}
@keyframes am-in {
	from {
		opacity: 0;
		transform: translateY(-6px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: none;
	}
}
.am-wallet {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px 18px;
	border-radius: 16px;
	background: var(--accent);
	color: var(--on-accent);
}
.am-wallet-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 4px;
}
.am-wallet-title {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	font-weight: 700;
}
.am-wallet .avatar {
	background: var(--card);
	color: var(--txt);
	box-shadow: none;
}
.am-address-row {
	display: flex;
	align-items: center;
	gap: 10px;
}
.am-address-row b {
	font-family: var(--num);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.02em;
}
.am-copy {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: none;
	color: inherit;
	opacity: 0.75;
	cursor: pointer;
}
.am-copy:hover {
	opacity: 1;
	background: color-mix(in srgb, var(--on-accent) 12%, transparent);
}
.am-id {
	display: flex;
	align-items: baseline;
	gap: 8px;
	min-width: 0;
	font-size: 13px;
	opacity: 0.85;
}
.am-id > span:first-child {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.am-wallet .pm-role-badge {
	flex: none;
	font-size: 11px;
	font-weight: 600;
	padding: 1px 7px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--on-accent) 14%, transparent);
}
.am-balance {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding: 16px 12px 12px;
	font-size: 14px;
	color: var(--txt-2);
}
.am-balance b {
	font-family: var(--num);
	font-size: 16px;
	font-weight: 700;
	color: var(--txt);
	letter-spacing: -0.02em;
}
.am-balance small {
	font-size: 11.5px;
	font-weight: 600;
	color: var(--muted);
}
/* AI credits row (copilot.js mounts it under the wallet balance). */
.am-credits {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	margin: -6px 0 10px;
	padding: 0 12px;
	border: 0;
	background: none;
	color: var(--txt-2);
	font: inherit;
	font-size: 14px;
	text-align: left;
	cursor: pointer;
}
.am-credits b {
	font-family: var(--num);
	font-size: 16px;
	font-weight: 700;
	color: var(--txt);
	letter-spacing: -0.02em;
}
.am-credits small {
	margin-left: 6px;
	font-size: 11.5px;
	font-weight: 600;
	color: var(--link);
}
.am-credits:hover small {
	text-decoration: underline;
}
.am-credits.cp-credits-low b {
	color: var(--warn);
}
.am-pill {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 48px;
	margin-bottom: 6px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--card-2);
	color: var(--txt);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.14s;
}
.am-pill:hover {
	background: var(--hover);
}
.pm-item {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 11px 12px;
	border: 0;
	border-radius: 12px;
	background: none;
	color: var(--txt-2);
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	text-align: left;
	cursor: pointer;
	transition:
		background 0.12s,
		color 0.12s;
}
.pm-item:hover {
	background: var(--hover);
	color: var(--txt);
}
.pm-item .tb-ic {
	color: var(--muted);
}
.pm-item:hover .tb-ic {
	color: var(--txt);
}
.pm-item .pm-arrow {
	width: 16px;
	height: 16px;
	margin-left: 2px;
}
.pm-sep {
	height: 1px;
	margin: 6px 4px;
	background: var(--border);
}
.pm-danger:hover {
	color: var(--down);
}
.pm-danger:hover .tb-ic {
	color: var(--down);
}
@media (max-width: 640px) {
	/* Phones: the cards shrink to their essentials beside the 40px circles. */
	.tb-link,
	.profile-id {
		display: none;
	}
	.tb-card {
		height: 40px;
		border-radius: 999px;
	}
	#nav-deposit {
		padding: 0 12px;
	}
	.profile-btn {
		padding: 0;
		border: 0;
		background: none;
	}
	.profile-menu {
		position: fixed;
		top: auto;
		right: 10px;
		left: 10px;
		width: auto;
		margin-top: 8px;
	}
}
@media (prefers-reduced-motion: reduce) {
	.profile-menu {
		animation: none;
	}
}
