/* ==========================================================================
   MSM Tools — Layout
   Navigation, mega-menu, header search, page headers, footer.
   Replaces the ~370 lines of CSS the original main.js injected at runtime.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */
.navbar {
	position: fixed;
	top: 0;
	inset-inline-start: 0;
	z-index: 999;
	width: 100%;
	margin: 0;
	background: var(--nav-bg);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border-bottom: 1px solid var(--card-border-soft);
	transition: background 0.3s;
}

.navbar .container {
	position: relative;
	/*
	 * Three tracks rather than space-between: the outer columns share the
	 * leftover width evenly, so the menu stays centred on the viewport even
	 * when the logo and the action cluster are different widths.
	 */
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 18px;
	height: var(--nav-height);
}

.navbar .container > .logo,
.navbar .container > .site-branding {
	justify-self: start;
}

.navbar .nav-links {
	justify-self: center;
}

.logo {
	flex: 0 1 auto;
	min-width: 0;
	font-size: 1.6rem;
	font-weight: 700;
	letter-spacing: -0.5px;
	line-height: 1;
	white-space: nowrap;
}

.logo a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: inherit;
}

.logo span {
	background: var(--msm-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
	font-weight: 700;
}

.logo img {
	max-height: 40px;
	width: auto;
}

/* Primary links */
.nav-links {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 24px;
	font-size: 0.95rem;
	font-weight: 500;
}

.nav-links li {
	display: flex;
	align-items: center;
}

.nav-links a {
	color: var(--text-nav);
	transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active,
.nav-links .current-menu-item > a,
.nav-links .current-menu-parent > a {
	color: var(--link-hover);
}

/* Actions cluster */
.nav-actions {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	flex-shrink: 0;
	align-items: center;
	justify-self: end;
	gap: 18px;
}

.nav-actions button,
.nav-actions .msm-icon {
	color: var(--text-nav);
	transition: color 0.2s ease, transform 0.2s ease;
}

.nav-actions button:hover .msm-icon,
.nav-actions button:hover {
	color: var(--link-hover);
	transform: scale(1.1);
}

.theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px;
	font-size: 1.15rem;
	line-height: 1;
}

.login-btn {
	padding: 6px 16px;
	border: 1.5px solid var(--msm-brand);
	border-radius: 40px;
	color: var(--msm-brand);
	font-weight: 600;
	font-size: 0.9rem;
	background: transparent;
	transition: background 0.2s, color 0.2s;
}

.login-btn:hover {
	background: var(--msm-brand);
	color: var(--msm-on-brand);
}

.hamburger {
	display: none;
	font-size: 1.3rem;
	line-height: 1;
	color: var(--text-nav);
}

/* --------------------------------------------------------------------------
   Mega menu
   -------------------------------------------------------------------------- */
.nav-links li.dropdown {
	position: static;
}

.nav-links li.dropdown .dropdown-toggle {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--text-nav);
	font-weight: 500;
	cursor: pointer;
}

.nav-links li.dropdown .dropdown-toggle .msm-icon {
	font-size: 0.75rem;
	transition: transform 0.25s ease;
}

.nav-links li.dropdown:hover .dropdown-toggle .msm-icon,
.nav-links li.dropdown.open .dropdown-toggle .msm-icon {
	transform: rotate(180deg);
}

