body { display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: #0a0807; }
.docwrap { position: relative; flex: 1; display: flex; min-height: 0; }
.outline { width: 230px; flex: none; padding: 22px 12px; overflow: auto; border-right: 1px solid var(--line); }
.outline .cap { font: 500 11px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 0 10px 10px; }
.outline button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 5px 10px; border-radius: 6px; cursor: pointer; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.outline button:hover { background: rgba(255,236,228,.06); color: var(--text); }
.outline button.h1 { color: var(--text); font-weight: 600; }
.outline button.h2 { padding-left: 20px; }
.outline button.h3 { padding-left: 30px; font-size: 12.5px; }
.outline .none { color: var(--faint); font-size: 12.5px; padding: 0 10px; }
.scroller { flex: 1; overflow: auto; padding: 28px 24px 80px; }
.paper { --z: 1; width: 816px; min-height: 1056px; margin: 0 auto; padding: 96px 96px; background: #fffdfc; color: #1d1715; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.5), 0 12px 40px rgba(0,0,0,.45); outline: none; font: 15px/1.6 "Noto Sans", Arial, sans-serif; caret-color: #e2361f; word-wrap: break-word; }
.paper ::selection { background: rgba(255,122,26,.3); }
.paper h1 { font-size: 30px; line-height: 1.25; margin: .7em 0 .35em; font-weight: 700; }
.paper h2 { font-size: 22px; line-height: 1.3; margin: .9em 0 .3em; font-weight: 700; }
.paper h3 { font-size: 17px; margin: .9em 0 .3em; font-weight: 700; color: #4a3a35; }
.paper h1:first-child, .paper h2:first-child { margin-top: 0; }
.paper p { margin: 0 0 .55em; }
.paper blockquote { margin: .8em 0; padding: .2em 0 .2em 16px; border-left: 3px solid #e2361f; color: #574843; }
.paper pre { background: #f4eeeb; padding: 12px 14px; border-radius: 6px; font: 13px/1.5 ui-monospace, monospace; white-space: pre-wrap; }
.paper a { color: #c42a12; }
.paper img { max-width: 100%; height: auto; border-radius: 2px; cursor: pointer; }
.paper img.sel { outline: 2px solid #ff7a1a; outline-offset: 2px; }
.paper hr { border: 0; border-top: 1px solid #d8ccc7; margin: 1.4em 0; }
.paper hr.pb { border-top: 2px dashed #e0b8ad; }
.paper table { border-collapse: collapse; width: 100%; margin: .6em 0; }
.paper td, .paper th { border: 1px solid #cfc2bd; padding: 6px 8px; vertical-align: top; min-width: 40px; }
.paper ul[data-checklist] { list-style: none; padding-left: 4px; }
.paper ul[data-checklist] li { position: relative; padding-left: 28px; }
.paper ul[data-checklist] li::before { content: ""; position: absolute; left: 2px; top: .3em; width: 15px; height: 15px; border: 1.6px solid #8f7f7a; border-radius: 4px; background: #fff; }
.paper ul[data-checklist] li[data-checked="true"] { color: #8f7f7a; text-decoration: line-through; }
.paper ul[data-checklist] li[data-checked="true"]::before { background: #e2361f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12l5 5 9-10' fill='none' stroke='white' stroke-width='3'/%3E%3C/svg%3E") center/12px no-repeat; border-color: #e2361f; }
.paper[contenteditable="false"] { caret-color: transparent; }
.paper:empty::before { content: "Start typing…"; color: #a8988f; }
.toolbar .tbtn { min-width: 30px; height: 30px; padding: 0 6px; border: 0; border-radius: 6px; background: none; cursor: pointer; display: inline-grid; place-items: center; font-weight: 600; }
.toolbar .tbtn:hover { background: rgba(255,236,228,.08); }
.toolbar .tbtn.on { background: rgba(226,54,31,.2); color: #ffc0b2; }
.toolbar .tbtn svg { width: 17px; height: 17px; }
.toolbar select.style { width: 118px; } .toolbar select.font { width: 120px; } .toolbar select.size { width: 64px; } .toolbar select.zoom { width: 74px; }
.find { position: absolute; right: 22px; top: 12px; z-index: 6; width: 330px; padding: 12px; display: grid; gap: 8px; background: var(--panel-solid); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.find .field { height: 34px; }
.find .frow { display: flex; align-items: center; gap: 6px; }
.find .btn { height: 30px; padding: 0 10px; }
.find .grow { flex: 1; }
.dstatus { display: flex; gap: 14px; padding: 5px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); background: rgba(8,6,6,.95); }
.dstatus .grow { flex: 1; }
.imgbar { position: fixed; z-index: 7; display: flex; gap: 2px; padding: 4px; background: var(--panel-solid); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.imgbar .btn { height: 28px; padding: 0 10px; }
@media (max-width: 1100px) { .outline { display: none; } }
@media (max-width: 860px) { .paper { width: 100%; padding: 40px 28px; min-height: 80vh; } }
@media print {
  body { display: block; height: auto; overflow: visible; background: #fff; }
  .outline, .dstatus, .find, .imgbar { display: none !important; }
  .docwrap, .scroller { display: block; overflow: visible; padding: 0; }
  .paper { width: auto; min-height: 0; padding: 0; box-shadow: none; transform: none; }
  .paper hr.pb { break-after: page; border: 0; }
}
