/**
 * Bookably Hosts — app-feel rules.
 *
 * Inert in a normal browser tab. When the workspace runs INSTALLED
 * (html.bha-standalone, stamped by the inline detector in
 * Bookably_Host_Pwa::head_tags), these rules strip the website out of
 * the app: theme chrome gone, document-scroll physics replaced with
 * app physics, browser affordances (tap highlight, text selection on
 * controls, pinch zoom side-effects) suppressed.
 *
 * Owner finding driving this file (2026-08-07): the installed PWA
 * "still feels like a webpage rather than an app".
 */

/* ---- Website chrome: gone. RentalHive theme structure. ---- */
html.bha-standalone .site-header,
html.bha-standalone .site-footer {
	display: none !important;
}

/* The theme pads content below its (now absent) header; reclaim it. */
html.bha-standalone .site-container {
	padding-top: 0 !important;
	margin-top: 0 !important;
	min-height: 100vh;
	min-height: 100dvh;
}

/* WP admin bar never belongs in the app (owner/admin accounts). */
html.bha-standalone #wpadminbar {
	display: none !important;
}
html.bha-standalone body.admin-bar {
	margin-top: 0 !important;
}

/* ---- Scroll + touch physics ---- */
html.bha-standalone,
html.bha-standalone body {
	/* no rubber-band beyond the app, no pull-to-refresh surprises */
	overscroll-behavior-y: none;
	/* momentum scrolling inside, document behaves like an app shell */
	-webkit-overflow-scrolling: touch;
}

html.bha-standalone body {
	/* browser tap flash reads as "webpage" instantly */
	-webkit-tap-highlight-color: transparent;
	/* keyboard-safe viewport on phones with notches/gesture bars */
	padding-top: env(safe-area-inset-top);
	padding-bottom: env(safe-area-inset-bottom);
}

/* Brand the status-bar zone. In the native app the status bar is
   transparent over our white top padding ("white nothing", owner);
   this paints that exact strip brand teal, matching what Chrome's
   theme-color gives the installed PWA. In the PWA the top inset is 0,
   so the strip collapses and nothing doubles up. Above everything
   (drawer included) so the app wears one continuous teal cap. */
html.bha-standalone body::after {
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
	background: #1097c5;
	z-index: 100001;
	pointer-events: none;
}

/* Safe-area padding ON THE WRAPPER — it is position:fixed, so body
   padding can't shield it from system bars. Sources: Capacitor 8's
   injected --safe-area-inset-* variables (native app; env() is not
   what the plugin feeds) falling back to browser env() (installed
   PWA), falling back to 0 (older devices, which never draw under
   their bars anyway). Specificity note: html.bha-standalone + class
   deliberately OUTRANKS `.bha-chat-wrapper.bha-fullscreen { padding:
   0 }` in chat-chrome.css, which silently flattened the first attempt
   (probe on the S25 Ultra: vars 48px/34px, computed padding 0). */
html.bha-standalone .bha-chat-wrapper {
	box-sizing: border-box;
	padding-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
	padding-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
	padding-left: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
	padding-right: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
}

/* The chat's fullscreen/minimise toggle is a WEBSITE affordance (the
   chat is a widget there). Installed, the chat IS the app — a minimise
   button is an escape hatch to nowhere (owner-flagged on the first
   app-feel walk). */
html.bha-standalone .bha-fullscreen-toggle {
	display: none !important;
}

/* Controls should feel like controls: no accidental text selection,
   no long-press callouts on buttons/chips/nav. Message content and
   form fields stay selectable. */
html.bha-standalone button,
html.bha-standalone .bha-quick-chip,
html.bha-standalone .bha-top-nav__btn,
html.bha-standalone a {
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}
