.image-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin:20px 0}.image-gallery img{display:block;width:100%;max-height:420px;object-fit:contain;background:#edf1e3;border:1px solid #dce4ce;border-radius:4px}.attachments{padding:20px 30px;border-top:1px solid #dce2d0}.image-upload{display:flex;flex-wrap:wrap;align-items:center;gap:12px;font-size:12px;color:#789165}.image-upload input{width:auto;max-width:100%;font-size:11px}.image-upload small{color:#9ca98c;font-size:10px}.image-selection{display:flex;flex-wrap:wrap;gap:12px;margin-top:15px}.image-selection>div{border:1px solid #d6e0c7;border-radius:4px;padding:5px;background:#eef3e3}.image-selection img{width:110px;height:85px;object-fit:contain;display:block}.image-selection button{display:block;width:100%;padding:6px;font-size:10px;color:#9f805d}.upload-status{font-size:11px;margin:8px 0 0}.upload-status:empty{display:none}.knowledge-editor-shell #record-panel{padding:28px 30px;border-top:1px solid #dce2d0}.record-timeline header{display:flex;flex-wrap:wrap;align-items:baseline;gap:15px;margin:20px 0}.record-timeline h2{font-size:24px;margin:0}.record-timeline header .eyebrow{width:100%}.record-timeline header small{color:#a1af90;font-size:10px}.record-timeline article{padding:25px 0;border-bottom:1px solid #dce2d0}.record-meta{display:flex;justify-content:space-between;gap:15px;font-size:10px;color:#97a787;align-items:center}.record-meta>div{display:flex;gap:15px}.record-meta button{font-size:11px;color:#7a9266}.record-timeline>p{font-size:12px}.record-timeline .markdown{font-size:14px}#record-form{max-width:none;margin-top:25px;padding:23px;background:#edf3e1;border:1px solid #d7e1c7;border-radius:5px}#record-form h3{margin:0 0 18px;font-size:18px}#record-form>label{display:flex;flex-direction:column;gap:10px;font-size:11px;color:#7d936c}#record-form textarea{font:12px/1.9 Consolas,monospace}#record-form .attachments{padding:18px 0;border:0}.record-actions{display:flex;flex-wrap:wrap;gap:18px;align-items:center;font-size:11px}.record-actions button{color:#75935e}.record-actions .primary{color:#f2f6e9;margin-left:auto}.new-record-hint{padding:18px 30px;font-size:11px}dialog:has(.knowledge-editor-shell){max-width:1050px;width:94vw}.knowledge-editor-shell .note-editor{max-width:none}#record-panel .form-help{margin-top:15px;font-size:10px}.reading-page .outline-button{margin-top:25px}.reading-page .record-timeline{margin-top:50px}@media(max-width:750px){.knowledge-editor-shell #record-panel{padding:22px}#record-form{padding:16px}.record-meta{flex-wrap:wrap}.record-actions{gap:12px}.record-actions .primary{margin-left:0}.attachments{padding:20px 22px}.image-gallery{grid-template-columns:1fr}.record-meta button{min-height:36px}}

.format-tools{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}.format-tools button{padding:6px 10px;border:1px solid #d4dfc5;border-radius:3px;font-size:10px;color:#7b916a;background:#f3f7e9}

/* The workspace must override the smaller branch-dialog :has(form:not(...)) rule. */
dialog#editor:has(.knowledge-editor-shell){width:calc(100vw - 32px);max-width:none;height:calc(100dvh - 32px);max-height:none;margin:16px auto;border-radius:8px;overflow-y:auto;scrollbar-gutter:stable}
dialog#editor .knowledge-editor-shell form{max-width:none;width:100%}
.knowledge-editor-shell{min-height:100%}
.knowledge-editor-shell .dialog-heading{position:sticky;top:0;z-index:4;background:#f8faf1f5;backdrop-filter:blur(8px)}
.knowledge-editor-shell .editor-fields{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}
.knowledge-editor-shell input,.knowledge-editor-shell select,.knowledge-editor-shell textarea{font-size:14px}
.knowledge-editor-shell .editor-fields label,.knowledge-editor-shell .editor-body>label{font-size:13px}
.knowledge-editor-shell .editor-body textarea{min-height:45vh;font:14px/1.9 Consolas,monospace}
.knowledge-editor-shell .editor-body>section .markdown{font-size:15px}
dialog#editor .knowledge-editor-shell #record-form{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:20px 28px;padding:28px}
#record-form>h3,#record-form>.form-message,#record-form>.attachments,#record-form>.record-actions,#record-form>.form-help{grid-column:1/-1}
#record-form>h3{margin-bottom:0}
#record-form>label{min-width:0;font-size:13px}
#record-form .record-live-preview{min-width:0;padding:12px 24px;border-left:1px solid #d7e1c7;overflow-wrap:anywhere}
#record-form textarea{min-height:42vh;font:14px/1.9 Consolas,monospace}
.knowledge-editor-shell .record-actions button,.knowledge-editor-shell .dialog-actions button{font-size:13px}
@media(max-width:900px){dialog#editor .knowledge-editor-shell #record-form{grid-template-columns:minmax(0,1fr)}#record-form .record-live-preview{border-left:0;border-top:1px solid #d7e1c7;padding:20px 0}}
@media(max-width:750px){dialog#editor:has(.knowledge-editor-shell){width:100vw;height:100dvh;margin:0;border:0;border-radius:0}.knowledge-editor-shell .editor-body textarea,#record-form textarea{min-height:45dvh}dialog#editor .knowledge-editor-shell #record-form{padding:18px}.knowledge-editor-shell .dialog-heading{padding:16px 20px}.knowledge-editor-shell .dialog-actions{gap:12px}}
