/* iOS adaptations (Safari, home-screen web app and the native WKWebView shell).
   Additive only: desktop and Android rules are not touched. */

/* Inside the iOS app the page is the whole screen; no rubber-band scrolling. */
html[data-native-container] body { overscroll-behavior:none; }

/* Home-screen / standalone web app: keep content out from under the status bar and home indicator. */
@media (display-mode:standalone) {
  body { overscroll-behavior-y:none; }
}

/* Touch devices: no sticky hover look after a tap. */
@media (hover:none) { :is(button,a,summary):hover { filter:none; } }

/* Buttons behave like Apple's: they dim and shrink slightly under the finger (UIKit's highlighted state),
   have no sticky hover, no grey tap flash and no text selection. Layout, colours and sizes stay as they are. */
:is(html[data-ios],html[data-native-container]) :is(button,summary,[role="button"],a.account-entry,.tool-btn,.chip-row button,.theme-chip,.home-tab,.mobile-switch button) {
  -webkit-tap-highlight-color:transparent; -webkit-touch-callout:none; -webkit-user-select:none; user-select:none;
  touch-action:manipulation;
  transition:scale .16s cubic-bezier(.2,.8,.2,1),opacity .16s ease,background-color .16s ease;
}
:is(html[data-ios],html[data-native-container]) :is(button,summary,[role="button"],a.account-entry,.tool-btn,.chip-row button,.theme-chip,.home-tab,.mobile-switch button):active:not(:disabled) { scale:.96; opacity:.7; }
:is(html[data-ios],html[data-native-container]) :is(button,.tool-btn):disabled { opacity:.4; }
:is(html[data-ios],html[data-native-container]) :is(button,summary,a.account-entry):focus-visible { outline:2px solid var(--tint); outline-offset:2px; }
@media (prefers-reduced-motion:reduce) {
  :is(html[data-ios],html[data-native-container]) :is(button,summary,[role="button"]) { transition:none; }
  :is(html[data-ios],html[data-native-container]) :is(button,summary,[role="button"]):active:not(:disabled) { scale:1; }
}

/* Text fields: Apple's look and behaviour (system font, tinted caret, no inner shadow); layout is unchanged.
   Date and time pickers keep the system picker. */
:is(html[data-ios],html[data-native-container]) :is(input:not([type="checkbox"],[type="radio"],[type="range"],[type="button"],[type="submit"],[type="file"],[type="hidden"],[type="color"],[type="date"],[type="time"],[type="datetime-local"],[type="month"]),textarea) {
  -webkit-appearance:none; appearance:none; caret-color:var(--tint);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;
  -webkit-text-size-adjust:100%;
}
:is(html[data-ios],html[data-native-container]) :is(#destinationSearchInput,#travelersSel,#dailyBudget,#authEmail,#authPassword) { border-radius:10px; }
:is(html[data-ios],html[data-native-container]) :is(input,textarea,select)::selection { background:var(--tint-soft); }
/* iOS picks the keyboard colour from the page's colour scheme. */
:root[data-theme="dark"] { color-scheme:dark; }
:root[data-theme="light"] { color-scheme:light; }
/* The page may scroll all the way down under the home indicator. */
:is(html[data-ios],html[data-native-container]) .start-page > .sp-go { bottom:max(0px,env(safe-area-inset-bottom)); }
