:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #2c3330;
  background: #faf8f4;
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #dfa7a5; outline-offset: 2px; }
[hidden] { display: none !important; }
.workspace { display: grid; grid-template-columns: minmax(260px, 332px) minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { display: flex; min-height: 0; flex-direction: column; background: #fffcf9; border-right: 1px solid #e9e5e0; }
.brand { padding: 28px 23px 25px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid #f0ebe7; }
.brand img { border-radius: 15px; box-shadow: 0 3px 10px rgba(155, 68, 68, .08); }
.brand-name { display: flex; flex-direction: column; gap: 4px; }
.brand-name strong { font-size: 18px; font-weight: 730; letter-spacing: -.5px; color: #333b37; }
.brand-name span { color: #99918b; font-size: 12px; }
.sidebar-heading { display: flex; justify-content: space-between; align-items: center; padding: 23px 17px 11px 23px; gap: 10px; }
.sidebar-heading > span { color: #918b84; letter-spacing: .13em; font-size: 10px; font-weight: 750; }
.tree-scroll { flex: 1; overflow: auto; padding: 7px 10px 24px; min-height: 0; overscroll-behavior: contain; }
.tree { min-width: 100%; width: max-content; }
.tree-row { display: flex; align-items: center; min-height: 40px; gap: 2px; border-radius: 10px; padding-right: 8px; margin-block: 1px; color: #514f4d; width: 100%; }
.tree-row.active { background: #fceced; color: #9a2944; }
.tree-row:hover:not(.active) { background: #f8f4ef; }
.twisty { flex: none; display: inline-flex; justify-content: center; align-items: center; width: 29px; height: 36px; border: 0; background: none; color: #9d9790; border-radius: 7px; font-size: 20px; line-height: 1; }
.twisty:not(:disabled):hover { background: #f0ebe6; }
.twisty:disabled { cursor: default; opacity: .27; }
.node-label { flex: 1; min-width: 70px; max-width: 290px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; padding: 8px 5px 8px 2px; border: 0; background: transparent; color: inherit; font-size: 14px; font-weight: 500; }
.tree-row.depth-0 .node-label { font-weight: 660; }
.tree-row.active .node-label { font-weight: 690; }
.sidebar-footer { padding: 16px 17px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid #eee9e4; }
.backup-actions { display: flex; gap: 10px; }
.sidebar-footer p { margin: 11px 6px 0; color: #a29b94; font-size: 11px; }
.button { display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; min-height: 38px; padding: 0 15px; font-size: 13px; font-weight: 680; border: 1px solid transparent; white-space: nowrap; transition: background .15s, border-color .15s; }
.button-small { min-height: 30px; padding-inline: 12px; font-size: 12px; }
.button-rose { background: #b63b56; color: #fff; border-color: #b63b56; }
.button-rose:hover { background: #9f2f48; }
.button-soft { background: #f7f2ef; color: #6e625c; border-color: #eae2dc; }
.button-soft:hover { background: #eee6e1; }
.button-quiet { background: transparent; color: #a16d71; border-color: transparent; }
.button-quiet:hover { background: #fbeeee; }
.button-plain { background: #fff; color: #6b6661; border: 1px solid #ebe5df; flex: 1; }
.button-plain:hover { background: #f8f4f0; }
.editor-panel { overflow-y: auto; min-width: 0; background: #faf8f4; }
.document { max-width: 870px; min-height: calc(100dvh - 72px); margin: 38px auto 34px; background: #fff; box-shadow: 0 12px 45px rgba(59, 49, 44, .04); border: 1px solid #f1eae4; border-radius: 19px; overflow: hidden; display: flex; flex-direction: column; }
.document-header { padding: 44px 52px 26px; border-bottom: 1px solid #f3eee9; }
.document-top { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.eyebrow { color: #a29c93; letter-spacing: .08em; font-size: 11px; font-weight: 740; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.save-status { color: #6a9b80; font-size: 11px; flex: none; }
.save-status.pending { color: #a58960; }
.save-status.error { color: #b63b56; }
.note-title { display: block; border: none; padding: 0; margin: 25px 0 23px; outline: none; width: 100%; color: #333a35; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.035em; font-weight: 750; }
.note-title::placeholder { color: #b9b4ad; }
.note-title:focus-visible { outline: none; }
.note-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notepad { display: flex; flex-direction: column; flex: 1; padding: 27px 52px 40px; min-height: 390px; }
.note-caption { font-size: 10px; font-weight: 750; letter-spacing: .13em; color: #ada59d; margin-bottom: 14px; }
#noteText { border: none; outline: none; resize: vertical; min-height: 310px; flex: 1; width: 100%; font-size: 15px; line-height: 1.85; color: #484d48; background: transparent; padding: 0; }
#noteText::placeholder { color: #b7b3ab; }
#noteText:focus-visible { outline: none; }
.empty-state { max-width: 480px; margin: min(22vh, 190px) auto; text-align: center; padding: 20px; }
.empty-state img { border-radius: 24px; }
.empty-state h1 { font-size: 25px; letter-spacing: -.025em; }
.empty-state p { color: #8e8881; font-size: 15px; line-height: 1.6; }
.mobile-nav { display: none; }
.move-dialog { width: min(460px, calc(100vw - 30px)); border: 1px solid #ece0d8; background: #fffefa; border-radius: 17px; box-shadow: 0 22px 70px rgba(43, 32, 25, .2); padding: 29px; color: #333a35; }
.move-dialog::backdrop { background: rgba(41, 34, 33, .35); }
.move-dialog form { display: flex; flex-direction: column; gap: 9px; }
.dialog-heading h2 { margin: 0; font-size: 21px; }
.dialog-heading p { margin: 9px 0 17px; color: #837a73; font-size: 13px; line-height: 1.5; }
.move-dialog label { font-size: 12px; font-weight: 700; color: #706861; margin-top: 6px; }
.move-dialog select { width: 100%; border: 1px solid #ded5ce; background: #fff; border-radius: 9px; padding: 12px; font-size: 14px; color: #3c423e; }
.dialog-buttons { display: flex; justify-content: flex-end; gap: 9px; margin-top: 21px; }
.toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: #293934; color: white; border-radius: 11px; padding: 11px 18px; font-size: 13px; box-shadow: 0 8px 30px rgba(0,0,0,.19); text-align: center; max-width: calc(100vw - 30px); z-index: 200; }
.visually-hidden { position: absolute; height: 1px; width: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 1100px) { .document { margin: 20px; min-height: calc(100dvh - 40px); } .document-header { padding: 36px 34px 23px; } .notepad { padding: 25px 34px 40px; } }
@media (max-width: 670px) {
  .workspace { display: block; }
  .sidebar { height: 100dvh; width: 100%; border-right: 0; }
  .brand { padding: calc(17px + env(safe-area-inset-top)) 20px 18px; }
  .sidebar-heading { padding-top: 17px; }
  .tree-scroll { padding-inline: 12px; }
  .tree-row { min-height: 46px; }
  .twisty { height: 41px; }
  .node-label { font-size: 15px; }
  .editor-panel { display: none; height: 100dvh; }
  .workspace.show-editor .sidebar { display: none; }
  .workspace.show-editor .editor-panel { display: block; }
  .mobile-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: calc(62px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; border-bottom: 1px solid #efe7e1; background: #fffcf9; }
  .mobile-nav .button { flex: none; }
  .mobile-nav span { font-size: 12px; font-weight: 700; color: #a6a099; }
  .document { margin: 0; min-height: calc(100dvh - 62px - env(safe-area-inset-top)); box-shadow: none; border: 0; border-radius: 0; }
  .document-header { padding: 29px 22px 23px; }
  .note-title { margin: 22px 0 22px; font-size: 29px; }
  .notepad { padding: 25px 22px 40px; min-height: 330px; }
  #noteText { font-size: 16px; min-height: 280px; }
  .note-actions { gap: 6px; }
  .note-actions .button { padding-inline: 12px; font-size: 12px; }
  .empty-state { margin: 90px auto; }
}
@media (prefers-reduced-motion: reduce) { .button { transition: none; } }
