/* Values remain native env() in production. Custom properties also allow the
   geometry to be checked with explicit insets in a separate local QA fixture. */
:root {
  --sf-safe-top: env(safe-area-inset-top, 0px);
  --sf-safe-right: env(safe-area-inset-right, 0px);
  --sf-safe-bottom: env(safe-area-inset-bottom, 0px);
  --sf-safe-left: env(safe-area-inset-left, 0px);
  color-scheme: light;
}
@media (max-width: 900px), (pointer: coarse), (display-mode: standalone) {
  html { background-color: var(--sf-chrome-color, var(--sf-page-chrome, #e6e1dc)); }
  /* Paint only the real web safe area, alongside the full-bleed page/header.
     Safari's own chrome and the physical Dynamic Island remain OS-controlled.
     Installed documents use a consistent dark hint for light launch-time glyphs. */
  html::after {
    content: ''; position: fixed; z-index: 2147483006; top: 0; left: 0; right: 0;
    height: var(--sf-safe-top); background: var(--sf-chrome-color, var(--sf-page-chrome, #e6e1dc)); pointer-events: none;
  }
}
/* Legacy Home Screen mode may expose navigator.standalone without the media query. */
html[data-sf-display-mode="standalone"]::after {
  content: ''; position: fixed; z-index: 2147483006; top: 0; left: 0; right: 0;
  height: var(--sf-safe-top); background: #2b2420; pointer-events: none;
}