.mega-menu {
	position: absolute;
	top: calc(100% + 4px);
	inset-inline-end: 0;
	inset-inline-start: 0;
	z-index: 1000;
	display: none;
	width: 100%;
	padding: 20px 18px;
	background: var(--card-solid);
	border: 1px solid var(--card-border);
	border-radius: var(--radius-md);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

body.dark .mega-menu {
	background: #1c1917;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

/* Hover bridge so the menu survives the 4px gap */
.mega-menu::before {
	content: '';
	position: absolute;
	top: -16px;
	inset-inline-start: 0;
	width: 100%;
	height: 16px;
}

.mega-column {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
	overflow: hidden;
}

.mega-category-title {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-bottom: 4px;
	padding-bottom: 6px;
	border-bottom: 2px solid rgba(var(--msm-brand-rgb), 0.15);
	color: var(--msm-brand);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color 0.2s;
}


.mega-category-title:hover {
	color: var(--msm-brand-hover);
}

.mega-link {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 4px 6px;
	border-radius: 6px;
	color: var(--text-nav);
	font-size: 0.78rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: background 0.15s, color 0.15s;
}

.mega-link:hover {
	background: var(--msm-brand-soft);
	color: var(--msm-brand);
}


@media (min-width: 1200px) {
	.mega-menu {
		grid-template-columns: repeat(7, minmax(0, 1fr));
		gap: 10px;
	}
}

@media (min-width: 992px) and (max-width: 1199px) {
	.mega-menu {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 14px;
	}
}

@media (min-width: 992px) {
	.nav-links li.dropdown:hover .mega-menu,
	.nav-links li.dropdown.open .mega-menu {
		display: grid;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}
}

/* --------------------------------------------------------------------------
   Header search
   -------------------------------------------------------------------------- */
.nav-search-wrapper {
	position: relative;
	display: flex;
	align-items: center;
}

.nav-search-icon {
	display: inline-flex;
	padding: 6px;
	font-size: 1.15rem;
	line-height: 1;
	color: var(--text-nav);
	transition: color 0.2s, transform 0.2s;
}

.nav-search-icon:hover {
	color: var(--msm-brand);
	transform: scale(1.1);
}

.nav-search-input-box {
	position: absolute;
	top: 50%;
	inset-inline-end: 0;
	z-index: 1005;
	display: none;
	align-items: center;
	width: 250px;
	padding: 4px 10px;
	background: var(--card-solid);
	border: 1.5px solid rgba(var(--msm-brand-rgb), 0.6);
	border-radius: 20px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
	transform: translateY(-50%);
}

body.dark .nav-search-input-box {
	border-color: rgba(129, 140, 248, 0.6);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.nav-search-input-box.active {
	display: flex;
	animation: msmPopIn 0.2s ease-out;
}

.nav-search-input-box input {
	width: 100%;
	min-width: 0;
	padding: 4px 8px;
	border: none;
	outline: none;
	background: transparent;
	color: var(--text-primary);
	font-size: 0.88rem;
}

/*
 * type="search" draws a clear control of its own in WebKit and Blink, which
 * sat next to the theme's close button: two crosses, one clearing the field
 * and one closing the panel, with nothing to tell them apart.
 */
.nav-search-input-box input::-webkit-search-cancel-button,
.nav-search-input-box input::-webkit-search-decoration {
	-webkit-appearance: none;
	appearance: none;
}

.nav-search-close {
	flex-shrink: 0;
	padding: 4px;
	font-size: 0.85rem;
	line-height: 1;
	color: var(--text-muted);
	transition: color 0.2s;
}

.nav-search-close:hover {
	color: var(--msm-danger);
}

.nav-search-results {
	position: absolute;
	top: calc(100% + 12px);
	inset-inline-end: 0;
	z-index: 1006;
	display: none;
	width: 330px;
	max-height: 380px;
	padding: 6px 0;
	overflow-y: auto;
	background: var(--card-solid);
	border: 1px solid var(--card-border);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-pop);
}

body.dark .nav-search-results {
	background: var(--bg-surface-alt);
}

.nav-search-results.active {
	display: block;
	animation: msmPopIn 0.2s ease-out;
}

/*
 * Hero variant. The header dropdown is a fixed 330px pinned to the right of
 * the navbar; under the hero search it should track the input instead.
 */
#heroSearchResults {
	top: calc(100% + 10px);
	inset-inline-end: auto;
	inset-inline-start: 0;
	width: 100%;
	max-height: 420px;
	text-align: start;
}

.search-result-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	border-bottom: 1px solid var(--card-border);
	color: var(--text-primary);
	transition: background 0.15s ease;
}

.search-result-item:last-child {
	border-bottom: none;
}

.search-result-item:hover,
.search-result-item.selected {
	background: var(--msm-brand-soft);
}

