:root {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  --bg:#faf9f6;
  --sidebar:#f1f0eb;
  --surface:#fffefa;
  --text:#343630;
  --muted:#83847b;
  --border:#e4e3dc;
  --accent:#c3366a;
  --accent-fill:#d43b73;
  --accent-on:#000000;
  --accent-hover:#d84f81;
  --accent-border:#f1cad5;
  --accent-selection:#d43b7338;
  --accent-soft:#f5e2e6;
  --hover:#e9e8e1;
  --code:#f0efea;
  --preview-size:16px;
  --editor-width:50%;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
select,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
}
button {
  border: 0;
  background: transparent;
}
button:hover {
  background: var(--hover);
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button:disabled {
  opacity: .4;
  cursor: default;
}
button,
select {
  border-radius: 6px;
}
button {
  transition: background .15s, color .15s;
}
button:active {
  transform: translateY(1px);
}
[hidden] {
  display: none !important;
}
.app {
  height: 100dvh;
  min-height: 400px;
  display: grid;
  grid-template-columns: var(--sidebar-width, 254px) minmax(0, 1fr);
}
.app.sidebar-hidden {
  grid-template-columns: minmax(0, 1fr);
}
.sidebar-hidden aside {
  display: none;
}
aside {
  position: relative;
  min-width: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 29px 18px 0;
  overflow: hidden;
}
#sidebar-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  touch-action: none;
  z-index: 2;
}
#sidebar-handle:hover,
#sidebar-handle:focus-visible,
.resizing-sidebar #sidebar-handle {
  background: var(--accent-fill);
}
#sidebar-handle:focus-visible {
  outline-offset: -2px;
}
.resizing-sidebar,
.resizing-sidebar * {
  cursor: col-resize !important;
  user-select: none !important;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  font-weight: 650;
  font-size: 22px;
  letter-spacing: -1px;
  color: var(--text);
  text-decoration: none;
  margin: 0 8px 42px;
}
.brand-mark {
  width: 32px;
  height: 32px;
  background: var(--accent-fill);
  color: var(--accent-on);
  border-radius: 8px;
  font: 700 26px Georgia;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -2px;
}
.brand-mark span {
  font: 15px sans-serif;
  align-self: flex-end;
  margin-bottom: 5px;
  margin-left: 1px;
}
.brand-dot {
  color: var(--accent);
}
.workspace-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1.3px;
  margin: 0 10px 17px;
  color: var(--muted);
}
.workspace-label > span {
  font-size: 8px;
  letter-spacing: 1px;
  border: 1px solid #d6d8cb;
  border-radius: 4px;
  padding: 3px 5px;
  color: #748269;
}
.file-actions {
  display: grid;
  gap: 7px;
}
.primary {
  height: 40px;
  background: var(--accent-fill);
  color: var(--accent-on);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 3px #0000000b;
}
.primary:hover {
  background: var(--accent-hover);
}
.primary > span {
  font-size: 19px;
  font-weight: 400;
}
.primary kbd {
  margin-left: auto;
  color: var(--accent-on);
}
kbd {
  font-family: inherit;
  font-size: 10px;
  color: var(--muted);
}
.folder-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 19px;
  border: 1px solid var(--border);
}
.folder-button span {
  font-size: 12px;
}
.files-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 30px 6px 6px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
  font-weight: 600;
}
.files-heading > span > span {
  font-size: 9px;
  background: var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  margin-left: 5px;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  font-size: 17px;
  color: var(--muted);
  flex-shrink: 0;
}
.search-wrap {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 0 6px 13px;
  color: var(--muted);
}
.search-wrap > span {
  font-size: 20px;
}
.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 11px;
  padding: 7px 2px;
  outline-offset: 0;
}
.search-wrap input::placeholder {
  color: var(--muted);
}
#file-list {
  overflow: auto;
  flex: 1;
  min-height: 60px;
}
.file-entry {
  position: relative;
}
.remove-file {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
}
.remove-file:hover,
.remove-file:focus-visible {
  color: var(--accent);
  background: var(--hover);
}
.remove-file:active {
  transform: translateY(-50%);
}
.file-row {
  display: flex;
  width: 100%;
  gap: 9px;
  align-items: center;
  padding: 10px 36px 10px 11px;
  margin-bottom: 3px;
  font-size: 12px;
  text-align: left;
  border: 1px solid transparent;
}
.file-row.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
}
.file-row .file-icon {
  font-size: 10px;
  font-weight: 700;
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 2px;
  opacity: .65;
}
.file-row .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-row .unsaved {
  font-size: 8px;
}
.folder-group summary {
  font-size: 11px;
  color: var(--muted);
  padding: 8px 4px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.folder-group > .file-entry .file-row {
  padding-left: 17px;
}
.empty-files {
  font-size: 12px;
  color: var(--muted);
  padding: 12px;
}
.sidebar-bottom {
  padding-top: 20px;
}
.drop-card {
  border: 1px dashed #d5d4c9;
  border-radius: 8px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 20px 5px;
  color: var(--muted);
}
.drop-symbol {
  font-size: 24px;
  line-height: 1;
}
.drop-card > span:not(.drop-symbol) {
  font-size: 10px;
  line-height: 1.7;
}
.drop-card .file-types {
  font-family: ui-monospace, monospace;
  font-size: 9px !important;
  opacity: .7;
}
.sidebar-settings {
  display: flex;
  align-items: center;
  height: 54px;
}
#settings {
  width: 36px;
  height: 36px;
  font-size: 24px;
}
.app.footer-hidden aside { bottom: 0; }
.green-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  flex-shrink: 0;
}
main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.topbar {
  height: 74px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 27px;
  gap: 10px;
}
.document-location {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  font-size: 12px;
}
.sidebar-icon {
  font-size: 21px;
  margin-right: 1px;
}
.breadcrumb-label,
.breadcrumb-slash {
  color: var(--muted);
}
.breadcrumb-slash {
  opacity: .45;
}
#document-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 500;
}
#dirty-dot {
  font-size: 7px;
  color: var(--accent);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}
