/* Notes (Quill editor, tree, history, diff) */
.lc-notes-layout { display: flex; gap: 1rem; align-items: flex-start; }
.lc-notes-layout > .lc-notes-tree { flex: 0 0 260px; width: 260px; }
.lc-notes-layout > .lc-notes-grid { flex: 1 1 auto; min-width: 0; }

/* Note page: notebook tree | the selected node's notes | editor. */
.lc-note-workspace { display: flex; gap: 1rem; align-items: flex-start; }
.lc-note-workspace > .lc-ws-tree { flex: 0 0 220px; width: 220px; }
.lc-note-workspace > .lc-ws-list { flex: 0 0 230px; width: 230px; }
.lc-note-workspace > .lc-ws-tree,
.lc-note-workspace > .lc-ws-list { font-size: .9rem; }
.lc-note-workspace > .lc-ws-editor { flex: 1 1 auto; min-width: 0; }
/* Beside the sidebar the page itself never scrolls: it fills the window below the 3.5rem top row and the
   content's 1.1rem top padding, and the tree, the list, the note text and the history each scroll on their
   own. Every flex level down to Quill's container needs min-height: 0, or a long note stretches it. */
@media (min-width: 641px) {
    .lc-note-workspace { height: calc(100vh - 5.6rem); align-items: stretch; }
    .lc-note-workspace > .lc-ws-tree,
    .lc-note-workspace > .lc-ws-list { overflow-y: auto; }
    .lc-note-workspace > .lc-ws-editor { display: flex; flex-direction: column; min-height: 0; }
    .lc-ws-editor .lc-editor-page { flex: 1 1 auto; min-height: 0; }
    .lc-ws-editor .lc-editor-body,
    .lc-ws-editor .lc-editor-column,
    .lc-ws-editor .lc-editor-host { min-height: 0; } /* the host is Quill's .ql-container */
    .lc-ws-editor .lc-history { max-height: none; }
}
.lc-note-workspace.lc-panes-hidden > .lc-ws-tree,
.lc-note-workspace.lc-panes-hidden > .lc-ws-list { display: none; }
/* Too narrow for three columns: editor only, and nothing to toggle. */
@media (max-width: 1199.98px) {
    .lc-note-workspace > .lc-ws-tree, .lc-note-workspace > .lc-ws-list, .lc-panes-toggle { display: none !important; }
}

.lc-ws-list-head { display: flex; align-items: center; gap: .5rem; padding: 0 .25rem .5rem; }
.lc-ws-list-name { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-ws-note { display: block; padding: .35rem .5rem; border-radius: .375rem; color: inherit; text-decoration: none; }
.lc-ws-note:hover { background: #f1f3f5; color: inherit; }
.lc-ws-note.active { background: rgba(var(--bs-primary-rgb, 95, 54, 141), .8); color: #fff; }
.lc-ws-note-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-ws-note-meta { display: block; font-size: .75rem; color: #6c757d; }
.lc-ws-note.active .lc-ws-note-meta { color: rgba(255, 255, 255, .8); }

.lc-editor-page { display: flex; flex-direction: column; min-height: 60vh; }
.lc-editor-page .lc-editor-host { flex: 1 1 auto; display: flex; flex-direction: column; }
.lc-editor-page .lc-editor-host .ql-container { flex: 1 1 auto; }

/* Lines stay at most 900px wide for reading, but the editor (the note's scroll box) fills its frame so the
   scrollbar sits at the frame's edge and the wheel works anywhere in it: the cap is right padding, not
   max-width. 885px = 900px less the 15px left padding. */
.lc-editor-host .ql-editor { font-size: 1rem; padding-right: max(15px, calc(100% - 885px)); }

figure.lc-image, figure.lc-drawing {
    margin: 1rem 0; padding: .5rem; display: block; max-width: 100%;
    border: 1px solid #dee2e6; border-radius: .5rem; background: #fff;
}
figure.lc-image img, figure.lc-drawing img { max-width: 100%; height: auto; display: block; }
.lc-audio { display: block; width: 100%; max-width: 480px; margin: .75rem 0; }

.lc-caption { color: #6c757d; font-size: .875rem; margin-top: .25rem; outline: none; }
.lc-caption:empty::before { content: attr(data-placeholder); color: #9aa0a6; }

.lc-history { flex: 0 0 320px; width: 320px; max-height: 80vh; overflow-y: auto; border-left: 1px solid #dee2e6; padding-left: 1rem; }

.lc-diff-ins { background: #c8f7c5; }
.lc-diff-del { background: #f7c5c5; text-decoration: line-through; }

.lc-banner-conflict {
    padding: .75rem 1rem; margin-bottom: 1rem; border: 1px solid #ffecb5;
    border-radius: .375rem; color: #664d03; background-color: #fff3cd;
}
