/* Editor (CodeMirror 6) shell styling. Token / gutter / selection colors
 * are set inside cm6 themes (themes.js) bound to the --cm-* variables
 * in tokens.css; this file scopes the editor container's chrome to
 * match the rest of the app. */

/* Pre-hide opt-in textareas to avoid the textarea-visible-then-hidden
 * flicker on page load. editor.js un-hides them again if the bundle
 * fails to load or a per-textarea mount throws. The <noscript> rule
 * in _editor_assets.html un-hides for JS-disabled users. */
textarea[data-editor-language] { display: none; }

/* Pre-reserves the slot cm6 will mount into. The min-height formula
 * matches the height EditorView.theme applies inside editor-entry.js,
 * keyed off the textarea's `rows` attribute via the inline --editor-rows
 * custom property. Same expression on both sides = zero layout shift. */
.editor-mount {
  min-height: calc(var(--editor-rows, 8) * 1.84rem + 1.125rem);
}

.cm-editor {
  border: var(--line);
  border-radius: var(--radius-s);
}

.cm-editor.cm-focused {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

textarea[data-editor-language] + .cm-editor {
  width: 100%;
}
