/* Malgel site. Colors come from themes.css (generated from Malgel's themes). */

:root {
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --bar-h: 36px;
  --status-h: 28px;
  --outline-w: 232px;
  --gutter: 64px;
  --sel: var(--selection, color-mix(in srgb, var(--blue) 26%, transparent));
  --alert-note: var(--blue);
  --alert-tip: var(--green);
  --alert-important: var(--magenta);
  --alert-warning: var(--yellow);
  --alert-caution: var(--red);
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

::selection { background: var(--sel); }

button { font: inherit; color: inherit; }

svg { flex: none; }

.skip {
  position: absolute; left: 8px; top: -40px; z-index: 50;
  padding: 6px 10px; border-radius: 6px;
  background: var(--primary); color: var(--primary-fg);
}
.skip:focus { top: 8px; }

:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ------------------------------------------------------------ window */

.window {
  display: grid;
  grid-template-rows: var(--bar-h) minmax(0, 1fr) var(--status-h);
  height: 100vh;
  height: 100dvh;
}

.titlebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 8px;
  background: var(--title-bg);
  border-bottom: 1px solid var(--title-border);
  font-size: 14px;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  z-index: 20;
}

.menubar { display: flex; align-items: center; gap: 2px; min-width: 0; }

.menu { position: relative; }

.menu-btn {
  border: 0; background: none; padding: 4px 10px; border-radius: 6px; cursor: default;
  line-height: 20px;
}
.menu-btn:hover, .menu-btn[aria-expanded="true"] { background: var(--secondary-hover); }

.menu-pop {
  position: absolute; top: calc(100% + 4px); left: 0;
  min-width: 248px; padding: 4px;
  background: var(--popover-bg); color: var(--popover-fg);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 10px 30px -8px rgb(0 0 0 / .28), 0 2px 6px rgb(0 0 0 / .08);
  display: none;
  z-index: 30;
}
.menu-btn[aria-expanded="true"] + .menu-pop, .sub-btn[aria-expanded="true"] + .sub-pop { display: block; }

.menu-pop hr { border: 0; border-top: 1px solid var(--border); margin: 4px -4px; }

.menu-pop [role^="menuitem"] {
  display: flex; align-items: center; gap: 4px; width: 100%;
  padding: 5px 8px 5px 4px; border: 0; border-radius: 5px;
  background: none; color: inherit; text-align: left; text-decoration: none;
  font-size: 13.5px; line-height: 20px; cursor: default; white-space: nowrap;
}
.menu-pop [role^="menuitem"]:hover, .menu-pop [role^="menuitem"]:focus-visible,
.sub-btn[aria-expanded="true"] {
  background: var(--accent-bg); color: var(--accent-fg); outline: none;
}
.menu-pop [role^="menuitem"][aria-disabled="true"] { opacity: .45; }

.mi-check { width: 18px; display: inline-flex; justify-content: center; font-size: 12px; }
[aria-checked="true"] > .mi-check::before { content: "✓"; }

.menu-pop kbd, .menu-pop .chev {
  margin-left: auto; padding-left: 24px;
  font: 12px var(--font-ui); color: var(--muted);
}
.menu-pop .chev { font-size: 16px; line-height: 1; }

.submenu { position: relative; }
.sub-pop { top: -5px; left: calc(100% + 4px); min-width: 200px; max-height: 70vh; overflow: auto; }
.submenu.flip .sub-pop { left: auto; right: calc(100% + 4px); }

.doc-name {
  display: flex; align-items: center; gap: 8px;
  font-weight: 500; white-space: nowrap;
}
.doc-name img { display: block; }
.dirty { color: var(--muted); font-size: 10px; }

.toolbar { display: flex; justify-content: flex-end; gap: 2px; }

.tool {
  display: grid; place-items: center;
  width: 28px; height: 26px; padding: 0; border: 0; border-radius: 6px;
  background: none; color: var(--fg); cursor: default;
}
.tool:hover { background: var(--secondary-hover); }
.tool[aria-pressed="true"] { background: var(--secondary-active); }
.tool svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[data-mode="light"] .tool .sun, [data-mode="dark"] .tool .moon { display: none; }

.statusbar {
  display: flex; align-items: center; gap: 18px;
  padding: 0 10px;
  background: var(--status-bg);
  border-top: 1px solid var(--title-border);
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
}
.statusbar .spacer { flex: 1; }

/* ------------------------------------------------------------ panes */

.panes {
  display: grid;
  min-height: 0;
  grid-template-columns: 0 0 minmax(0, 1fr) var(--outline-w);
  grid-template-areas: "editor divider preview outline";
}

