/* ============================================
   NoteCraft — Design System
   Palette: Noir Editorial + Amber Accent
   Fonts: Instrument Serif + DM Sans
   ============================================ */

:root {
  --bg-base:        #0F0F0F;
  --bg-surface:     #161616;
  --bg-elevated:    #1E1E1E;
  --bg-hover:       #252525;
  --bg-active:      #2C2C2C;
  --border:         #2A2A2A;
  --border-subtle:  #1F1F1F;

  --text-primary:   #E8E4DF;
  --text-secondary: #9A9490;
  --text-muted:     #5A5652;
  --text-inverse:   #0F0F0F;

  --accent:         #D4A574;
  --accent-dim:     rgba(212, 165, 116, 0.12);
  --accent-glow:    rgba(212, 165, 116, 0.25);

  --danger:         #C0392B;
  --danger-dim:     rgba(192, 57, 43, 0.12);

  --sidebar-w:      280px;
  --topbar-h:       52px;
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;

  --font-display:   'Instrument Serif', Georgia, serif;
  --font-ui:        'DM Sans', system-ui, sans-serif;

  --transition:     0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-ui);
  background: var(--bg-base);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-slow), width var(--transition-slow), min-width var(--transition-slow);
  position: relative;
  z-index: 10;
  overflow: hidden;
}

.sidebar.collapsed {
  transform: translateX(calc(-1 * var(--sidebar-w)));
  width: 0;
  min-width: 0;
}

/* Brand */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Search */
.sidebar-search {
  padding: 12px 12px 8px;
  flex-shrink: 0;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

#searchInput {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 32px 8px 30px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition);
}

#searchInput::placeholder { color: var(--text-muted); }
#searchInput:focus { border-color: var(--accent); }

.btn-clear-search {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: color var(--transition);
}
.btn-clear-search:hover { color: var(--text-primary); }
.btn-clear-search.visible { display: flex; }

/* Filters */
.sidebar-filters {
  display: flex;
  gap: 4px;
  padding: 0 12px 10px;
  flex-shrink: 0;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.filter-btn:hover { color: var(--text-secondary); background: var(--bg-hover); }
.filter-btn.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(212, 165, 116, 0.2);
}

/* Tags */
.tags-section {
  padding: 0 12px 10px;
  flex-shrink: 0;
}

.tags-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 0;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.tag-chip:hover { border-color: var(--accent); color: var(--accent); }
.tag-chip.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

.tag-chip .tag-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 10px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity var(--transition);
}
.tag-chip .tag-remove:hover { opacity: 1; }

/* Notes list header */
.notes-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 8px;
  flex-shrink: 0;
}

#notesCount {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sort-wrap select {
  background: none;
  border: none;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  outline: none;
  appearance: none;
  padding-right: 2px;
}
.sort-wrap select option { background: var(--bg-elevated); color: var(--text-primary); }

/* Notes list */
.notes-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  gap: 10px;
}

.empty-icon {
  font-size: 24px;
  color: var(--text-muted);
  opacity: 0.4;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Note card */
.note-card {
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  border: 1px solid transparent;
  margin-bottom: 2px;
  position: relative;
}

.note-card:hover { background: var(--bg-hover); }

.note-card.active {
  background: var(--bg-active);
  border-color: var(--border);
}

.note-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.note-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  line-height: 1.4;
}

.note-card-title.untitled { color: var(--text-muted); font-style: italic; }

.note-pin-icon {
  color: var(--accent);
  flex-shrink: 0;
  opacity: 0.8;
}

.note-card-preview {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.note-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.note-card-date {
  font-size: 11px;
  color: var(--text-muted);
}

.note-card-tags {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.note-card-tag {
  font-size: 10px;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 10px;
  padding: 1px 6px;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.btn-new-note {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.01em;
}

.btn-new-note:hover {
  background: #E0B585;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-new-note:active { transform: translateY(0); }

/* Sidebar open button (when collapsed) */
.sidebar-open-btn {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  padding: 12px 8px;
  cursor: pointer;
  z-index: 20;
  display: none;
  transition: all var(--transition);
}

.sidebar-open-btn:hover { color: var(--accent); background: var(--bg-hover); }
.sidebar-open-btn.visible { display: flex; }

/* ============================================
   EDITOR AREA
   ============================================ */
.editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: var(--bg-base);
}

/* Welcome Screen */
.welcome-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.5s ease;
}

.welcome-content {
  text-align: center;
  max-width: 420px;
  padding: 40px;
}

.welcome-symbol {
  font-size: 36px;
  color: var(--accent);
  margin-bottom: 20px;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.95); }
}

.welcome-title {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  line-height: 1;
}

.welcome-sub {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 32px;
  font-style: italic;
}

.btn-welcome-new {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 28px;
}

.btn-welcome-new:hover {
  background: #E0B585;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.welcome-shortcuts {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.welcome-shortcuts span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

kbd {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-secondary);
}

/* Editor Panel */
.editor-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Editor Topbar */
.editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border-subtle);
  height: var(--topbar-h);
  flex-shrink: 0;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar-center {
  flex: 1;
  text-align: center;
}

.note-meta-date {
  font-size: 12px;
  color: var(--text-muted);
}

