/* ============================================================
   iPhone home-screen web app — status bar + safe areas (v3.63)
   ============================================================
   Every page head sets apple-mobile-web-app-status-bar-style
   "black-translucent" and viewport-fit=cover: the page is drawn under the
   status bar, so the garden's dark green continues behind the clock (the
   opaque "black" style renders as a light bar on current iOS).

   env(safe-area-inset-*) is 0 in a normal browser tab, so nothing moves
   there. Loaded last in <head>; it only ever adds safe-area offsets.
   body::before is the botanical texture (main.css), so the band uses ::after. */

:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --statusbar-bg: #07140E;
}

/* Overscroll / rubber-band area in the app colour */
html { background-color: var(--statusbar-bg); }

body {
    padding-top: var(--safe-top);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
}

/* Solid band behind the clock: scrolled content never shows through it */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--safe-top);
    background: var(--statusbar-bg);
    z-index: 2147483000;
    pointer-events: none;
}

/* Sticky / fixed elements anchored to the top start below the clock */
.topbar,
.lp-nav { top: var(--safe-top); }
.sidebar {
    top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
}

/* Floating buttons, panels and toasts stay above the home indicator */
.actfab { bottom: calc(96px + var(--safe-bottom)); }
.act-panel { bottom: calc(158px + var(--safe-bottom)); }
.ferdy-btn { bottom: calc(22px + var(--safe-bottom)); }
.ferdy-panel,
.ferdy-toast { bottom: calc(94px + var(--safe-bottom)); }
.act-lock-toast { bottom: calc(28px + var(--safe-bottom)); }
.mow-toast { bottom: calc(24px + var(--safe-bottom)); }
@media (max-width: 720px) {
    .actfab,
    .act-panel { bottom: calc(84px + var(--safe-bottom)); }
}
@media (max-width: 640px) {
    .ferdy-panel {
        bottom: calc(78px + var(--safe-bottom));
        max-height: min(72dvh, calc(100dvh - 92px - var(--safe-top) - var(--safe-bottom)));
    }
}

/* ── v3.64: the page never slides away or gets dragged sideways ──
   In the home-screen app a scroll that hit its end (on the page or in a
   panel) bounced the whole page, so it slid away and showed blank edges.
   The browser tab keeps pull-to-refresh; its overscroll is painted in the
   app colour by the html background above. overflow-x: clip is the safety
   net against anything wider than the screen (iPhone lets you drag such a
   page sideways); wide tables scroll inside their own boxes. */
@media (display-mode: standalone) {
    html,
    body {
        overscroll-behavior: none;
        overflow-x: clip;
    }
}
/* Panels that scroll on their own keep the scroll to themselves */
.sidebar,
.act-panel,
.act-panel .bed-pick,
.ferdy-msgs { overscroll-behavior: contain; }
