/* Match the visible viewport frame by frame. No delayed height animation. */
:root { --wk-visible-height:100dvh; --wk-visible-top:0px; --wk-keyboard-inset:0px; }
html,body,dialog,[role=dialog],iframe { touch-action:pan-x pan-y; }
input, textarea, [contenteditable="true"] { scroll-margin-block:16px; }
html[data-wk-keyboard-open] body::after { content:""; display:block; height:var(--wk-keyboard-inset); pointer-events:none; }
html[data-wk-keyboard-open] :is(.mobile-bottom-nav,.staff-mobile-tabs,.sf-mobile-navigation,.floating-cart,.sf-cart-feedback,[data-support-launcher],.customer-ai-launch) { visibility:hidden!important; pointer-events:none!important; }
html[data-wk-keyboard-open] dialog[open] {
  position:fixed!important; top:calc(var(--wk-visible-top) + 8px)!important; bottom:auto!important;
  margin-block:0!important; max-height:calc(var(--wk-visible-height) - 16px)!important;
  min-height:0!important; box-sizing:border-box; overflow-y:auto;
}
html[data-wk-keyboard-open] .dialog-backdrop {
  top:var(--wk-visible-top)!important; bottom:auto!important; height:var(--wk-visible-height)!important;
  box-sizing:border-box; padding-block:8px!important; align-items:center;
}
html[data-wk-keyboard-open] .dialog-backdrop .dialog { min-height:0; max-height:calc(var(--wk-visible-height) - 16px)!important; overflow-y:auto; }
html[data-wk-keyboard-open] #help-dialog.help-chat-dialog { height:calc(var(--wk-visible-height) - 16px)!important; overflow:hidden; }
html[data-wk-keyboard-open] .support-chat-dialog:has([data-wk-guide-panel]:not([hidden])) { height:calc(var(--wk-visible-height) - 16px)!important; overflow:hidden!important; }
html[data-wk-keyboard-open] .support-chat-dialog:has([data-wk-guide-panel]:not([hidden])) > [data-wk-support-workspace] { height:100%; min-height:0; grid-template-rows:auto minmax(0,1fr); gap:8px; }
html[data-wk-keyboard-open] [data-wk-guide-panel] { height:100%!important; min-height:0!important; }
@media(max-width:1100px) {
  html[data-wk-keyboard-open] .studio-editor .studio-workspace.mobile-tools .studio-panel {
    inset-inline:0!important; top:0!important; bottom:0!important; height:100%!important; max-height:100%!important;
  }
  html[data-wk-keyboard-open] .studio-editor .studio-workspace.mobile-tools .studio-rail { display:none!important; }
  html[data-wk-keyboard-open] .studio-editor .studio-mobile-tabs { display:none!important; }
  html[data-wk-keyboard-open] .studio-editor .studio-panel-title { min-height:48px!important; padding-block:2px!important; }
}
/* iOS ignores scale restrictions for focus: readable fields prevent focus zoom. */
@media(pointer:coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), textarea, select { font-size: max(16px, 1em)!important; }
}