[data-outline="off"] .panes { --outline-w: 0px; }
[data-layout="split"] .panes { grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr) var(--outline-w); }
[data-layout="editor"] .panes { grid-template-columns: minmax(0, 1fr) 0 0 var(--outline-w); }

.pane { position: relative; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--thumb) transparent; }
.pane::-webkit-scrollbar { width: 10px; height: 10px; }
.pane::-webkit-scrollbar-thumb { background: var(--thumb); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

.editor-pane { grid-area: editor; background: var(--ed-bg); }
.preview-pane { grid-area: preview; }
.divider { grid-area: divider; background: var(--border); }

[data-layout="preview"] .editor-pane, [data-layout="editor"] .preview-pane { visibility: hidden; }

.outline {
  grid-area: outline;
  overflow: auto;
  border-left: 1px solid var(--border);
  padding: 10px 8px;
  font-size: 14px;
  scrollbar-width: thin;
}
[data-outline="off"] .outline { display: none; }
.outline-head {
  margin: 2px 8px 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.outline ul { list-style: none; margin: 0; padding: 0; }
.outline a {
  display: block; padding: 4px 10px; border-radius: 6px;
  color: var(--muted); text-decoration: none; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.outline a.lvl-1 { color: var(--fg); }
.outline a.lvl-3 { padding-left: 26px; font-size: 13px; }
.outline a:hover { background: var(--secondary-hover); color: var(--fg); }
.outline a[aria-current="true"] { background: var(--active-bg); color: var(--fg); }

/* ------------------------------------------------------------ editor */

.editor {
  position: relative;
  padding: 28px 24px 45vh 0;
  font: 14px/24px var(--font-mono);
  font-variant-ligatures: none;
  color: var(--ed-fg);
  tab-size: 4;
  min-height: 100%;
}
[data-layout="editor"] .editor { max-width: 900px; margin: 0 auto; }

.ed-row { display: grid; grid-template-columns: var(--gutter) minmax(0, 1fr); }
.ed-row.active { background: var(--ed-active); }
.ed-num {
  padding-right: 22px; text-align: right;
  color: var(--ed-ln); user-select: none; -webkit-user-select: none;
}
.ed-row.active .ed-num { color: var(--ed-ln-active); }
.ed-code, .ed-input {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
}
.ed-code { min-height: 24px; }

.ed-input {
  position: absolute;
  top: 28px; bottom: 45vh; left: var(--gutter); right: 24px;
  width: calc(100% - var(--gutter) - 24px);
  margin: 0; padding: 0; border: 0; outline: none; resize: none; overflow: hidden;
  background: transparent;
  color: transparent;
  caret-color: var(--fg);
  font: inherit; line-height: inherit; letter-spacing: inherit; tab-size: inherit;
  font-variant-ligatures: none;
}
.ed-input::selection { background: var(--sel); color: transparent; }

/* Source highlighting, after the themes' tree-sitter scopes. */
.t-title { color: var(--sx-title, var(--fg)); font-weight: var(--sx-title-weight, 400); font-style: var(--sx-title-style, normal); }
.t-hmark { opacity: .75; }
.t-link-text { color: var(--sx-link-text, var(--link)); text-decoration: var(--sx-link-text-deco, none); }
.t-link-uri { color: var(--sx-link-uri, var(--muted)); font-style: var(--sx-link-uri-style, normal); }
.t-literal { color: var(--sx-literal, var(--fg)); }
.t-math { color: var(--sx-math, var(--sx-literal)); }
.t-list { color: var(--sx-list, var(--muted)); }
.t-punct, .t-fence { color: var(--muted); }
.t-alert { color: var(--sx-alert, var(--link)); }
.t-strong { font-weight: 700; }
.t-em { font-style: italic; }
.t-strike { text-decoration: line-through; text-decoration-color: var(--muted); }
.t-fm-key { color: var(--sx-attr, var(--fg)); }
.t-fm-val { color: var(--sx-str, var(--fg)); }

.c-kw { color: var(--sx-kw); font-weight: var(--sx-kw-weight, 400); font-style: var(--sx-kw-style, normal); }
.c-str { color: var(--sx-str); }
.c-fn { color: var(--sx-fn); }
.c-num { color: var(--sx-num); }
.c-com { color: var(--sx-com); font-style: var(--sx-com-style, normal); }
.c-type { color: var(--sx-type); }
.c-const { color: var(--sx-const); }
.c-attr { color: var(--sx-attr); }
.c-var { color: var(--sx-var); }

/* ------------------------------------------------------------ preview */

.preview-pane { scroll-padding-top: 20px; }

.md-root {
  max-width: 800px;
  margin: 0 auto;
  padding: 36px 56px 40vh 80px;
  outline: none;
  overflow-wrap: break-word;
}
[data-layout="split"] .md-root { padding: 28px 28px 40vh 64px; }

.md-root > * { margin: 0 0 16px; }

.md-root h1, .md-root h2, .md-root h3, .md-root h4 {
  position: relative;
  line-height: 1.25;
  font-weight: 700;
  scroll-margin-top: 20px;
}
.md-root h1 { font-size: 2.1em; margin-top: 8px; }
.md-root h2 { font-size: 1.55em; margin-top: 44px; }
.md-root h3 { font-size: 1.2em; margin-top: 30px; }
.md-root h4 { font-size: 1em; margin-top: 24px; }

/* The Markdown shows through: heading marks hang in the margin. */
.hmark {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  font: 400 .72em/1 var(--font-mono);
  color: var(--muted);
  opacity: .6;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .15s, color .15s;
}
.md-root h1 .hmark { font-size: .5em; }
h1:hover > .hmark, h2:hover > .hmark, h3:hover > .hmark, h4:hover > .hmark { opacity: 1; color: var(--sx-title, var(--link)); }

.md-root a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.md-root a:hover { text-decoration-thickness: 2px; }
.md-root strong { font-weight: 700; }
.md-root del { color: var(--muted); }

/* Inline code keeps its backticks, faintly. */
.md-root code {
  font: .86em var(--font-mono);
  padding: .12em .3em;
  border-radius: 4px;
  background: var(--muted-bg);
  border: 1px solid var(--border);
}
.md-root :not(pre) > code::before, .md-root :not(pre) > code::after { content: "`"; color: var(--muted); opacity: .55; }

/* Front matter as a property list, as Malgel shows it. */
.md-front {
  display: grid;
  grid-template-columns: max-content 1fr;
  margin-bottom: 36px !important;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  overflow: hidden;
}
.md-front div { display: contents; }
.md-front dt, .md-front dd { margin: 0; padding: 6px 14px; border-top: 1px solid var(--border); }
.md-front div:first-child > * { border-top: 0; }
.md-front dt { color: var(--muted); font-family: var(--font-mono); font-size: 12.5px; background: var(--muted-bg); }

/* Title block */
.md-root h1.doc-title {
  display: flex; align-items: center; gap: .4em;
  font-size: clamp(2.6em, 6vw, 3.6em);
  letter-spacing: -.02em;
  margin: 0 0 14px;
}
.md-root h1.doc-title::after {
  content: ""; order: -1; flex: none;
  width: 1.1em; height: 1.1em; margin: -.1em 0;
  background: url(../assets/malgel.svg) center / 125% no-repeat;
}
.md-root p.lede { font-size: 1.22em; line-height: 1.55; color: var(--fg); margin-bottom: 26px; }
.md-root p.lede strong { font-weight: 700; }

.md-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px !important; }
.md-actions a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--secondary-bg);
  color: var(--fg) !important;
  font-weight: 600; font-size: .95em;
  text-decoration: none !important;
  transition: background .15s, transform .15s;
}
.md-actions a::before { content: "["; font: 400 .95em var(--font-mono); opacity: .45; }
.md-actions a::after { content: "]"; font: 400 .95em var(--font-mono); opacity: .45; }
.md-actions a:hover { background: var(--secondary-hover); }
.md-actions a:first-child { background: var(--primary); border-color: var(--primary); color: var(--primary-fg) !important; }
.md-actions a:first-child:hover { filter: brightness(1.08); }
.md-actions a:active { transform: translateY(1px); }

