/* ════════════════════════════════════════════════════════════════════════
   PHASE 161 — Writer: keep caret-reveal from slamming a line to the top edge
   When you tap a script line (or the soft keyboard opens), the browser scrolls
   the caret into view. The writer's scroller had NO top scroll-padding (it was
   `auto`), so that reveal could jam the tapped line hard against the very top,
   which reads as the page "jumping" — most noticeable on iPad where the keyboard
   also rises. A top scroll-padding gives the reveal a margin so the active line
   lands with breathing room instead of at the edge.

   scroll-padding is inert for manual finger/wheel scrolling — it only affects
   programmatic / caret-driven scrolls — so it cannot regress normal scrolling.
   (Bottom padding is already set elsewhere and left as-is.)
   ════════════════════════════════════════════════════════════════════════ */

#editor-frame,
.editor-frame {
  scroll-padding-top: 72px;
}

/* Soft keyboard up: a slightly smaller top margin keeps more of the shrunken
   viewport for the line you're editing while still avoiding an edge slam. */
html[data-tablet-keyboard="true"] #editor-frame,
html[data-tablet-keyboard="true"] .editor-frame,
body[data-phone-keyboard="open"] #editor-frame,
body[data-phone-keyboard="open"] .editor-frame {
  scroll-padding-top: 56px;
}
