.notes-toolbar {
  margin-bottom: 16px;
}

.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color var(--t), background var(--t);
}

.note-card.dragging { opacity: 0.35; }
.note-card.drag-over { border-color: var(--accent); }

.note-card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px 0 10px;
}

.note-drag-handle {
  color: var(--text-muted);
  cursor: grab;
  opacity: 0.3;
  transition: opacity 140ms;
  flex-shrink: 0;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
}

.note-card:hover .note-drag-handle { opacity: 0.8; }
.note-drag-handle:active { cursor: grabbing; }

.note-card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.note-favorite-btn {
  padding: 4px 6px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 140ms, color 140ms, background 140ms;
}
.note-card:hover .note-favorite-btn { opacity: 1; }
.note-favorite-btn.is-favorited { opacity: 1; color: var(--accent); }
.note-favorite-btn:hover { color: var(--accent); }

.note-body > :first-child { margin-top: 0; }

.note-body {
  padding: 6px 16px 14px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-2);
}

.note-body h1, .note-body h2, .note-body h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--text);
  margin: 0.8em 0 0.3em;
}
.note-body h1 { font-size: 1.2rem; }
.note-body h2 { font-size: 1.05rem; }
.note-body h3 { font-size: 0.95rem; }
.note-body p { margin: 0.5em 0; }
.note-body ul, .note-body ol { padding-left: 1.4em; margin: 0.4em 0; }
.note-body li { margin: 0.15em 0; }
.note-body code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--surface-2);
  border-radius: 3px;
  padding: 1px 4px;
}
.note-body pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 12px;
  overflow-x: auto;
  margin: 0.6em 0;
}
.note-body pre code { background: none; padding: 0; }
.note-body hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }
.note-body strong { color: var(--text); }
.note-body blockquote {
  border-left: 3px solid var(--border-mid);
  padding-left: 12px;
  margin: 0.5em 0;
  color: var(--text-muted);
}
.note-empty { color: var(--text-muted); font-style: italic; }

.note-expand-wrap {
  position: relative;
  padding-bottom: 8px;
  text-align: center;
}

.note-fade {
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--surface));
  margin-bottom: 4px;
}

/* HOME VIEW */
.home-note-body {
  padding: 6px 16px 14px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-2);
}

.home-note-body > :first-child { margin-top: 0; }
.home-note-body h1, .home-note-body h2, .home-note-body h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--text);
  margin: 0.8em 0 0.3em;
}
.home-note-body h1 { font-size: 1.2rem; }
.home-note-body h2 { font-size: 1.05rem; }
.home-note-body h3 { font-size: 0.95rem; }
.home-note-body p { margin: 0.5em 0; }
.home-note-body ul, .home-note-body ol { padding-left: 1.4em; margin: 0.4em 0; }
.home-note-body li { margin: 0.15em 0; }
.home-note-body code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--surface-2);
  border-radius: 3px;
  padding: 1px 4px;
}
.home-note-body pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 12px;
  overflow-x: auto;
  margin: 0.6em 0;
}
.home-note-body pre code { background: none; padding: 0; }
.home-note-body hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }
.home-note-body strong { color: var(--text); }
.home-note-body blockquote {
  border-left: 3px solid var(--border-mid);
  padding-left: 12px;
  margin: 0.5em 0;
  color: var(--text-muted);
}

.home-copy-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
}

.home-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 48px 20px;
  font-style: italic;
}

/* FULLSCREEN NOTE EDITOR */
.note-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: none;
  flex-direction: column;
  transition: background var(--t);
}

.note-editor-overlay.open { display: flex; }

.note-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  flex-shrink: 0;
  gap: 12px;
  transition: border-color var(--t), background var(--t);
}

.note-editor-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--t);
}

.note-editor-actions { display: flex; gap: 8px; flex-shrink: 0; }

.note-editor-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  justify-content: center;
}

.note-editor-textarea {
  width: 100%;
  max-width: 740px;
  padding: 28px 20px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  transition: color var(--t);
}