.accent-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
#accent-color {
  width: 36px;
  height: 36px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}
#accent-color::-webkit-color-swatch-wrapper { padding: 0; }
#accent-color::-webkit-color-swatch { border: 0; border-radius: 3px; }
#accent-color::-moz-color-swatch { border: 0; border-radius: 3px; }
#reset-accent { padding: 8px 10px; border: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.vertical-rule {
  height: 18px;
  width: 1px;
  background: var(--border);
}
.save-button {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.save-button > span {
  font-size: 18px;
}
.save-button kbd {
  margin-left: 6px;
  font-size: 9px;
}
.viewbar {
  min-height: 61px;
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 10px 31px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.view-tabs {
  display: flex;
  gap: 3px;
  background: var(--sidebar);
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 7px;
}
.view-tabs button {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 15px;
  padding: 6px 12px;
}
.view-tabs button span {
  font-size: 11px;
}
.view-tabs [aria-selected=true] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px #292b2310;
}
.reading-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}
.width-control {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
}
.focus-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
}
#width-select {
  width: 72px;
}
.type-label {
  font-family: Georgia, serif;
  font-size: 17px;
  color: var(--muted);
}
select {
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 11px;
  padding: 6px 3px;
  max-width: 110px;
}
select option {
  background: var(--surface);
}
.reading-options .icon-button {
  font-size: 12px;
  width: 27px;
}
.reading-options #help {
  border: 1px solid var(--border);
  border-radius: 50%;
  height: 17px;
  width: 17px;
  font-size: 10px;
  margin-left: 7px;
}
.document-area {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
  overflow: hidden;
}
#preview-panel {
  overflow: auto;
  width: 100%;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.paper {
  max-width: 796px;
  margin: 0 auto;
  padding: 55px 65px 30px;
}
.paper-eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 8px;
  letter-spacing: 1.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 24px;
}
.little-file {
  font-size: 9px;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 3px;
  letter-spacing: -.5px;
  color: var(--accent);
}
.markdown {
  font-size: var(--preview-size);
  line-height: 1.85;
  overflow-wrap: anywhere;
}
.markdown > :first-child {
  margin-top: 0;
}
.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
  line-height: 1.35;
  letter-spacing: -.7px;
  font-weight: 600;
  color: var(--text);
  margin: 1.8em 0 .7em;
}
.markdown h1 {
  font-size: 2.3em;
  letter-spacing: -1.5px;
  font-weight: 650;
  line-height: 1.2;
  margin-bottom: .55em;
}
.markdown h2 {
  font-size: 1.25em;
}
.markdown h3 {
  font-size: 1.06em;
}
.markdown p {
  margin: .85em 0;
  color: var(--text);
}
.markdown h1 + p {
  color: var(--muted);
  font-size: 1.05em;
  line-height: 1.75;
}
.markdown a {
  color: var(--accent);
  text-underline-offset: 3px;
}
.markdown ul,
.markdown ol {
  padding-left: 1.45em;
}
.markdown li {
  padding-left: .3em;
  margin: .3em 0;
}
.markdown li::marker {
  color: var(--muted);
}
.markdown input {
  accent-color: var(--accent);
  margin-right: 7px;
}
.markdown blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.6em 0;
  padding: 5px 20px;
  background: var(--accent-soft);
  border-radius: 0 5px 5px 0;
}
.markdown blockquote p {
  font-size: .92em;
  margin: 8px 0;
}
.markdown code {
  background: var(--code);
  padding: 3px 6px;
  border-radius: 4px;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  font-size: .8em;
  color: var(--accent);
}
.markdown pre {
  background: var(--code);
  border: 1px solid var(--border);
  padding: 19px 22px;
  border-radius: 7px;
  overflow: auto;
  line-height: 1.65;
}
.markdown pre code {
  padding: 0;
  background: none;
  color: var(--text);
  font-size: .78em;
  white-space: pre;
  overflow-wrap: normal;
}
.markdown hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}
.markdown table {
  border-collapse: collapse;
  width: 100%;
  display: block;
  overflow: auto;
  font-size: .87em;
}
.markdown th,
.markdown td {
  border: 1px solid var(--border);
  padding: 8px 13px;
  text-align: left;
}
.markdown th {
  background: var(--code);
  font-weight: 600;
}
.markdown img {
  max-width: 100%;
  height: auto;
}
.blocked-image {
  font-size: .85em;
  color: var(--muted);
  background: var(--code);
  border: 1px dashed var(--border);
  padding: 6px 10px;
  border-radius: 4px;
  display: inline-block;
}
.paper-end {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-top: 42px;
  color: #c2c1b6;
  font-size: 13px;
}
.paper-end span:not(:nth-child(2)) {
  height: 1px;
  width: 35px;
  background: var(--border);
}
footer {
  height: 35px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 23px;
  font-size: 9px;
  color: var(--muted);
  background: var(--bg);
  gap: 10px;
}
footer > div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.document-stats {
  gap: 19px;
}
.markdown-label {
  color: var(--accent);
}
#editor-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  background: var(--surface);
}
.editor-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 43px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}
.editor-tools > span {
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--muted);
}
.editor-tools > div {
  display: flex;
  gap: 2px;
}
.editor-tools button {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  min-width: 27px;
  height: 27px;
  color: var(--muted);
}
#editor {
  resize: none;
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font:
    13px/1.9 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  padding: 30px;
  tab-size: 2;
  overflow: auto;
}
#editor:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent-soft);
}
[data-mode=split] #editor-panel {
  width: var(--editor-width);
  flex-shrink: 0;
}
[data-mode=split] #preview-panel {
  flex: 1;
  min-width: 0;
}
[data-mode=split] .paper {
  padding: 35px 35px 25px;
}
[data-mode=split] .markdown h1 {
  font-size: 1.9em;
}
#split-handle {
  width: 7px;
  flex-shrink: 0;
  background: var(--border);
  cursor: col-resize;
  position: relative;
  touch-action: none;
}
#split-handle:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  height: 30px;
  width: 3px;
  background: var(--muted);
  border-radius: 3px;
  opacity: .5;
}
#split-handle:hover,
#split-handle:focus-visible {
  background: var(--accent-soft);
}
#exit-focus {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  opacity: .45;
}
#exit-focus:hover,
#exit-focus:focus-visible {
  opacity: 1;
  color: var(--text);
  background: var(--hover);
}
.app.focus-mode {
  grid-template-columns: minmax(0, 1fr);
}
.app.focus-mode > aside,
.app.focus-mode .topbar,
.app.focus-mode .viewbar,
.app.focus-mode footer,
.app.focus-mode .paper-eyebrow,
.app.focus-mode .paper-end {
  display: none;
}
#drop-overlay {
  position: fixed;
  inset: 12px;
  background: var(--bg);
  opacity: .98;
  border: 2px dashed var(--accent);
  border-radius: 14px;
  z-index: 20;
  display: grid;
  place-items: center;
  text-align: center;
  pointer-events: none;
}
#drop-overlay div > span {
  font-size: 55px;
  color: var(--accent);
}
#drop-overlay h2 {
  font: 32px Georgia, serif;
}
#drop-overlay p {
  font-size: 14px;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(90vw, 560px);
  background: var(--text);
  color: var(--bg);
  padding: 12px 20px;
  font-size: 12px;
  border-radius: 8px;
  box-shadow: 0 4px 25px #0002;
  z-index: 30;
}
dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 33px;
  max-width: 470px;
  width: calc(100% - 40px);
  box-shadow: 0 20px 90px #0003;
}
dialog::backdrop {
  background: #171a164d;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font: 27px Georgia, serif;
  letter-spacing: -.7px;
  margin: 0 0 18px;
}
dialog p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}
.dialog-close {
  position: absolute;
  right: 10px;
  top: 10px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.settings-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 20px 0;
  font-size: 13px;
  line-height: 1.6;
  cursor: pointer;
}
.settings-checkbox input { margin: 4px 0 0; accent-color: var(--accent); }
.settings-about { color: var(--accent); font-size: 12px; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; }
.shortcut-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.shortcut-row kbd {
  font-size: 11px;
}
.dialog-actions {
  display: flex;
  gap: 9px;
  margin-top: 20px;
}
.dialog-actions button {
  padding: 10px 15px;
  background: var(--accent-fill);
  color: var(--accent-on);
  font-size: 12px;
}
.dialog-actions button + button {
  background: var(--hover);
  color: var(--text);
}
html[data-font=serif] .markdown {
  font-family:
    Georgia,
    "Times New Roman",
    serif;
}
html[data-font=mono] .markdown {
  font-family:
    ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
html[data-theme=dark] {
  --bg:#20231f;
  --sidebar:#1b1e1a;
  --surface:#252823;
  --text:#dcded5;
  --muted:#92988a;
  --border:#353a31;
  --accent:#dd6692;
  --accent-soft:#40272e;
  --accent-border:#5f2b3c;
  --hover:#30352c;
  --code:#292e26;
  color-scheme: dark;
}
html[data-theme=dark] .primary {
  background: var(--accent-fill);
  color: var(--accent-on);
}
html[data-theme=dark] .drop-card {
  border-color: var(--border);
}
::selection {
  background: var(--accent-selection);
}
@media (min-width: 1500px) {
  .paper {
    padding-top: 70px;
    max-width: 850px;
  }
  .app {
    grid-template-columns: var(--sidebar-width, 270px) minmax(0, 1fr);
  }
}
html[data-preview-width=wide] .paper {
  max-width: 1120px;
  padding-inline: 32px;
}
html[data-preview-width=fluid] .paper {
  max-width: none;
  padding-inline: 16px;
}
html[data-preview-width=wide] [data-mode=split] .paper {
  padding-inline: 24px;
}
@media (max-width: 1000px) {
  .app {
    grid-template-columns: var(--sidebar-width, 220px) minmax(0, 1fr);
  }
  aside {
    padding: 25px 13px 0;
  }
  .paper {
    padding: 40px 40px 30px;
  }
  .viewbar {
    padding: 10px 20px;
  }
  .reading-options {
    gap: 3px;
  }
  .topbar {
    padding: 0 17px;
  }
  .view-tabs button {
    padding: 6px 9px;
  }
  .document-location {
    gap: 9px;
  }
  .breadcrumb-label,
  .breadcrumb-slash {
    display: none;
  }
}
@media (max-width: 700px) {
  #sidebar-handle {
    display: none;
  }
  .app {
    grid-template-columns: minmax(0, 1fr);
  }
  aside {
    position: fixed;
    left: 0;
    top: 74px;
    bottom: 35px;
    width: 254px;
    z-index: 10;
    box-shadow: 10px 0 30px #0002;
    padding-top: 20px;
  }
  .brand {
    margin-bottom: 25px;
  }
  .viewbar {
    padding: 8px 12px;
    min-height: 58px;
  }
  .type-label {
    display: none;
  }
  .reading-options #help {
    display: none;
  }
  .reading-options select {
    width: 85px;
  }
  .reading-options {
    gap: 0;
  }
  html[data-preview-width=wide] .paper,
  html[data-preview-width=wide] [data-mode=split] .paper {
    padding-inline: 20px;
  }
  html[data-preview-width=fluid] .paper {
    padding-inline: 12px;
  }
  .view-tabs button {
    padding: 6px 7px;
    gap: 4px;
  }
  .view-tabs button span {
    font-size: 10px;
  }
  .view-tabs button {
    font-size: 12px;
  }
  .paper {
    padding: 35px 25px 25px;
  }
  .markdown {
    font-size: calc(var(--preview-size) - 1px);
  }
  .markdown h1 {
    font-size: 2em;
  }
  .save-button kbd {
    display: none;
  }
  .header-actions {
    gap: 7px;
  }
  .document-area[data-mode=split] {
    flex-direction: column;
  }
  [data-mode=split] #editor-panel {
    width: 100%;
    height: 45%;
    min-height: 90px;
  }
  [data-mode=split] #preview-panel {
    width: 100%;
  }
  #split-handle {
    width: 100%;
    height: 7px;
    cursor: row-resize;
  }
  #split-handle:after {
    top: 2px;
    left: 50%;
    width: 30px;
    height: 3px;
  }
  #editor {
    padding: 18px;
  }
  .editor-tools {
    min-height: 34px;
  }
  .document-stats {
    gap: 10px;
  }
  .footer-encoding {
    display: none;
  }
  footer {
    padding: 0 12px;
    font-size: 8px;
  }
  [data-mode=split] .paper {
    padding: 25px;
  }
}
/* Readable text fields avoid iOS focus zoom, including wider touch layouts.
   Keep the viewport zoomable so people can still enlarge content themselves. */
@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  #editor,
  #file-search {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Mermaid is rendered offscreen, then displayed as an isolated SVG image. */
.mermaid-render-stage {
  position: fixed;
  left: -100000px;
  top: 0;
  width: 1200px;
  pointer-events: none;
}
.diagram-block {
  margin: 1.5em 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: auto;
}
.markdown .mermaid-diagram {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}
.diagram-status {
  font-size: 12px;
  color: var(--muted);
}
.markdown .diagram-error {
  color: var(--accent);
  white-space: pre-wrap;
}
.diagram-source {
  margin-top: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  color: var(--muted);
}
.diagram-source summary {
  cursor: pointer;
  width: fit-content;
}
.markdown .diagram-source pre {
  font-size: 13px;
  color: var(--text);
}
