.note-history-dialog {
  width:min(890px,calc(100vw - 32px));
  height:min(680px,calc(100dvh - 32px));
  max-width:none; max-height:none; padding:0; overflow:hidden;
  border:1px solid #e2e4e2; border-radius:8px; background:#fff; color:#33352f;
}
.note-history-dialog[open] { display:flex; flex-direction:column; }
.note-history-dialog::backdrop { background:#20262066; backdrop-filter:blur(2px); }
.note-history-header {
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:14px 18px; border-bottom:1px solid #e8eae7;
}
.note-history-header h2 { font-size:17px; margin:0; }
.note-history-layout { display:grid; flex:1; min-height:0; grid-template-columns:minmax(220px,1fr) minmax(0,1.85fr); }
.note-history-list,.note-history-detail { min-width:0; min-height:0; display:flex; flex-direction:column; }
.note-history-list { border-right:1px solid #e8eae7; background:#fafbf9; }
.note-history-filter { display:flex; align-items:center; gap:8px; padding:10px 12px; border-bottom:1px solid #edefeb; }
.note-history-filter select {
  flex:1; min-width:0; min-height:34px; padding:0 7px;
  border:1px solid #e2e6e0; border-radius:4px; background:#fff; color:inherit; font:inherit; font-size:13px;
}
.note-history-feed,.note-history-diff { overflow:auto; overscroll-behavior:contain; }
.note-history-feed { flex:1; }
.note-history-row {
  display:grid; width:100%; gap:5px; padding:12px; text-align:left;
  border:0; border-bottom:1px solid #edefeb; background:transparent; color:inherit; font:inherit;
}
.note-history-row:hover,.note-history-row[aria-current] { background:#edf1eb; }
.note-history-row[aria-current] { box-shadow:inset 3px 0 #708f74; }
.note-history-row-title { font-size:13px; }
.note-history-snippet { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#4b5449; font-size:12px; }
.note-history-meta { display:flex; flex-wrap:wrap; column-gap:9px; font-size:11px; color:#656d64; }
.note-history-extra { font-size:11px; color:#586e57; }
.note-history-empty { margin:14px; color:#747a73; font-size:13px; }
#noteHistoryStatus:empty { display:none; }
#noteHistoryMore { margin:10px 12px; }
.note-history-detail-heading { display:flex; align-items:center; min-height:54px; gap:10px; padding:0 16px; }
#noteHistoryHeadingDetail { margin:0; font-size:15px; }
#noteHistoryBack { display:none; }
.note-history-diff { flex:1; padding:0 16px 16px; }
.note-history-detail-meta { font-size:12px; color:#676f66; margin:0 0 12px; }
.note-history-excerpt { margin:0 0 12px; padding:8px 10px; border-left:2px solid #c3cbbf; font-size:13px; overflow-wrap:anywhere; }
.note-history-change { border:1px solid #e7eae5; border-radius:4px; margin-bottom:10px; overflow:hidden; }
.note-history-change-heading { display:flex; align-items:center; gap:8px; padding:8px 10px; font-size:12px; background:#f7f8f6; }
.note-history-change-heading input { width:16px; height:16px; margin:0; accent-color:#53765a; }
.note-history-change-pair { display:grid; grid-template-columns:1fr 1fr; }
.note-history-value { color:#414340; padding:8px 10px; min-width:0; }
.note-history-value.before { background:#fdf4f4; border-right:1px solid #ece8e8; }
.note-history-value.after { background:#f1f7f0; }
.note-history-value span { display:block; color:#626863; font-size:11px; margin-bottom:4px; }
.note-history-value pre { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; font:13px/1.5 ui-monospace,monospace; }
.note-history-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; padding:10px 14px; border-top:1px solid #e8eae7; }
.note-history-actions[hidden] { display:none; }
#noteHistoryError { flex:1; margin:0; color:#a13f3f; font-size:12px; overflow-wrap:anywhere; }
@media(max-width:620px) {
  .note-history-dialog { width:calc(100vw - 12px); height:calc(100dvh - 12px); }
  .note-history-layout { grid-template-columns:minmax(0,1fr); }
  .note-history-list { border-right:0; }
  .note-history-detail { display:none; }
  .note-history-dialog.has-detail .note-history-list { display:none; }
  .note-history-dialog.has-detail .note-history-detail { display:flex; }
  #noteHistoryBack { display:inline-flex; }
  .note-history-actions { flex-wrap:wrap; }
  #noteHistoryError { flex-basis:100%; }
}
