.ntst-pwa-install {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 99990;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 15px;
	border: 1px solid currentColor;
	border-radius: 999px;
	background: #111;
	color: #fff;
	font: inherit;
	font-size: 14px;
	line-height: 1;
	box-shadow: 0 8px 26px rgba(0, 0, 0, .18);
	cursor: pointer;
}

.ntst-pwa-install[hidden] {
	display: none !important;
}

.ntst-pwa-install:hover,
.ntst-pwa-install:focus-visible {
	transform: translateY(-1px);
}

.ntst-pwa-install:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.ntst-pwa-install > span {
	font-size: 20px;
	font-weight: 400;
	line-height: 1;
}

@media (max-width: 600px) {
	.ntst-pwa-install {
		right: 12px;
		bottom: 12px;
		max-width: calc(100vw - 24px);
	}
}

/* Installed-app bottom navigation. Hidden in normal browser tabs by JavaScript. */
.ntst-pwa-nav {
	position: fixed;
	left: 50%;
	bottom: 0;
	z-index: 99980;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr);
	width: min(100%, 680px);
	padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
	border: 1px solid rgba(0, 0, 0, .12);
	border-bottom: 0;
	border-radius: 16px 16px 0 0;
	background: rgba(255, 255, 255, .96);
	box-shadow: 0 -7px 28px rgba(0, 0, 0, .12);
	backdrop-filter: blur(12px);
	transform: translateX(-50%);
}

.ntst-pwa-nav-item {
	display: flex;
	align-items: center;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
	padding: 6px 4px;
	border-radius: 10px;
	color: #4b5563;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.15;
	text-align: center;
	text-decoration: none;
}

.ntst-pwa-nav-action {
	border: 0;
	background: transparent;
	font: inherit;
	cursor: pointer;
}

.ntst-pwa-nav-item svg {
	width: 21px;
	height: 21px;
	fill: currentColor;
}

.ntst-pwa-nav-item.is-active,
.ntst-pwa-nav-item:hover,
.ntst-pwa-nav-item:focus-visible {
	background: rgba(2, 132, 199, .10);
	color: #075985;
}

.ntst-pwa-nav-item:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

body.ntst-pwa-has-nav {
	padding-bottom: calc(78px + env(safe-area-inset-bottom));
}

body.ntst-pwa-has-nav .ntst-pwa-install {
	bottom: calc(82px + env(safe-area-inset-bottom));
}


html.ntst-pwa-pull-refresh,
body.ntst-pwa-pull-refresh {
	overscroll-behavior-y: contain;
}

/* Touch pull-to-refresh feedback for standalone mode. */
.ntst-pwa-refresh {
	position: fixed;
	left: 50%;
	top: 0;
	z-index: 100000;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	max-width: calc(100vw - 32px);
	padding: 9px 13px;
	border: 1px solid rgba(0, 0, 0, .12);
	border-radius: 999px;
	background: rgba(255, 255, 255, .97);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
	color: #17202a;
	font-size: 12px;
	pointer-events: none;
	opacity: 0;
	transform: translate(-50%, -120%);
	transition: opacity 120ms ease, transform 120ms ease;
}

.ntst-pwa-refresh.is-visible {
	opacity: 1;
}

.ntst-pwa-refresh-icon {
	display: inline-block;
	font-size: 18px;
	line-height: 1;
	transition: transform 120ms ease;
}

.ntst-pwa-refresh.is-ready .ntst-pwa-refresh-icon {
	transform: rotate(180deg);
}

.ntst-pwa-refresh.is-refreshing .ntst-pwa-refresh-icon {
	animation: ntst-pwa-spin .7s linear infinite;
}

@keyframes ntst-pwa-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.ntst-pwa-refresh,
	.ntst-pwa-refresh-icon,
	.ntst-pwa-install {
		transition: none;
	}

	.ntst-pwa-refresh.is-refreshing .ntst-pwa-refresh-icon {
		animation: none;
	}
}



/* iPhone/iPad Add to Home Screen guidance. */
.ntst-pwa-ios-overlay {
	position: fixed;
	inset: 0;
	z-index: 100100;
	display: grid;
	place-items: end center;
	padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
	background: rgba(15, 23, 42, .48);
	backdrop-filter: blur(4px);
}

.ntst-pwa-ios-overlay[hidden] {
	display: none !important;
}

.ntst-pwa-ios-dialog {
	position: relative;
	width: min(100%, 520px);
	padding: 24px;
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
	color: #17202a;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ntst-pwa-ios-dialog h2 {
	margin: 8px 38px 8px 0;
	font-size: 22px;
	line-height: 1.2;
}

.ntst-pwa-ios-intro {
	margin: 0 0 14px;
	color: #475569;
}

.ntst-pwa-ios-dialog ol {
	margin: 0 0 18px;
	padding-left: 22px;
}

.ntst-pwa-ios-dialog li {
	margin: 9px 0;
	line-height: 1.45;
}

.ntst-pwa-ios-share {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border-radius: 14px;
	background: #e0f2fe;
	color: #0369a1;
	font-size: 28px;
	font-weight: 700;
}

.ntst-pwa-ios-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: #f1f5f9;
	color: #334155;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.ntst-pwa-ios-done {
	width: 100%;
	min-height: 44px;
	border: 0;
	border-radius: 10px;
	background: #111;
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.ntst-pwa-ios-close:focus-visible,
.ntst-pwa-ios-done:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}


