
/* Actual pages, not the retired app wrapper. Insets have a single owner. */
html body :is(#practicePage,#myBodyPage){box-sizing:border-box!important;padding-top:max(env(safe-area-inset-top,0px),52px)!important;padding-bottom:0!important;background:#f6f0e9!important;overflow:hidden!important}
html body #mapPage{box-sizing:border-box!important;padding-top:max(env(safe-area-inset-top,0px),24px)!important;padding-bottom:0!important;background:#f6f0e9!important;overflow:hidden!important}
html body :is(#practicePage,#myBodyPage,#mapPage)>iframe{display:block!important;width:100%!important;height:100%!important;min-height:0!important;border:0!important;background:#f6f0e9}
html body #mapPage #map-live-frame{min-height:0!important}
html body :is(#schedulePage,#vocabPage){touch-action:pan-y}

/* Keep the real home iframe painted beneath pages; do not reveal an unpainted fallback on swipe. */
/* Home is exposed by nk-peek only; cancelled gestures must restore the original backdrop. */
html body #homePage #home2f{backface-visibility:hidden;-webkit-backface-visibility:hidden;transform:translateZ(0)}

/* Returning to home: only the real home and outgoing page are painted.
   The icon-opening wallpaper replica must not cover the exposed home. */
html.nk-sw:has(#homePage.nk-peek) body #ilBack,
html.nk-sw:has(#homePage.nk-peek) body #ilDim{display:none!important;visibility:hidden!important}
html.nk-sw:has(#homePage.nk-peek) body #app::before{content:none!important;display:none!important}

/* Diary paper stays opaque throughout drag, cancellation and return. */
html body #diaryPage,html body #diaryLetterPage{background-color:#fffdf9!important}
html[data-mode="night"] body #diaryPage,html[data-mode="night"] body #diaryLetterPage,html body [data-mode="night"] #diaryPage,html body [data-mode="night"] #diaryLetterPage,body[data-mode="night"] #diaryPage,body[data-mode="night"] #diaryLetterPage{background-color:#182334!important}
