:root {
  --paper: #f4f0e8;
  --paper-deep: #eae4d9;
  --paper-light: #fbf9f4;
  --ink: #25231f;
  --ink-soft: #6e6960;
  --line: #d9d2c7;
  --accent: #e86545;
  --accent-dark: #c94e31;
  --green: #5d8069;
  --sidebar: 264px;
  --topbar: 78px;
  --statusbar: 30px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Avenir Next', Avenir, 'Segoe UI', sans-serif;
  color-scheme: light;
  font-synthesis: none;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  overflow: hidden;
}

button, input, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { display: flex; height: 100dvh; }

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #eee9df;
  position: relative;
  z-index: 20;
}

.brand-row { display: flex; align-items: center; justify-content: space-between; padding: 24px 22px 21px; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--ink);
  border-radius: 50% 50% 48% 52%;
  font: italic 700 21px/1 var(--serif);
  transform: rotate(-4deg);
}
.brand-mark.large { width: 48px; height: 48px; font-size: 28px; flex: none; }
.brand strong { display: block; font: 700 20px/1 var(--serif); letter-spacing: -.02em; }
.brand small { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 9px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }

.workspace-label { margin: 0 14px 16px; padding: 13px 12px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.28); display: flex; align-items: center; justify-content: space-between; }
.workspace-label span:not(.connection-dot) { display: block; color: var(--ink-soft); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }
.workspace-label strong { display: block; margin-top: 4px; font-size: 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #a9a39a; box-shadow: 0 0 0 3px rgba(169,163,154,.15); }
.connection-dot.online { background: var(--green); box-shadow: 0 0 0 3px rgba(93,128,105,.15); }

.local-workspace-button { margin: -7px 14px 13px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: transparent; display: grid; grid-template-columns: 17px minmax(0, 1fr) 7px; gap: 8px; align-items: center; text-align: left; cursor: pointer; }
.local-workspace-button:hover { background: rgba(255,255,255,.42); }
.local-workspace-button svg { width: 16px; color: var(--ink-soft); }
.local-workspace-button span { min-width: 0; }
.local-workspace-button small { display: block; color: #918a80; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.local-workspace-button strong { display: block; overflow: hidden; margin-top: 2px; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.local-workspace-button i { width: 6px; height: 6px; border-radius: 50%; background: #aaa39a; }
.local-workspace-button i.linked { background: var(--green); }

.new-post-button {
  margin: 0 14px 15px;
  min-height: 42px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--ink);
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}
.new-post-button:hover { background: #000; transform: translateY(-1px); }
.new-post-button kbd { margin-left: auto; opacity: .5; }

.explorer-controls { padding: 0 14px 13px; }
.scope-switcher { display: grid; grid-template-columns: 1fr 1fr; padding: 2px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 5px; }
.scope-switcher button { border: 0; border-radius: 3px; padding: 5px; background: transparent; color: var(--ink-soft); font-size: 8px; font-weight: 800; cursor: pointer; }
.scope-switcher button.active { background: var(--paper-light); color: var(--ink); box-shadow: 0 1px 3px rgba(40,34,27,.08); }
.file-search { height: 31px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.35); display: flex; align-items: center; gap: 6px; }
.file-search:focus-within { border-color: #aaa196; background: var(--paper-light); }
.file-search svg { width: 13px; color: #918a80; }
.file-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 10px; }
.file-search input::placeholder { color: #a49c91; }

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { display: none; }
kbd { padding: 2px 5px; border: 1px solid currentColor; border-radius: 3px; font: 9px/1.2 var(--sans); }

.explorer-heading { padding: 0 18px 9px 22px; display: flex; justify-content: space-between; align-items: center; color: var(--ink-soft); font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; cursor: pointer; }
.icon-button:hover { background: rgba(37,35,31,.07); }
.icon-button.subtle { width: 26px; height: 26px; }
.icon-button.subtle svg { width: 14px; }
.icon-button.spinning svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.file-list { flex: 1; overflow: auto; padding: 0 9px 16px; scrollbar-width: thin; scrollbar-color: #c6beb1 transparent; }
.file-group-label { padding: 14px 12px 6px; color: #928b80; font: 700 9px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.file-item { width: 100%; border: 0; border-radius: 5px; background: transparent; padding: 9px 10px; display: grid; grid-template-columns: 18px minmax(0, 1fr) 7px; gap: 9px; align-items: center; text-align: left; cursor: pointer; color: var(--ink-soft); }
.file-item:hover { background: rgba(255,255,255,.48); color: var(--ink); }
.file-item.active { background: var(--paper-light); color: var(--ink); box-shadow: 0 1px 4px rgba(45,39,30,.06); }
.file-item svg { width: 15px; height: 15px; }
.file-item .name { min-width: 0; font: 600 12px/1.2 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item .dirty-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: 0; }
.file-item.dirty .dirty-dot { opacity: 1; }
.tree-folder { width: 100%; padding: 6px 8px; border: 0; border-radius: 4px; background: transparent; display: grid; grid-template-columns: 14px 16px minmax(0,1fr); gap: 5px; align-items: center; color: var(--ink-soft); text-align: left; cursor: pointer; }
.tree-folder:hover { background: rgba(255,255,255,.4); color: var(--ink); }
.tree-folder .chevron { width: 11px; transition: transform .15s; }
.tree-folder.expanded .chevron { transform: rotate(90deg); }
.tree-folder .folder-icon { width: 14px; }
.tree-folder .name { overflow: hidden; font-size: 10px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.file-item.tree-file { padding-top: 6px; padding-bottom: 6px; }
.file-item.tree-file.binary { opacity: .62; }
.file-item.tree-file .name { font-size: 10px; }
.empty-state.compact { padding: 10px 12px; }
.skeleton-line { display: block; height: 29px; margin-bottom: 8px; border-radius: 4px; background: linear-gradient(90deg, #e1dbd1 25%, #eeeae2 50%, #e1dbd1 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
.skeleton-line.short { width: 70%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.file-empty { padding: 26px 16px; text-align: center; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }

.sidebar-footer { border-top: 1px solid var(--line); padding: 10px 12px max(10px, env(safe-area-inset-bottom)); display: flex; gap: 3px; }
.sidebar-action { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 4px; border: 0; border-radius: 5px; background: transparent; color: var(--ink-soft); font-size: 10px; cursor: pointer; }
.sidebar-action:hover { color: var(--ink); background: rgba(255,255,255,.4); }
.sidebar-action svg { width: 14px; height: 14px; }

.workspace { flex: 1; min-width: 0; height: 100%; display: grid; grid-template-rows: var(--topbar) minmax(0, 1fr) var(--statusbar); background-color: var(--paper-light); background-image: radial-gradient(rgba(55,46,35,.035) .7px, transparent .7px); background-size: 5px 5px; }
.topbar { grid-row: 1; border-bottom: 1px solid var(--line); padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(251,249,244,.88); backdrop-filter: blur(12px); }
.document-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.document-identity > div { min-width: 0; }
.eyebrow { color: #918a80; font-size: 8px; font-weight: 800; letter-spacing: .15em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.document-title { display: block; width: min(380px, 38vw); margin-top: 3px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 700 20px/1.2 var(--serif); text-overflow: ellipsis; }
.document-title:disabled { opacity: 1; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.view-switcher { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 6px; }
.view-switcher button { border: 0; border-radius: 4px; background: transparent; padding: 6px 9px; color: var(--ink-soft); font-size: 9px; font-weight: 700; cursor: pointer; }
.view-switcher button.active { background: var(--ink); color: #fff; }
.save-state { color: var(--ink-soft); font-size: 10px; white-space: nowrap; }
.save-state > span { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--green); vertical-align: 1px; }
.save-state.dirty > span { background: var(--accent); }
.save-state.saving > span { background: #d2a13c; animation: pulse .8s infinite alternate; }
@keyframes pulse { to { opacity: .35; } }

.primary-button { min-height: 38px; padding: 0 15px; border: 0; border-radius: 5px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; box-shadow: 0 2px 0 var(--accent-dark); transition: transform .15s, background .15s; }
.primary-button:hover:not(:disabled) { background: #d9593a; transform: translateY(-1px); }
.primary-button:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.primary-button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.primary-button svg { width: 15px; }
.primary-button kbd { opacity: .7; }
.primary-button.large { min-height: 45px; padding: 0 20px; }

.welcome { grid-row: 2; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; overflow: auto; }
.welcome-art { width: 145px; height: 112px; position: relative; margin-bottom: 22px; }
.paper { position: absolute; width: 78px; height: 96px; border: 1px solid #a99e90; border-radius: 2px; background: #fdfbf6; box-shadow: 4px 7px 0 rgba(60,50,38,.06); }
.paper-back { left: 22px; top: 2px; transform: rotate(-9deg); background: #eae3d7; }
.paper-front { left: 37px; top: 5px; transform: rotate(4deg); padding: 23px 13px; }
.paper-front i { display: block; height: 1px; background: #cfc6b8; margin-bottom: 9px; }
.paper-front i:nth-child(2) { width: 76%; }
.paper-front i:nth-child(4) { width: 52%; }
.pen { position: absolute; z-index: 3; width: 7px; height: 91px; top: 28px; right: 25px; border: 1px solid #9c4632; border-radius: 4px 4px 1px 1px; background: var(--accent); transform: rotate(32deg); box-shadow: 2px 3px 0 rgba(60,50,38,.08); }
.pen::after { content: ''; position: absolute; bottom: -11px; left: -1px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 12px solid #ba9c79; }
.welcome-kicker, .modal-kicker { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .19em; }
.welcome h1 { margin: 11px 0 14px; font: 700 clamp(37px, 4.2vw, 58px)/.98 var(--serif); letter-spacing: -.045em; }
.welcome h1 em { color: var(--accent); font-weight: 400; }
.welcome > p { max-width: 430px; margin: 0 0 22px; color: var(--ink-soft); font: 15px/1.65 var(--serif); }
.shortcut-hint { margin-top: 14px; color: #968e82; font-size: 9px; }

.editor-area { grid-row: 2; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.editor-area.write { grid-template-columns: 1fr; }
.editor-area.preview-only { grid-template-columns: 1fr; }
.editor-area.write .preview-pane { display: none; }
.editor-area.preview-only .editor-pane { display: none; }
.editor-pane, .preview-pane { min-width: 0; min-height: 0; display: grid; grid-template-rows: 34px minmax(0, 1fr); position: relative; }
.editor-pane { grid-template-rows: 34px 37px minmax(0, 1fr); }
.editor-pane { border-right: 1px solid var(--line); background: rgba(255,255,255,.2); }
.preview-pane { background: rgba(255,255,255,.34); }
.pane-label { padding: 0 21px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(217,210,199,.65); color: #9a9287; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
#editor { width: 100%; height: 100%; resize: none; border: 0; outline: 0; padding: 30px max(26px, 6vw) 90px; background: transparent; color: #34312c; font: 14px/1.82 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; tab-size: 2; caret-color: var(--accent); }
.editor-toolbar { padding: 4px 14px; border-bottom: 1px solid rgba(217,210,199,.65); display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.editor-toolbar::-webkit-scrollbar { display: none; }
.editor-toolbar button { flex: 0 0 auto; min-width: 27px; height: 27px; padding: 0 6px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-soft); font: 11px/1 var(--sans); cursor: pointer; }
.editor-toolbar button:hover { background: var(--paper-deep); color: var(--ink); }
.editor-toolbar > span { width: 1px; height: 16px; margin: 0 4px; background: var(--line); flex: none; }
.editor-toolbar.disabled { opacity: .42; pointer-events: none; }
.editor-plain-preview { margin: 0; color: var(--ink); font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.binary-notice { margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-deep); }
.markdown-body { min-height: 0; overflow: auto; padding: 42px max(30px, 7vw) 100px; font: 16px/1.72 var(--serif); overflow-wrap: anywhere; }
.markdown-body > *:first-child { margin-top: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { font-family: var(--serif); line-height: 1.15; letter-spacing: -.03em; }
.markdown-body h1 { font-size: 42px; margin: 0 0 27px; }
.markdown-body h2 { font-size: 27px; margin: 38px 0 13px; }
.markdown-body h3 { font-size: 20px; margin-top: 28px; }
.markdown-body p { margin: 0 0 20px; }
.markdown-body a { color: var(--accent-dark); text-underline-offset: 3px; }
.markdown-body blockquote { margin: 28px 0; padding: 2px 0 2px 21px; border-left: 3px solid var(--accent); color: var(--ink-soft); font-style: italic; }
.markdown-body code { padding: 2px 5px; border-radius: 3px; background: var(--paper-deep); font: 12px/1.5 ui-monospace, monospace; }
.markdown-body pre { overflow: auto; padding: 18px; border-radius: 6px; background: var(--ink); color: #eee8dc; }
.markdown-body pre code { padding: 0; background: transparent; color: inherit; }
.markdown-body img { display: block; max-width: 100%; height: auto; margin: 26px auto; border-radius: 4px; }
.markdown-body hr { margin: 35px 0; border: 0; border-top: 1px solid var(--line); }
.markdown-body ul, .markdown-body ol { padding-left: 24px; }
.frontmatter-card { margin: -12px 0 30px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 5px; background: rgba(238,233,223,.55); color: var(--ink-soft); font: 10px/1.7 ui-monospace, monospace; white-space: pre-wrap; }

.drop-overlay { display: none; position: absolute; inset: 71px 0 0; z-index: 4; align-items: center; justify-content: center; flex-direction: column; gap: 8px; background: rgba(244,240,232,.94); border: 2px dashed var(--accent); color: var(--ink-soft); }
.drop-overlay.visible { display: flex; }
.drop-overlay svg { width: 32px; height: 32px; color: var(--accent); }
.drop-overlay strong { color: var(--ink); font-family: var(--serif); font-size: 19px; }
.drop-overlay span { font-size: 11px; }

.draft-banner { grid-row: 2; align-self: start; z-index: 6; margin: 0; padding: 8px 18px; background: #fff1c9; border-bottom: 1px solid #e8d49b; display: flex; align-items: center; justify-content: space-between; font-size: 11px; }
.draft-banner[hidden] { display: none; }
.draft-banner > div { display: flex; align-items: center; gap: 8px; }
.draft-banner svg { width: 15px; }
.draft-banner button { border: 0; background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.draft-banner button:last-child { padding: 6px 9px; border-radius: 4px; background: var(--ink); color: #fff; }

.statusbar { grid-row: 3; padding: 0 15px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 17px; color: #898278; background: #eee9df; font-size: 8px; font-weight: 700; letter-spacing: .04em; }
.statusbar > span { display: inline-flex; align-items: center; gap: 5px; }
.statusbar i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.status-spacer { flex: 1; }

.modal { width: min(530px, calc(100vw - 32px)); padding: 0; border: 1px solid #cfc6b9; border-radius: 9px; color: var(--ink); background: var(--paper-light); box-shadow: 0 24px 80px rgba(44,36,27,.24); }
.modal::backdrop { background: rgba(35,31,26,.48); backdrop-filter: blur(3px); }
.modal form { padding: 29px; }
.modal-heading { display: flex; align-items: center; gap: 15px; margin-bottom: 8px; }
.modal-heading.simple { justify-content: space-between; align-items: flex-start; }
.modal-heading h2 { margin: 4px 0 0; font: 700 27px/1.1 var(--serif); letter-spacing: -.025em; }
.modal-intro { margin: 0 0 23px 63px; color: var(--ink-soft); font: 13px/1.5 var(--serif); }
.modal label:not(.checkbox-label) { display: block; margin-top: 16px; color: var(--ink-soft); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.modal input:not([type="checkbox"]) { width: 100%; height: 40px; margin-top: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 5px; outline: 0; background: #fffdf8; color: var(--ink); font-size: 12px; text-transform: none; letter-spacing: 0; transition: border .15s, box-shadow .15s; }
.modal input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,101,69,.1); }
.form-grid { display: grid; gap: 13px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.password-field, .suffix-field { position: relative; }
.password-field button { position: absolute; right: 3px; bottom: 3px; width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer; }
.password-field input { padding-right: 40px !important; }
.suffix-field input { padding-right: 42px !important; }
.suffix-field span { position: absolute; right: 11px; bottom: 12px; color: var(--ink-soft); font-size: 12px; text-transform: none; letter-spacing: 0; }
.checkbox-label { display: flex; gap: 8px; align-items: center; margin-top: 16px; color: var(--ink-soft); font-size: 11px; cursor: pointer; }
.checkbox-label input { accent-color: var(--accent); }
.form-note { display: flex; gap: 9px; margin-top: 19px; padding: 11px 12px; border-radius: 5px; background: #eee9df; color: var(--ink-soft); font-size: 10px; line-height: 1.45; }
.form-note svg { width: 14px; flex: none; }
.form-error { min-height: 16px; margin: 10px 0 0; color: #b5412c; font-size: 10px; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 8px; }
.text-button { min-height: 38px; padding: 0 13px; border: 0; background: transparent; color: var(--ink-soft); font-size: 11px; font-weight: 700; cursor: pointer; }
.text-button:hover { color: var(--ink); }
.secondary-button { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--ink-soft); font-size: 11px; font-weight: 700; cursor: pointer; }
.secondary-button:hover { color: var(--ink); background: var(--paper-deep); }
.small-modal { width: min(435px, calc(100vw - 32px)); }
.commit-path { padding: 9px 11px; border-radius: 4px; background: var(--paper-deep); color: var(--ink-soft); font: 10px/1.4 ui-monospace, monospace; overflow-wrap: anywhere; }
.workspace-description { color: var(--ink-soft); font: 13px/1.55 var(--serif); }
.workspace-state { margin: 18px 0 8px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-deep); display: flex; align-items: center; gap: 11px; }
.workspace-state svg { width: 22px; color: var(--accent); }
.workspace-state span { display: block; color: #928b80; font-size: 7px; font-weight: 800; letter-spacing: .14em; }
.workspace-state strong { display: block; margin-top: 4px; font-size: 12px; }
.workspace-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.workspace-progress { margin: 12px 0 0; color: var(--ink-soft); font-size: 10px; text-align: right; }

.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 42px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { min-width: 240px; max-width: 360px; padding: 12px 14px; border-radius: 6px; color: #fff; background: var(--ink); box-shadow: 0 8px 26px rgba(30,25,19,.2); display: flex; align-items: center; gap: 9px; font-size: 11px; animation: toast-in .24s ease both; }
.toast.error { background: #9f3829; }
.toast svg { width: 15px; flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.sidebar-scrim, .mobile-only { display: none; }

@media (max-width: 900px) {
  .view-switcher button[data-view="split"] { display: none; }
  .save-state { display: none; }
  .topbar { padding: 0 15px; }
  .editor-area { grid-template-columns: 1fr; }
  .editor-area:not(.preview-only) .preview-pane { display: none; }
  .document-title { width: min(280px, 35vw); }
}

@media (max-width: 680px) {
  :root { --topbar: 68px; }
  .mobile-only { display: grid; }
  .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-102%); transition: transform .24s ease; box-shadow: 8px 0 30px rgba(30,25,19,.18); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { display: block; position: fixed; z-index: 19; inset: 0; border: 0; background: rgba(30,27,23,.4); opacity: 0; visibility: hidden; transition: opacity .24s, visibility .24s; }
  .sidebar.open + .sidebar-scrim { opacity: 1; visibility: visible; }
  .topbar-actions { gap: 7px; }
  .primary-button kbd { display: none; }
  .view-switcher { display: none; }
  .document-title { width: 42vw; font-size: 17px; }
  .eyebrow { max-width: 42vw; }
  #editor { padding: 24px 21px 80px; }
  .markdown-body { padding: 30px 24px 80px; }
  .statusbar { gap: 11px; }
  #cursor-position { display: none; }
  .form-grid.two { grid-template-columns: 1fr; gap: 0; }
  .modal form { padding: 23px; }
  .modal-intro { margin-left: 0; }
  .draft-banner { align-items: flex-start; gap: 7px; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