/* Lists: the markers are the Markdown ones. */
.md-list { padding: 0; list-style: none; }
.md-list li { position: relative; padding-left: 1.6em; margin: 3px 0; }
.md-list li::before {
  content: attr(data-marker);
  position: absolute; left: 0; top: 0;
  width: 1.2em; text-align: left;
  font: .88em/1.82 var(--font-mono);
  color: var(--sx-list, var(--muted));
}
ol.md-list li::before { width: auto; }
ol.md-list li { padding-left: 1.9em; }
.md-list .md-list { margin: 3px 0 0; }
.md-list.loose li { margin: 10px 0; }
.md-list li > p { margin: 0 0 8px; }
.md-list li.task { display: flex; align-items: flex-start; gap: .5em; padding-left: 0; }
.md-list li.task::before { content: none; }
.md-list li.task > div { min-width: 0; }
.box {
  flex: none;
  width: 15px; height: 15px; margin-top: .36em;
  border: 1.5px solid var(--fg); border-radius: 3px;
  display: grid; place-items: center;
}
.task.done .box { background: var(--fg); }
.task.done .box::after {
  content: ""; width: 8px; height: 4px; margin-top: -2px;
  border: 2px solid var(--bg); border-top: 0; border-right: 0;
  transform: rotate(-45deg);
}
.md-list li.task .md-list { margin-left: 0; }

