.mks-gre-lms-pwa-install {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 9998;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 18px;
	border: 1px solid #6d28d9;
	border-radius: 999px;
	background: linear-gradient(135deg, #a66bff 0%, #8746f1 48%, #6223bc 100%);
	color: #ffffff;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.1;
	box-shadow: 0 14px 28px rgba(91, 33, 182, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.24);
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
	max-width: min(calc(100vw - 24px), 240px);
}

.mks-gre-lms-pwa-header-host {
	position: relative;
}

.mks-gre-lms-pwa-header-slot {
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	flex: 0 0 auto;
	margin-left: 10px;
}

.mks-gre-lms-pwa-install.is-header {
	position: relative;
	right: auto;
	bottom: auto;
	z-index: auto;
	width: 48px;
	height: 48px;
	min-width: 48px;
	min-height: 48px;
	padding: 0;
	border-color: rgba(167, 139, 250, 0.7);
	border-radius: 14px;
	background: #1c1534;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
	line-height: 1;
	max-width: none;
}

.mks-gre-lms-pwa-install.is-header svg {
	width: 25px;
	height: 25px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.mks-gre-lms-pwa-install:hover {
	transform: translateY(-1px);
	filter: saturate(1.03);
	box-shadow: 0 18px 32px rgba(76, 29, 149, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.mks-gre-lms-pwa-install.is-header:hover {
	background: #332356;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mks-gre-lms-pwa-install[hidden] {
	display: none !important;
}

.mks-gre-lms-pwa-nav-controls {
	position: fixed;
	left: calc(env(safe-area-inset-left, 0px) + 12px);
	top: calc(env(safe-area-inset-top, 0px) + 12px);
	z-index: 100000;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 144px;
	height: 48px;
	padding: 5px;
	border: 1px solid rgba(255, 255, 255, 0.32);
	border-radius: 18px;
	background: rgba(15, 23, 42, 0.58);
	box-shadow: 0 14px 30px rgba(2, 6, 23, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	box-sizing: border-box;
	opacity: 0;
	pointer-events: none;
	transform: translateY(-2px);
	transition: opacity 0.16s ease, transform 0.16s ease;
}

/* Keep the compact controls crisp over the solid course toolbar in the
 * installed PWA. A translucent backdrop here blurs the toolbar edge on iOS. */
body.gre-lms-course-page .mks-gre-lms-pwa-nav-controls {
	background: #351464;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
}

body.gre-lms-course-page .mks-ai-root:not(.is-open) .mks-ai-launch {
	box-shadow: none;
}

.mks-gre-lms-pwa-nav-controls.is-ready {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

.mks-gre-lms-pwa-nav-controls.is-inline {
	position: static !important;
	left: auto !important;
	top: auto !important;
	z-index: 2;
	flex: 0 0 96px;
	order: 2;
	width: 96px;
	height: 36px;
	margin: 0 !important;
	padding: 3px;
	gap: 3px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.1);
	box-shadow: none;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	transform: none;
}

.mks-gre-lms-pwa-nav-controls.is-inline .mks-gre-lms-pwa-nav-control {
	width: 28px;
	height: 28px;
	border-radius: 8px;
	box-shadow: none;
}

.mks-gre-lms-pwa-nav-controls.is-inline .mks-gre-lms-pwa-nav-control--back {
	border-radius: 999px;
}

.mks-gre-lms-pwa-nav-controls.is-inline .mks-gre-lms-pwa-nav-control svg {
	width: 17px;
	height: 17px;
}

#mobile-header .site-header-section-left > .mks-gre-lms-pwa-nav-controls.is-inline {
	margin-left: auto !important;
	margin-right: 8px !important;
}

.mks-gre-lms-pwa-nav-controls[hidden] {
	display: none !important;
}

/* The parent course shell already provides PWA navigation. Do not repeat it
 * inside lesson/test iframes embedded by that shell. */
body.gre-lms-course-embed-body .mks-gre-lms-pwa-nav-controls {
	display: none !important;
}

.mks-gre-lms-pwa-nav-control {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	height: 38px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.34);
	background: rgba(255, 255, 255, 0.13);
	color: #ffffff;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
	cursor: pointer;
	transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box;
}

.mks-gre-lms-pwa-nav-control--back {
	width: 38px;
	border-radius: 999px;
}

.mks-gre-lms-pwa-nav-control--home {
	width: 38px;
	border-radius: 10px;
}

.mks-gre-lms-pwa-nav-control--refresh {
	width: 38px;
	border-radius: 10px;
}

.mks-gre-lms-pwa-nav-control svg {
	width: 21px;
	height: 21px;
	display: block;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.45;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.mks-gre-lms-pwa-nav-control:hover {
	background: rgba(255, 255, 255, 0.22);
	border-color: rgba(255, 255, 255, 0.52);
	transform: translateY(-1px);
	box-shadow: 0 10px 18px rgba(2, 6, 23, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mks-gre-lms-pwa-nav-control:active {
	transform: translateY(0);
	background: rgba(255, 255, 255, 0.16);
}

.mks-gre-lms-pwa-nav-control:focus-visible {
	outline: 3px solid rgba(255, 255, 255, 0.38);
	outline-offset: 2px;
}

.mks-gre-lms-pwa-toast {
	position: fixed;
	left: 50%;
	bottom: 82px;
	z-index: 9998;
	display: grid;
	gap: 6px;
	transform: translateX(-50%);
	width: min(calc(100vw - 24px), 360px);
	padding: 14px 16px;
	border: 1px solid rgba(109, 40, 217, 0.22);
	border-radius: 18px;
	background: rgba(15, 23, 42, 0.94);
	color: #f8fafc;
	box-shadow: 0 18px 44px rgba(15, 23, 42, 0.34);
}

.mks-gre-lms-pwa-toast[hidden] {
	display: none !important;
}

.mks-gre-lms-pwa-toast strong {
	font-size: 15px;
	line-height: 1.25;
}

.mks-gre-lms-pwa-toast p {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: #e2e8f0;
}

/* A viewport-constrained edge guard suppresses the native iOS standalone
 * scroll-edge pocket without covering or intercepting the page controls. */
.mks-gre-lms-pwa-scroll-edge-guard {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 2147483646;
	height: 1px;
	background: #000000;
	pointer-events: none;
}

/* Keep the installed iOS PWA status area and mobile header as one solid
 * surface. This is standalone-only so normal Safari/Chrome pages retain the
 * theme's regular header treatment. */
@media (display-mode: standalone) and (max-width: 1024px) {
	#mobile-header,
	#mobile-header .site-header-row,
	#mobile-header .site-header-row-container-inner {
		background-color: #000000 !important;
		box-shadow: none !important;
		filter: none !important;
		backdrop-filter: none !important;
		-webkit-backdrop-filter: none !important;
	}
}

@media (max-width: 767px) {
	.mks-gre-lms-pwa-install:not(.is-header) {
		display: none !important;
	}

	.mks-gre-lms-pwa-nav-controls {
		width: 144px;
		border-radius: 17px;
	}

	.mks-gre-lms-pwa-nav-controls.is-inline {
		width: 96px;
		border-radius: 12px;
	}
}

@media (max-width: 430px) {
	.mks-gre-lms-pwa-nav-controls.is-inline {
		flex-basis: 88px;
		width: 88px;
		gap: 2px;
	}

	.mks-gre-lms-pwa-nav-controls.is-inline .mks-gre-lms-pwa-nav-control {
		width: 26px;
		height: 26px;
	}
}

.mks-gre-lms-pwa-toast-close {
	justify-self: end;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 999px;
	background: transparent;
	color: #ffffff;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.mks-gre-lms-pwa-toast-close:hover {
	background: rgba(255, 255, 255, 0.08);
}

/* Align the Kadence header with the GRE logo, navigation controls, menu,
 * utility icons, and account control in that reading order. */
@media (min-width: 1025px) {
	#masthead .site-top-header-wrap .site-container {
		max-width: none !important;
	}

	#masthead .site-top-header-inner-wrap {
		grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr) !important;
		align-items: center;
	}

	#masthead .site-header-top-section-center {
		grid-column: 1;
		grid-row: 1;
		justify-self: start;
	}

	#masthead .site-header-top-section-left {
		grid-column: 2;
		grid-row: 1;
		justify-self: center;
	}

	#masthead .site-header-top-section-right {
		grid-column: 3;
		grid-row: 1;
		justify-self: end;
		gap: 12px;
	}

	#masthead .site-header-top-section-center > .site-header-item {
		display: flex;
		align-items: center;
		gap: 12px;
	}

	#masthead .mks-gre-lms-pwa-nav-controls.is-inline {
		flex-basis: 132px;
		width: 132px;
		height: 44px;
		padding: 3px;
		gap: 3px;
	}

	#masthead .mks-gre-lms-pwa-nav-controls.is-inline .mks-gre-lms-pwa-nav-control {
		width: 39px;
		height: 36px;
	}

}

