/*
 * Academy App Menu for BuddyBoss.
 * All rules are scoped to plugin body state plus verified BuddyBoss containers.
 */

body.aam-active {
	--aam-collapsed-width: 74px;
	--aam-radius: 12px;
	--aam-border: rgba(20, 34, 59, 0.12);
	--aam-border: color-mix(in srgb, var(--aam-text) 12%, transparent);
	--aam-focus: 0 0 0 3px rgba(79, 109, 245, 0.28);
	--aam-focus: 0 0 0 3px color-mix(in srgb, var(--aam-accent) 28%, transparent);
	--aam-shadow: 0 5px 18px rgba(20, 34, 59, 0.08);
	--aam-shadow: 0 5px 18px color-mix(in srgb, var(--aam-text) 8%, transparent);
}

body.aam-active .aam-branding {
	align-items: center;
	color: var(--aam-text);
	display: flex;
	gap: 10px;
	min-width: 0;
	text-decoration: none;
}

body.aam-active .aam-brand-logo {
	display: block;
	height: auto;
	max-height: var(--aam-logo-height);
	max-width: min(160px, 46vw);
	object-fit: contain;
	width: auto;
}

body.aam-active .aam-brand-copy {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
	min-width: 0;
}

body.aam-active .aam-brand-copy strong {
	color: inherit;
	font-size: 15px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

body.aam-active .aam-brand-copy small {
	color: var(--aam-muted);
	font-size: 12px;
	margin-top: 3px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

body.aam-brand-align-center .aam-branding {
	justify-content: center;
	text-align: center;
}

body.aam-active .aam-menu .aam-role-hidden,
body.aam-active .aam-menu .aam-visibility-hidden {
	display: none !important;
}

body.aam-active .aam-menu .aam-has-custom-icon > a > i:not(.aam-item-icon, .bs-submenu-toggle),
body.aam-active .aam-menu .aam-has-custom-icon > a > img:not(.aam-item-icon),
body.aam-active .aam-menu .aam-has-custom-icon > a > svg {
	display: none !important;
}

body.aam-active .aam-menu .aam-item-icon {
	color: currentColor;
	font-size: 21px;
	line-height: 1;
}

body.aam-active .aam-menu .aam-item-subtitle {
	color: var(--aam-muted);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.35;
}

body.aam-active .aam-menu a:focus-visible,
body.aam-active .aam-branding:focus-visible,
body.aam-active .bb-left-panel-mobile:focus-visible,
body.aam-active .bb-close-panel:focus-visible,
body.aam-active .bb-toggle-panel:focus-visible {
	box-shadow: var(--aam-focus);
	outline: 2px solid transparent;
}

/* Mobile: BuddyBoss Theme 2.20.0 switches at 800px. */
/* Layout rules are driven by the early html state class. */
html.aam-layout-mobile body.aam-mobile-active .bb-mobile-header-wrapper a.bb-left-panel-mobile {
	-webkit-tap-highlight-color: transparent;
	align-items: center;
	background: transparent;
	border-radius: 10px;
	box-sizing: border-box;
	display: inline-flex;
	flex: 0 0 48px;
	height: 48px;
	justify-content: center;
	margin-left: 0;
	min-height: 48px;
	min-width: 48px;
	padding: 0;
	touch-action: manipulation;
	width: 48px;
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-header-wrapper a.bb-left-panel-mobile:hover {
	background: rgba(15, 23, 42, 0.04);
	background: color-mix(in srgb, var(--aam-text) 4%, transparent);
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-header-wrapper a.bb-left-panel-mobile:active {
	background: rgba(15, 23, 42, 0.08);
	background: color-mix(in srgb, var(--aam-text) 8%, transparent);
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-header-wrapper a.bb-left-panel-mobile > i {
	flex: 0 0 auto;
	height: 24px;
	line-height: 24px;
	margin: 0;
	pointer-events: none;
	width: 24px;
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-wrapper {
	background: var(--aam-background);
	box-shadow: none;
	height: 100vh;
	height: 100dvh;
	max-width: 100%;
	min-height: -webkit-fill-available;
	overscroll-behavior: contain;
	overflow: hidden;
	width: 100vw;
}

html.aam-layout-mobile body.admin-bar.aam-mobile-active .bb-mobile-panel-wrapper {
	height: calc(100vh - 32px);
	height: calc(100dvh - 32px);
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-inner {
	-webkit-overflow-scrolling: touch;
	box-sizing: border-box;
	height: 100%;
	max-width: 100%;
	overflow: hidden;
	padding: 0 max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
	width: 100%;
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-wrapper .bb-mobile-panel-header {
	background: linear-gradient(135deg, var(--aam-header-start), var(--aam-header-end));
	background: linear-gradient(
		135deg,
		color-mix(in srgb, var(--aam-header-start) 72%, #0f172a),
		color-mix(in srgb, var(--aam-header-end) 78%, #0f172a)
	);
	border: 0;
	box-shadow: none;
	box-sizing: border-box;
	color: #fff;
	flex: 0 0 auto;
	margin: 0 calc(-1 * max(16px, env(safe-area-inset-right))) 0 calc(-1 * max(16px, env(safe-area-inset-left)));
	min-height: 76px;
	padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left));
	position: relative;
	top: auto;
	width: auto;
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-wrapper .bb-mobile-panel-header .user-name,
html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-wrapper .bb-mobile-panel-header .my-account-link a,
html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-wrapper .bb-mobile-panel-header .aam-member-role {
	color: #fff;
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-wrapper .bb-mobile-panel-header .user-wrap {
	min-width: 0;
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-header.aam-visitor-brand-overridden .logo-wrap,
html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-header.aam-branding-hidden .logo-wrap {
	display: none;
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-header .aam-branding-mobile {
	background: transparent;
	border: 0;
	color: #fff;
	flex: 1 1 auto;
	margin-right: 12px;
	min-height: 0;
	padding: 0;
}

html.aam-layout-mobile body.aam-mobile-active:not(.logged-in) .bb-mobile-panel-header .aam-branding-mobile {
	box-sizing: border-box;
	padding-left: 12px;
	padding-left: max(12px, env(safe-area-inset-left));
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-header .aam-branding-mobile .aam-brand-copy small {
	color: rgba(255, 255, 255, 0.82);
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-wrapper .bb-mobile-panel-header .user-wrap > div {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-wrapper .bb-mobile-panel-header .avatar {
	border: 2px solid rgba(255, 255, 255, 0.72);
	height: 48px;
	margin-right: 11px;
	width: 48px;
}

html.aam-layout-mobile body.aam-hide-member-avatar .bb-mobile-panel-header .user-wrap > a {
	display: none;
}

html.aam-layout-mobile body.aam-hide-member-name .bb-mobile-panel-header .user-name {
	display: none;
}

html.aam-layout-mobile body.aam-mobile-active .aam-member-role {
	font-size: 12px;
	margin-top: 3px;
	opacity: 0.84;
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-wrapper a.bb-close-panel {
	-webkit-tap-highlight-color: transparent;
	align-items: center;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.42);
	border-radius: 10px;
	display: flex;
	flex: 0 0 48px;
	height: 48px;
	justify-content: center;
	margin-left: auto;
	min-height: 48px;
	min-width: 48px;
	padding: 0;
	touch-action: manipulation;
	width: 48px;
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-wrapper a.bb-close-panel i {
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 25px;
	height: auto;
	line-height: 1;
	padding: 0;
	position: static;
	width: auto;
}

html.aam-layout-mobile body.aam-mobile-active .aam-branding-mobile {
	background: var(--aam-card);
	border-bottom: 1px solid var(--aam-border);
	flex: 0 0 auto;
	margin: 0 calc(-1 * max(16px, env(safe-area-inset-right))) 0 calc(-1 * max(16px, env(safe-area-inset-left)));
	min-height: 58px;
	padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-inner > .main-navigation {
	-webkit-overflow-scrolling: touch;
	box-sizing: border-box;
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 14px 0 2px;
	scrollbar-gutter: stable;
	width: 100%;
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-inner > .main-navigation > ul.aam-menu {
	align-content: start;
	display: grid;
	gap: 9px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	height: max-content;
	list-style: none;
	margin: 0;
	min-height: 0;
	padding: 0 0 8px;
	width: 100%;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li {
	float: none;
	margin: 0;
	min-height: 0;
	min-width: 0;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li:not(.aam-role-primary),
html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.menu-item-has-children {
	grid-column: 1 / -1;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-primary {
	grid-column: span var(--aam-primary-span);
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-language {
	grid-column: span 1;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li > a {
	-webkit-tap-highlight-color: transparent;
	align-items: center;
	background: var(--aam-card);
	border: 1px solid var(--aam-border);
	border-radius: var(--aam-radius);
	box-shadow: none;
	box-sizing: border-box;
	color: var(--aam-text);
	display: grid;
	gap: 2px 11px;
	grid-template-columns: 28px minmax(0, 1fr) auto;
	line-height: 1.3;
	margin: 0;
	min-height: 50px;
	padding: 10px 12px;
	inset: auto;
	position: relative;
	text-decoration: none;
	touch-action: manipulation;
	width: 100%;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li > a > i:not(.bs-submenu-toggle),
html.aam-layout-mobile body.aam-mobile-active .aam-menu > li > a > img {
	grid-column: 1;
	grid-row: 1;
	margin: 0;
	max-height: 28px;
	max-width: 28px;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-has-subtitle > a > i:not(.bs-submenu-toggle),
html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-has-subtitle > a > img {
	grid-row: 1 / span 2;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li > a > .link-text,
html.aam-layout-mobile body.aam-mobile-active .aam-menu > li > a > span:not(.count, .notification-count, .aam-item-subtitle) {
	grid-column: 2;
	margin: 0;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: normal;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li > a > .count,
html.aam-layout-mobile body.aam-mobile-active .aam-menu > li > a > .notification-count {
	grid-column: 3;
	grid-row: 1;
	margin: 0 10px 0 0;
	max-width: 72px;
	overflow: hidden;
	position: static;
	text-overflow: ellipsis;
	transform: none;
	white-space: nowrap;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-has-subtitle > a > .count,
html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-has-subtitle > a > .notification-count {
	grid-row: 1 / span 2;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li > a > .aam-item-subtitle {
	grid-column: 2 / 4;
	grid-row: 2;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li > a:hover,
html.aam-layout-mobile body.aam-mobile-active .aam-menu > li > a:focus-visible {
	border-color: var(--aam-accent);
	border-color: color-mix(in srgb, var(--aam-accent) 42%, transparent);
	box-shadow: var(--aam-shadow);
	color: var(--aam-accent);
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.current-menu-item > a,
html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.current-menu-ancestor > a {
	background: var(--aam-active);
	border-color: var(--aam-accent);
	border-color: color-mix(in srgb, var(--aam-accent) 36%, transparent);
	color: var(--aam-accent);
	font-weight: 600;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.current-menu-item > a > i:not(.bs-submenu-toggle),
html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.current-menu-ancestor > a > i:not(.bs-submenu-toggle),
html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.current-menu-item > a > .aam-item-icon,
html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.current-menu-ancestor > a > .aam-item-icon {
	border-color: currentColor;
	color: var(--aam-accent);
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-primary > a {
	align-content: center;
	box-shadow: var(--aam-shadow);
	min-height: 88px;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-section {
	display: block;
	grid-column: 1 / -1;
	min-height: 0;
	position: static;
	width: 100%;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-section > .aam-section-heading {
	background: transparent !important;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--aam-muted);
	display: block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	min-height: 32px;
	padding: 12px 2px 4px;
	position: static;
	text-transform: uppercase;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-section > .aam-section-heading > i,
html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-section > .aam-section-heading > img,
html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-section > .aam-section-heading > svg {
	display: none !important;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-language > a img {
	height: auto !important;
	max-height: none;
	max-width: var(--aam-flag-width) !important;
	object-fit: contain;
	width: var(--aam-flag-width) !important;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-language > a {
	align-items: center;
	display: flex;
	gap: 8px;
	justify-content: flex-start;
	min-height: 50px;
	padding: 8px 10px;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-language > a > i,
html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-language > a > img,
html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-language > a > span {
	flex: 0 0 auto;
	margin: 0;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-language > a > span:not(.count, .notification-count) {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: normal;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-utility > a,
html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-account > a {
	background: transparent;
	box-shadow: none;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-danger > a {
	background: var(--aam-card);
	border-color: var(--aam-border);
	color: var(--aam-text);
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-danger > a:hover {
	background: var(--aam-card);
	background: color-mix(in srgb, var(--aam-danger) 6%, var(--aam-card));
	border-color: var(--aam-danger);
	border-color: color-mix(in srgb, var(--aam-danger) 24%, transparent);
	color: var(--aam-danger);
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-danger > a:active {
	background: var(--aam-card);
	background: color-mix(in srgb, var(--aam-danger) 10%, var(--aam-card));
	border-color: var(--aam-danger);
	border-color: color-mix(in srgb, var(--aam-danger) 32%, transparent);
	color: var(--aam-danger);
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-danger > a:focus-visible {
	background: var(--aam-card);
	border-color: var(--aam-accent);
	box-shadow: var(--aam-focus);
	color: var(--aam-text);
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu .sub-menu {
	background: transparent;
	box-shadow: none;
	box-sizing: border-box;
	grid-column: 1 / -1;
	margin: 5px 0 0;
	padding: 0 0 0 20px;
	position: static;
	width: 100%;
}

html.aam-layout-mobile body.aam-mobile-active .aam-menu .sub-menu a {
	border-radius: 9px;
	box-sizing: border-box;
	inset: auto;
	min-height: 44px;
	position: relative;
	width: 100%;
}
@media screen and (max-width: 359px) {
	html.aam-layout-mobile body.aam-mobile-active .aam-menu > li.aam-role-primary {
		grid-column: 1 / -1;
	}
}

@media screen and (max-width: 782px) {
	html.aam-layout-mobile body.admin-bar.aam-mobile-active .bb-mobile-panel-wrapper {
		height: calc(100vh - 46px);
		height: calc(100dvh - 46px);
	}
}

/* Desktop BuddyPanel: preserve native controls, classes, submenus, and counters. */
/* Layout rules are driven by the early html state class. */
html.aam-layout-desktop body.aam-desktop-active.bb-buddypanel .buddypanel {
	width: var(--aam-collapsed-width);
}

html.aam-layout-desktop body.aam-desktop-active.bb-buddypanel.buddypanel-open .buddypanel {
	width: var(--aam-desktop-width);
}

html.aam-layout-desktop body.aam-desktop-active.bb-buddypanel:not(.bb-buddypanel-right) .site {
	margin-left: var(--aam-collapsed-width);
}

html.aam-layout-desktop body.aam-desktop-active.bb-buddypanel.buddypanel-open:not(.bb-buddypanel-right) .site {
	margin-left: var(--aam-desktop-width);
}

html.aam-layout-desktop body.aam-desktop-active.bb-buddypanel.bb-buddypanel-right .site {
	margin-right: var(--aam-collapsed-width);
}

html.aam-layout-desktop body.aam-desktop-active.bb-buddypanel.buddypanel-open.bb-buddypanel-right .site {
	margin-right: var(--aam-desktop-width);
}

html.aam-layout-desktop body.aam-desktop-active.bb-buddypanel.sticky-header .site-header {
	width: calc(100% - var(--aam-collapsed-width));
}

html.aam-layout-desktop body.aam-desktop-active.bb-buddypanel.buddypanel-open.sticky-header .site-header {
	width: calc(100% - var(--aam-desktop-width));
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel {
	background: var(--aam-card);
	box-shadow: 3px 0 16px rgba(20, 34, 59, 0.07);
	box-shadow: 3px 0 16px color-mix(in srgb, var(--aam-text) 7%, transparent);
}

/*
 * BuddyBoss removes .panel-head when its BuddyPanel toggle is disabled.
 * Restore only that missing vertical reservation when no logo/branding sibling
 * already occupies the space. JS captures the site's native inner padding.
 */
html.aam-layout-desktop body.aam-desktop-active .buddypanel.buddypanel--toggle-off.aam-toggle-off-spacer .side-panel-inner {
	padding-top: calc(var(--bb-header-height, 0px) + var(--aam-toggle-off-native-padding, 0px));
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel.aam-desktop-branding-suppressed > .site-branding,
html.aam-layout-desktop body.aam-desktop-active .buddypanel.aam-desktop-branding-suppressed > .buddypanel-site-icon {
	display: none !important;
}

/*
 * Match BuddyBoss's native logo-off breathing room. BuddyBoss does not add
 * this padding when its logo setting remains on, even though this plugin
 * suppresses the separate BuddyPanel branding row.
 */
html.aam-layout-desktop body.aam-desktop-active .buddypanel.aam-desktop-branding-suppressed.buddypanel--toggle-on .side-panel-inner {
	padding-top: 15px;
}

html.aam-layout-desktop body.aam-desktop-active:not(.buddypanel-open) .buddypanel .bb-toggle-panel {
	margin-left: auto;
	margin-right: auto;
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li {
	box-sizing: border-box;
	margin: 2px 9px;
	min-height: 44px;
}

html.aam-layout-desktop body.aam-desktop-active.aam-spacing-comfortable .buddypanel ul.aam-menu > li {
	margin-bottom: 5px;
	min-height: 50px;
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li > a {
	border: 1px solid transparent;
	border-radius: 9px;
	box-sizing: border-box;
	color: var(--aam-text);
	min-height: 44px;
	padding-bottom: 9px;
	padding-top: 9px;
}

html.aam-layout-desktop body.aam-desktop-active.buddypanel-open .buddypanel ul.aam-menu > li > a {
	bottom: auto;
	left: auto;
	max-width: 100%;
	position: relative;
	right: auto;
	top: auto;
	width: 100%;
}

html.aam-layout-desktop body.aam-desktop-active:not(.buddypanel-open) .buddypanel ul.aam-menu > li:not(.aam-role-section) {
	margin-left: 5px;
	margin-right: 5px;
}

html.aam-layout-desktop body.aam-desktop-active:not(.buddypanel-open) .buddypanel ul.aam-menu > li:not(.aam-role-section) > a {
	bottom: auto;
	justify-content: center;
	left: auto;
	max-width: 100%;
	position: relative;
	right: auto;
	top: auto;
	width: 100%;
}

html.aam-layout-desktop body.aam-desktop-active:not(.buddypanel-open) .buddypanel ul.aam-menu > li:not(.aam-role-section) > a > i:first-child {
	min-width: 0;
	width: auto;
}

html.aam-layout-desktop body.aam-desktop-active:not(.buddypanel-open) .buddypanel ul.aam-menu > li:not(.aam-role-section) > a > span:first-of-type {
	max-width: 0;
	margin: 0;
	opacity: 0;
	overflow: hidden;
	transition: max-width 0.2s ease, opacity 0.12s ease, visibility 0s linear 0.2s;
	visibility: hidden;
	width: 0;
}

html.aam-layout-desktop body.aam-desktop-active:not(.buddypanel-open) .buddypanel ul.aam-menu > li:not(.aam-role-section) > a[data-balloon]::before,
html.aam-layout-desktop body.aam-desktop-active:not(.buddypanel-open) .buddypanel ul.aam-menu > li:not(.aam-role-section) > a[data-balloon]::after {
	display: none !important;
}

body.aam-active .aam-rail-tooltip {
	background: #172033;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 7px;
	box-shadow: 0 5px 16px rgba(20, 34, 59, 0.2);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.25;
	max-width: min(240px, calc(100vw - 24px));
	overflow: hidden;
	padding: 7px 9px;
	pointer-events: none;
	position: fixed;
	text-overflow: ellipsis;
	transform: translateY(-50%);
	white-space: nowrap;
	z-index: 1000;
}

body.aam-active .aam-rail-tooltip[hidden] {
	display: none !important;
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li > a > span:first-of-type {
	color: inherit;
	max-width: calc(var(--aam-desktop-width) - 72px);
	opacity: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: max-width 0.2s ease, opacity 0.14s ease, visibility 0s linear 0s;
	visibility: visible;
	white-space: nowrap;
	width: auto;
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li > a:hover,
html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li > a:focus-visible {
	background: transparent;
	background: color-mix(in srgb, var(--aam-accent) 7%, transparent);
	color: var(--aam-accent);
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li.aam-role-primary > a {
	border-color: var(--aam-accent);
	border-color: color-mix(in srgb, var(--aam-accent) 24%, transparent);
	color: var(--aam-accent);
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li.aam-role-danger > a {
	color: var(--aam-text);
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li.aam-role-danger > a:hover {
	background: transparent;
	background: color-mix(in srgb, var(--aam-danger) 6%, transparent);
	color: var(--aam-danger);
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li.aam-role-danger > a:active {
	background: transparent;
	background: color-mix(in srgb, var(--aam-danger) 10%, transparent);
	color: var(--aam-danger);
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li.aam-role-danger > a:focus-visible {
	background: transparent;
	background: color-mix(in srgb, var(--aam-accent) 7%, transparent);
	box-shadow: var(--aam-focus);
	color: var(--aam-text);
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li.current-menu-item > a,
html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li.current-menu-ancestor > a {
	background: var(--aam-active);
	border-color: var(--aam-accent);
	border-color: color-mix(in srgb, var(--aam-accent) 25%, transparent);
	color: var(--aam-active-contrast, #fff);
	font-weight: 600;
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li.current-menu-item > a > i:first-child,
html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li.current-menu-ancestor > a > i:first-child,
html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li.current-menu-item > a > .aam-item-icon,
html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li.current-menu-ancestor > a > .aam-item-icon {
	color: var(--aam-accent);
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li.aam-role-section {
	margin-top: 8px;
	min-height: 28px;
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li.aam-role-section > .aam-section-heading {
	align-items: center;
	background: transparent !important;
	border: 0;
	box-sizing: border-box;
	color: var(--aam-muted);
	display: flex;
	font-size: 11px;
	letter-spacing: 0.06em;
	min-height: 28px;
	padding-bottom: 5px;
	padding-top: 8px;
	text-transform: uppercase;
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li.aam-role-section > .aam-section-heading > i,
html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li.aam-role-section > .aam-section-heading > img,
html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li.aam-role-section > .aam-section-heading > svg {
	display: none !important;
}

html.aam-layout-desktop body.aam-desktop-active:not(.buddypanel-open) .buddypanel ul.aam-menu > li.aam-role-section {
	min-height: 18px;
}

html.aam-layout-desktop body.aam-desktop-active:not(.buddypanel-open) .buddypanel ul.aam-menu > li.aam-role-section > .aam-section-heading,
html.aam-layout-desktop body.aam-desktop-active:not(.buddypanel-open) .buddypanel .aam-item-subtitle {
	display: none;
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel .aam-item-subtitle {
	display: block;
	font-size: 11px;
	margin-top: 3px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel .aam-role-language img {
	height: auto !important;
	max-width: var(--aam-flag-width) !important;
	width: var(--aam-flag-width) !important;
}

/*
 * Desktop sites can already expose their language picker in the header.
 * Language controls remain in the routed menu for the mobile panel, but are
 * deliberately suppressed in both expanded and collapsed desktop BuddyPanels.
 */
html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li.aam-role-language {
	display: none !important;
}

/*
 * BuddyBoss may hide the desktop menu container at intermediate responsive
 * states. Keep the Academy rail available whenever the plugin selected desktop
 * layout, while preserving BuddyBoss/LearnDash Focus Mode's intentional aside.
 */
html.aam-layout-desktop body.aam-desktop-active:not(.bb-sfwd-aside) .buddypanel .side-panel-inner,
html.aam-layout-desktop body.aam-desktop-active:not(.bb-sfwd-aside) .buddypanel .side-panel-menu-container {
	display: block !important;
	opacity: 1;
	visibility: visible !important;
}

/*
 * A dedicated compositor layer prevents Chrome from retaining hit-test boxes
 * without repainting the fixed desktop BuddyPanel children after live resize.
 */
html.aam-layout-desktop body.aam-desktop-active .buddypanel .side-panel-menu-container.aam-resize-repaint {
	-webkit-backface-visibility: hidden;
	-webkit-transform: translateZ(0);
	backface-visibility: hidden;
	transform: translateZ(0);
}

html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li:not(.aam-role-language):not(.aam-role-hidden):not(.aam-visibility-hidden):not(.aam-has-custom-icon) > a > i:not(.bs-submenu-toggle),
html.aam-layout-desktop body.aam-desktop-active .buddypanel ul.aam-menu > li > a > .aam-item-icon {
	opacity: 1;
	visibility: visible;
}

/* Force the native container that matches the calculated viewport mode. */
html.aam-layout-mobile body.aam-mobile-active .site-header .site-header-container,
html.aam-layout-mobile body.aam-mobile-active aside.buddypanel {
	display: none !important;
}

html.aam-layout-mobile body.aam-mobile-active .bb-mobile-header-wrapper,
html.aam-layout-mobile body.aam-mobile-active .bb-mobile-panel-wrapper {
	display: block !important;
}

html.aam-layout-mobile body.aam-mobile-active.bb-buddypanel .site {
	margin-left: 0;
	margin-right: 0;
}

html.aam-layout-mobile body.aam-mobile-active.bb-buddypanel.sticky-header .site-header {
	width: 100%;
}

html.aam-layout-desktop body.aam-desktop-active .bb-mobile-header-wrapper,
html.aam-layout-desktop body.aam-desktop-active .bb-mobile-panel-wrapper {
	display: none !important;
}

html.aam-layout-desktop body.aam-desktop-active aside.buddypanel {
	display: block !important;
}

html.aam-layout-desktop body.aam-desktop-active .site-header .site-header-container {
	display: flex !important;
}

@media (prefers-reduced-motion: reduce) {
	body.aam-active .bb-mobile-panel-wrapper,
	body.aam-active .buddypanel,
	body.aam-active .site,
	body.aam-active .site-header,
	body.aam-active .aam-menu a,
	body.aam-active .aam-menu span {
		scroll-behavior: auto;
		transition-duration: 0.01ms !important;
	}
}