body.dark .search-result-item:hover,
body.dark .search-result-item.selected {
	background: rgba(99, 102, 241, 0.25);
}

.search-result-icon {
	flex-shrink: 0;
	font-size: 1.2rem;
}

.search-result-details {
	display: flex;
	flex-direction: column;
	gap: 2px;
	overflow: hidden;
}

.search-result-title {
	font-size: 0.88rem;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.search-result-title mark {
	background: none;
	color: var(--msm-brand);
	font-weight: 700;
	text-decoration: underline;
}


.search-result-meta {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.75rem;
	color: var(--text-muted);
}

.search-result-meta > span:last-child {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.search-result-badge {
	flex-shrink: 0;
	padding: 1px 6px;
	border-radius: 4px;
	background: rgba(var(--msm-brand-rgb), 0.12);
	color: var(--msm-brand);
	font-size: 0.7rem;
	font-weight: 500;
}


.search-no-results {
	padding: 16px;
	color: var(--text-muted);
	font-size: 0.88rem;
	text-align: center;
}

/* --------------------------------------------------------------------------
   Page header
   Left-aligned and shallow: the visitor searched for the tool, so the banner's
   job is to confirm they are in the right place and then get out of the way.
   -------------------------------------------------------------------------- */
.page-header {
	position: relative;
	padding: 44px 0 34px;
	overflow: hidden;
	border-bottom: 1px solid var(--card-border);
	background: radial-gradient(760px 240px at 50% -40%, var(--msm-brand-soft), transparent 70%);
	text-align: center;
}

.page-header > .container {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.page-header-kicker {
	display: flex;
	align-items: center;
	gap: 9px;
	margin-bottom: 14px;
	color: var(--msm-brand);
	font-family: var(--msm-font-mono);
	font-size: 0.6rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.page-header-kicker::before,
.page-header-kicker::after {
	content: "";
	width: 24px;
	height: 1px;
	background: var(--msm-brand);
}

.page-header h1 {
	max-width: 24ch;
	margin-bottom: 0;
	font-size: clamp(1.75rem, 4vw, 2.6rem);
	font-weight: 700;
	line-height: 1.14;
}

.page-header p {
	max-width: 64ch;
	margin: 12px 0 0;
	color: var(--text-secondary);
	font-size: 1.05rem;
}

.page-header-facts {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 18px;
	margin-top: 18px;
	color: var(--text-muted);
	font-family: var(--msm-font-mono);
	font-size: 0.72rem;
}

.page-header-facts span::before {
	content: "\25CF";
	margin-inline-end: 7px;
	color: var(--msm-brand);
}

.msm-breadcrumbs {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 16px;
	color: var(--text-muted);
	font-family: var(--msm-font-mono);
	font-size: 0.72rem;
}

.msm-breadcrumbs a:hover {
	color: var(--msm-brand);
}

@media (max-width: 620px) {
	.page-header {
		padding: 30px 0 26px;
	}

	.page-header h1 {
		font-size: clamp(1.55rem, 7vw, 2rem);
	}

	.page-header p {
		font-size: 0.98rem;
	}
}


/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
	margin-top: 60px;
	padding: 48px 0 24px;
	background: var(--msm-gradient);
	color: var(--msm-on-brand);
}

.footer-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 32px;
	margin-bottom: 32px;
}

.footer-grid h5 {
	margin-bottom: 14px;
	font-size: 1.1rem;
	font-weight: 600;
	color: #fff;
}

.footer-grid ul li {
	margin-bottom: 8px;
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.85);
	transition: color 0.2s, transform 0.2s;
}

.footer-grid ul li:hover {
	color: #fff;
	transform: translateX(4px);
}

[dir="rtl"] .footer-grid ul li:hover {
	transform: translateX(-4px);
}

.footer-logo {
	margin-bottom: 12px;
	font-size: 1.6rem;
	font-weight: 700;
	letter-spacing: -0.5px;
}

.footer-logo a {
	color: #fff;
}

.footer-about {
	margin-bottom: 12px;
	font-size: 0.85rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.85);
}

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 16px;
	padding-top: 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.8);
}