blockquote {
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--border);
  color: var(--muted);
  margin-left: 0 !important;
  margin-right: 0 !important;
}
blockquote > :last-child { margin-bottom: 0; }
blockquote p { margin: 0 0 8px; }

.md-hr { border: 0; height: auto; margin: 36px 0 !important; overflow: visible; text-align: left; }
.md-hr::after { content: "---"; font: 14px var(--font-mono); color: var(--muted); letter-spacing: .1em; }

/* GitHub alerts */
.md-alert {
  --c: var(--alert-note);
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--c) 55%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--c) 7%, var(--bg));
}
.alert-tip { --c: var(--alert-tip); }
.alert-important { --c: var(--alert-important); }
.alert-warning { --c: var(--alert-warning); }
.alert-caution { --c: var(--alert-caution); }
.md-alert > :last-child { margin-bottom: 0; }
.md-alert p { margin: 0 0 8px; }
.alert-title { display: flex; align-items: center; gap: 7px; color: var(--c); font-weight: 700; margin-bottom: 4px !important; }
.alert-title .icon { width: 16px; height: 16px; }

/* Tables */
.md-table { overflow-x: auto; }
.md-table table {
  border-collapse: separate; border-spacing: 0;
  min-width: 50%;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: .95em;
}
.md-table th, .md-table td { padding: 8px 12px; border-top: 1px solid var(--border); text-align: left; vertical-align: top; }
.md-table th + th, .md-table td + td { border-left: 1px solid var(--border); }
.md-table thead th { border-top: 0; color: var(--muted); font-weight: 500; }
.md-table img { display: block; max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--border); }