/* Icon buttons */
.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.btn-icon:hover { color: var(--text-primary); background: var(--bg-hover); }
.btn-icon.active { color: var(--accent); }
.btn-icon.btn-danger:hover { color: var(--danger); background: var(--danger-dim); }

.btn-icon-sm {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.btn-icon-sm:hover { color: var(--accent); }

/* Title area */
.title-area {
  padding: 24px 40px 8px;
  flex-shrink: 0;
}

.note-title-input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.note-title-input::placeholder { color: var(--text-muted); }

/* Tags row */
.note-tags-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 40px 12px;
  flex-shrink: 0;
}

.note-tags-display {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.note-tag-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-dim);
  border: 1px solid rgba(212, 165, 116, 0.2);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--accent);
}

.note-tag-item button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font-size: 11px;
  opacity: 0.6;
  transition: opacity var(--transition);
  line-height: 1;
}
.note-tag-item button:hover { opacity: 1; }

.btn-add-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-add-tag:hover { border-color: var(--accent); color: var(--accent); }

.tag-input-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}

#tagInput {
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  width: 120px;
}

.btn-tag-confirm {
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-inverse);
  cursor: pointer;
  transition: background var(--transition);
}
.btn-tag-confirm:hover { background: #E0B585; }

.btn-tag-cancel {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  transition: color var(--transition);
}
.btn-tag-cancel:hover { color: var(--text-primary); }

/* Format Toolbar */
.format-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 40px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 1px;
}

.toolbar-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}

.toolbar-spacer { flex: 1; }

.fmt-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  transition: all var(--transition);
}

.fmt-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.fmt-btn.active { color: var(--accent); background: var(--accent-dim); }

.word-count {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Editor Content */
.editor-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 40px 60px;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
  outline: none;
  caret-color: var(--accent);
}

.editor-content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
  font-style: italic;
}

/* Rich text styles inside editor */
.editor-content h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 24px 0 10px;
  line-height: 1.3;
}

.editor-content h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 20px 0 8px;
  line-height: 1.4;
}

.editor-content p { margin-bottom: 10px; }

.editor-content ul, .editor-content ol {
  padding-left: 24px;
  margin-bottom: 10px;
}

.editor-content li { margin-bottom: 4px; }

.editor-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
  margin: 16px 0;
  color: var(--text-secondary);
  font-style: italic;
  background: var(--accent-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.editor-content pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--accent);
  overflow-x: auto;
  margin: 12px 0;
  line-height: 1.6;
}

.editor-content a { color: var(--accent); text-decoration: underline; }
.editor-content strong { font-weight: 600; color: var(--text-primary); }
.editor-content em { font-style: italic; color: var(--text-secondary); }

/* ============================================
   FOCUS MODE
   ============================================ */
.focus-overlay {
  position: fixed;
  inset: 0;
  background: #0A0A0A;
  z-index: 100;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

.focus-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.focus-overlay:hover .focus-topbar { opacity: 1; }

.btn-exit-focus {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-exit-focus:hover { color: var(--text-primary); border-color: var(--text-muted); }

.focus-word-count {
  font-size: 12px;
  color: var(--text-muted);
}

.focus-title-input {
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  padding: 0 calc(50% - 380px);
  width: 100%;
  caret-color: var(--accent);
}

.focus-title-input::placeholder { color: var(--text-muted); }

.focus-editor {
  flex: 1;
  overflow-y: auto;
  padding: 16px calc(50% - 380px) 80px;
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.9;
  color: var(--text-secondary);
  outline: none;
  caret-color: var(--accent);
}

.focus-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
  font-style: italic;
}

.focus-editor h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 28px 0 12px;
}

.focus-editor h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--text-primary);
  margin: 22px 0 10px;
}

.focus-editor p { margin-bottom: 12px; color: var(--text-secondary); }
.focus-editor ul, .focus-editor ol { padding-left: 24px; margin-bottom: 12px; }
.focus-editor blockquote {
  border-left: 3px solid var(--accent);
  padding: 10px 20px;
  margin: 20px 0;
  color: var(--text-muted);
  font-style: italic;
  background: var(--accent-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.focus-editor pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: var(--accent);
  overflow-x: auto;
  margin: 14px 0;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-icon {
  width: 52px;
  height: 52px;
  background: var(--danger-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--danger);
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-modal-cancel {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-modal-cancel:hover { color: var(--text-primary); border-color: var(--text-muted); }

.btn-modal-confirm {
  background: var(--danger);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-modal-confirm:hover { background: #E74C3C; }

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text-primary);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 300;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   TOPBAR BUTTON STATES
   ============================================ */
.topbar-btn { border-radius: var(--radius-sm); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 50;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
  }

  .editor-area { width: 100%; }

  .title-area { padding: 20px 20px 8px; }
  .note-tags-row { padding: 0 20px 10px; }
  .format-toolbar { padding: 6px 20px; }
  .editor-content { padding: 16px 20px 60px; }

  .focus-title-input { padding: 0 20px; }
  .focus-editor { padding: 16px 20px 60px; }

  .welcome-title { font-size: 36px; }
}

/* ============================================
   SEARCH HIGHLIGHT
   ============================================ */
.highlight {
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 1px;
}

/* ============================================
   TOPBAR PIN ACTIVE STATE
   ============================================ */
#pinNoteBtn.pinned svg {
  fill: var(--accent);
  stroke: var(--accent);
}