/* VELYON Theme — installable app polish (v2.0.0)
   Markup: inc/pwa.php, header.php (.app-back). Behaviour: assets/js/pwa-install.js.
   The banner is phones only (<=782px), above the tab bar (z 95: over the bar at 90,
   under the drawer at 300 and the sheets/search at 400). */

/* ---------- Install banner ---------- */
.vpwa-banner { display: none; }
@media (max-width: 782px) {
	.vpwa-banner {
		position: fixed;
		left: 12px;
		right: 12px;
		bottom: calc(var(--velyon-bottom-nav-height, 64px) + var(--velyon-bottom-bar-height, 0px) + 10px);
		z-index: 95;
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 12px;
		border: 1px solid var(--velyon-border);
		border-radius: var(--velyon-radius-l);
		background: var(--velyon-surface);
		box-shadow: 0 14px 40px rgba(0, 0, 0, .38);
		opacity: 0;
		transform: translateY(16px);
		transition: opacity .25s ease, transform .25s ease;
	}
	.vpwa-banner[hidden] { display: none; }
	.vpwa-banner.is-open { opacity: 1; transform: none; }
}
.vpwa-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.vpwa-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.vpwa-title { font-family: var(--velyon-font-heading); font-size: 14.5px; font-weight: 700; line-height: 1.25; }
.vpwa-text { font-size: 12.5px; line-height: 1.35; color: var(--velyon-text-muted); }
.vpwa-go {
	flex: none;
	min-height: 40px;
	padding: 8px 16px;
	border: 0;
	border-radius: 999px;
	background: var(--velyon-accent);
	color: var(--velyon-on-accent, #05170A);
	font-family: var(--velyon-font-heading);
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}
.vpwa-go:focus-visible,
.vpwa-x:focus-visible { outline: 2px solid var(--velyon-accent); outline-offset: 2px; }
.vpwa-x {
	flex: none;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--velyon-text-muted);
}
.vpwa-x svg { width: 16px; height: 16px; }

/* iPhone "Add to Home Screen" guide: numbered steps, not links */
.vpwa-steps { counter-reset: none; }
.vpwa-step { cursor: default; }
.vpwa-step:hover { background: transparent; }

/* ---------- Back arrow (installed app only) ---------- */
.app-back { display: none; }
@media (max-width: 782px) {
	html.is-standalone .app-back:not([hidden]) {
		display: flex;
		align-items: center;
		justify-content: center;
		flex: none;
		width: 38px;
		height: 38px;
		padding: 0;
		border-radius: 10px;
		border: 1px solid var(--velyon-border);
		background: var(--velyon-surface);
		color: var(--velyon-text);
	}
	.app-back svg { width: 20px; height: 20px; }
}

/* ---------- Safe areas (notch / status bar / home indicator) ----------
   viewport-fit=cover lets the page use the whole screen; these keep content clear of
   the notch and the status bar. In a normal browser tab every inset is 0, so nothing
   changes there (landscape phones aside, where the sides are padded). */
.site-header { padding-top: env(safe-area-inset-top, 0px); }
#page {
	padding-left: env(safe-area-inset-left, 0px);
	padding-right: env(safe-area-inset-right, 0px);
}
@media (max-width: 782px) {
	.bottom-nav {
		padding-left: env(safe-area-inset-left, 0px);
		padding-right: env(safe-area-inset-right, 0px);
	}
}

/* ---------- App feel when installed ---------- */
html.is-standalone {
	-webkit-tap-highlight-color: transparent;
}
html.is-standalone body {
	-webkit-touch-callout: none;
}
html.is-standalone .bottom-nav,
html.is-standalone .hamburger,
html.is-standalone .vsheet,
html.is-standalone .vpwa-banner {
	-webkit-user-select: none;
	user-select: none;
}