/* Code blocks: fences stay visible, as does the copy button. */
.md-code {
  position: relative;
  border-radius: 8px;
  background: var(--muted-bg);
  border: 1px solid var(--border);
  font: 13.5px/1.6 var(--font-mono);
}
.md-code .fence { padding: 8px 14px 0; color: var(--muted); font-size: 12px; opacity: .8; user-select: none; -webkit-user-select: none; }
.md-code .fence:last-child { padding: 0 14px 8px; }
.md-code pre { margin: 0; padding: 4px 14px; overflow-x: auto; }
.md-code pre code { font: inherit; background: none; border: 0; padding: 0; }
.md-code .copy {
  position: absolute; top: 8px; right: 8px;
  display: grid; place-items: center;
  width: 28px; height: 28px; padding: 0;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.md-code .copy:hover { background: var(--secondary-hover); color: var(--fg); border-color: var(--border); }
.md-code .copy .icon { width: 15px; height: 15px; }

/* Math and diagrams */
.md-math { overflow-x: auto; overflow-y: hidden; text-align: center; padding: 4px 0; }
.md-root .katex { font-size: 1.1em; }
.md-math .katex-display { margin: 0; }
.math-pending { font-family: var(--font-mono); font-size: .9em; color: var(--muted); }

.md-diagram { display: flex; justify-content: center; overflow-x: auto; padding: 8px 0; }
.md-diagram svg { max-width: 100%; height: auto; }
.fc-node { fill: color-mix(in srgb, var(--blue) 12%, var(--bg)); stroke: color-mix(in srgb, var(--blue) 70%, var(--fg)); stroke-width: 1.5; }
.fc-label { fill: var(--fg); font: 14px var(--font-ui); text-anchor: middle; dominant-baseline: central; }
.fc-edge { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.fc-edge.dotted { stroke-dasharray: 3 4; }
.fc-edge.thick { stroke-width: 3; }
.fc-arrowhead { fill: var(--muted); }
.fc-edge-label-bg { fill: var(--bg); }
.fc-edge-label { fill: var(--muted); font: 12.5px var(--font-ui); text-anchor: middle; dominant-baseline: central; }
.md-diagram.error { display: block; }
.md-diagram.error pre { margin: 0; padding: 10px 14px; border-radius: 8px 8px 0 0; background: var(--muted-bg); border: 1px solid var(--border); font: 13px/1.6 var(--font-mono); overflow-x: auto; }
.diagram-error { margin: 0; padding: 8px 14px; border: 1px solid color-mix(in srgb, var(--red) 55%, var(--border)); border-top: 0; border-radius: 0 0 8px 8px; color: var(--red); font-size: .9em; }

/* Images */
.md-figure { margin: 8px 0 24px !important; }
.md-root img { max-width: 100%; height: auto; }
.md-figure img {
  display: block;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px -24px rgb(0 0 0 / .35), 0 2px 8px rgb(0 0 0 / .06);
  cursor: zoom-in;
}
.md-table img { cursor: zoom-in; }
[data-mode="light"] .only-dark, [data-mode="dark"] .only-light { display: none !important; }

.theme-link[aria-current="true"] { font-weight: 700; text-decoration-thickness: 2px; }
.theme-link[aria-current="true"]::after { content: " ✓"; font-size: .8em; }

/* ------------------------------------------------------------ overlays */

.palette-backdrop { position: fixed; inset: 0; z-index: 40; display: flex; justify-content: center; align-items: flex-start; padding: 84px 16px 16px; }
.palette-backdrop[hidden] { display: none; }
.palette {
  width: min(448px, 100%);
  background: var(--popover-bg); color: var(--popover-fg);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 20px 50px -12px rgb(0 0 0 / .4);
  overflow: hidden;
}
.palette-input { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.palette-input svg { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; }
.palette-input input { flex: 1; border: 0; outline: none; background: none; color: inherit; font: 14px var(--font-ui); }
.palette-input input::placeholder { color: var(--muted); }
#paletteList { list-style: none; margin: 0; padding: 4px; max-height: 50vh; overflow: auto; }
#paletteList li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; font-size: 14px; cursor: default; }
#paletteList li[aria-selected="true"] { background: var(--accent-bg); color: var(--accent-fg); }
#paletteList .lvl { font: 600 11px var(--font-ui); color: var(--muted); width: 18px; }
#paletteList .lvl sub { font-size: 8px; }
#paletteList .empty { color: var(--muted); }
#paletteList li.indent-3 { padding-left: 22px; }

.lightbox {
  position: fixed; inset: 0; z-index: 45;
  display: grid; place-items: center; padding: 24px;
  background: rgb(0 0 0 / .7);
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 30px 80px rgb(0 0 0 / .5); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--status-h) + 16px); z-index: 50;
  transform: translate(-50%, 8px);
  padding: 7px 14px; border-radius: 8px;
  background: var(--primary); color: var(--primary-fg);
  font-size: 13.5px;
  opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ focus mode */

[data-focus] .titlebar, [data-focus] .statusbar, [data-focus] .outline,
[data-focus] .editor-pane, [data-focus] .divider { display: none; }
[data-focus] .window { grid-template-rows: 0 minmax(0, 1fr) 0; }
[data-focus] .panes { grid-template-columns: 0 0 minmax(0, 1fr) 0; }
[data-focus] .preview-pane { visibility: visible; }
[data-focus] .md-root { font-size: 19px; max-width: 760px; padding-top: 18vh; }
[data-focus] .md-root > * { opacity: .22; transition: opacity .25s; }
[data-focus] .md-root > .is-current { opacity: 1; }

/* ------------------------------------------------------------ narrow */

@media (max-width: 1100px) {
  .outline { display: none; }
  .panes { --outline-w: 0px !important; }
}

@media (max-width: 760px) {
  :root { --gutter: 44px; }
  .titlebar { grid-template-columns: 1fr auto; padding: 0 4px; }
  .doc-name, .menu-format, .tool-split, .st-hide, .st-theme { display: none; }
  .menu-btn { padding: 4px 7px; }
  [data-layout="split"] .panes { grid-template-columns: 0 0 minmax(0, 1fr) 0; }
  [data-layout="split"] .editor-pane { visibility: hidden; }
  [data-layout="split"] .preview-pane { visibility: visible; }
  .menu-pop { position: fixed; top: calc(var(--bar-h) + 4px); left: 8px; right: 8px; min-width: 0; }
  .sub-pop { position: static; box-shadow: none; border: 0; border-left: 2px solid var(--border); border-radius: 0; margin: 2px 0 4px 18px; max-height: none; }
  .md-root, [data-layout="split"] .md-root { padding: 24px 16px 30vh; }
  .hmark { position: static; transform: none; display: inline-block; margin-right: .35em; vertical-align: .08em; }
  .md-root h1.doc-title .hmark { display: none; }
  .editor { padding-right: 12px; }
  .ed-num { padding-right: 12px; }
  .ed-input { right: 12px; width: calc(100% - var(--gutter) - 12px); }
  .statusbar { gap: 12px; font-size: 12px; }
  .md-table table { font-size: .9em; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
