#notesRoot {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: var(--list-width) 1fr;
  background: var(--surface);
  overflow: hidden;
}
.notes-list-pane {
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.notes-list-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.notes-list-header h2 { font-size: var(--fs-md); margin: 0; }
.notes-list { flex: 1; overflow-y: auto; }
.note-list-item {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: background var(--dur-fast) var(--ease);
}
.note-list-item:hover { background: var(--surface-sunken); }
.note-list-item.selected { background: var(--primary-tint); }
.note-title { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 50px; }
.note-untitled { color: var(--ink-faint); font-weight: 400; font-style: italic; }
.note-snippet { font-size: var(--fs-xs); color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-date { position: absolute; top: var(--sp-3); right: var(--sp-4); font-size: var(--fs-xs); font-family: var(--font-mono); color: var(--ink-faint); }

.notes-editor-pane { display: flex; flex-direction: column; overflow: hidden; }
.notes-empty-state {
  margin: auto; text-align: center; color: var(--ink-faint); max-width: 280px; padding: var(--sp-5);
}
.notes-empty-state .glyph { font-size: 36px; margin-bottom: var(--sp-3); opacity: 0.5; }
.notes-editor-toolbar {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.note-title-input {
  border: none; outline: none; background: transparent;
  font-size: var(--fs-lg); font-weight: 700;
  flex: 1; min-width: 0;
}
.notes-save-status { font-size: var(--fs-xs); color: var(--ink-faint); flex-shrink: 0; width: 52px; }
.notes-attachments-host { padding: 0 var(--sp-4); }
.notes-attachments-host .attachment-chips { padding-bottom: var(--sp-2); }
.attachment-chip .chip-open {
  border: none; background: transparent; color: var(--ink-faint);
  cursor: pointer; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; flex-shrink: 0;
}
.attachment-chip .chip-open:hover { background: var(--primary-tint); color: var(--primary-dark); }
.notes-editor-wrap {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: 0 var(--sp-4) var(--sp-4);
  overflow: hidden;
}
.notes-editor-wrap .ql-container.ql-snow { border: 1px solid var(--border) !important; border-top: none !important; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.notes-editor-wrap .ql-toolbar.ql-snow { border: 1px solid var(--border) !important; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--surface-sunken); }

.mobile-only-back { display: none; }

@media (max-width: 760px) {
  #notesRoot { grid-area: stage; grid-template-columns: 1fr; }
  .app[data-mobile-view="reading"] #notesRoot .notes-list-pane { display: none; }
  .app[data-mobile-view="list"] #notesRoot .notes-editor-pane { display: none; }
  .mobile-only-back { display: flex; }
}