.social-icons {
	display: flex;
	align-items: center;
	gap: 14px;
}

.social-icons a {
	color: #fff;
	font-size: 1.2rem;
	line-height: 1;
	transition: transform 0.3s;
}

.social-icons a:hover {
	transform: scale(1.2) rotate(-5deg);
}

/* --------------------------------------------------------------------------
   Responsive navigation
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
	/*
	 * The blur is deliberately dropped here. An element with backdrop-filter
	 * becomes the containing block for its fixed descendants, so the drawer
	 * below — fixed, inset to top/right/bottom — was sizing itself against
	 * the 72px header rather than the viewport and opening as a sliver
	 * clipped to the bar. Removing the filter hands the viewport back. The
	 * bar has to go solid in exchange, because --nav-bg is translucent and
	 * was relying on the blur to stop content reading through it.
	 */
	.navbar {
		background: var(--bg-surface);
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
	}

	.navbar .container {
		grid-template-columns: 1fr auto;
		height: var(--nav-height);
	}

	.hamburger {
		display: inline-flex;
	}

	/*
	 * Below the desktop breakpoint the menu becomes a drawer anchored to the
	 * right edge rather than a panel pushed under the bar, so the header keeps
	 * its height on every page and the list scrolls on its own.
	 */
	.navbar .nav-links {
		position: fixed;
		top: 0;
		inset-inline-end: 0;
		bottom: 0;
		z-index: 1200;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
		width: min(84vw, 340px);
		max-width: 100%;
		margin: 0;
		padding: calc(var(--nav-height) + 12px) 16px 28px;
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
		background: var(--card-solid);
		border-inline-start: 1px solid var(--card-border);
		border-radius: 0;
		box-shadow: -18px 0 40px rgba(0, 0, 0, 0.16);
		transform: translateX(100%);
	}

	/* The drawer parks off the closing edge, which swaps sides with the
	   document direction; the shadow it casts back over the page swaps with
	   it. Neither property has a logical form. */
	[dir="rtl"] .navbar .nav-links {
		box-shadow: 18px 0 40px rgba(0, 0, 0, 0.16);
		transform: translateX(-100%);
		visibility: hidden;
		transition: transform 0.24s ease, visibility 0.24s;
	}

	.navbar .nav-links.active {
		transform: none;
		visibility: visible;
	}

	/*
	 * Dims the page behind the open drawer and closes it on tap.
	 *
	 * Deliberately below the navbar's 999. The scrim is a child of body, in
	 * the root stacking context, while the drawer is inside the navbar and so
	 * can never paint above 999 whatever its own z-index says. A scrim above
	 * that number therefore covers the drawer and eats every click meant for
	 * a link in it. The header is left undimmed as a result, which reads as
	 * intended now the mobile bar is opaque: bar and drawer sit together
	 * above a dimmed page.
	 */
	.nav-scrim {
		position: fixed;
		inset: 0;
		z-index: 998;
		background: rgba(28, 25, 23, 0.45);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.2s;
	}

	.nav-scrim.active {
		opacity: 1;
		pointer-events: auto;
	}

	body.nav-open {
		overflow: hidden;
	}

	.nav-links > li > a {
		display: block;
		width: 100%;
		padding: 13px 12px;
		border-radius: var(--radius-sm);
		font-size: 1.02rem;
	}

	.nav-links > li > a:hover {
		background: var(--bg-surface-alt);
	}

	body.dark .navbar .nav-links {
		box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	}

	.navbar .nav-links.active {
		display: flex;
	}

	.nav-links li {
		width: 100%;
	}

	.mega-menu {
		position: static;
		display: none;
		width: 100%;
		padding: 10px 0 0;
		padding-inline-start: 12px;
		background: transparent;
		border: none;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}

	.nav-links li.dropdown.open .mega-menu {
		display: flex;
		flex-direction: column;
		gap: 12px;
	}
}

@media (max-width: 600px) {
	/* Logo and the actions cluster must share one row on every page. */
	.logo {
		font-size: 1.35rem;
	}

	.logo img {
		max-height: 32px;
	}

	.nav-actions {
		gap: 12px;
	}

	.nav-search-results {
		max-height: 320px;
	}
}