/* Unified install fallback/help shown when the browser cannot expose a one-click prompt. */
.ntst-pwa-help-overlay {
	position: fixed;
	inset: 0;
	z-index: 100100;
	display: grid;
	place-items: center;
	padding: 18px;
	background: rgba(15, 23, 42, .48);
	backdrop-filter: blur(4px);
}

.ntst-pwa-help-overlay[hidden] {
	display: none !important;
}

.ntst-pwa-help-dialog {
	position: relative;
	width: min(100%, 520px);
	padding: 24px;
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
	color: #17202a;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ntst-pwa-help-dialog h2 {
	margin: 8px 38px 8px 0;
	font-size: 22px;
	line-height: 1.2;
}

.ntst-pwa-help-text {
	margin: 0 0 18px;
	color: #475569;
	line-height: 1.55;
}

.ntst-pwa-help-icon {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border-radius: 14px;
	background: #e0f2fe;
	color: #0369a1;
	font-size: 28px;
	font-weight: 700;
}

.ntst-pwa-help-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: #f1f5f9;
	color: #334155;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.ntst-pwa-help-done {
	width: 100%;
	min-height: 44px;
	border: 0;
	border-radius: 10px;
	background: #111;
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.ntst-pwa-help-close:focus-visible,
.ntst-pwa-help-done:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

body.ntst-pwa-dialog-open {
	overflow: hidden;
}


/* Installed-app update notice shown when a new service worker is waiting. */
.ntst-pwa-update {
	position: fixed;
	left: 50%;
	bottom: calc(16px + env(safe-area-inset-bottom));
	z-index: 100090;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: min(calc(100vw - 28px), 620px);
	padding: 14px;
	border: 1px solid rgba(0, 0, 0, .14);
	border-radius: 14px;
	background: rgba(255, 255, 255, .98);
	box-shadow: 0 16px 44px rgba(0, 0, 0, .22);
	color: #17202a;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	transform: translateX(-50%);
}

body.ntst-pwa-has-nav .ntst-pwa-update {
	bottom: calc(88px + env(safe-area-inset-bottom));
}

.ntst-pwa-update-copy {
	display: grid;
	gap: 3px;
	min-width: 0;
}

.ntst-pwa-update-copy strong {
	font-size: 14px;
	line-height: 1.3;
}

.ntst-pwa-update-copy span {
	color: #52606d;
	font-size: 12px;
	line-height: 1.45;
}

.ntst-pwa-update-actions {
	display: flex;
	gap: 8px;
	flex: 0 0 auto;
}

.ntst-pwa-update button {
	min-height: 38px;
	padding: 8px 12px;
	border-radius: 9px;
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
}

.ntst-pwa-update-later {
	border: 1px solid #cbd5e1;
	background: #fff;
	color: #334155;
}

.ntst-pwa-update-now {
	border: 1px solid #111;
	background: #111;
	color: #fff;
}

.ntst-pwa-update button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

@media (max-width: 600px) {
	.ntst-pwa-update {
		align-items: stretch;
		flex-direction: column;
		gap: 10px;
	}

	.ntst-pwa-update-actions {
		justify-content: flex-end;
	}
}


/* Installed-app network status. Keeps offline state visible and confirms reconnection briefly. */
.ntst-pwa-connectivity {
	position: fixed;
	left: 50%;
	top: calc(14px + env(safe-area-inset-top));
	z-index: 100110;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	width: min(calc(100vw - 28px), 620px);
	padding: 11px 12px;
	border: 1px solid rgba(0, 0, 0, .14);
	border-radius: 14px;
	background: rgba(255, 255, 255, .98);
	box-shadow: 0 14px 38px rgba(0, 0, 0, .20);
	color: #17202a;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	transform: translateX(-50%);
}

.ntst-pwa-connectivity[hidden] {
	display: none !important;
}

.ntst-pwa-connectivity-icon {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #fff7ed;
	color: #c2410c;
	font-weight: 900;
}

.ntst-pwa-connectivity.is-online .ntst-pwa-connectivity-icon {
	background: #ecfdf5;
	color: #047857;
}

.ntst-pwa-connectivity-copy {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.ntst-pwa-connectivity-copy strong {
	font-size: 13px;
	line-height: 1.25;
}

.ntst-pwa-connectivity-copy span {
	color: #52606d;
	font-size: 11px;
	line-height: 1.35;
}

.ntst-pwa-connectivity-retry {
	min-height: 34px;
	padding: 7px 10px;
	border: 0;
	border-radius: 9px;
	background: #111;
	color: #fff;
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
}

.ntst-pwa-connectivity-retry[hidden] {
	display: none !important;
}

.ntst-pwa-connectivity-retry:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

@media (max-width: 520px) {
	.ntst-pwa-connectivity {
		grid-template-columns: auto minmax(0, 1fr);
	}
	.ntst-pwa-connectivity-retry {
		grid-column: 1 / -1;
		width: 100%;
	}
}


/* Native Web Share fallback feedback. */
.ntst-pwa-share-toast {
	position: fixed;
	left: 50%;
	bottom: calc(88px + env(safe-area-inset-bottom));
	z-index: 100120;
	padding: 9px 13px;
	border-radius: 999px;
	background: rgba(17, 24, 39, .96);
	box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
	color: #fff;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 12px;
	font-weight: 700;
	pointer-events: none;
	opacity: 0;
	transform: translate(-50%, 10px);
	transition: opacity 140ms ease, transform 140ms ease;
}

.ntst-pwa-share-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

body:not(.ntst-pwa-has-nav) .ntst-pwa-share-toast {
	bottom: calc(18px + env(safe-area-inset-bottom));
}
