.editor {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.editor :global(.cm-editor) {
  height: 100%;
  font: 13px/1.5 ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
}

.editor :global(.cm-scroller) {
  background: var(--color-background-muted, #f6f8fa);
  font-family: inherit;
  /*
   * Default to scrollable. Earlier versions of this file froze the
   * scroller unless its widget slot carried `data-widget-interacting`
   * (the interactGate path), but the file widget no longer uses
   * interactGate, and the expanded / split-screen panes portal outside
   * any widget slot, so the gate selector never matches there either.
   *
   * Result: edit-mode in fullscreen / split / interactGate-less canvas
   * widgets was completely unscrollable. Make scrolling the default and
   * let the special "frozen" mode be opt-in via a parent that carries
   * `data-widget-frozen` (currently unused — kept as an extension point).
   */
  overflow: auto;
}

:global([data-widget-frozen]) .editor :global(.cm-scroller) {
  overflow: hidden;
}

.cmContainer {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.fallback {
  flex: 1;
  margin: 0;
  padding: 12px 16px;
  font: 13px/1.5 ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
  background: var(--color-background-muted, #f6f8fa);
  color: var(--color-foreground, #1f2328);
  white-space: pre;
  overflow: auto;
  tab-size: 2;
  word-break: break-all;
}

.loading {
  opacity: 0.6;
}