@media (max-width: 1024px) {
	#mobile-header .site-top-header-wrap .site-container {
		max-width: none !important;
	}

	#mobile-header .site-top-header-inner-wrap {
		display: flex !important;
		align-items: center;
		gap: 4px;
	}

	#mobile-header .site-header-top-section-center {
		order: 1;
		flex: 0 0 auto;
		width: auto !important;
	}

	#mobile-header .site-header-top-section-left {
		order: 2;
		flex: 0 0 auto;
		width: auto !important;
		gap: 4px;
	}

	#mobile-header .site-header-top-section-right {
		order: 3;
		flex: 0 0 auto;
		width: auto !important;
		margin-left: auto;
		gap: 4px;
	}

	#mobile-header .site-header-top-section-left > .mks-gre-lms-pwa-header-controls.is-inline {
		order: 1;
		margin: 0 !important;
	}

	#mobile-header .site-header-top-section-left > .site-header-item {
		order: 2;
	}

	#mobile-header .site-branding a.brand img {
		max-width: 65px;
		max-height: 44px;
	}

	#mobile-header .mks-gre-lms-pwa-nav-controls.is-inline {
		flex-basis: 80px;
		width: 80px;
		height: 34px;
		gap: 2px;
		padding: 2px;
	}

	#mobile-header .mks-gre-lms-pwa-nav-controls.is-inline .mks-gre-lms-pwa-nav-control {
		width: 24px;
		height: 28px;
	}

	#mobile-header .menu-toggle-open {
		width: 34px;
		height: 34px;
	}

	#mobile-header .mks-gre-lms-pwa-install.is-header {
		width: 36px;
		height: 36px;
		min-width: 36px;
		min-height: 36px;
		border-radius: 10px;
	}
}

@media (max-width: 360px) {
	#mobile-header .site-branding a.brand img {
		max-width: 50px;
	}

	#mobile-header .mks-gre-lms-pwa-nav-controls.is-inline {
		flex-basis: 72px;
		width: 72px;
	}

	#mobile-header .mks-gre-lms-pwa-nav-controls.is-inline .mks-gre-lms-pwa-nav-control {
		width: 21px;
	}
}