/*
 * Header search below the desktop breakpoint.
 *
 * Both panels are absolutely positioned and were anchored to
 * .nav-search-wrapper, which is the search icon itself, sitting to the left
 * of the language switcher, the theme toggle and the hamburger. A fixed
 * 200px box and a 100vw dropdown hung from that point both ran off the left
 * edge of the screen: the placeholder lost its first characters and the
 * results panel lost the start of every tool name, which on a list of
 * "...calculator" and "...generator" is the half that tells them apart.
 *
 * Making the wrapper static hands the positioning context to
 * .navbar .container, which is already relative and already spans the header
 * with the same gutters as the logo. Anchoring both edges then gives the
 * full-width field on open and the dropdown beneath it, and neither can
 * leave the viewport whatever the icon's position in the bar. Closing puts
 * the box back to display:none and the icon returns.
 */
@media (max-width: 900px) {
	.nav-search-wrapper {
		position: static;
	}

	.nav-search-input-box {
		inset-inline: 0;
		width: auto;
	}

	.nav-search-results {
		inset-inline: 0;
		width: auto;
	}
}

/* --------------------------------------------------------------------------
   Language switcher
   -------------------------------------------------------------------------- */
.lang {
	position: relative;
}

.lang-btn {
	display: flex;
	align-items: center;
	gap: 7px;
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--card-border);
	border-radius: 40px;
	background: var(--bg-surface);
	color: var(--text-nav);
	font: inherit;
	font-size: 0.82rem;
	font-weight: 700;
	cursor: pointer;
	transition: border-color 0.2s, color 0.2s;
}

.lang-btn:hover,
.lang-btn[aria-expanded="true"] {
	border-color: var(--msm-brand);
	color: var(--msm-brand);
}

.lang-btn .msm-icon {
	width: 0.95em;
	height: 0.95em;
}

.lang-btn .caret .msm-icon {
	width: 0.62em;
	height: 0.62em;
	opacity: 0.6;
	transition: transform 0.2s;
}

.lang-btn[aria-expanded="true"] .caret .msm-icon {
	transform: rotate(180deg);
}

.lang-code {
	letter-spacing: 0.04em;
}

.lang-menu {
	position: absolute;
	top: 46px;
	inset-inline-end: 0;
	min-width: 220px;
	padding: 6px;
	background: var(--card-solid);
	border: 1px solid var(--card-border);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
	z-index: 60;
}

.lang.open .lang-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.lang-menu a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: var(--radius-sm);
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--text-primary);
}

.lang-menu a:hover,
.lang-menu a:focus-visible {
	background: var(--bg-surface-alt);
}

.lang-menu a.is-on {
	background: var(--msm-brand-soft);
	color: var(--msm-brand);
}

.lang-native {
	display: block;
}

.lang-sub {
	display: block;
	font-size: 0.74rem;
	font-weight: 500;
	color: var(--text-muted);
}

.lang-tick {
	margin-inline-start: auto;
	color: var(--msm-brand);
}

.lang-tick .msm-icon {
	width: 0.8em;
	height: 0.8em;
}

/*
 * Flags are drawn in CSS. An emoji flag depends on a font the visitor may not
 * have, and an image would be a request per language for 26 pixels.
 */
.lang-flag {
	flex-shrink: 0;
	width: 26px;
	height: 19px;
	border: 1px solid var(--card-border);
	border-radius: 3px;
	overflow: hidden;
}

.flag-en {
	background: #012169;
	position: relative;
}

