/* Phone layout uses the current viewport, including standalone launch and rotation. */
@media (max-width:767px), (max-height:500px) and (any-pointer:coarse) {
 body.kph-standalone{--kph-admin-height:0px;overflow-x:hidden!important;overflow-y:auto!important;background:#181a1d}
 body.admin-bar.kph-standalone{--kph-admin-height:32px}
 body.kph-standalone #page,body.kph-standalone #content,body.kph-standalone #primary,body.kph-standalone article,body.kph-standalone .entry-content{min-height:0;transform:none}
 body.kph-standalone .kph-screen,body.admin-bar.kph-standalone .kph-screen{
  position:relative;inset:auto;top:auto;left:auto;right:auto;bottom:auto;z-index:1;
  width:100%;height:auto;min-height:calc(100vh - var(--kph-admin-height));min-height:calc(100dvh - var(--kph-admin-height));
  overflow:visible;transform:none;isolation:isolate;
 }
 .kph-screen .kph-backdrop{overflow:hidden;pointer-events:none;z-index:-1}
 .kph-screen .kph-home-content{
  display:grid;grid-template-rows:auto 1fr auto;justify-content:stretch;align-items:stretch;
  width:100%;height:auto;min-height:inherit;gap:12px;
  padding:max(28px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));
 }
 .kph-screen .kph-brand{grid-row:1;min-width:0;padding-top:6svh}
 .kph-screen .kph-entry{grid-row:3;width:100%;padding-bottom:3svh}
 .kph-screen .kph-logo{width:auto;height:auto;max-width:min(46vw,240px);max-height:18svh}
 .kph-screen .kph-navigation{display:flex;flex-wrap:wrap;justify-content:center;gap:clamp(12px,6vw,64px);width:100%;min-width:0}
 .kph-screen a.kph-destination{font-size:clamp(1.5rem,6.5vw,2.3rem)!important;padding:12px 8px 20px;min-height:54px;touch-action:manipulation}
 .kph-screen .kph-fullscreen,.kph-screen .kph-return{top:max(12px,env(safe-area-inset-top))}
 .kph-screen .kph-fullscreen{right:max(12px,env(safe-area-inset-right))}
 .kph-screen .kph-home-return{right:calc(max(12px,env(safe-area-inset-right)) + 56px)}
 .kph-screen .kph-back{right:calc(max(12px,env(safe-area-inset-right)) + 112px)}
 .kph-screen .kph-wip-content{
  width:100%;height:auto;min-height:inherit;min-width:0;display:grid;place-items:center;
  padding:calc(max(12px,env(safe-area-inset-top)) + 56px) max(16px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));
 }
 .kph-screen .kph-wip-image{display:block;width:auto;height:auto;max-width:100%;max-height:calc(100dvh - var(--kph-admin-height) - 100px - env(safe-area-inset-top) - env(safe-area-inset-bottom));object-fit:contain}
}
@media (max-width:767px){body.admin-bar.kph-standalone{--kph-admin-height:46px}}
@media (max-height:500px) and (any-pointer:coarse) and (orientation:landscape){
 .kph-screen .kph-brand{padding-top:0}
 .kph-screen .kph-entry{padding-bottom:0}
 .kph-screen .kph-logo{max-height:22svh;max-width:28vw}
 .kph-screen a.kph-destination{font-size:1.6rem!important;padding:8px 10px 16px}
}

/* Remove theme/shortcode wrappers from the visual surface once the footer script runs. */
@media (max-width:767px), (max-height:500px) and (any-pointer:coarse) {
 body.kph-standalone.kph-surface-ready > :not(.kph-screen):not(#wpadminbar):not(#kph-rotate-prompt):not(.kph-diagnostics):not(.kph-viewport-probe):not(script):not(style){display:none!important}
 body.kph-standalone > .kph-screen{margin:0!important;padding:0!important;border:0!important}
}
