/*
 * PrimeTime add-on for Termix on phones, see mobile-keys.js. Everything here is
 * keyed on html.pt-kb-open (software keyboard open on a touch device), except
 * the last rule, so desktop and normal use look exactly like stock Termix.
 */
html.pt-kb-open,
html.pt-kb-open body {
  height: var(--pt-vvh) !important;
  overflow: hidden !important;
}

/* Termix sizes its shell with 100dvh, which ignores the keyboard on iOS. */
html.pt-kb-open [style*="100dvh"],
html.pt-kb-open .h-dvh {
  height: calc(var(--pt-vvh) - var(--termix-titlebar-height, 0px)) !important;
}

html.pt-kb-open .fixed.inset-0 {
  bottom: auto !important;
  height: var(--pt-vvh) !important;
}

/* While typing, the bottom menu only takes room from the terminal. */
html.pt-kb-open nav.safe-bottom {
  display: none !important;
}

/* Landscape + keyboard leaves ~150px: drop the tab strip and the quick-key
   row so the terminal keeps several lines. The main key row stays. */
html.pt-kb-open.pt-landscape .flex.items-end.bg-sidebar.border-b,
html.pt-kb-open.pt-landscape div:has(> div > button[title="Edit quick keys"]) {
  display: none !important;
}

/* iOS zooms into inputs with a font below 16px; xterm's hidden input would trigger it. */
@media (pointer: coarse) {
  .xterm .xterm-helper-textarea {
    font-size: 16px !important;
  }
}