.flag-en::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(#fff 42%, transparent 42% 58%, #fff 58%) 0 0 / 100% 100% no-repeat,
		linear-gradient(90deg, transparent 40%, #fff 40% 60%, transparent 60%);
}

.flag-en::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(transparent 45%, #c8102e 45% 55%, transparent 55%),
		linear-gradient(90deg, transparent 43%, #c8102e 43% 57%, transparent 57%);
}

.flag-de {
	background: linear-gradient(#000 0 33.33%, #dd0000 33.33% 66.66%, #ffce00 66.66%);
}

/*
 * Pakistan: a white hoist band on the left quarter, dark green field, and the
 * crescent and star as a masked disc. Drawn rather than set as an emoji or an
 * image for the same reason as the others — the star is approximated with a
 * radial dot, which reads correctly at 26px and would be mush at any smaller
 * size anyway.
 */
.flag-ur {
	position: relative;
	background: linear-gradient(90deg, #fff 0 25%, #01411c 25%);
}

.flag-ur::before {
	content: "";
	position: absolute;
	inset-inline-start: 44%;
	top: 26%;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #fff;
}

.flag-ur::after {
	content: "";
	position: absolute;
	inset-inline-start: 47%;
	top: 22%;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #01411c;
	box-shadow: 5px 4px 0 -3.2px #fff;
}

.footer-langs {
	display: flex;
	align-items: center;
	gap: 8px;
}

.footer-langs a {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 6px 13px;
	border: 1px solid var(--card-border);
	border-radius: 40px;
	background: var(--bg-surface);
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--text-secondary);
	transition: border-color 0.2s, color 0.2s;
}

.footer-langs a:hover {
	border-color: var(--msm-brand);
	color: var(--msm-brand);
}

.footer-langs a.is-on {
	background: var(--msm-brand);
	border-color: var(--msm-brand);
	color: var(--msm-on-brand);
}

@media (max-width: 900px) {
	.lang-menu {
		inset-inline-end: -8px;
		min-width: 200px;
	}

	.lang-btn {
		padding: 0 10px;
	}

	.lang-sub {
		display: none;
	}

	.lang-menu a {
		padding: 13px 12px;
	}
}

/* --------------------------------------------------------------------------
   Language suggestion bar
   Pinned to the bottom so revealing it never shifts the page: a top bar
   inserted after first paint pushes everything down and is scored as layout
   shift on every page that shows it.
   -------------------------------------------------------------------------- */
.lang-suggest {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 70;
	background: var(--card-solid);
	border-top: 1px solid var(--card-border);
	box-shadow: 0 -18px 36px -18px rgba(0, 0, 0, 0.14);
	animation: lang-suggest-in 0.25s ease-out;
}

.lang-suggest[hidden],
.lang-suggest-offer[hidden] {
	display: none;
}

.lang-suggest-offer {
	display: flex;
	align-items: center;
	gap: 14px;
	max-width: var(--container);
	margin-inline: auto;
	padding: 12px 22px;
	padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.lang-suggest-text {
	flex-grow: 1;
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--text-primary);
}

.lang-suggest-go {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 20px;
	border-radius: var(--radius-sm);
	background: var(--msm-brand);
	color: var(--msm-on-brand);
	font-family: var(--msm-font-display);
	font-size: 0.9rem;
	font-weight: 700;
	text-decoration: none;
}

.lang-suggest-go:hover {
	background: var(--msm-brand-hover);
	color: var(--msm-on-brand);
}

.lang-suggest-go[lang="ur"] {
	font-family: inherit;
	font-weight: 600;
}

.lang-suggest-close {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--text-muted);
	cursor: pointer;
}

.lang-suggest-close:hover {
	background: var(--bg-surface-alt);
	color: var(--text-primary);
}

.lang-suggest-go:focus-visible,
.lang-suggest-close:focus-visible {
	outline: 2px solid var(--msm-brand);
	outline-offset: 2px;
}

.lang-suggest-close .msm-icon {
	width: 16px;
	height: 16px;
}

@keyframes lang-suggest-in {
	from {
		transform: translateY(100%);
	}
}

@media (max-width: 640px) {
	.lang-suggest-offer {
		flex-wrap: wrap;
		gap: 10px;
		padding-inline: 14px;
	}

	.lang-suggest-text {
		flex-basis: 0;
		min-width: 0;
		font-size: 0.9rem;
	}

	.lang-suggest-go {
		flex-basis: 100%;
		order: 3;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lang-suggest {
		animation: none;
	}
}
