
/* Opal layout glue — intentionally minimal.
   All visual styling comes from obsidian.css (1,420 classes, 1,069 variables). */
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
#root { height: 100%; }
.app-container { height: 100%; }
.horizontal-main-container { display: flex; height: 100%; }
.workspace { display: flex; flex: 1; min-width: 0; height: 100%; }
.workspace-split.mod-left-split { flex: 0 0 auto; }
.workspace-split.mod-root { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.workspace-tabs { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.workspace-leaf { flex: 1; min-height: 0; display: flex; }
.workspace-leaf-content { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.view-header { flex: 0 0 auto; }
.view-content { flex: 1; min-height: 0; overflow: auto; }
.markdown-source-view, .cm-editor-host, .cm-editor { height: 100%; }
.cm-scroller { overflow: auto; }
.workspace-tab-header-container { display: flex; align-items: center; }
.workspace-tab-header-spacer { flex: 1; }
.nav-files-container { height: 100%; overflow: auto; }
.tree-item-self { cursor: pointer; }


/* --- THE width fix -------------------------------------------------------
   .workspace-split.mod-root has width 1324px but its child .workspace-tabs
   measured 0. Cause: the split is a row-flex container and the child had no
   intrinsic width. Obsidian's stylesheet assumes the app sets the direction;
   our shell must declare it. This single rule is what makes the editor visible. */
.workspace-split.mod-root {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.workspace-split.mod-root > .workspace-tabs {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
}
.workspace-split.mod-root > .workspace-tabs > .workspace-leaf {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
}
.workspace-split.mod-root .workspace-leaf-content {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
}
.workspace-split.mod-left-split {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.workspace-split.mod-left-split > .workspace-tabs {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}


/* Chrome lives in packages/ui/src/theme.css. This file only wires layout. */

/* --- width flow -----------------------------------------------------------
   Obsidian's stylesheet positions .markdown-source-view inside a flex/grid the
   app provides. Our shell uses plain flex, so the chain from view-content down
   to the CodeMirror host must be told to stretch. Without this the editor gets
   width 0 and the note is invisible even though it is in the DOM. */
.workspace-leaf-content[data-type="markdown"] > .view-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}
.workspace-leaf-content[data-type="markdown"] .markdown-source-view {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
}
.markdown-source-view .cm-editor-host {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
}
.markdown-source-view .cm-editor {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}
.markdown-source-view .cm-scroller {
  width: 100%;
  min-width: 0;
}
/* The gutter is absolutely positioned by CM; keep it from eating width. */
.markdown-source-view .cm-gutters { flex: 0 0 auto; }

/* --- sidebar ------------------------------------------------------------ */
.workspace-split.mod-left-split { width: 260px; flex: 0 0 260px; min-width: 160px; }
.workspace-split.mod-left-split .workspace-tabs { width: 100%; }
.workspace-split.mod-left-split .workspace-leaf { height: 100%; }

/* --- tab bar ------------------------------------------------------------ */
.workspace-tab-header-container {
  flex: 0 0 auto;
  height: 40px;
  min-height: 40px;
}
.workspace-tab-header { height: 100%; display: flex; align-items: center; }
.workspace-tab-header-inner { padding: 0 12px; display: flex; align-items: center; }
