Index: src/views/shell.ejs
===================================================================
--- src/views/shell.ejs	(revision a78e0510b83d6c7816b9e170d532097356374f6f)
+++ src/views/shell.ejs	(revision 923235ee7a5656aa6ab0462142ad54aa41a2e964)
@@ -684,7 +684,14 @@
   function autoSize(ta) {
     if (!ta || ta.tagName !== 'TEXTAREA') return;
-    ta.style.overflowY = 'hidden';
+    // Skip hidden textareas (e.g. inside a closed <details> or an unopened reply
+    // box): measuring scrollHeight there yields a bad height that sticks as inline
+    // style and makes the field open huge. They get sized on focus once visible.
+    if (ta.offsetParent === null && ta.offsetHeight === 0) return;
     ta.style.height = 'auto';
-    ta.style.height = ta.scrollHeight + 'px';
+    var maxH = parseFloat(getComputedStyle(ta).maxHeight);
+    var sh = ta.scrollHeight;
+    var h = (maxH && !isNaN(maxH)) ? Math.min(sh, maxH) : sh;   // respect a CSS max-height
+    ta.style.height = h + 'px';
+    ta.style.overflowY = sh > h ? 'auto' : 'hidden';
   }
   function sizeAll(root) {
