/* The app, not iOS status/gesture chrome, owns the editor's usable rectangle. */
:root{
  --terry-safe-top:env(safe-area-inset-top,0px);
  --terry-safe-right:env(safe-area-inset-right,0px);
  --terry-safe-bottom:env(safe-area-inset-bottom,0px);
  --terry-safe-left:env(safe-area-inset-left,0px);
}
/* Some installed iOS web apps report a zero top inset under the status bar. */
@media(max-width:599px) and (orientation:portrait){
  html.terry-ios-home{--terry-safe-top:max(env(safe-area-inset-top,0px),72px)}
}
#siteAppRoot{box-sizing:border-box;padding-left:var(--terry-safe-left);padding-right:var(--terry-safe-right)}
#siteAppRoot #siteHeader{
  box-sizing:border-box;padding-top:var(--terry-safe-top);flex-shrink:0;
  background:#fff!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;
}
body.editor-v45.has-media{min-height:0!important;height:var(--editor-visual-height,100dvh)!important;overscroll-behavior-y:none}
body.editor-v45.has-media #siteAppRoot{
  position:fixed;top:var(--editor-visual-top,0px);left:0;right:0;
  display:flex!important;flex-direction:column!important;
  height:var(--editor-visual-height,100dvh)!important;min-height:0!important;
  padding-bottom:var(--terry-safe-bottom);overflow:hidden!important;
}
/* Two IDs deliberately give this height owner precedence over old breakpoint
   layers. Frame/photo/timeline grid rows remain owned by their own styles. */
body.editor-v45.has-media #siteAppRoot #editorWorkspace{flex:1 1 auto;height:auto!important;min-height:0!important}
body.editor-v45.has-media.editor-keyboard-open #siteAppRoot{padding-bottom:0}
#previewModal{padding-top:calc(12px + var(--terry-safe-top));padding-bottom:calc(12px + var(--terry-safe-bottom));padding-left:calc(12px + var(--terry-safe-left));padding-right:calc(12px + var(--terry-safe-right))}
.metadata-display-controls{display:grid;gap:6px;margin-top:12px;padding:12px;border:1px solid #dfe5e9;border-radius:10px;background:#f7f9fa}
.metadata-display-controls p{font-size:12px;line-height:1.5;color:#62717c;margin:0}
.metadata-display-controls p:last-child{font-size:11px}
@media(prefers-reduced-transparency:reduce){#siteAppRoot #siteHeader{background:#fff!important}}
